Documentation
¶
Index ¶
- Constants
- type Agent
- type AuditCommandHandler
- type AuditResult
- type AuditResultHandler
- type AuditResultStatus
- type Auditor
- type Automation
- type AutomationExecutor
- type AutomationFeedback
- type AutomationFeedbackHandler
- type AutomationHandler
- type AutomationStatus
- type ChangeLogLevelHandler
- type Constraint
- type ConstraintsHandler
- type ContainerResources
- type Delta
- type DeltasHandler
- type EntitiesResync
- type EntitiesResyncHandler
- type EntitiesResyncItem
- type EntitiesSource
- type EntityDeltaKind
- type Gateway
- type GroupVersionResourceKind
- type LogLevel
- type Match
- type Metric
- type MetricsHandler
- type MetricsSource
- type ParentController
- type RequestLimit
- type RestartHandler
Constants ¶
View Source
const ( AuditResultStatusViolating = "violation" AuditResultStatusCompliant = "compliance" AuditResultStatusIgnored = "ignored" )
View Source
const AuthorizationTimeoutDuration = 2 * time.Hour
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct { AccountID uuid.UUID ClusterID uuid.UUID AgentID uuid.UUID MetricsSource MetricsSource EntitiesSource EntitiesSource AutomationExecutor AutomationExecutor Gateway Gateway Auditor Auditor // contains filtered or unexported fields }
func New ¶
func New( metricsSource MetricsSource, entitiesSource EntitiesSource, automationExecutor AutomationExecutor, gateway Gateway, logLevelHandler ChangeLogLevelHandler, auditor Auditor, ) *Agent
type AuditCommandHandler ¶ added in v3.4.0
type AuditCommandHandler func() error
type AuditResult ¶ added in v3.3.1
type AuditResult struct { TemplateID *string ConstraintID *string CategoryID *string Severity *string Description string HowToSolve string Status AuditResultStatus Msg *string EntityName *string EntityKind *string NamespaceName *string ParentName *string ParentKind *string NodeIP *string EntitySpec map[string]interface{} }
type AuditResultHandler ¶ added in v3.3.1
type AuditResultHandler func(auditResult []*AuditResult) error
type AuditResultStatus ¶ added in v3.4.0
type AuditResultStatus string
type Auditor ¶ added in v3.3.1
type Auditor interface { Start(ctx context.Context) error Stop() error HandleConstraints(constraint []*Constraint) map[string]error HandleAuditCommand() error SetAuditResultHandler(handler AuditResultHandler) }
type Automation ¶
type AutomationExecutor ¶
type AutomationExecutor interface { Start(ctx context.Context) error Stop() error SubmitAutomation(automation *Automation) error SetAutomationFeedbackHandler(handler AutomationFeedbackHandler) }
type AutomationFeedback ¶
type AutomationFeedbackHandler ¶
type AutomationFeedbackHandler func(feedback *AutomationFeedback) error
type AutomationHandler ¶
type AutomationHandler func(automation *Automation) error
type AutomationStatus ¶
type AutomationStatus string
const ( AutomationExecuted AutomationStatus = "executed" AutomationFailed AutomationStatus = "failed" AutomationSkipped AutomationStatus = "skipped" )
type ChangeLogLevelHandler ¶
type Constraint ¶ added in v3.3.1
type ConstraintsHandler ¶ added in v3.3.1
type ConstraintsHandler func(constraints []*Constraint) map[string]error
type ContainerResources ¶
type ContainerResources struct { Requests *RequestLimit Limits *RequestLimit }
type Delta ¶
type Delta struct { Kind EntityDeltaKind Gvrk GroupVersionResourceKind Data unstructured.Unstructured Parent *ParentController Timestamp time.Time }
type DeltasHandler ¶
type EntitiesResync ¶
type EntitiesResync struct { Timestamp time.Time `json:"timestamp"` // map of entities kind and entities definitions Snapshot map[string]EntitiesResyncItem `json:"snapshot"` }
type EntitiesResyncHandler ¶
type EntitiesResyncHandler func(resync *EntitiesResync) error
type EntitiesResyncItem ¶
type EntitiesResyncItem struct { Gvrk GroupVersionResourceKind `json:"gvrk"` Data []*unstructured.Unstructured `json:"data"` }
type EntitiesSource ¶
type EntitiesSource interface { Start(ctx context.Context) error Stop() error SetDeltasHandler(handler DeltasHandler) SetEntitiesResyncHandler(handler EntitiesResyncHandler) }
type EntityDeltaKind ¶
type EntityDeltaKind string
const ( EntityDeltaKindUpsert EntityDeltaKind = "UPSERT" EntityDeltaKindDelete EntityDeltaKind = "DELETE" )
type Gateway ¶
type Gateway interface { Start(ctx context.Context) error WaitAuthorization(timeout time.Duration) error SendMetrics(metrics []*Metric) error SendEntitiesDeltas(deltas []*Delta) error SendEntitiesResync(resync *EntitiesResync) error SendAutomationFeedback(feedback *AutomationFeedback) error SendAuditResults(auditResult []*AuditResult) error SetAutomationHandler(handler AutomationHandler) SetRestartHandler(handler RestartHandler) SetChangeLogLevelHandler(handler ChangeLogLevelHandler) SetConstraintsHandler(handler ConstraintsHandler) SetAuditCommandHandler(handler AuditCommandHandler) }
type GroupVersionResourceKind ¶
type GroupVersionResourceKind struct { schema.GroupVersionResource Kind string }
type Metric ¶
type Metric struct { Name string Type string NodeName string NodeIP string NamespaceName string ControllerName string ControllerKind string ContainerName string Timestamp time.Time Value int64 PodName string AdditionalTags map[string]interface{} }
Metric metrics struct
type MetricsHandler ¶
type MetricsSource ¶
type MetricsSource interface { Start(ctx context.Context) error Stop() error SetMetricsHandler(handler MetricsHandler) }
type ParentController ¶
type ParentController struct { Kind string `json:"kind"` Name string `json:"name"` APIVersion string `json:"api_version"` IsWatched bool `json:"is_watched"` Parent *ParentController `json:"parent"` }
type RequestLimit ¶
type RestartHandler ¶
type RestartHandler func() error
Click to show internal directories.
Click to hide internal directories.