redact

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package redact minimizes the sensitive operational detail an evidence bundle physically ships, while leaving the cryptographic verification story intact.

The signed predicate commits to artifacts by hash and carries the derived fingerprint / criteria-match / per-phase counts — that is the conformance signal. The snapshot and CTRF payloads are the *backing content* those digests point at, not the signal itself, so they can be shrunk without weakening the binding.

Two transforms are applied by the minimal policy:

  • Snapshot: a fail-closed allowlist that is enforced at every level — measurement type, subtype, AND data key. Only enumerated types, subtypes, and keys survive; a new type, subtype, or key a future collector adds is dropped until explicitly allowlisted (there is no keep-all subtype). Node names, provider instance IDs, the raw node label/taint set, kernel/sysctl tuning, loaded modules, and systemd service config are dropped.
  • CTRF: per-test Stdout and Message (free-form log text that can leak IPs, DNS names, secret/cert names, internal URLs) are omitted; the pass/fail signal (name, status, duration, suite, summary counts) is preserved.

Both functions are pure and non-mutating: they build fresh structures and never alter their inputs, so the full (unredacted) artifacts remain available for the --full emit path and for computing the predicate fingerprint from the raw snapshot.

Index

Constants

View Source
const (
	// PolicyName identifies the redaction policy recorded in the predicate.
	PolicyName = "minimal"

	// PolicyVersion is the allowlist/scrub-rule version. Bump on any change
	// to what survives redaction so verifiers can tell which rules ran.
	PolicyVersion = "v1"
)

Variables

This section is empty.

Functions

func CTRF

func CTRF(in *ctrf.Report) (*ctrf.Report, []string)

CTRF returns a redacted deep copy of in with per-test Stdout and Message omitted, and the sorted list of applied rule identifiers. It never mutates in. Returns (nil, nil) when in is nil.

func Snapshot

func Snapshot(in *snapshotter.Snapshot) (*snapshotter.Snapshot, []string)

Snapshot returns a redacted deep copy of in and the sorted list of applied rule identifiers. It never mutates in. Returns (nil, nil) when in is nil.

Types

This section is empty.

Jump to

Keyboard shortcuts

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