Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions api/v1/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,18 @@ type CustomScraperBase struct {
DeleteFields []string `json:"deleteFields,omitempty"`
}

// ScraperExclusion specifies patterns for excluding external entities by name.
// Patterns support wildcards via collections.MatchItems (e.g. "system:controller:*").
type ScraperExclusion struct {
ExternalRoles []string `json:"externalRoles,omitempty" yaml:"externalRoles,omitempty"`
ExternalUsers []string `json:"externalUsers,omitempty" yaml:"externalUsers,omitempty"`
ExternalGroups []string `json:"externalGroups,omitempty" yaml:"externalGroups,omitempty"`
}

func (e ScraperExclusion) IsEmpty() bool {
return len(e.ExternalRoles) == 0 && len(e.ExternalUsers) == 0 && len(e.ExternalGroups) == 0
}

type BaseScraper struct {
CustomScraperBase `yaml:",inline" json:",inline"`

Expand All @@ -298,6 +310,9 @@ type BaseScraper struct {
// Properties are custom templatable properties for the scraped config items
// grouped by the config type.
Properties []ConfigProperties `json:"properties,omitempty" template:"true"`

// Exclude specifies patterns for excluding external entities.
Exclude ScraperExclusion `json:"excludeResources,omitempty" yaml:"excludeResources,omitempty"`
}

func (base BaseScraper) ApplyPlugins(plugins ...ScrapePluginSpec) BaseScraper {
Expand Down
31 changes: 31 additions & 0 deletions api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading