signatures

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 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 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).

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",
}

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 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"`
	// 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