v3: go.mozilla.org/sops/v3/audit Index | Files

package audit

import "go.mozilla.org/sops/v3/audit"

Index

Package Files

audit.go

func Register Uses

func Register(auditor Auditor)

Register registers a new Auditor in the global auditor list

func SubmitEvent Uses

func SubmitEvent(event interface{})

SubmitEvent handles an event for all auditors

type Auditor Uses

type Auditor interface {
    // Handle() takes an audit event and attempts to persists it;
    // how it is persisted and how errors are handled is up to the
    // implementation of this interface.
    Handle(event interface{})
}

Auditor is notified when noteworthy events happen, for example when a file is encrypted or decrypted.

type DecryptEvent Uses

type DecryptEvent struct {
    File string
}

DecryptEvent contains fields relevant to a decryption event

type EncryptEvent Uses

type EncryptEvent struct {
    File string
}

EncryptEvent contains fields relevant to an encryption event

type PostgresAuditor Uses

type PostgresAuditor struct {
    DB *sql.DB
}

PostgresAuditor is a Postgres SQL DB implementation of the Auditor interface. It persists the audit event by writing a row to the 'audit_event' table. Errors with writing to the database will output a log message and the process will exit with status set to 1

func NewPostgresAuditor Uses

func NewPostgresAuditor(connStr string) (*PostgresAuditor, error)

NewPostgresAuditor is the constructor for a new PostgresAuditor struct initialized with the given db connection string

func (*PostgresAuditor) Handle Uses

func (p *PostgresAuditor) Handle(event interface{})

Handle persists the audit event by writing a row to the 'audit_event' postgres table

type RotateEvent Uses

type RotateEvent struct {
    File string
}

RotateEvent contains fields relevant to a key rotation event

Package audit imports 10 packages (graph) and is imported by 1 packages. Updated 2020-07-18. Refresh now. Tools for package owners.