audit

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditLog

type AuditLog struct {
	// contains filtered or unexported fields
}

func NewAuditLog

func NewAuditLog(root string) *AuditLog

func (*AuditLog) DeleteRecord

func (a *AuditLog) DeleteRecord(index int) error

func (*AuditLog) LoadHistory

func (a *AuditLog) LoadHistory() ([]ScanRecord, error)

func (*AuditLog) LogScan

func (a *AuditLog) LogScan(record ScanRecord) error

type FindingSummary

type FindingSummary struct {
	Path     string `json:"path"`
	Detector string `json:"detector"`
	Severity string `json:"severity"`
	Line     int    `json:"line"`
}

type Options

type Options struct {
	// StoreRaw preserves raw match/secret data in the audit log (opt-in).
	StoreRaw bool
}

Options controls how audit records are written.

type ScanRecord

type ScanRecord struct {
	Timestamp      time.Time        `json:"timestamp"`
	ScanID         string           `json:"scan_id"`
	Root           string           `json:"root"`
	TotalFindings  int              `json:"total_findings"`
	NewFindings    int              `json:"new_findings"`
	BaselinedCount int              `json:"baselined_count"`
	SeverityCounts map[string]int   `json:"severity_counts"`
	FilesScanned   int              `json:"files_scanned"`
	Duration       string           `json:"duration"`
	BaselineFile   string           `json:"baseline_file,omitempty"`
	TopFindings    []FindingSummary `json:"top_findings,omitempty"`
	AllFindings    []types.Finding  `json:"all_findings,omitempty"`
}

func CreateScanRecord

func CreateScanRecord(
	root string,
	allFindings []types.Finding,
	newFindings []types.Finding,
	filesScanned int,
	duration time.Duration,
	baselineFile string,
	opts Options,
) ScanRecord

Jump to

Keyboard shortcuts

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