signatures

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 6 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 signatures is the database of what the machine inventory scripts collect (PRD-006 D4). A signature is data: which read-only capability of the script engine to run, with which parameters, why, and how the server interprets what comes back. Adding something to collect means adding a signature; the engines, which implement the capabilities once, do not change.

Index

Constants

This section is empty.

Variables

View Source
var AreaTitles = map[string]string{
	"platform": "Platform and policy", "software": "Software and runtimes", "tls": "TLS stacks", "ssh": "SSH",
	"servers": "Servers", "vpn": "VPN and tunnels", "auth": "Authentication", "pki": "Keys and certificates", "bound": "Services and bindings",
}

AreaTitles are the areas' names on screen.

View Source
var Areas = []string{"platform", "software", "tls", "ssh", "servers", "vpn", "auth", "pki", "bound"}

Areas are the groups a signature belongs to, in display order.

View Source
var Capabilities = map[string]Capability{
	"registry": {Platforms: []string{"windows"}, Params: []string{"key"}, Optional: []string{"values", "depth", "subkeys"},
		How: "reads the named values of a registry key (and of its sub-keys to the given depth), and with subkeys=yes the names of its sub-keys; nothing is written"},
	"certstore": {Platforms: []string{"windows"}, Params: []string{"locations", "stores"},
		How: "lists the certificates in the named stores, with whether a private key is associated; no key is opened"},
	"file": {Platforms: []string{"windows", "linux"}, Params: []string{"roots", "names"}, Optional: []string{"depth", "max"},
		How: "finds files with these names under these folders and reports path, size, version and SHA-256; their content is not sent"},
	"program": {Platforms: []string{"windows"}, Params: []string{"match"},
		How: "lists installed programs (Windows' uninstall list) whose name matches"},
	"lines": {Platforms: []string{"windows", "linux"}, Params: []string{"paths", "match"}, Optional: []string{"max", "join"},
		How: "reads these text files and reports only the lines that match (joining backslash continuations when asked); files named like keys are never opened, and a line holding key material is dropped"},
	"query": {Platforms: []string{"windows", "linux"}, Params: []string{"query"}, Optional: []string{"match", "max"},
		How: "runs one of the engine's own fixed read-only queries (a version or algorithm listing, a settings cmdlet, the effective SSH server policy) and reports the lines that match; the signature names the query, never a command"},
	"listeners": {Platforms: []string{"windows", "linux"}, Optional: []string{"max"},
		How: "lists listening sockets with the owning process, its executable and the names of the cryptographic libraries that process has loaded; nothing is read from the processes but names"},
	"package": {Platforms: []string{"linux"}, Params: []string{"match"},
		How: "lists installed packages (dpkg, rpm or apk) whose name matches, with version and architecture"},
	"certfiles": {Platforms: []string{"linux"}, Params: []string{"dirs"}, Optional: []string{"depth", "max"},
		How: "copies the CERTIFICATE blocks of .crt, .cer and .pem files in these folders; key folders and key files are never entered or opened"},
}

Capabilities are the only things an engine can do. No signature can name a command (PRD-006 D5): the "query" capability only selects, by id, one of the fixed read-only queries written in the engine itself (PRD-019 D1), listed in Queries.

View Source
var Interpretations = map[string]string{
	"certificate":          "certificates, through the collector's certificate sensors",
	"package":              "packages, through the collector's knowledge base (which algorithms each version can use)",
	"library-file":         "library files, through the collector's knowledge base",
	"software":             "installed programs, listed as software",
	"schannel-protocols":   "Windows TLS/SSL versions, as protocol components",
	"schannel-ciphers":     "Windows cipher and hash settings",
	"schannel-suite-order": "Windows cipher suite order, as a protocol component",
	"ssh-config":           "SSH server algorithms, as algorithm components",
	"ssh-host-key":         "SSH host key types, as algorithm and key components",
	"openssl-config":       "OpenSSL defaults, as a protocol component",
	"crypto-policy":        "the system crypto policy",
	"config":               "configuration values, recorded as observed",

	"platform":          "platform state (FIPS, TPM, disk encryption, Secure Boot, kernel, policy), as facts of the machine",
	"runtime":           "a language runtime or tool with its version and the cryptographic library it runs with",
	"openssl-build":     "the installed OpenSSL: version, providers, and the algorithms it can use",
	"ssh-supported":     "the algorithms the installed OpenSSH can use",
	"ssh-effective":     "the SSH server's effective policy, as sshd reports it",
	"ssh-client-config": "SSH client algorithms, as a protocol component",
	"ssh-host-key-info": "SSH host key sizes and fingerprints",
	"tls-config":        "a server's or stack's TLS settings, as a protocol component",
	"tls-cipher-suites": "the cipher suites and curves Windows negotiates with, in effective order",
	"java-security":     "the Java security policy (disabled algorithms, providers, key store type)",
	"auth-policy":       "authentication settings (Kerberos, NTLM, SMB, LDAP, RDP, password hashing)",
	"vpn-config":        "VPN and tunnel settings, as a protocol component",
	"pki-policy":        "key and certificate policy and infrastructure (providers, enrolment, PKCS#11, trust stores)",
	"key-providers":     "which provider holds each personal certificate's private key (hardware or software)",
	"tls-bindings":      "which certificate each listening TLS endpoint presents",
	"listeners":         "listening services with the cryptographic libraries they loaded",
	"kernel-crypto":     "the kernel's cryptographic algorithms and modules",
}

