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 ¶
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.
var Areas = []string{"platform", "software", "tls", "ssh", "servers", "vpn", "auth", "pki", "bound"}
Areas are the groups a signature belongs to, in display order.
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.
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.
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 MustLoad ¶
func MustLoad() *DB
MustLoad is Load for the embedded database, which tests keep valid.
func (*DB) Engine ¶
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.
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.