wincerts

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2026 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package wincerts is the sensor for the certificates in the Windows system certificate stores: the machine's own certificates, the trust anchors (root and intermediate authorities), trusted publishers and trusted people, for the machine and for the user the collector runs as.

It asks Windows, through internal/winapi, for each allow-listed store and describes each certificate from its own encoded bytes: subject, issuer, validity, key algorithm and size, signature algorithm, and whether a private key is associated with it. It never reads, opens, exports or uses a key (ADR-0005, ADR-0016; SECARCH-001 SR-06, SR-07).

Like windows-cng it knows nothing about Windows itself, so the logic is tested anywhere with a fake, and it runs only for a live Windows host: a mounted disk or a --root override has no certificate stores this sensor could ask about.

Index

Constants

View Source
const (
	// Name is the sensor's registry name.
	Name = "windows-certs"
	// Version is the version of this sensor's behaviour.
	Version = "0.1.0"
)

Variables

This section is empty.

Functions

func Register

func Register(reg *sense.Registry, api winapi.CertStoreAPI) error

Register adds the sensor to reg, asking api. Production uses the package's init (the real Windows API); tests register a fake.

Types

type Sensor

type Sensor struct {
	// contains filtered or unexported fields
}

Sensor implements sense.Sensor.

func New

func New(env sense.Env, api winapi.CertStoreAPI) *Sensor

New returns a sensor that asks api about the host described by env.

func (*Sensor) Collect

func (s *Sensor) Collect(ctx context.Context) (evidence.Batch, error)

Collect reads each store and returns the observations.

func (*Sensor) Detect

func (s *Sensor) Detect(context.Context) (bool, error)

Detect reports whether Windows can be asked about THIS machine.

func (*Sensor) Info

func (*Sensor) Info() sense.Info

Info implements sense.Sensor.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL