Skip to content

refactor: source ares technique credit from loot token_coverage - #28

Merged
l50 merged 1 commit into
mainfrom
feat/credit-techniques-from-ares-token-coverage
Jul 30, 2026
Merged

refactor: source ares technique credit from loot token_coverage#28
l50 merged 1 commit into
mainfrom
feat/credit-techniques-from-ares-token-coverage

Conversation

@l50

@l50 l50 commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Key Changes:

  • Replaced the Redis-based exploited-set fetch with a single loot JSON round trip, sourcing technique credit from ares's own token_coverage map now that ares-cli chore(deps): update pre-commit hook codespell-project/codespell to v2.4.3 dreadnode/DreadGOAD#366 made Exploited count only proven techniques
  • Swapped the vuln_id prefix table for an explicit category-to-technique join table that consumes ares's categorisation rather than re-deriving it, eliminating the silent drift that left acl_*, gpo_*, and adcs_esc8 uncreditable for months
  • Simplified drift detection to surface only categories this repo has never classified, since ares now owns the vuln_id-to-category derivation

Added:

  • Category credit and refusal tables - Introduced creditableCategories (category-to-answer-key-technique join) and uncreditableCategories (deliberate refusals for other, golden_ticket, printnightmare, zerologon) in transport_ares.go, with aresCategoryToTechniqueID as the lookup helper
  • Token coverage credit path - Added writeTokenCoverageEntries to emit one deterministic (sorted) finding per creditable category with a proven exploit, deduped against already-emitted findings
  • Comprehensive test coverage - Added TestAresCategoryToTechniqueID, TestAresCreditedTechniquesExistInAnswerKey, TestEveryAresCategoryIsClassified, TestUncreditableCategoriesAreDeliberate, TestNoAresCategoryDrifts, TestWriteTokenCoverageEntries, TestWriteTokenCoverageEntriesIsDeterministic, and TestTokenCoverageEvidenceNamesTheCategory in transport_ares_test.go, asserting every ares category is exactly one of creditable or refused and that synthesized output stays stable across polls

Changed:

  • FetchReport flow - Reduced to a single SSM round trip by dropping the proven/superseded Redis reads; detectTokenCoverageDrift and synthesizeJSONL now take only the loot, with drift redefined as "categories neither creditable nor explicitly refused"
  • Evidence strings - Findings now name the category and its proven count (e.g. ares token_coverage: acl_abuse (3 proven)) instead of individual vuln_ids, reflecting that token_coverage is aggregated
  • Test call sites - Updated synthesizeJSONL callers in verify_test.go to the single-argument signature and populated TokenCoverage where technique credit was previously injected via the exploited-set slice

Removed:

  • Redis exploited-set machinery - Deleted fetchExploited, splitExploitedSets, the exploitedSetMarker constant, and the aresExploitedToTechniqueIDs prefix table from transport_ares.go, along with the driftCategoryAliases map and the old driftExemptCategories table
  • Obsolete tests - Removed TestAresExploitedToTechniqueIDs, TestSplitExploitedSets, TestAresExploitedTechniquesExistInAnswerKey, TestDriftCategoriesCoverAresTokenCategory, and TestDriftExemptCategoriesAreDeliberate, which pinned the retired prefix-and-Redis approach

**Changed:**

- Technique credit now derives from the loot JSON's own `token_coverage` map instead of re-deriving categories from raw vuln_id prefixes, eliminating the second Redis round trip - `transport_ares.go`. ares owns the vuln_id-to-category derivation as of ares-cli dreadnode#366, so `FetchReport` is now a single SSM call.
- Replaced the prefix-matching credit path with a `creditableCategories` join table mapping ares category names to answer-key technique IDs, plus a `uncreditableCategories` refusal table for `other`, `golden_ticket`, `printnightmare`, and `zerologon` - `transport_ares.go`. `printnightmare` and `zerologon` are explicit refusals because ares mints them on evidence that precedes success.
- Reworked `detectTokenCoverageDrift` to surface only categories that are neither creditable nor deliberately refused, failing closed on unknown categories so new ares techniques warn rather than silently dead-credit - `transport_ares.go`.
- `writeTokenCoverageEntries` emits one finding per creditable category with a proven exploit, walking categories in sorted order for deterministic output; evidence now names the category and proven count since ares no longer exposes individual vuln_ids - `transport_ares.go`.
- Restructured the test suite around the category join: added coverage for the credit table, refusal classification, drift detection, deterministic output, and evidence formatting - `transport_ares_test.go`.
- Updated `synthesizeJSONL` call sites to drop the exploited-set argument and drive golden-ticket-adjacent verification through `TokenCoverage` - `verify_test.go`.

**Removed:**

- Removed the Redis fetch path (`fetchExploited`, `splitExploitedSets`, `exploitedSetMarker`) that read the `:exploited` and `:superseded` sets, since technique credit no longer needs the proven subset - `transport_ares.go`.
- Removed the `aresExploitedToTechniqueIDs` prefix table and its aliases (`driftCategoryAliases`, `driftExemptCategories`), which duplicated ares's own categorisation and drifted from it silently - `transport_ares.go`.
- Removed the obsolete tests for the prefix mapping and combined-SMEMBERS parsing (`TestAresExploitedToTechniqueIDs`, `TestSplitExploitedSets`, `TestDriftCategoriesCoverAresTokenCategory`) - `transport_ares_test.go`.
@l50
l50 force-pushed the feat/credit-techniques-from-ares-token-coverage branch from d1dba78 to 97719b4 Compare July 30, 2026 18:03
@l50
l50 merged commit 91eb84f into main Jul 30, 2026
9 checks passed
@l50
l50 deleted the feat/credit-techniques-from-ares-token-coverage branch July 30, 2026 18:14
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