Secret Leak Detection Readiness — Policy & Security Brief

Audience: Policy Guild, Security Guild
Related backlog: SCANNER-ENG-0007 (deterministic leak detection pipeline), DOCS-SCANNER-BENCH-62-007 (rule bundle documentation), SCANNER-SECRETS-01…03 (Surface.Secrets alignment)

1. Goal & scope

2. Proposed evidence pipeline

  1. Source resolution
    • Surface.Secrets providers (Kubernetes, file bundle, inline) continue to resolve operational credentials. Handles remain opaque and never enter analyzer outputs.
  2. Deterministic scanning
    • New plug-in executes signed rule bundles (regex + entropy signatures) stored under scanner/rules/secrets/.
    • Execution context restricted to read-only layer mount; analyzers emit secret.leak evidence with: {rule.id, rule.version, confidence, severity, mask, file, line}.
  3. Analysis store persistence
    • Findings are written into ScanAnalysisStore (ScanAnalysisKeys.secretFindings) so Policy Engine can ingest them alongside component fragments.
  4. Policy overlay
    • Policy predicates (see §3) evaluate evidence, lattice scores, and tenant-scoped allow/deny lists.
    • CLI/export surfaces show masked snippets and remediation hints.
  5. Offline parity
    • Rule bundles, signature manifests, and validator hash lists ship with Offline Kit; rule updates must be signed and versioned to preserve determinism.

3. Policy Engine considerations

3.1 Implemented predicates (SPRINT_20260104_004_POLICY)

The following secret-related signals are now available via StellaOps.PolicyDsl.SignalContext:

SignalTypeDescription
secret.has_findingboolTrue if any secret finding exists
secret.countintTotal number of secret findings
secret.severity.criticalboolTrue if any critical severity finding exists
secret.severity.highboolTrue if any high severity finding exists
secret.severity.mediumboolTrue if any medium severity finding exists
secret.severity.lowboolTrue if any low severity finding exists
secret.confidence.highboolTrue if any high confidence finding exists
secret.confidence.mediumboolTrue if any medium confidence finding exists
secret.confidence.lowboolTrue if any low confidence finding exists
secret.mask.appliedboolTrue if masking was applied to all findings
secret.bundle.versionstringActive bundle version (YYYY.MM format)
secret.bundle.idstringActive bundle identifier
secret.bundle.rule_countintNumber of rules in the active bundle
secret.bundle.signer_key_idstringKey ID used to sign the bundle
secret.aws.countintCount of AWS-related secret findings
secret.github.countintCount of GitHub-related secret findings
secret.private_key.countintCount of private key findings

3.2 Usage in SPL policies

{
  "conditions": [
    { "field": "secret.severity.critical", "operator": "eq", "value": true },
    { "field": "secret.bundle.version", "operator": "gte", "value": "2025.01" }
  ]
}

See example policies in src/Policy/__Libraries/StellaOps.Policy/Schemas/spl-secret-block@1.json and spl-secret-warn@1.json.

3.3 Integration with SignalContext

using StellaOps.Policy.Secrets;
using StellaOps.PolicyDsl;

// Add secret evidence to policy evaluation
var signalContext = SignalContext.Builder()
    .WithSecretEvidence(secretEvidenceProvider)
    .Build();

3.4 Lattice weight suggestions

3.5 Waiver workflow

3.6 Masking / privacy

4. Security guardrails

5. Offline & update flow

  1. Engineering publishes new bundle → Signer signs → Offline Kit includes bundle + manifest.
  2. Operators import bundle via CLI (stella secrets bundle install --path <bundle>).
    • CLI verifies signature, version monotonicity, and rule hash list.
  3. Policy update: push config snippet enabling bundle, severity mapping, and waiver templates.
  4. Run stella secrets scan --dry-run to verify deterministic output against golden fixtures before enabling in production.

6. Open questions / owners

TopicQuestionOwnerTarget decision
Masking depthDo we mask file paths or only payloads?Security GuildSprint 132 design review
Telemetry retentionShould secret finding metrics be sampled or full fidelity?Policy + Observability GuildSprint 132
Default bundlesWhich rule families ship enabled-by-default (cloud creds, SSH keys, JWT)?Security GuildSprint 133
Tenant overridesFormat for per-tenant allow lists (path glob vs digest)?Policy GuildSprint 133

Decision tracker

DecisionOwner(s)Target dateStatus
Masking depth (paths vs payloads)Security Guild2025-11-10Pending
Telemetry retention granularityPolicy + Observability Guild2025-11-10Pending
Default rule bundles (cloud creds/SSH/JWT)Security Guild2025-11-10Draft proposals under review
Tenant override formatPolicy Guild2025-11-10Pending
Policy predicates implementationPolicy Guild2026-01-04DONE (SPRINT_20260104_004_POLICY)

7. Next steps

  1. Policy Guild drafts predicate specs + policy templates DONE — See spl-secret-block@1.json, spl-secret-warn@1.json.
  2. Security Guild reviews signing + masking requirements; align with Surface.Secrets roadmap.
  3. Docs Guild continues maintaining docs/benchmarks/scanner/deep-dives/secrets.md with finalized rule taxonomy and references.
  4. Engineering provides prototype fixture outputs for review once SCANNER-ENG-0007 spikes begin.
  5. NEW: Integration testing between Scanner.Analyzers.Secrets and Policy DSL signals.

Coordination