Documentation
¶
Index ¶
- Constants
- type Agent
- type AuditCommandHandler
- type AuditResult
- type AuditResultHandler
- type AuditResultStatus
- type Auditor
- type ChangeLogLevelHandler
- type Constraint
- type ConstraintsHandler
- type Delta
- type DeltasHandler
- type EntitiesResync
- type EntitiesResyncHandler
- type EntitiesResyncItem
- type EntitiesSource
- type EntityDeltaKind
- type Gateway
- type GroupVersionResourceKind
- type LogLevel
- type Match
- type ParentController
- 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 EntitiesSource EntitiesSource Gateway Gateway Auditor Auditor // contains filtered or unexported fields }
func New ¶
func New(entitiesSource EntitiesSource, 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 Controls []string Standards []string Description string HowToSolve string Status AuditResultStatus Msg *string EntityName *string EntityKind *string NamespaceName *string ParentName *string ParentKind *string EntitySpec map[string]interface{} Trigger string }
func (*AuditResult) ToPacket ¶ added in v3.6.1
func (r *AuditResult) ToPacket() *proto.PacketAuditResultItem
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 ChangeLogLevelHandler ¶
type Constraint ¶ added in v3.3.1
type Constraint struct { Id string TemplateId string AccountId string ClusterId string Name string TemplateName string Parameters map[string]interface{} Match Match Code string Description string HowToSolve string UpdatedAt time.Time CategoryId string Severity string Controls []string Standards []string DeletedAt *string }
type ConstraintsHandler ¶ added in v3.3.1
type ConstraintsHandler func(constraints []*Constraint) map[string]error
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 SendEntitiesDeltas(deltas []*Delta) error SendEntitiesResync(resync *EntitiesResync) error SendAuditResults(auditResult []*AuditResult) error SetRestartHandler(handler RestartHandler) SetChangeLogLevelHandler(handler ChangeLogLevelHandler) SetConstraintsHandler(handler ConstraintsHandler) SetAuditCommandHandler(handler AuditCommandHandler) }
type GroupVersionResourceKind ¶
type GroupVersionResourceKind struct { schema.GroupVersionResource Kind string }
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 RestartHandler ¶
type RestartHandler func() error
Click to show internal directories.
Click to hide internal directories.