Skip to main content

Crate redact_scan

Crate redact_scan 

Source
Expand description

Read-only Postgres PII discovery scanner.

Prefer a replica or staging database. Reports list locations and counts only — never sample values.

Re-exports§

pub use error::ScanError;
pub use report::Finding;
pub use report::ScanReport;
pub use scan::run_scan;

Modules§

bound
Rule-of-three helper for negative samples. Rule of three for negative sampling results.
canonical
Canonical JSON hashing for ScanReport::content_hash.
catalog
Layer 0 catalog metadata. Layer 0: pg_catalog / information_schema metadata. No user-table reads.
cli
Command-line argument types.
detect
Pattern-engine wrapper that drops matched text. Pattern-engine wrapper that drops matched text immediately.
error
Scrubbed scanner errors.
format
Human-readable table output. Human-readable table output. Never prints sample values.
ident
Identifier quoting. Identifier quoting. Values are always double-quoted.
json_scan
Layer 2 JSON path sampling. Layer 2: JSON/JSONB path sampling.
layers
Discovery layer identifiers (0, 0.5, 1, 2).
report
Value-free report types.
safety
Read-only session and privilege checks. Read-only session setup and privilege refusal.
sample
Layer 1 table sampling. Layer 1: bounded TABLESAMPLE SYSTEM of candidate columns.
scan
Scan orchestration. Scan orchestration for layers 0, 0.5, 1, and 2.
score
Name and type heuristics. Name and type heuristics for layer 0.
scrub
Credential redaction for logs and errors.
stats
Layer 0.5 planner statistics. Layer 0.5: pg_stats most-common values and histogram bounds.
upload
Optional HTTP POST of the report JSON. Optional HTTP POST of the report JSON.

Constants§

EXIT_CLEAN
Process exit code when the scan completed with no fail-on match.
EXIT_ERROR
Process exit code for usage errors, safety refusals, and I/O failures.
EXIT_FINDINGS
Process exit code when --fail-on matched at least one finding.