filters

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoCloseRule

type AutoCloseRule struct {
	Name             string      `json:"name"`
	Enabled          bool        `json:"enabled"`
	Filters          RuleFilters `json:"filters"`
	Action           RuleAction  `json:"action"`
	SkipNotification bool        `json:"skip_notification"`
}

type FilterEngine

type FilterEngine struct {
	Rules []AutoCloseRule
}

func NewFilterEngine

func NewFilterEngine(rules []AutoCloseRule) *FilterEngine

func (*FilterEngine) FindMatchingRule

func (e *FilterEngine) FindMatchingRule(finding *events.SecurityHubV2Finding) (*AutoCloseRule, bool)

type ResourceTagFilter

type ResourceTagFilter struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type RuleAction

type RuleAction struct {
	StatusID int32  `json:"status_id"`
	Comment  string `json:"comment"`
}

type RuleFilters

type RuleFilters struct {
	FindingTypes  []string            `json:"finding_types,omitempty"`
	Severity      []string            `json:"severity,omitempty"`
	ProductName   []string            `json:"product_name,omitempty"`
	ResourceTypes []string            `json:"resource_types,omitempty"`
	ResourceTags  []ResourceTagFilter `json:"resource_tags,omitempty"`
	Accounts      []string            `json:"accounts,omitempty"`
	Regions       []string            `json:"regions,omitempty"`
}

type S3Client

type S3Client interface {
	ListObjectsV2(ctx context.Context, params *s3.ListObjectsV2Input, optFns ...func(*s3.Options)) (*s3.ListObjectsV2Output, error)
	GetObject(ctx context.Context, params *s3.GetObjectInput, optFns ...func(*s3.Options)) (*s3.GetObjectOutput, error)
}

type S3RulesLoader

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

func NewS3RulesLoader

func NewS3RulesLoader(client S3Client) *S3RulesLoader

func (*S3RulesLoader) LoadRules

func (l *S3RulesLoader) LoadRules(ctx context.Context, bucket, prefix string) ([]AutoCloseRule, error)

Jump to

Keyboard shortcuts

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