secrets

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package secrets is the engine module wrapper around internal/secrets. It runs the secret-detection engine against Dockerfiles, filesystems, and images (layer-aware, including content deleted by a later layer) and projects each Detection into the unified Finding model. Findings are value-free: they carry a fingerprint, type, location, and verification state — never the secret.

Optional behaviour is driven entirely by Target.Metadata, so the CLI/HTTP frontends can toggle it without any new plumbing and every run stays reproducible:

secrets.classifier=true    enable the semantic entropy sweep (off by default)
secrets.verify=true        enable opt-in live verification (network!)
secrets.baseline=<path>    suppress findings accepted in a baseline file

Verification is the only feature that touches the network and is off unless explicitly requested; tests never enable it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command(args []string) int

Command implements the `dsecrat secrets` subcommand surface. Today it exposes honeytoken generation — decoy credentials to plant in images or repos so any later *use* of them is a high-confidence intrusion signal. The master wires this into cli.go (see NOTES.md); the body lives here to keep the CLI file out of this phase's lane.

Usage:

dsecrat secrets honeytoken --label <name> [--count N]

Output is a decoy value plus its fingerprint. The value is intentionally printable: it is not a real secret, it is a tripwire you embed on purpose.

func Register

func Register(r *engine.Registry)

Register adds the secrets module to the registry. The master agent calls this from modules.Default() during integration; this package never edits the shared registry file.

Types

type Module

type Module struct{}

Module is the secret-detection capability (CAPABILITY_SPEC domain 7).

func New

func New() *Module

New returns a secrets module.

func (*Module) Analyze

func (m *Module) Analyze(ctx context.Context, t *engine.Target) ([]engine.Finding, error)

Analyze dispatches on target type, runs the scanner, and maps detections to findings. A failure to load the target is returned as an error; a scanner that simply finds nothing returns no findings and no error.

func (*Module) Description

func (m *Module) Description() string

func (*Module) Domains

func (m *Module) Domains() []string

func (*Module) Name

func (m *Module) Name() string

func (*Module) Supports

func (m *Module) Supports(t engine.TargetType) bool

Supports reports the target types the module scans.

Jump to

Keyboard shortcuts

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