auditing

package
v0.0.0-...-18e089f Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 28 Imported by: 2

Documentation

Index

Constants

View Source
const (
	GetSenderTimeout     = time.Second
	SendTimeout          = time.Second * 3
	DefaultSendersNum    = 100
	DefaultBatchSize     = 100
	DefaultBatchInterval = time.Second * 3
	WebhookURL           = "https://kube-auditing-webhook-svc.kubesphere-logging-system.svc:6443/audit/webhook/event"
)
View Source
const (
	DefaultWebhook       = "kube-auditing-webhook"
	DefaultCacheCapacity = 10000
	CacheTimeout         = time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Auditing

type Auditing interface {
	Enabled() bool
	K8sAuditingEnabled() bool
	LogRequestObject(req *http.Request, info *request.RequestInfo) *auditv1alpha1.Event
	LogResponseObject(e *auditv1alpha1.Event, resp *ResponseCapture)
}

func NewAuditing

func NewAuditing(informers informers.InformerFactory, opts *options.Options, stopCh <-chan struct{}) Auditing

type Backend

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

func NewBackend

func NewBackend(opts *options.Options, cache chan *v1alpha1.Event, stopCh <-chan struct{}) *Backend

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) 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