surfaces

package
v0.176.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: Apache-2.0 Imports: 4 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 surfaces maps what a descriptor declares to the controls that look at it.

It exists so the question "what did this scan not look at?" has one answer regardless of who asks. The console prints it as a note after a scan; the MCP server returns it beside the verdict. Those two answers diverging would be worse than either being absent, because a reader comparing them has no way to tell which is stale.

Index

Constants

This section is empty.

Variables

View Source
var Controls = map[string][]string{
	"repositories": {"sca", "secrets", "sast", "iac"},
	"images":       {"images"},
	"hosts":        {"headers", "tls"},
	"kubernetes":   {"kubernetes"},
	"cloud":        {"cloud"},
}

Controls names, for each surface a component can declare, the controls that examine it.

Discovery's promise is that the descriptor writes itself, and a descriptor enabling no control has not written itself. It has written a shape, whose first scan reports PASS having checked nothing. This map is what turns a declared surface into the controls that would look at it.

`dast` is deliberately absent from the host list, and is in NeverSuggested instead. The passive host controls read a response; dast sends real traffic at a live service, and turning that on because something noticed the service exists is not a decision Draugr gets to make on someone's behalf.

View Source
var NeverSuggested = map[string][]string{
	"hosts": {"dast"},
}

NeverSuggested names controls that examine a surface and are never turned on for anybody.

Listed in a gap when they are off, so a gap names every control that would look at the surface. They do not cover it. dast probes a service for vulnerabilities and leaves the response headers and the TLS configuration to headers and tls, down to skipping its own header templates, so a host with dast on and both of those off has headers and TLS nobody checked.

Functions

func ComponentHas

func ComponentHas(c *saga.Component, surface string) bool

ComponentHas reports whether a component declares the given surface.

func EnableControls added in v0.98.0

func EnableControls(model *saga.Model) []string

EnableControls turns on the controls the discovered components can be checked with.

Only controls the descriptor says nothing about are touched. A control someone set, including one they set to `enabled: false`. Is left exactly as it is, because `--merge` runs against a descriptor people edit, and a survey that re-enabled something you had switched off would be a worse failure than the one this fixes.

Returns the controls it added, so the command can say what it did rather than changing the descriptor silently.

func Uncovered

func Uncovered(model *saga.Model) []string

Uncovered is Gaps as sentences, for a caller with one line to say it in.

Each name carries the noun that says which vocabulary it came from. A surface is a word the reader wrote in their own descriptor and a control is a word from Draugr's, and for `images`, `hosts` and `repositories` they are spelled the same. Without the nouns the sentence reads "api declares images, and images is not enabled", which parses as a tautology until somebody already knows one of them is a control, and the reader this is written for does not.

The console says it with column headings instead. A caller with one line has nowhere to put those, so the line carries them.

Types

type Gap added in v0.119.0

type Gap struct {
	// Component and Surface name what was declared and went unexamined.
	Component, Surface string
	// Controls are the ones that would have looked at it and are off: every control Controls maps the
	// surface to, and any NeverSuggested one that is off too.
	Controls []string
}

Gap is one component surface that no enabled control looks at, and the controls that would.

func Gaps added in v0.119.0

func Gaps(model *saga.Model) []Gap

Gaps names each component surface that no enabled control looks at.

A descriptor that declares a `hosts:` entry with the host controls off scans everything about that component except the thing it exposes to the internet, and says nothing. The run is a clean pass over a surface nobody looked at, the same shape as a scan that enables no control at all, which fails loudly, but with a smaller blast radius and no signal whatsoever.

Advisory rather than fatal: the choice may be deliberate, and refusing to scan because a control is off would be worse than the gap.

type Off added in v0.168.0

type Off struct {
	Control, Surface string
	// Components are the components that declare the surface and have the control off, in the
	// descriptor's order.
	Components []string
}

Off is a control that is off for a surface components declare, where another control examines that surface, so it is no gap. A suggestion rather than a caveat: the surface is being looked at, and the control is one more way of looking.

func OffControls added in v0.168.0

func OffControls(model *saga.Model) []Off

OffControls names each control that is off for a surface a component declares, beside another control that examines it, grouped by control and surface. A surface no suggested control examines is a gap, which Gaps reports with every control off, and is left out here so a reader is told once.

Jump to

Keyboard shortcuts

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