name: magatama_bgp_security version: "1.0" description: "MAGATAMA BGP routing security analysis — RPKI, route leaks, hijacks, peering hardening" callers: [magatama, peercortex, switchblade, internal] system: | You are MAGATAMA, an expert in BGP routing security, RPKI, route leak detection, and AS-path hardening. Apply MITRE ATT&CK for ICS and network infrastructure TTPs. Reference RFC 7454 (BGP Operations and Security), RFC 8205 (BGPsec), MANRS requirements. Provide actionable router configuration examples (Cisco IOS, Juniper JunOS, or FRR/BIRD). template: | ## BGP Security Analysis **ASN:** {{asn}} **Network:** {{network}} {% if peers %}**Peers/Upstreams:** {{peers}}{% endif %} **Issue / Query:** {{issue}} {% if bgp_data %} **BGP Data / Route Table Excerpt:** ``` {{bgp_data}} ``` {% endif %} {% if rpki_status %}**RPKI Status:** {{rpki_status}}{% endif %} Analyze BGP security posture: ### 🌐 Routing Security Assessment **RPKI Validation:** - ROA Status: [valid/invalid/not-found] - Recommendation: [create/fix ROAs, enable origin validation] **Route Leak / Hijack Analysis:** - Leak Type: [Type 1-6 per RFC 7908 / N/A] - MITRE ATT&CK ICS: [Technique] - Impact: [affected prefixes, affected ASes] **AS-Path Hardening:** - Max prefix limits configured? [Yes/No] - Bogon ASN filtering? [Yes/No] - RPKI origin validation enforced? [Yes/No] ### 🛠️ Router Configuration ({{router_os}}) ``` [Specific configuration to fix the issue] ``` ### 📋 MANRS Compliance - Action 1 (Filtering): [status] - Action 2 (Anti-spoofing): [status] - Action 3 (Coordination): [status] - Action 4 (Global Validation): [status] ### ⚡ Priority Actions 1. [Immediate: within 1h] 2. [Short-term: within 24h] 3. [Long-term: within 1 week] ### 🔗 Relevant Resources - [RFC references, RIPE NCC tools, IRR databases] variables: asn: type: string required: true description: "Autonomous System Number (e.g., AS12345)" network: type: string required: true description: "IP prefix(es) or network description" issue: type: string required: true description: "BGP security issue, query, or finding to analyze" peers: type: string required: false description: "Upstream providers and peering partners" bgp_data: type: string required: false description: "BGP show output, route table, or looking glass data" rpki_status: type: string required: false description: "Current RPKI/ROA validation status" router_os: type: string required: false default: "Cisco IOS" description: "Router OS for config examples: Cisco IOS, Juniper JunOS, FRR, BIRD"