security

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package security provides security posture scanning for CloudMock environments. It checks mock AWS resources for common misconfigurations and compliance violations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Finding

type Finding struct {
	CheckID  string    `json:"check_id"`
	Resource string    `json:"resource"` // ARN or identifier
	Service  string    `json:"service"`
	Status   string    `json:"status"` // "pass", "fail", "warning"
	Detail   string    `json:"detail"`
	FoundAt  time.Time `json:"found_at"`
}

Finding records the result of a check against a specific resource.

func FindingsByCategory

func FindingsByCategory(findings []Finding, checks []SecurityCheck, category string) []Finding

FindingsByCategory filters findings by check category.

type ScanResult

type ScanResult struct {
	ScanID     string    `json:"scan_id"`
	StartedAt  time.Time `json:"started_at"`
	FinishedAt time.Time `json:"finished_at"`
	Findings   []Finding `json:"findings"`
	Summary    Summary   `json:"summary"`
}

ScanResult holds the output of a full security scan.

type Scanner

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

Scanner runs security checks against the service registry.

func NewScanner

func NewScanner(registry *routing.Registry) *Scanner

NewScanner creates a scanner with built-in checks.

func (*Scanner) Checks

func (s *Scanner) Checks() []SecurityCheck

Checks returns the list of available security checks.

func (*Scanner) LastScan

func (s *Scanner) LastScan() *ScanResult

LastScan returns the cached results from the most recent scan.

func (*Scanner) Registry

func (s *Scanner) Registry() *routing.Registry

Registry returns the underlying service registry for inspecting services.

func (*Scanner) Scan

func (s *Scanner) Scan() *ScanResult

Scan runs all checks and caches the results.

type SecurityCheck

type SecurityCheck struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Category    string `json:"category"` // "iam", "s3", "encryption", "network"
	Severity    string `json:"severity"` // "critical", "high", "medium", "low", "info"
	Description string `json:"description"`
	Remediation string `json:"remediation"`
}

SecurityCheck defines a check that the scanner runs.

type Summary

type Summary struct {
	Total      int            `json:"total"`
	Pass       int            `json:"pass"`
	Fail       int            `json:"fail"`
	Warning    int            `json:"warning"`
	BySeverity map[string]int `json:"by_severity"`
}

Summary provides aggregate counts by severity and status.

Jump to

Keyboard shortcuts

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