audit

package
v1.15.11 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: MIT Imports: 26 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 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 {
	Secrets  map[string]SecretReport
	Template string
	Duration time.Duration
}

func (*Report) PrintResults added in v1.15.3

func (r *Report) PrintResults(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 {
	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
	Findings map[string]Finding
	Age      time.Duration
}

Jump to

Keyboard shortcuts

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