audit

package
v2.1.13-rc1+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

type Log struct {
	AuditID        k8stypes.UID `json:"auditID,omitempty"`
	RequestURI     string       `json:"requestURI,omitempty"`
	RequestBody    interface{}  `json:"requestBody,omitempty"`
	ResponseBody   interface{}  `json:"responseBody,omitempty"`
	ResponseStatus string       `json:"responseStatus,omitempty"`
	SourceIPs      []string     `json:"sourceIPs,omitempty"`
	User           *userInfo    `json:"user,omitempty"`
	UserAgent      string       `json:"userAgent,omitempty"`
	Verb           string       `json:"verb,omitempty"`
	Stage          string       `json:"stage,omitempty"`
	StageTimestamp string       `json:"stageTimestamp,omitempty"`
}

type LogWriter

type LogWriter struct {
	Level  int
	Output *lumberjack.Logger
}

func NewLogWriter

func NewLogWriter(path string, level, maxAge, maxBackup, maxSize int) *LogWriter

func (*LogWriter) LogRequest

func (a *LogWriter) LogRequest(req *http.Request, auditID k8stypes.UID, authed bool, contentType, user string, group []string) error

func (*LogWriter) LogResponse

func (a *LogWriter) LogResponse(resBody []byte, auditID k8stypes.UID, statusCode int, contentType string) error

Jump to

Keyboard shortcuts

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