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 Capabilities = map[string]Capability{ "registry": {Platforms: []string{"windows"}, Params: []string{"key", "values"}, Optional: []string{"depth"}, How: "reads the named values of a registry key (and of its sub-keys to the given depth); 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"}, How: "reads these text files and reports only the lines that match; files named like keys are never opened, and a line holding key material is dropped"}, "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. There is deliberately no capability that runs a command or a program (PRD-006 D5).
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",
}
Interpretations the server knows.
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"`
// 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.