audit

package
v1.15.13 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

Package audit contains the password-strength auditing implementation. It reads all decrypted passwords and applies different heuristics and external password strength checks to determine the quality of the password (i.e. the first line of the secret - only!).

Index

Constants

This section is empty.

Variables

View Source
var DefaultExpiration = time.Hour * 24 * 365

DefaultExpiration is the default expiration time for secrets.

Functions

func FilterExcludes added in v1.15.13

func FilterExcludes(excludes string, in []string) []string

FilterExcludes filters the given list of secrets against the given exclude patterns (RE2 syntax).

func Single

func Single(ctx context.Context, password string)

Single runs a password strength audit on a single password.

Types

type Auditor added in v1.15.3

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

func New added in v1.15.3

func New(ctx context.Context, s secretGetter) *Auditor

func (*Auditor) Batch added in v1.15.3

func (a *Auditor) Batch(ctx context.Context, secrets []string) (*Report, error)

Batch runs a password strength audit on multiple secrets. Expiration is in days.

type Finding added in v1.15.3

type Finding struct {
	Severity string
	Message  string
}

type Report added in v1.15.3

type Report struct {
	// secret name -> report
	Secrets map[string]SecretReport

	// finding -> secrets
	Findings map[string]set.Set[string]

	Template string
	Duration time.Duration
}

func (*Report) PrintResults added in v1.15.3

func (r *Report) PrintResults(ctx context.Context) error

func (*Report) PrintSummary added in v1.15.13

func (r *Report) PrintSummary(ctx context.Context) error

func (*Report) RenderCSV added in v1.15.3

func (r *Report) RenderCSV(w io.Writer) error

func (*Report) RenderHTML added in v1.15.3

func (r *Report) RenderHTML(w io.Writer) error

type ReportBuilder added in v1.15.3

type ReportBuilder struct {
	// protects all below
	sync.Mutex
	// contains filtered or unexported fields
}

func (*ReportBuilder) AddFinding added in v1.15.3

func (r *ReportBuilder) AddFinding(secret, finding, message, severity string)

func (*ReportBuilder) AddPassword added in v1.15.3

func (r *ReportBuilder) AddPassword(name, pw string)

func (*ReportBuilder) Finalize added in v1.15.3

func (r *ReportBuilder) Finalize() *Report

Finalize computes the duplicates.

func (*ReportBuilder) SetAge added in v1.15.3

func (r *ReportBuilder) SetAge(name string, age time.Duration)

type SecretReport added in v1.15.3

type SecretReport struct {
	Name string
	// analyzer -> finding details
	Findings map[string]Finding
	Age      time.Duration
}

func (*SecretReport) HasFindings added in v1.15.13

func (s *SecretReport) HasFindings() bool

func (*SecretReport) HumanizeAge added in v1.15.13

func (s *SecretReport) HumanizeAge() string

Jump to

Keyboard shortcuts

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