Documentation ¶
Index ¶
- type CreateOption
- func WithAdditionalOpsPodLabels(labels map[string]string) CreateOption
- func WithConfig(config *rest.Config) CreateOption
- func WithID(id string) CreateOption
- func WithLogger(logger provider.Logger) CreateOption
- func WithMetadata(metadata map[string]string) CreateOption
- func WithName(name string) CreateOption
- type Provider
- func (p *Provider) AddRulesets(rulesets ...ruleset.Ruleset) error
- func (p *Provider) ID() string
- func (p *Provider) Logger() sharedprovider.Logger
- func (p *Provider) Metadata() map[string]string
- func (p *Provider) Name() string
- func (p *Provider) RunAll(ctx context.Context) (provider.ProviderResult, error)
- func (p *Provider) RunRule(ctx context.Context, rulesetID, rulesetVersion, ruleID string) (rule.RuleResult, error)
- func (p *Provider) RunRuleset(ctx context.Context, rulesetID, rulesetVersion string) (ruleset.RulesetResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateOption ¶
type CreateOption func(*Provider)
CreateOption is a function that acts on a Provider and is used to construct such objects.
func WithAdditionalOpsPodLabels ¶ added in v0.8.0
func WithAdditionalOpsPodLabels(labels map[string]string) CreateOption
WithAdditionalOpsPodLabels sets the AdditionalOpsPodLabels of a Provider.
func WithConfig ¶
func WithConfig(config *rest.Config) CreateOption
WithConfig sets the Config of a Provider.
func WithLogger ¶
func WithLogger(logger provider.Logger) CreateOption
WithLogger sets the logger of a Provider.
func WithMetadata ¶
func WithMetadata(metadata map[string]string) CreateOption
WithMetadata sets the metadata of a Provider.
type Provider ¶
type Provider struct { AdditionalOpsPodLabels map[string]string Config *rest.Config // contains filtered or unexported fields }
Provider is a Managed Kubernetes Cluster Provider that can be used to implement rules against a kubernetes cluster.
func FromGenericConfig ¶
func FromGenericConfig(providerConf config.ProviderConfig) (*Provider, error)
FromGenericConfig creates a Provider from ProviderConfig.
func (*Provider) AddRulesets ¶
AddRulesets adds Rulesets to Provider.
func (*Provider) Logger ¶
func (p *Provider) Logger() sharedprovider.Logger
Logger returns the Provider's logger. If not set it set it to slog.Default().With("provider", p.ID()) then return it.
func (*Provider) RunRule ¶
func (p *Provider) RunRule(ctx context.Context, rulesetID, rulesetVersion, ruleID string) (rule.RuleResult, error)
RunRule executes specific Rule of a known Ruleset.
func (*Provider) RunRuleset ¶
func (p *Provider) RunRuleset(ctx context.Context, rulesetID, rulesetVersion string) (ruleset.RulesetResult, error)
RunRuleset executes all Rules of a known Ruleset.
Directories ¶
Path | Synopsis |
---|---|
ruleset
|
|
disak8sstig/rules
Package rules implements rules that correspond to the latest supported ruleset version.
|
Package rules implements rules that correspond to the latest supported ruleset version. |
securityhardenedk8s/rules
Package rules implements rules that correspond to the latest supported ruleset version.
|
Package rules implements rules that correspond to the latest supported ruleset version. |