Documentation
¶
Overview ¶
Package selftest signs and verifies the X-Scout-Scan header that Scout puts on every outbound scan request. Sentinel (or any app) can verify it to tag Scout traffic as a self-test rather than a real attacker.
Header format:
X-Scout-Scan: v1;ts=<unix seconds>;scan=<scan id>;sig=<hex hmac>
The signature is HMAC-SHA256 over the version, timestamp, scan ID, method, host and path, so a captured header cannot be replayed against another endpoint or reused after the allowed clock skew.
Index ¶
Constants ¶
View Source
const DefaultMaxSkew = 5 * time.Minute
DefaultMaxSkew is how far a header timestamp may drift from the verifier's clock.
View Source
const Header = "X-Scout-Scan"
Header is the self-test header name.
Variables ¶
View Source
var ( ErrMissing = errors.New("selftest: header missing") ErrMalformed = errors.New("selftest: header malformed") ErrExpired = errors.New("selftest: timestamp outside allowed skew") ErrSignature = errors.New("selftest: signature mismatch") )
Verification errors.
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.