← Back to Pull requests

firewall: T5493: Implement remote-group #4326

Closed
unknown closed this pull request without merging on Mar 25, 2025 15:20 UTC
View on GitHub
unknown unknown commented on Jan 30, 2025 20:38 UTC
Author

Change summary


Initial implementation of firewall remote-group capabilities. This PR adds the 'remote-group' tag-node to the firewall, which utilises the vyos-domain-resolver to fetch & load a list of IPv4 networks/address's from an external URL.

Types of changes


  • Bug fix (non-breaking change which fixes an issue)

  • New feature (non-breaking change which adds functionality)

  • Code style update (formatting, renaming)

  • Refactoring (no functional changes)

  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component

  • Other (please describe):
  • Related Task(s)


    https://vyos.dev/T5493

    Related PR(s)

    How to test / Smoketest result


    Test Steps
    1. Configure a firewall remote-group:
    set firewall group remote-group externallist url http://127.0.0.1/ip-list.txt
    

    2. Check entries have been loaded into NFT correctly:

    vyos@vyos# sudo nft list ruleset | grep 'R_externallist' -A 12
    	set R_externallist {
    		type ipv4_addr
    		flags interval
    		elements = { 127.0.0.1/32, 192.168.1.0/24 }
    	}
    --
    	set R_externallist {
    		type ipv4_addr
    		flags interval
    		elements = { 127.0.0.1/32, 192.168.1.0/24 }
    	}
    --
    	set R_externallist {
    		type ipv4_addr
    		flags interval
    	}
    
    

    Smoke Test

    vyos@vyos:~$ python3 /usr/libexec/vyos/tests/smoke/cli/test_firewall.py
    test_bridge_firewall (__main__.TestFirewall.test_bridge_firewall) ... ok
    test_cyclic_jump_validation (__main__.TestFirewall.test_cyclic_jump_validation) ... ok
    test_flow_offload (__main__.TestFirewall.test_flow_offload) ... ok
    test_geoip (__main__.TestFirewall.test_geoip) ... ok
    test_gre_match (__main__.TestFirewall.test_gre_match) ... ok
    test_groups (__main__.TestFirewall.test_groups) ... ok
    test_ipsec_metadata_match (__main__.TestFirewall.test_ipsec_metadata_match) ... ok
    test_ipv4_advanced (__main__.TestFirewall.test_ipv4_advanced) ... ok
    test_ipv4_basic_rules (__main__.TestFirewall.test_ipv4_basic_rules) ... ok
    test_ipv4_dynamic_groups (__main__.TestFirewall.test_ipv4_dynamic_groups) ... ok
    test_ipv4_global_state (__main__.TestFirewall.test_ipv4_global_state) ... ok
    test_ipv4_mask (__main__.TestFirewall.test_ipv4_mask) ... ok
    test_ipv4_remote_group (__main__.TestFirewall.test_ipv4_remote_group) ... ok
    test_ipv4_state_and_status_rules (__main__.TestFirewall.test_ipv4_state_and_status_rules) ... ok
    test_ipv4_synproxy (__main__.TestFirewall.test_ipv4_synproxy) ... ok
    test_ipv6_advanced (__main__.TestFirewall.test_ipv6_advanced) ... ok
    test_ipv6_basic_rules (__main__.TestFirewall.test_ipv6_basic_rules) ... ok
    test_ipv6_dynamic_groups (__main__.TestFirewall.test_ipv6_dynamic_groups) ... ok
    test_ipv6_mask (__main__.TestFirewall.test_ipv6_mask) ... ok
    test_nested_groups (__main__.TestFirewall.test_nested_groups) ... ok
    test_source_validation (__main__.TestFirewall.test_source_validation) ... ok
    test_sysfs (__main__.TestFirewall.test_sysfs) ... ok
    test_timeout_sysctl (__main__.TestFirewall.test_timeout_sysctl) ... ok
    test_zone_basic (__main__.TestFirewall.test_zone_basic) ... ok
    test_zone_flow_offload (__main__.TestFirewall.test_zone_flow_offload) ... ok
    test_zone_with_vrf (__main__.TestFirewall.test_zone_with_vrf) ... ok
    
    ----------------------------------------------------------------------
    Ran 26 tests in 88.646s
    
    OK
    

    Checklist:


  • I have read the CONTRIBUTING document

  • I have linked this PR to one or more Phabricator Task(s)

  • I have run the components SMOKETESTS if applicable

  • My commit headlines contain a valid Task id

  • My change requires a change to the documentation

  • I have updated the documentation accordingly
  • Diff: 483 lines (+362 / -121) across 6 files Reviewer: roedie Review duration: 77442m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.47) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.47 · 483 lines diff across 6 files
    0.47
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.370
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #4326"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 47.3% (MEDIUM) · Higher = larger blast radius
    47.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 18.7% · Safe to merge
    18.7%
    Repository