audit

package
v1.0.17 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuditLevelEncoder

func AuditLevelEncoder(lvl zapcore.Level, enc zapcore.PrimitiveArrayEncoder)

Types

type AuditConfig

type AuditConfig struct {
	HMACKey []byte
}

AuditConfig captures the various config necessary for add audit functionality to a component

type AuditLevel

type AuditLevel zapcore.Level

func (AuditLevel) CapitalString

func (l AuditLevel) CapitalString() string

func (AuditLevel) Enabled

func (l AuditLevel) Enabled(_ zapcore.Level) bool

func (*AuditLevel) Get

func (l *AuditLevel) Get() interface{}

func (AuditLevel) MarshalText

func (l AuditLevel) MarshalText() ([]byte, error)

func (*AuditLevel) Set

func (l *AuditLevel) Set(s string) error

func (AuditLevel) String

func (l AuditLevel) String() string

func (*AuditLevel) UnmarshalText

func (l *AuditLevel) UnmarshalText(text []byte) error

type AuditLog

type AuditLog struct {
	Tenant  string       `json:"tenant"`
	Payload AuditPayload `json:"payload"`
	Hmac    string       `json:"hmac"`
}

AuditLog captures the format of the audit event

type AuditPayload

type AuditPayload struct {
	Timestamp       time.Time        `json:"timestamp"`
	ParentAuditID   string           `json:"parentAuditId"`
	ID              string           `json:"id"`
	MachineID       string           `json:"machineId"`
	Operation       string           `json:"operation"`
	Type            string           `json:"type"`
	ActorID         string           `json:"actorId"`
	ActorLocation   string           `json:"actorLocation"`
	SubjectID       string           `json:"subjectId"`
	SubjectLocation string           `json:"subjectLocation"`
	ObjectID        string           `json:"objectId"`
	ObjectLocation  string           `json:"objectLocation"`
	HmacBefore      string           `json:"hmacBefore"`
	HmacAfter       string           `json:"hmacAfter"`
	StateSummary    string           `json:"stateSummary"`
	Summary         string           `json:"summary"`
	State           string           `json:"state"`
	Data            AuditRequestData `json:"data"`
}

AuditPayload contains the actual information provided by the component generting the audit event

type AuditRecorder

type AuditRecorder interface {
	RecordEvent(*AuditPayload)
}

AuditRecorder describes the functionality that is required to be write/record an audit-event

type AuditRequestData

type AuditRequestData struct {
	ErrorMessage string `json:"errorMessage"`
	HttpMethod   string `json:"httpMethod"`
	RequestUri   string `json:"requestUri"`
	RemoteAddr   string `json:"remoteAddr"`
	UserAgent    string `json:"userAgent"`
	HttpStatus   int    `json:"httpStatus"`
}

AuditRequestData captures the core information about the request generating the audit event

type Auditor

type Auditor interface {
	AuditRecorder
}

Auditor captures the various functionality of the any audit provider

func NewLogAuditor

func NewLogAuditor() (Auditor, error)

func NewNoopAuditor

func NewNoopAuditor() Auditor

type NoopAuditor

type NoopAuditor struct{}

func (*NoopAuditor) RecordEvent

func (n *NoopAuditor) RecordEvent(_ *AuditPayload)

Jump to

Keyboard shortcuts

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