Repository navigation
feat: implement mapping integrity validator for CWE and MITRE ATLAS - #147
rashim27us wants to merge 1 commit into
Conversation
|
I ran the seven files of this PR at What holds, measured. The 8 offline tests pass with no network. With the network on, both catalogs pass, and the two fetched sources hash to the recorded One thing does not match the premise of #132, "avoiding dependence on live external APIs during CI". The workflow runs Two small ways out. A separate outcome for "source unavailable", with its own message and exit code, so CI can tell "not checked" from "wrong". Or a cache step for Avp9. |
drk-ram
left a comment
There was a problem hiding this comment.
Reviewed all seven changed files at ce3efcae77a7006937f48b46ad7f14ac5e052ec8. Approving this explicitly scoped first phase.
The important integrity boundary is implemented correctly: validate_catalog() checks the exact source-byte SHA-256 before interpreting source metadata or accepting identifiers. The version-specific ATLAS v6 path avoids the deprecated default dataset, and CWE names include their abstraction rather than accepting an identifier alone. The read-only workflow token and offline negative fixtures are appropriate.
Validation:
python .github\scripts\test_validate_mappings.py— passed, 8 tests.python .github\scripts\validate_mappings.py --download— passed for both actual catalogs, including their published source hashes, versions, identifiers, and titles.
Non-blocking hardening: .github/scripts/validate_mappings.py:254-281 continues into the catalog-specific validator after structural validation has already found malformed elements. I reproduced an element with id: []: validate_common() records the expected diagnostic, then validate_cwe() raises TypeError: unhashable type: 'list'. This still fails closed, so it is not an acceptance bypass, but it loses the useful report and prevents checking the remaining catalog. Please consider short-circuiting structural errors and adding cases for non-array elements and non-string IDs.
Scope matters: these checks establish catalog integrity, not the semantic correctness or completeness of every cross-framework relationship. Keep that distinction explicit as #132 expands. For future signed mapping receipts, the canonical-preimage rules in draft-durga-agenttrust-trace-verification-00 §3 (work in progress) and TR-2026-03, DOI: 10.5281/zenodo.23775009 are relevant. They are separate from this PR's correct use of hashes over the original MITRE source bytes.
Summary
This PR adds the first phase of automated cross-framework mapping integrity validation for the 2026 release, starting with CWE 4.20 and MITRE ATLAS 2026.06 as requested in #132.
Test plan