grade

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package grade runs once after the engine barrier: it computes the A to F grade per target and overall, with the reasons for each grade.

Index

Constants

View Source
const (
	CodeLiveOverThreshold        = "live_over_threshold"
	CodeLivePublic               = "live_public"
	CodeLiveKey                  = "live_key"
	CodeUnverifiedHighConfidence = "unverified_high_confidence"
	CodeOtherFinding             = "other_finding"
	CodeClean                    = "clean"
)

Reason codes. Each reason string starts with its code and ": ".

View Source
const Default = "default"

Default is the name of the AD-15 grader. Per target, first match wins: F for a live key when the summed live dollars at risk per day reach the threshold or the target is public, D for any live key, C for an unverified high-confidence key, B for any other finding and A for none.

View Source
const DefaultFThresholdUSDPerDay = 500

DefaultFThresholdUSDPerDay is the live dollars at risk per day at which a target gets grade F when Options.FThresholdUSDPerDay is 0 or unset.

Variables

This section is empty.

Functions

func Register

func Register(name string, f Factory)

Register adds a grade adapter. Adapters call it from init().

Types

type Factory

type Factory func(Options) (Grader, error)

Factory builds a Grader.

func Lookup

func Lookup(name string) (Factory, bool)

Lookup returns the grade adapter registered under name.

type Grader

type Grader interface {
	Grade(findings []model.Finding, targets []model.Target) ([]model.TargetGrade, model.Grade, []string)
}

Grader is the grade stage interface. Grade returns the grade of each target, in the order given, and the overall grade with its reasons. Suppressed findings are never graded. Every reason has the form "code: ASCII sentence".

type Options

type Options struct {
	// FThresholdUSDPerDay is the summed live dollars at risk per day at which a target
	// gets grade F (grade.f_threshold_usd_per_day). 0 or less means
	// DefaultFThresholdUSDPerDay.
	FThresholdUSDPerDay float64
}

Options configures a grader.

Jump to

Keyboard shortcuts

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