audit

package
v0.0.0-...-29fea5a Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Audit

type Audit interface {
	Write(context.Context, *QueryData) error
}

type ConsoleAudit

type ConsoleAudit struct {
	Logger *zap.SugaredLogger
}

func NewLoggerAudit

func NewLoggerAudit(logger *zap.SugaredLogger) *ConsoleAudit

func (*ConsoleAudit) Write

func (d *ConsoleAudit) Write(_ context.Context, q *QueryData) error

type Option

type Option func(*SplunkAudit)

func WithHTTPClient

func WithHTTPClient(client *http.Client) Option

type QueryData

type QueryData struct {
	Query     string
	User      string
	Namespace string
	Pod       string
	Timestamp int64
}

type SplunkAudit

type SplunkAudit struct {
	SplunkEnv *splunk.Env
	// contains filtered or unexported fields
}

func NewSplunkAudit

func NewSplunkAudit(splunk *splunk.Env, options ...Option) *SplunkAudit

func (*SplunkAudit) SetHTTPClient

func (d *SplunkAudit) SetHTTPClient(client *http.Client)

func (*SplunkAudit) Write

func (d *SplunkAudit) Write(ctx context.Context, q *QueryData) error

type SplunkEventData

type SplunkEventData struct {
	Query     string `json:"query"`
	User      string `json:"user"`
	Namespace string `json:"namespace"`
	Pod       string `json:"pod"`
}

type SplunkQueryData

type SplunkQueryData struct {
	Event      *SplunkEventData `json:"event"`
	Index      string           `json:"index"`
	Host       string           `json:"host"`
	Source     string           `json:"source"`
	SourceType string           `json:"sourcetype"`
	Time       int64            `json:"time"`
}

Jump to

Keyboard shortcuts

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