security

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package security implements the security audit system (REQ-440).

The audit checks configuration, file permissions, exec safety, and model hygiene, producing severity-graded findings with remediation text. Run via `roger security audit` CLI subcommand.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatReport

func FormatReport(r Report) string

FormatReport formats a report for terminal output with severity colors.

Types

type AuditOpts

type AuditOpts struct {
	Deep bool // if true, probe the running gateway
}

AuditOpts controls audit behavior.

type Finding

type Finding struct {
	CheckID     string   `json:"checkId"`
	Severity    Severity `json:"severity"`
	Title       string   `json:"title"`
	Detail      string   `json:"detail"`
	Remediation string   `json:"remediation"`
}

Finding is a single audit check result.

type Report

type Report struct {
	Timestamp string    `json:"timestamp"`
	Summary   Summary   `json:"summary"`
	Findings  []Finding `json:"findings"`
}

Report is the output of a security audit.

func RunAudit

func RunAudit(cfg *config.Root, opts AuditOpts) Report

RunAudit performs all security checks and returns a report.

type Severity

type Severity string

Severity levels for audit findings.

const (
	SeverityInfo     Severity = "info"
	SeverityWarn     Severity = "warn"
	SeverityCritical Severity = "critical"
)

type Summary

type Summary struct {
	Critical int `json:"critical"`
	Warn     int `json:"warn"`
	Info     int `json:"info"`
}

Summary counts findings by severity.

Jump to

Keyboard shortcuts

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