auditing

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XForwardedFor = "X-Forwarded-For"
	XRealIP       = "X-Real-IP"
	XClientIP     = "x-client-ip"
)

Variables

This section is empty.

Functions

func RemoteIP

func RemoteIP(req *http.Request) string

Types

type Backend

type Backend interface {
	SendEvent(e audit.Event)
}

func NewDatabaseBackend

func NewDatabaseBackend(operator platform.EventWriter, stopCh <-chan struct{}) Backend

type ConsoleBackend

type ConsoleBackend struct {
}

func (ConsoleBackend) SendEvent

func (c ConsoleBackend) SendEvent(e audit.Event)

type DatabaseBackend

type DatabaseBackend struct {
	// contains filtered or unexported fields
}

func (*DatabaseBackend) CreateEvent

func (c *DatabaseBackend) CreateEvent(e *audit.Event)

func (*DatabaseBackend) SendEvent

func (c *DatabaseBackend) SendEvent(e audit.Event)

type Interface

type Interface interface {
	Enabled() bool
	AddBackend(backend Backend)
	LogRequestObject(req *http.Request, info *request.Info) *audit.Event
	LogResponseObject(e *audit.Event, resp *ResponseCapture)
}

func NewAuditing

func NewAuditing(options *auditoptions.AuditOptions) Interface

type LoginRequest

type LoginRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type Object

type Object struct {
	metav1.ObjectMeta `json:"metadata,omitempty"`
}

type ResponseCapture

type ResponseCapture struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

func NewResponseCapture

func NewResponseCapture(w http.ResponseWriter) *ResponseCapture

func (*ResponseCapture) Bytes

func (c *ResponseCapture) Bytes() []byte

func (*ResponseCapture) CloseNotify

func (c *ResponseCapture) CloseNotify() <-chan bool

CloseNotify is part of http.CloseNotifier interface

func (*ResponseCapture) Flush

func (c *ResponseCapture) Flush()

func (*ResponseCapture) Header

func (c *ResponseCapture) Header() http.Header

func (*ResponseCapture) Hijack

func (c *ResponseCapture) Hijack() (net.Conn, *bufio.ReadWriter, error)

Hijack implements the http.Hijacker interface. This expands the Response to fulfill http.Hijacker if the underlying http.ResponseWriter supports it.

func (*ResponseCapture) StatusCode

func (c *ResponseCapture) StatusCode() int

func (*ResponseCapture) Write

func (c *ResponseCapture) Write(data []byte) (int, error)

func (*ResponseCapture) WriteHeader

func (c *ResponseCapture) WriteHeader(statusCode int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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