Documentation
¶
Overview ¶
Package activescript runs user-authored ACTIVE scanner checks written in Starlark — the active twin of internal/checkscript. A custom active check defines:
def check(point, baseline, probe):
r = probe("'") # send a payload at this injection point
if re_search("(?i)SQL syntax", r.body):
return [finding("High", "SQL injection (custom)", evidence=r.body[:80])]
return []
`probe(payload)` sends one mutated request through the engine's sender (so it's recorded, session-auth applied, and counts against the run's request budget). Starlark is sandboxed: no files, sockets, clock, or imports — only the builtins we hand it (finding, re_search). Execution is step-bounded to stop runaway loops.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToActiveChecks ¶
func ToActiveChecks(checks []*Check) []activescan.Check
ToActiveChecks wraps compiled user checks as activescan.Check entries. When the file id matches a built-in probe id, the check replaces that built-in (same disable toggle). Otherwise ids are prefixed with custom-active:.
Types ¶
type Check ¶
type Check struct {
ID string
// contains filtered or unexported fields
}
Check is a compiled user-authored active check. Run matches activescan.Check.Run so a Check can be used directly as an activescan.Check (wrapped with its ID).
func Compile ¶
Compile parses and compiles an active check, requiring a callable check(point, baseline, probe).
func LoadDir ¶
LoadDir compiles every `*.star` active check in dir (sorted). Returns the compiled checks plus a filename→error map for any that failed to compile.
func (*Check) Run ¶
func (c *Check) Run(p activescan.Point, baseline activescan.Response, probe activescan.Prober) (hit *activescan.Hit)
Run executes the check against one injection point. probe sends payloads through the engine (budget/cancellation honoured by the caller's Prober). A check that returns multiple findings reports the highest-severity one as the Hit (carrying its own title/severity/detail/fix so each finding is self-describing).