Documentation
¶
Overview ¶
Package scanning is the secret-scanning ruleset (ADR docs/adr/secret-scanning.md).
The compiled ruleset is a pinned, allowlisted, fixtured snapshot of the gitleaks rules plus one Hikyo-owned two-stage rule for the hik_ family. The runtime here imports no hash/HMAC primitive: per-rule semantic digests and the snapshot version are computed at generation and embedded as constants (see internal/scanning/gen). A Finding carries a rule id only — no match text, offset, length or excerpt exists on any exported type (ADR §4), so the scanner cannot mint a new disclosure path.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Finding ¶
type Finding struct {
RuleID string
}
Finding is the redacted result: a rule id and nothing else. No match text, offset, length or excerpt may ever be added — the type is the enforcement point for the non-disclosure invariant (ADR §4, SS4).
type Ruleset ¶
type Ruleset struct {
// contains filtered or unexported fields
}
Ruleset is the validated, boot-compiled ruleset.
func Load ¶
Load validates the embedded compiled ruleset and returns it. Any inconsistency is an error; server boot refuses to start on it (fail fast, ADR §7). Load is the only constructor callers use.
func (*Ruleset) Scan ¶
Scan reports which rules match content. It returns one Finding per matched rule (no offsets, so duplicate hits carry no information). Keywords prefilter only. ctx cancellation/deadline is honoured between rules — the scan shares the enclosing operation's clock (ADR §7).
func (*Ruleset) SemanticDigest ¶
SemanticDigest returns the generation-time digest of a rule, used to key dismissals (ADR §4). The second result is false for an unknown rule id.
func (*Ruleset) SnapshotVersion ¶
SnapshotVersion is the stable identifier binding the gitleaks pin and the allowlist digest (ADR §4).
func (*Ruleset) Subset ¶
Subset returns a ruleset carrying only the named rules, with their compiled form, semantic digests and snapshot version unchanged, so a verdict from the subset is the verdict the full ruleset gives for those rules. It narrows and never widens: an unknown id, a duplicate or an empty selection is an error.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package bench is the schema shared by cmd/bench-scan (which writes the result artifact) and the scanning validation test (which parses it).
|
Package bench is the schema shared by cmd/bench-scan (which writes the result artifact) and the scanning validation test (which parses it). |
|
Package corpus is the true-positive / false-positive fixture corpus for the secret scanner (ADR §3, SS1).
|
Package corpus is the true-positive / false-positive fixture corpus for the secret scanner (ADR §3, SS1). |
|
Command gen produces internal/scanning/rules_gen.go from the vendored gitleaks snapshot plus the committed allowlist.
|
Command gen produces internal/scanning/rules_gen.go from the vendored gitleaks snapshot plus the committed allowlist. |