norn

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package norn evaluates scan results against policy to produce a verdict (pass/fail) per control and overall. It begins with declarative severity thresholds; a richer policy language (e.g. OPA/Rego) can follow.

The Norns decide fate — here, the fate of a release.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ControlOutcome

type ControlOutcome struct {
	Control   string
	Verdict   Verdict
	Highest   sarif.Level
	Counts    sarif.Counts
	Threshold sarif.Level
}

ControlOutcome is the verdict for a single control.

type Policy

type Policy struct {
	FailOn     sarif.Level
	PerControl map[string]sarif.Level
}

Policy decides verdicts from findings. A control fails when its most severe finding is at least as severe as the applicable threshold. FailOn is the default threshold; PerControl overrides it for named controls. The zero value fails on error.

func (Policy) Evaluate

func (p Policy) Evaluate(reports map[string]sarif.Report) Result

Evaluate judges each control's report against the policy and combines them. The overall verdict is Fail if any control fails. Controls are reported in the given order (sort upstream for determinism if needed).

type Result

type Result struct {
	Verdict  Verdict
	Controls []ControlOutcome
}

Result is the overall evaluation across all controls.

type Verdict

type Verdict string

Verdict is the outcome of a policy evaluation.

const (
	Pass Verdict = "pass"
	Fail Verdict = "fail"
)

The possible verdicts.

Jump to

Keyboard shortcuts

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