Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow forwarding of all DHCP traffic #3975

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

milan-zededa
Copy link
Contributor

Recently we added iptables rule to prevent forwarding of non-app traffic (so that attacker cannot use EVE to hop from one network to another). This rule is based on connection tracking and differentiating between host and app traffic using marks. However, app-initiated DHCP requests can match the same conntrack entry as was created for DHCP requests sent by the DHCP client of EVE.
This is because source/destination IPs are undefined or broadcast:

  [72]: udp 17 src=0.0.0.0 dst=255.255.255.255 sport=68 dport=67
        src=255.255.255.255 dst=0.0.0.0 sport=67 dport=68 mark=0xa

This means that application DHCP traffic may get mark in_dhcp (as opposed to app_dhcp) and forwarding will not be allowed. This is particularly problem for switch NI.

Lets create an exception rule, allowing forwarding of DHCP traffic even if it has in_dhcp mark, given that the same mark can be accidentally assigned also to an application DHCP request.

@github-actions github-actions bot requested a review from eriknordmark June 11, 2024 15:39
@eriknordmark eriknordmark added the stable Should be backported to stable release(s) label Jun 11, 2024
Recently we added iptables rule to prevent forwarding of non-app traffic
(so that attacker cannot use EVE to hop from one network to another).
This rule is based on connection tracking and differentiating
between host and app traffic using marks. However, app-initiated DHCP
requests can match the same conntrack entry as was created for DHCP
requests sent by the DHCP client of EVE.
This is because source/destination IPs are undefined or broadcast:
  [72]: udp 17 src=0.0.0.0 dst=255.255.255.255 sport=68 dport=67
        src=255.255.255.255 dst=0.0.0.0 sport=67 dport=68 mark=0xa
This means that application DHCP traffic may get mark "in_dhcp"
(as opposed to "app_dhcp") and forwarding will not be allowed.
This is particularly problem for switch NI.

Lets create an exception rule, allowing forwarding of DHCP traffic even
if it has in_dhcp mark, given that the same mark can be accidentally
assigned also to an application DHCP request.

Signed-off-by: Milan Lenco <milan@zededa.com>
Copy link
Contributor

@eriknordmark eriknordmark left a comment

Choose a reason for hiding this comment

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

LGTM

@eriknordmark
Copy link
Contributor

Seems like #3837 was added in 12.0.0 so this presumable should be backported to 12.0-stable.

@eriknordmark
Copy link
Contributor

I ran test_app_switch 18 times or so and it passed every time (as opposed to failing every time without this fix).

@eriknordmark eriknordmark merged commit 080afbf into lf-edge:master Jun 12, 2024
22 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stable Should be backported to stable release(s)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants