Documentation
¶
Overview ¶
Package selfcheck verifies that unruly's own oracles work against the target before their results are trusted.
Every scanner surveyed fails the same way: an oracle stops working, the tool finds nothing, and "nothing found" is printed as though it meant "nothing is wrong". supascan's enumerator returns an empty slice when the OpenAPI spec answers 401 — no warning, no error, a clean report on a world-writable database. That is not an unlucky bug; it is what happens whenever a tool cannot tell "I looked and it is fine" apart from "I could not look".
unruly is not immune by construction. Its enumeration depends on PostgREST volunteering relation names in a 404 hint. That behaviour is a convenience of a particular server version, not a guarantee: an older PostgREST, a proxy that rewrites error bodies, or a future release that stops being helpful would each silently reduce recall to whatever the wordlist happens to cover. The scan would still print findings, so nothing would look wrong.
So the oracles are tested, not assumed, and a capability that fails is reported as a finding in its own right — a scan run half-blind is a fact the operator needs, and it outranks any individual finding in that scan.
Where possible the test uses EVIDENCE FROM THE SCAN rather than a synthetic probe. That distinction was learned the hard way: the first version of this package asked for a made-up relation name, drew no hint because nothing in the schema resembled it, and declared the oracle broken on two of three targets while enumeration was recovering 21 of 21 relations. A probe that draws no signal has not shown the oracle is broken; it has shown the probe was unlike anything present. Watching whether the server volunteered hints during the real scan settles the question without that ambiguity.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Capability ¶
type Capability struct {
Name string
// Working is true when the oracle answered as expected.
Working bool
// Detail explains what was observed.
Detail string
// Impact states what the scan loses when this oracle is down.
Impact string
}
Capability names an oracle the scan depends on.
type Evidence ¶
type Evidence struct {
// ProbesDenied and ProbesTotal describe credential acceptance. When most
// probes are rejected before the schema is consulted, the credential is
// wrong — and every downstream stage would otherwise report an empty,
// confident, wrong result.
ProbesDenied int
ProbesTotal int
// RequestsSent and RequestsFailed describe the transport. A scan that lost
// requests may have lost findings: a relation whose probe never got an
// answer looks exactly like one that does not exist.
RequestsSent int64
RequestsFailed int64
// HintsObserved is how many relation names the server volunteered during
// enumeration. Any number above zero proves the oracle works here.
HintsObserved int
// RelationsFound is how many relations enumeration recovered.
RelationsFound int
}
Evidence is what the scan itself observed. Preferring it to synthetic probes is the correction to a bug in this package's first version: it probed with a made-up name, drew no hint because nothing in the schema resembled it, and declared the oracle broken on two of three targets while enumeration was recovering 21 of 21 relations. Absence of a hint for one arbitrary name is not evidence of a broken oracle — a fact this package exists to insist on, and promptly got wrong itself.