audit

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package audit re-checks what is already stored against the redaction rules. Redaction runs once, at ingest; this is the inspection after the fact, like a compliance officer sampling filed claims to confirm nothing sensitive slipped through, whether because a rule was added after a row was written or because a code path never redacted at all.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Example

type Example struct {
	ID        int64
	SessionID string
	Seq       *int64
	Rules     []string
}

Example points at one offending row. It carries no text: the report must not repeat the secret it is warning about.

type Location

type Location struct {
	Table, Column string
	Scanned       int
	Hits          int            // rows with at least one residual match
	ByRule        map[string]int // rule name -> rows it matched
	Examples      []Example
}

Location is the outcome for one table.column.

func (Location) RuleNames

func (l Location) RuleNames() []string

RuleNames returns the location's matched rule names in a stable order.

type Report

type Report struct {
	Locations []Location
}

Report is the outcome of Secrets.

func Secrets

func Secrets(db *sql.DB) (Report, error)

Secrets scans every stored text column against the current redaction rules and reports rows that would still be changed by redact.Redact. It streams rows rather than loading them, since messages.raw is the bulk of the database.

func (Report) Hits

func (r Report) Hits() int

Hits is the total number of rows with a residual match, across locations.

Jump to

Keyboard shortcuts

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