Skip to content

Add behavioural anomalies and EPSS/KEV enrichment (long tail, part 1) - #43

Merged
therandomsecurityguy merged 2 commits into
mainfrom
dac/predictive-long-tail
Oct 28, 2026
Merged

therandomsecurityguy merged 2 commits into
mainfrom
dac/predictive-long-tail

Conversation

@therandomsecurityguy

Copy link
Copy Markdown
Owner

Summary

Completion item 5, part 1 of 2 (~/Documents/Testing/plans/2026-10-27-predictive-completion.md): the UEBA breadth that needs no external dataset, plus the EPSS/KEV half of exploitability enrichment. 27 files, +671/−86.

Behavioural anomalies (CloudTrail analyzer)

  • NEW_API_FOR_PRINCIPAL: calls a principal never made in the 30-day baseline (a never-touched service shows through its calls) — medium, RULE-035
  • UNUSUAL_HOUR_ACTIVITY: UTC hours never used in the baseline — low, RULE-036
  • Both reuse the established query shape (7-day eval, partition projection, same exclusions), carry a capped detail column recorded on the anomaly node, and auto-ticket off (behavioural leads wait for /rules/quality evidence)
  • ASN attribution deferred with reason recorded: needs an external IP→ASN dataset + licensing decision, which this repo doesn't take silently

EPSS/KEV enrichment

  • Threat-intel types gain cve (known-exploited membership, e.g. CISA KEV export) and epss (CVE-YYYY-NNNN,score — FIRST CSV's first two columns); store carries the score; Vulnerability.cve_id candidates both lookups
  • One shared helper now computes exploitability for both the likelihood and the score: max(CVSS/10, EPSS) + 0.2 for a known exploit — they can no longer disagree
  • Terraform variables/outputs → chart values/schema/configmap → OPERATIONAL runbook for the two new list URIs

Load-bearing updates (explicit, per AGENTS.md)

  • Rule catalogue 34 → 36 (pinned counts in rules.test.ts, README, ARCHITECTURE updated)
  • REVIEWED_MAPPING gains reviewed entries for RULE-035/036 (→ KH-DET-1, with reasons); RULE_TECHNIQUES gains T1078 each; getRemediationHint gains both hints
  • KH-DET-1 broadened from "credential-use anomalies" to "identity anomalies" (relatedRules + evidence text; control counts unchanged)

Why this is safe

  • Both queries are read-only, window-bounded and exclusion-filtered like the existing three; new rules report leads with auto-ticketing off
  • Threat-intel additions reuse the reviewed import path (validation, dedup, caps, TTL) and only raise exploitability through values the score already carried
  • No new write surface, no identifiers; part 2 (trust-center projections, per-issue risk window/SLO burn, exposure-by-type series) remains open in the plan

Test plan

  • npx jest --runInBand — 20 projects / 1863 tests passed (new: query shape/bounds, detail parsing + cap, 5-vs-6 column rules, EPSS/KEV parsing + candidates, runner KEV/EPSS threading, shared exploitability helper, rule/technique/remediation/mapping pins)
  • npm run typecheck; full workspace lint; npm run format:check
  • npm run ci:build; npm run package:lambdas; terraform fmt -check; chart schema parses (helm validation in CI)

Completion item 5 from the re-review
(~/Documents/Testing/plans/2026-10-27-predictive-completion.md), first of
two parts: the UEBA breadth that does not require an external dataset,
and the EPSS/KEV half of exploitability enrichment.

Behavioural anomalies:
- Two new bounded CloudTrail analyzer queries share the established
  shape (7-day evaluation against a 30-day baseline, partition
  projection, the same exclusions): NEW_API_FOR_PRINCIPAL (calls a
  principal never made in the baseline — a never-touched service shows
  through its calls) and UNUSUAL_HOUR_ACTIVITY (UTC hours never used).
  Both rows carry a detail column (new APIs / hours, capped at 200
  chars) that the anomaly nodes record.
- RULE-035 (medium; first-use APIs are a lead) and RULE-036 (low;
  timezone moves trip it) surface them; neither auto-tickets. ASN
  attribution is deferred with its reason recorded: it needs an
  external IP-to-ASN dataset and a licensing decision.

EPSS/KEV:
- threat-intel types gain cve (known-exploited membership, e.g. a CISA
  KEV export) and epss (CVE,score lines — the FIRST CSV's first two
  columns), with validation, dedup, caps and TTL unchanged; the store
  carries the score; Vulnerabilities' cve_id candidates both lookups.
- A KEV match marks the exploit available and EPSS rides exploitability
  through one shared helper — max(CVSS/10, EPSS) + 0.2 for a known
  exploit, clamped — now used by both pathLikelihood and computeRiskScore
  so the likelihood and the score can no longer disagree.
- Terraform variables/outputs, chart values/schema/configmap and the
  OPERATIONAL runbook wire the two new list URIs.

Load-bearing updates, explicit: the rule catalogue goes 34 -> 36
(pinned counts in rules.test.ts, README, ARCHITECTURE updated);
REVIEWED_MAPPING gains reviewed entries for both rules (-> KH-DET-1);
RULE_TECHNIQUES gains T1078 for each; getRemediationHint gains both
hints; KH-DET-1 is broadened from credential-use to identity anomalies
with the new rules and evidence text (control counts unchanged).

Why this is safe: both queries are read-only, window-bounded and
exclusion-filtered like the existing three; the new rules report
behavioural leads with auto-ticketing off; the threat-intel additions
reuse the reviewed import path (validation, cap, TTL) and only raise
exploitability through values the score already carried (CVSS,
exploit-known); no new write surface and no identifiers.
rules.graph.test.ts's "every rule has a graph test" guard scans the file
for rule ids; the two new anomaly rules need their real Gremlin
coverage. Extend the anomaly-type matrix with both types and both rules.

Why this is safe: test-only change; runs in the graph-queries job.
@therandomsecurityguy
therandomsecurityguy merged commit 3a83d44 into main Oct 28, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant