caclmgrd: Deny BGP to VLAN SVI on Fairwater BT0 devices - #428
Open
yyynini wants to merge 1 commit into
Open
Conversation
On Fairwater (FW) BT0 devices, deny inbound BGP (tcp/179) destined to the VLAN SVI (default gateway), while preserving all other BGP traffic (e.g. uplink peering) via the existing blanket ACCEPT. Non-FW devices are completely unaffected. - FairwaterBt0 flag detected once at daemon init from DEVICE_METADATA: mgmt_type == 'FairWater' and type == 'BackEndToRRouter'. Verified against a real FW BT0 device (ATL21-0101-0022-12BT0) and a real non-FW DualToR device (str2-8101c1-01). - New generate_block_bgp_to_fw_vlan_svi_commands() reads VLAN_INTERFACE live (same convention as generate_block_ip2me_traffic_iptables_commands) and emits DROP rules for tcp/179 to the SVI address, IPv4 and IPv6. - DROP rules are appended before the existing ACCEPT rule for BGP, so SVI-destined BGP is denied first; everything else falls through to ACCEPT unchanged; mgmt-port (eth0) exclusion is preserved as-is. Tested: added tests/caclmgrd/test_bgp_fw_vlan_svi_vectors.py + caclmgrd_bgp_fw_vlan_svi_test.py (4 vectors), all passing via pytest against the real module. Full existing caclmgrd test suite (69 tests) re-run with no regressions.
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
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.
What
On Fairwater (FW) BT0 devices, deny inbound BGP (tcp/179) destined to the VLAN SVI (default gateway), while preserving all other BGP traffic (e.g. uplink peering) via the existing blanket ACCEPT. Non-FW devices are completely unaffected.
Why
caclmgrdcurrently has a hardcoded blanket ACCEPT for all inbound BGP (except the mgmt port), with a long-standing TODO in the source acknowledging this gap. On FW BT0, this allows BGP session attempts from the server/VLAN side to reach the switch's own control plane, which should be blocked.How
FairwaterBt0flag detected once at daemon init fromDEVICE_METADATA:mgmt_type == "FairWater" and type == "BackEndToRRouter". Verified against a real FW BT0 device and a real non-FW DualToR device.generate_block_bgp_to_fw_vlan_svi_commands()readsVLAN_INTERFACElive (same convention as the existinggenerate_block_ip2me_traffic_iptables_commands) and emits DROP rules for tcp/179 to the SVI address, IPv4 and IPv6.eth0) exclusion is preserved as-is.Testing
tests/caclmgrd/test_bgp_fw_vlan_svi_vectors.py+caclmgrd_bgp_fw_vlan_svi_test.py(4 vectors), all passing via pytest against the real module.caclmgrdtest suite (69 tests) re-run with no regressions.