Skip to content

Fix security vulnerability in caclmgrd#139

Merged
qiluo-msft merged 1 commit intosonic-net:masterfrom
ZhaohuiS:fix/caclmgrd_ttl
Jul 23, 2024
Merged

Fix security vulnerability in caclmgrd#139
qiluo-msft merged 1 commit intosonic-net:masterfrom
ZhaohuiS:fix/caclmgrd_ttl

Conversation

@ZhaohuiS
Copy link
Contributor

@ZhaohuiS ZhaohuiS commented Jul 16, 2024

  • description:

After installation, a default iptables rule allows people to bypass all others rules protecting the switch management & control-plane.

  • Mitigation:

Accept only ttl-lt 2 for ICMP packets, or possibly dst-port > 1024.
Traceroute may be based on ICMP or UDP or TCP.

The original behavior:
Add iptables/ip6tables commands to allow all incoming packets with TTL of 0 or 1

The behavior after change:
For ICMP: accept all icmp protocol TTL < 2 packets
For UDP: accept UDP protocol TTL < 2 and UDP dest port > 1024 packets
For TCP: accept TCP protocol TTL < 2 and TCP dest port > 1024 packets
For other mismatched packets, default action is drop

  • work item:

28662516

Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
@ZhaohuiS ZhaohuiS requested review from maipbui and qiluo-msft July 23, 2024 07:36
Copy link
Contributor

@maipbui maipbui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@qiluo-msft qiluo-msft requested a review from bingwang-ms July 23, 2024 21:14
@bingwang-ms
Copy link

LGTM. The test code in sonic-mgmt repo also need to be updated.

@ZhaohuiS
Copy link
Contributor Author

sonic-net/sonic-mgmt#13786 test case update

wangxin pushed a commit to sonic-net/sonic-mgmt that referenced this pull request Jul 29, 2024
What is the motivation for this PR?
RP test will fail after sonic-net/sonic-host-services#139, update the case accordingly.

How did you do it?
add expected iptable rules

How did you verify/test it?
run cacl/test_cacl_application.py

Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
mssonicbld pushed a commit to mssonicbld/sonic-host-services that referenced this pull request Jul 29, 2024
- description:

After installation, a default iptables rule allows an attacker to bypass all others rules protecting the switch management & control-plane.

- Mitigation:

Accept only ttl-lt 2 for ICMP packets, or possibly dst-port > 1024.
Traceroute may be based on ICMP or UDP or TCP.
For ICMP: accept all icmp protocol TTL < 2 packets
For UDP: accept UDP protocol TTL < 2 and UDP dest port > 1024 packets
For TCP: accept TCP protocol TTL < 2 and TCP dest port > 1024 packets
For other mismatched packets, default action is drop

- work item:

28662516
@mssonicbld
Copy link

Cherry-pick PR to 202405: #141

mssonicbld pushed a commit that referenced this pull request Jul 29, 2024
- description:

After installation, a default iptables rule allows an attacker to bypass all others rules protecting the switch management & control-plane.

- Mitigation:

Accept only ttl-lt 2 for ICMP packets, or possibly dst-port > 1024.
Traceroute may be based on ICMP or UDP or TCP.
For ICMP: accept all icmp protocol TTL < 2 packets
For UDP: accept UDP protocol TTL < 2 and UDP dest port > 1024 packets
For TCP: accept TCP protocol TTL < 2 and TCP dest port > 1024 packets
For other mismatched packets, default action is drop

- work item:

28662516
ZhaohuiS added a commit to ZhaohuiS/sonic-mgmt that referenced this pull request Jul 31, 2024
)

What is the motivation for this PR?
RP test will fail after sonic-net/sonic-host-services#139, update the case accordingly.

How did you do it?
add expected iptable rules

How did you verify/test it?
run cacl/test_cacl_application.py

Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
arista-hpandya pushed a commit to arista-hpandya/sonic-mgmt that referenced this pull request Oct 2, 2024
)

What is the motivation for this PR?
RP test will fail after sonic-net/sonic-host-services#139, update the case accordingly.

How did you do it?
add expected iptable rules

How did you verify/test it?
run cacl/test_cacl_application.py

Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
vikshaw-Nokia pushed a commit to vikshaw-Nokia/sonic-mgmt that referenced this pull request Oct 23, 2024
)

What is the motivation for this PR?
RP test will fail after sonic-net/sonic-host-services#139, update the case accordingly.

How did you do it?
add expected iptable rules

How did you verify/test it?
run cacl/test_cacl_application.py

Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants