refactor: credit ares techniques from token_coverage instead of redis - #29
Closed
l50 wants to merge 1 commit into
Closed
refactor: credit ares techniques from token_coverage instead of redis#29l50 wants to merge 1 commit into
l50 wants to merge 1 commit into
Conversation
… exploited set **Added:** - `aresTokenCoverage` struct and `TokenCoverage` map field on `aresLoot` to parse ares's `token_coverage` JSON, which is keyed by scoreboard category and reports proven-only exploit counts - `transport_ares.go` - `aresCategoryToTechniqueID` translating residual category-to-technique-ID disagreements (`forest_trust`→`cross_forest_trust`) and refusing categories the scoreboard must not credit (`zerologon`, `golden_ticket`, `other`) - `transport_ares.go` - `writeTokenCoverageEntries` crediting one objective per category with a proven exploit, walking categories in sorted order for byte-stable output across polls - `transport_ares.go` - Test coverage for the new path: `TestAresCategoryToTechniqueID`, `TestWriteTokenCoverageEntries` and its determinism/nil/emitted-map variants, `TestSynthesizeJSONL_GoldenTicketStillPerDomain`, and `TestAresCategoriesExistInAnswerKey` - `transport_ares_test.go` **Changed:** - `FetchReport` now sources technique credit from `token_coverage` via the `jqFilter`, dropping the second Redis round-trip; ares owns the category mapping and superseded subtraction so the two sides can no longer drift on naming - `transport_ares.go` - `synthesizeJSONL` signature drops the `exploited []string` parameter, updating all call sites in tests - `transport_ares.go`, `verify_test.go` - Answer-key guard test reworked to validate categories through `aresCategoryToTechniqueID` rather than raw `vuln_id` prefixes - `transport_ares_test.go` **Removed:** - `fetchExploited` and its `ares:op:<id>:exploited`/`superseded` Redis SDIFF round-trip, now handled by ares's own superseded subtraction - `transport_ares.go` - `aresExploitedToTechniqueIDs` hand-maintained prefix table and its `TestAresExploitedToTechniqueIDs`/`TestAresExploitedTechniquesExistInAnswerKey` tests, which duplicated ares's category mapping - `transport_ares.go`, `transport_ares_test.go`
Owner
Author
|
Closing as a duplicate of #28, which implements the same token_coverage adoption and handles it better. I checked both of the cases I was going to raise and #28 already covers them: the It also gets one case right that this PR got wrong: #28 refuses |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Key Changes:
SDIFF exploited superseded) with ares's owntoken_coveragemap, so technique credit is derived from a single loot payloadvuln_idprefix table that mirrored ares's category mapping, removing a persistent source of drift between the two sidesAdded:
aresTokenCoveragestruct andTokenCoveragefield to model ares'stoken_coverageJSON, keyed by scoreboard category with proven-onlyExploitedcounts -transport_ares.goaresCategoryToTechniqueIDto handle the small residual translation between ares category keys and answer-key technique IDs, explicitly refusing check-only categories (zerologon), the catch-all (other), and the per-domaingolden_ticket(credited viadomain_compromise[]instead)writeTokenCoverageEntriesto credit one technique per category with a proven exploit, respecting the sharedemittedmap and sorted iterationtransport_ares_test.goChanged:
FetchReportnow includestoken_coveragein its jq filter and no longer performs a second SSM/Redis call for exploited techniques -transport_ares.gosynthesizeJSONLsignature dropped itsexploited []stringparameter, with all call sites updated acrosstransport_ares.goandverify_test.goTestAresExploitedToTechniqueIDsintoTestAresCategoryToTechniqueIDand updated the answer-key existence guard to enumerate ares category keys rather than rawvuln_idshapes -transport_ares_test.goRemoved:
fetchExploitedand itsares:op:<id>:exploited/:supersededRedis SDIFF logic, now superseded by ares's own proven-only counting -transport_ares.goaresExploitedToTechniqueIDsprefix-matching table and itsreflect-based test, both obsoleted by ares normalising categories to scoreboard names upstream -transport_ares.go,transport_ares_test.go