cmd

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2025 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BuiltinRulesFS fs.FS

BuiltinRulesFS is a reference to the embedded filesystem from main package This will be set by the main package during initialization

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately.

func GetLogger

func GetLogger() *slog.Logger

GetLogger returns the configured logger instance

Types

type AdmissionServer

type AdmissionServer struct {
	Config *ServerConfig
	Rules  []*models.SecurityRule
	Engine engine.EvaluationEngine
	Logger interface {
		Info(string, ...interface{})
		Error(string, ...interface{})
	}
}

AdmissionServer handles admission webhook requests

type RuleWithSource

type RuleWithSource struct {
	*models.SecurityRule
	Source string // "built-in" or "custom"
}

RuleWithSource wraps a SecurityRule with its source information

type ScanConfig

type ScanConfig struct {
	Output                  string
	OutputFile              string
	Parallelism             int
	Timeout                 time.Duration
	MinSeverity             string
	MaxViolations           int
	Quiet                   bool
	SummaryOnly             bool
	IncludeNamespaces       []string
	ExcludeNamespaces       []string
	ResourceTypes           []string
	Recursive               bool
	FileExtensions          []string
	IncludePaths            []string
	FollowSymlinks          bool
	NoColor                 bool
	Verbose                 bool
	FailOnViolations        bool
	ExcludeSystemNamespaces bool
	IncludeClusterResources bool
}

ScanConfig holds configuration for scan operations

type ServerConfig

type ServerConfig struct {
	Mode          string // "validating" or "evaluating"
	Port          int
	TLSCertFile   string
	TLSKeyFile    string
	Namespaces    []string
	ResourceTypes []string
	MinSeverity   string
	LogFormat     string
	LogLevel      string
}

ServerConfig holds the server configuration

type TestCaseConfig

type TestCaseConfig struct {
	RuleID string         `yaml:"ruleID"`
	Good   []TestCaseFile `yaml:"good"`
	Bad    []TestCaseFile `yaml:"bad"`
}

type TestCaseFile

type TestCaseFile struct {
	File        string `yaml:"file"`
	Expected    bool   `yaml:"expected"`
	Description string `yaml:"description"`
}

type TestConfig

type TestConfig struct {
	TestCases map[string]TestCaseConfig `yaml:"testCases"`
}

Test case validation structures

Jump to

Keyboard shortcuts

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