audit

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package audit emits security-relevant events: auth/authz failures, rate limiting, and configuration reloads

Index

Constants

View Source
const (
	EventAuthFailure  = "auth_failure"
	EventConfigReload = "config_reload"
	EventRateLimited  = "rate_limited"
)

Operators match on these in their log pipelines, so changing one is a breaking change

View Source
const (
	OutcomeSuccess = "success"
	OutcomeFailure = "failure"
)

Outcomes of a config reload

View Source
const ReasonConfigFile = "config_file"

Secret-driven reloads supply their own reason from internal/secrets

View Source
const ReasonSignal = "signal"

Variables

This section is empty.

Functions

func AuthFailure

func AuthFailure(ctx context.Context, reason string)

func ConfigReload

func ConfigReload(ctx context.Context, reason string, err error)

Records a hot reload and the error that stopped it, if any. reason is one of the Reason constants

func Enabled

func Enabled() bool

func RateLimited added in v0.14.0

func RateLimited(ctx context.Context, policy, rule, layer, user, tenant string)

The caller limits how often this fires so a client hammering away doesn't flood the log

func SetAuditLoggerOnStartup

func SetAuditLoggerOnStartup(l *slog.Logger)

Types

This section is empty.

Jump to

Keyboard shortcuts

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