feat(mapping): auto-link attacks to CREs via CWE references (Phase 2)#719
feat(mapping): auto-link attacks to CREs via CWE references (Phase 2)#719PRAteek-singHWY wants to merge 4 commits intoOWASP:mainfrom
Conversation
|
Hi @northdpole , I’ve been proceeding cautiously with a small, incremental PR (Phase 2) based on the phased approach I outlined on issue #471, keeping everything reviewable and reversible. This PR focuses only on automated CWE-based linking for OWASP Attacks and intentionally avoids parsers, syncing, or any long-running jobs at this stage. I’m very happy to adjust the direction, scope, or implementation based on your feedback. Please feel free to suggest any changes (or if you’d prefer a different approach entirely). I’m continuing the work in phases mainly to respect reviewer time and keep each step easy to reason about. Thanks for taking a look whenever you get a chance — no rush at all. I’ll continue contributing incrementally and iterating based on maintainer guidance. |
Overview
This PR implements Phase 2 of the OWASP Attacks integration plan (Issue 471).
It introduces automated linking logic that parses CWE references from Attack descriptions and creates Related links to the corresponding CREs.
This allows OpenCRE to leverage existing CWE mappings to automatically organize OWASP Attack content without manual curation.
Files Changed
Changes
1. Automated Linking Utility (application/utils/attack_mapper.py)
CWE-89) from Attack descriptions2. Database Safety (application/database/db.py)
sectionattribute (e.g. Attack nodes).AttributeErrorduring ingestion and improves robustness for non-standard node types.3. Verification Script (application/manual_seed_attacks.py)
CWE -> CRErelationship (CWE-22 -> Input Validation)Verification
Executed locally:
Path Traversal -> Input Validation (via CWE-22)
Path Traversalnode created.CWE-22reference.Graceful handling of missing CWEs (e.g. CWE-89)
SQL InjectionwithCWE-89.CWE-89is missing.No runtime errors when processing Attack nodes
db.pylogging fix prevented crashes.Partially fixes #471