sync

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client to sync audit violations to Security Command Center

func NewClient

func NewClient(ctx context.Context, log logr.Logger, kubeconfig string, dryRun bool, source, clusterName, googleServiceAccount string) (*Client, error)

NewClient creates a Client that reads audit violations and creates findings. Use defer Client.Close() to clean up.

func (*Client) Close

func (c *Client) Close() error

Close cleans up resources, use with defer

func (*Client) Sync

func (c *Client) Sync(ctx context.Context) error

Sync retrieves Gatekeeper audit constraint violations and creates a finding in Security Command Center for each violation.

type Constraint

type Constraint struct {
	Name             string
	SelfLink         string
	UID              types.UID
	Kind             string
	AuditTime        time.Time
	SpecJSON         string
	TemplateUID      types.UID
	TemplateSelfLink string
	TemplateSpecJSON string
}

Constraint holds the constraint-related values used to create a finding request

type Resource

type Resource struct {
	Name           string
	Namespace      string
	GVK            schema.GroupVersionKind
	SelfLink       string
	UID            types.UID
	ProjectID      string
	StatusSelfLink string
	Message        string
	SpecJSON       string
}

Resource holds the resource-related values used to create a finding request

Jump to

Keyboard shortcuts

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