Documentation
¶
Overview ¶
Package certfiles is the sensor for X.509 certificates that a Linux host keeps as files: the system trust store, CA anchors, and the certificates of the services that run on it. It describes certificates, never keys.
What it will not do (ADR-0005, PRD-003 REQ-CERT-4, SECARCH-001 SR-06, SR-16):
- It never opens a file whose name says it holds a key or a key store (*.key, *.p12, *.pfx, *.jks, "privkey", "private", ...), and never enters a directory called private. Those are counted, not read.
- In a file it does open, it decodes CERTIFICATE blocks only. A block whose label names a private key is skipped without being decoded, copied or kept, and only noted ("a private key is stored alongside this certificate"). See scanPEM.
- It follows a symbolic link only when the link stays inside the searched host root, names a regular file, and is followed once (no chains); every directory on the way must be a real directory. A link that fails any of these is refused and counted.
- It reads only within the allow-listed directories below, with bounds on depth, entries, file size, certificates per file and certificates per run.
Each certificate becomes one host-stream observation at the `provisioned` rung (the host holds this certificate), keyed by its SHA-256 fingerprint so it is the same entity as the certificate a TLS scan sees on the wire.
Index ¶
Constants ¶
const ( // Name is the sensor's registry name. Name = "cert-files" // Version is the version of this sensor's behaviour. Version = "0.1.0" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PEMCertificates ¶
PEMCertificates is the certificate-only PEM reader for callers outside this sensor (the private trust-anchor upload, the server-wide CA bundle): the same rules, so a private key in an upload is counted and refused, never decoded.
func ReadPEMCertificates ¶
func ReadPEMCertificates(data []byte) PEMCertificates
ReadPEMCertificates scans text for certificate blocks.
type Sensor ¶
type Sensor struct {
// contains filtered or unexported fields
}
Sensor implements sense.Sensor.