rules

package
v0.0.0-...-d0c7a6b Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Rules Engine

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rule

type Rule struct {
	Name        string            `yaml:"name"`
	Description string            `yaml:"description"`
	Category    string            `yaml:"category"`
	Severity    string            `yaml:"severity"`
	Condition   string            `yaml:"condition"`
	Suggestion  string            `yaml:"suggestion"`
	Metadata    map[string]string `yaml:"metadata,omitempty"`
}

type RuleSet

type RuleSet struct {
	Rules []Rule `yaml:"rules"`
}

type RulesEngine

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

RulesEngine handles loading and evaluating security rules

func NewRulesEngine

func NewRulesEngine(ruleFiles map[string]string) (*RulesEngine, error)

NewRulesEngine creates a new rules engine instance

func (*RulesEngine) EvaluateRules

func (e *RulesEngine) EvaluateRules(category string, obj runtime.Object) []types.Finding

EvaluateRules evaluates all rules for a given category against a Kubernetes object

Jump to

Keyboard shortcuts

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