Interpretations the server knows.

View Source
var Queries = map[string][]string{
	"linux": {"os.kernel", "cpu.crypto-flags", "openssl.version", "openssl.providers", "openssl.ciphers", "openssl.kem-algorithms",
		"openssl.signature-algorithms", "gnutls.version", "gpg.version", "curl.version", "wget.version", "ssh.version", "ssh.algorithms",
		"sshd.effective", "ssh.host-keys", "crypto-policies", "java.version", "python.ssl", "node.versions", "go.version", "ruby.openssl",
		"php.openssl", "dotnet.runtimes", "nginx.build", "apache.build", "haproxy.build", "postfix.tls", "dovecot.ssl", "samba.effective",
		"bind.build", "openvpn.version", "ipsec.version", "wireguard.interfaces", "stunnel.version", "cryptsetup.version", "disk.encryption",
		"secure-boot"},
	"windows": {"tls.cipher-suites", "tls.curves", "tpm", "bitlocker", "deviceguard", "http.sslcert", "certstore.providers", "smb.server",
		"winrm.listeners", "dotnet.runtimes", "host.role", "ssh.algorithms", "windows.features"},
}

Queries are the fixed read-only queries each engine implements (PRD-019 D1). The ids here must match the engines' tables; a test checks both ways.

Functions

This section is empty.

Types

type Capability

type Capability struct {
	Platforms []string
	Params    []string // required parameters
	Optional  []string
	How       string // template: what the engine does, in words
}

Capability is one read-only primitive an engine implements.

type DB

type DB struct {
	Version    string                       `json:"version"`
	About      string                       `json:"about"`
	Maps       map[string]map[string]string `json:"maps"`
	Signatures []Signature                  `json:"signatures"`
}

DB is the whole database.

func Load

func Load() (*DB, error)

Load parses and validates the embedded database.

func MustLoad

func MustLoad() *DB

MustLoad is Load for the embedded database, which tests keep valid.

func Parse

func Parse(b []byte) (*DB, error)

Parse parses and validates a database.

func (*DB) ByID

func (db *DB) ByID(id string) (Signature, bool)

ByID finds a signature.

func (*DB) Engine

func (db *DB) Engine(platform string) string

Engine renders a platform's signatures in the line format the engines read: one "sig <id> <capability> key=value ..." line each, tab separated, after a version line.

func (*DB) For

func (db *DB) For(platform string) []Signature

For returns the signatures of one platform, in database order.

func (*DB) Validate

func (db *DB) Validate() error

Validate checks every signature (REQ-SG-2).

type Signature

type Signature struct {
	ID         string            `json:"id"`
	Platform   string            `json:"platform"` // windows | linux
	Title      string            `json:"title"`
	Why        string            `json:"why"`
	Capability string            `json:"capability"`
	Params     map[string]string `json:"params"`
	Interpret  string            `json:"interpret"`
	// Area groups signatures on the Inventory page and the machine page (PRD-019): one of Areas.
	Area string `json:"area"`
	// Needs is "admin" when the full result needs Administrator or root; "" when a standard
	// user sees all of it.
	Needs string `json:"needs,omitempty"`
	// How says, in words, how the engine pulls it (filled in from the capability).
	How string `json:"how,omitempty"`
}

Signature is one thing the scripts collect.

Jump to

Keyboard shortcuts

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