collector

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2020 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ECRSeverityCritical      = "CRITICAL"
	ECRSeverityHigh          = "HIGH"
	ECRSeverityMedium        = "MEDIUM"
	ECRSeverityLow           = "LOW"
	ECRSeverityInformational = "INFORMATIONAL"
)
View Source
const (
	HarborSeverityCritical   = "Critical"
	HarborSeverityHigh       = "High"
	HarborSeverityMedium     = "Medium"
	HarborSeverityLow        = "Low"
	HarborSeverityNone       = "None"
	HarborSeverityUnknown    = "Unknown"
	HarborSeverityNegligible = "Negligible"
)

Variables

This section is empty.

Functions

func EcrOccurrenceNote added in v0.2.0

func EcrOccurrenceNote(queueName string) string

func EcrOccurrenceResourceURI added in v0.2.0

func EcrOccurrenceResourceURI(account, region, repository, tag, digest string) string

Types

type CloudTrailEventDetail

type CloudTrailEventDetail struct {
	EventVersion string    `json:"eventVersion"`
	EventID      string    `json:"eventID"`
	EventTime    time.Time `json:"eventTime"`
	EventType    string    `json:"eventType"`
	AwsRegion    string    `json:"awsRegion"`
	EventName    string    `json:"eventName"`
	UserIdentity struct {
		UserName    string `json:"userName"`
		PrincipalID string `json:"principalId"`
		AccessKeyID string `json:"accessKeyId"`
		InvokedBy   string `json:"invokedBy"`
		Type        string `json:"type"`
		Arn         string `json:"arn"`
		AccountID   string `json:"accountId"`
	} `json:"userIdentity"`
	EventSource       string                 `json:"eventSource"`
	RequestID         string                 `json:"requestID"`
	RequestParameters map[string]interface{} `json:"requestParameters"`
	ResponseElements  map[string]interface{} `json:"responseElements"`
}

CloudTrailEventDetail structured event details

type CloudWatchEvent

type CloudWatchEvent struct {
	Version    string          `json:"version"`
	ID         string          `json:"id"`
	DetailType string          `json:"detail-type"`
	Source     string          `json:"source"`
	AccountID  string          `json:"account"`
	Time       time.Time       `json:"time"`
	Region     string          `json:"region"`
	Resources  []string        `json:"resources"`
	Detail     json.RawMessage `json:"detail"`
}

CloudWatchEvent structured event

type Collector

type Collector interface {
	// Reconcile handles creating and updating any external resources that are required for your collector to function
	// properly. Reconcile should be idempotent.
	// The `name` parameter can be used to help provide names for the external resources managed by Reconcile.
	// Example: the ECR collector will use the Reconcile function to create and update SQS queues and CloudWatch events
	Reconcile(ctx context.Context, name types.NamespacedName) error

	// Destroy handles the deletion of resources that were created in the Reconcile function
	Destroy(ctx context.Context) error

	// Type returns the type of this collector
	Type() string
}

Collector converts events to occurrences

func NewEcrEventCollector

func NewEcrEventCollector(logger logr.Logger, awsConfig *aws.Config, queueName string) Collector

NewEcrEventCollector will create an collector of ECR events from Cloud watch

func NewHarborEventCollector added in v0.2.1

func NewHarborEventCollector(logger logr.Logger, harborURL string, secret *corev1.Secret, project string, namespace string, hostname *v1beta1.Ingress) Collector

func NewTestCollector added in v0.2.0

func NewTestCollector(logger logr.Logger, testMessage string) Collector

type ECRImageActionDetail

type ECRImageActionDetail struct {
	ActionType     string `json:"action-type"`
	RepositoryName string `json:"repository-name"`
	ImageDigest    string `json:"image-digest"`
	ImageTag       string `json:"image-tag"`
	Result         string `json:"result"`
}

ECRImageActionDetail structured event details

type ECRImageScanDetail

type ECRImageScanDetail struct {
	ScanStatus             string           `json:"scan-status"`
	RepositoryName         string           `json:"repository-name"`
	ImageDigest            string           `json:"image-digest"`
	ImageTags              []string         `json:"image-tags"`
	FindingsSeverityCounts map[string]int64 `json:"finding-severity-counts"`
}

ECRImageScanDetail structured event details

type ECRImageScanSeverity added in v0.2.0

type ECRImageScanSeverity string

type HarborEventCollector added in v0.2.1

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

func (*HarborEventCollector) Destroy added in v0.2.1

func (t *HarborEventCollector) Destroy(ctx context.Context) error

func (*HarborEventCollector) HandleWebhook added in v0.2.1

func (t *HarborEventCollector) HandleWebhook(writer http.ResponseWriter, request *http.Request, occurrenceCreator occurrence.Creator)

func (*HarborEventCollector) Reconcile added in v0.2.1

func (*HarborEventCollector) Type added in v0.2.1

func (t *HarborEventCollector) Type() string

type StartableCollector added in v0.2.1

type StartableCollector interface {
	// Start handles the logic required for the collector to receive events and create occurrences using the provided
	// `occurrenceCreator`
	Start(ctx context.Context, stopChan chan interface{}, occurrenceCreator occurrence.Creator) error
}

type WebhookCollector added in v0.2.1

type WebhookCollector interface {
	// HandleWebhook handles a given HTTP request for this collector and converts it into occurrences using the provided
	// `occurrenceCreator`
	HandleWebhook(writer http.ResponseWriter, request *http.Request, occurrenceCreator occurrence.Creator)
}

WebhookCollector receives events as HTTP payloads and converts them to occurrences

Jump to

Keyboard shortcuts

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