audit

package
v1.0.16 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

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