compliance

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckOptions

type CheckOptions struct {
	Namespace   string
	Image       string
	Path        string
	SkipRules   []string
	OnlyRules   []string
	MinSeverity string
}

CheckOptions contains options for compliance checks

type CheckResult

type CheckResult struct {
	RuleID      string      `json:"rule_id"`
	RuleName    string      `json:"rule_name"`
	Category    string      `json:"category"`
	Severity    string      `json:"severity"`
	Status      CheckStatus `json:"status"`
	Resource    string      `json:"resource"`
	Message     string      `json:"message"`
	Remediation string      `json:"remediation,omitempty"`
}

CheckResult represents the result of a compliance check

type CheckStatus

type CheckStatus string

CheckStatus represents the status of a compliance check

const (
	StatusPassed  CheckStatus = "passed"
	StatusFailed  CheckStatus = "failed"
	StatusSkipped CheckStatus = "skipped"
	StatusWarning CheckStatus = "warning"
)

type DockerChecker

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

DockerChecker checks Docker resources for compliance

func NewDockerChecker

func NewDockerChecker(opts CheckOptions) *DockerChecker

NewDockerChecker creates a new Docker checker

func (*DockerChecker) Run

func (c *DockerChecker) Run(ctx context.Context) ([]CheckResult, error)

Run runs the Docker compliance checks

type FileChecker

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

FileChecker checks configuration files for compliance

func NewFileChecker

func NewFileChecker(opts CheckOptions) *FileChecker

NewFileChecker creates a new file checker

func (*FileChecker) Run

func (c *FileChecker) Run(ctx context.Context) ([]CheckResult, error)

Run runs the file compliance checks

type K8sChecker

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

K8sChecker checks Kubernetes resources for compliance

func NewK8sChecker

func NewK8sChecker(opts CheckOptions) *K8sChecker

NewK8sChecker creates a new Kubernetes checker

func (*K8sChecker) Run

func (c *K8sChecker) Run(ctx context.Context) ([]CheckResult, error)

Run runs the Kubernetes compliance checks

type Policy

type Policy struct {
	ID          string `yaml:"id" json:"id"`
	Name        string `yaml:"name" json:"name"`
	Category    string `yaml:"category" json:"category"`
	Severity    string `yaml:"severity" json:"severity"`
	Description string `yaml:"description" json:"description"`
	Remediation string `yaml:"remediation" json:"remediation"`
}

Policy represents a compliance policy

func GetBuiltinPolicies

func GetBuiltinPolicies() []Policy

GetBuiltinPolicies returns all built-in compliance policies

type Report

type Report struct {
	Title       string        `json:"title"`
	GeneratedAt time.Time     `json:"generated_at"`
	Summary     ReportSummary `json:"summary"`
	Results     []CheckResult `json:"results"`
}

Report represents a compliance report

type ReportSummary

type ReportSummary struct {
	Total   int     `json:"total"`
	Passed  int     `json:"passed"`
	Failed  int     `json:"failed"`
	Skipped int     `json:"skipped"`
	Score   float64 `json:"score"`
}

ReportSummary contains report summary statistics

Jump to

Keyboard shortcuts

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