Documentation ¶
Index ¶
- Constants
- type Args
- type CreateOption
- func WithAdditionalOpsPodLabels(labels map[string]string) CreateOption
- func WithArgs(args Args) CreateOption
- func WithLogger(logger *slog.Logger) CreateOption
- func WithNumberOfWorkers(numWorkers int) CreateOption
- func WithRuntimeConfig(config *rest.Config) CreateOption
- func WithVersion(version string) CreateOption
- type Ruleset
- func (r *Ruleset) AddRules(rules ...rule.Rule) error
- func (r *Ruleset) ID() string
- func (r *Ruleset) Logger() *slog.Logger
- func (r *Ruleset) Name() string
- func (r *Ruleset) Run(ctx context.Context) (ruleset.RulesetResult, error)
- func (r *Ruleset) RunRule(ctx context.Context, id string) (rule.RuleResult, error)
- func (r *Ruleset) Version() string
Constants ¶
const (
// RulesetID is a constant containing the id of a DISA Kubernetes STIG Ruleset
RulesetID = "disa-kubernetes-stig"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Args ¶ added in v0.10.0
type Args struct {
MaxRetries *int `json:"maxRetries" yaml:"maxRetries"`
}
Args are Ruleset specific arguments.
type CreateOption ¶
type CreateOption func(*Ruleset)
CreateOption is a function that acts on a Ruleset 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 Ruleset.
func WithArgs ¶ added in v0.10.0
func WithArgs(args Args) CreateOption
WithArgs sets the args of a Ruleset.
func WithLogger ¶
func WithLogger(logger *slog.Logger) CreateOption
WithLogger the logger of a Ruleset.
func WithNumberOfWorkers ¶
func WithNumberOfWorkers(numWorkers int) CreateOption
WithNumberOfWorkers sets the max number of Workers of a Ruleset.
func WithRuntimeConfig ¶
func WithRuntimeConfig(config *rest.Config) CreateOption
WithRuntimeConfig sets the RuntimeConfig of a Ruleset.
func WithVersion ¶
func WithVersion(version string) CreateOption
WithVersion sets the version of a Ruleset.
type Ruleset ¶
type Ruleset struct { AdditionalOpsPodLabels map[string]string RuntimeConfig *rest.Config // contains filtered or unexported fields }
Ruleset implements DISA Kubernetes STIG.
func FromGenericConfig ¶
func FromGenericConfig(rulesetConfig config.RulesetConfig, additionalOpsPodLabels map[string]string, runtimeConfig *rest.Config) (*Ruleset, error)
FromGenericConfig creates a Ruleset from a RulesetConfig
func (*Ruleset) Logger ¶
Logger returns the Ruleset's logger. If not set it set it to slog.Default().With("ruleset", r.ID(), "version", r.Version() then return it.