Add chain DOCKER-FORWARD#49518
Merged
Merged
Conversation
9a041f2 to
c07435c
Compare
valentinBoch
approved these changes
Feb 21, 2025
c07435c to
6da51b8
Compare
thaJeztah
reviewed
Feb 21, 2025
akerouanton
reviewed
Feb 21, 2025
Member
akerouanton
left a comment
There was a problem hiding this comment.
I took a look and it seems okay but I'd like to take another look and play with it a bit on Monday before approving.
|
Will this fix fix the problem described in docker/for-linux#1521? This does not appear to be directly linked to Tailscale, though I note in the comments to the Tailscale issue that one user notes OCI as a contributing factor and 1521 was discovered and repro'd on OCI. |
Contributor
Author
Yes, it looks the same. |
Contributor
Author
|
Added a regression test. |
This was referenced Feb 23, 2025
In 28.0.0, Docker appended to the FORWARD chain - breaking other applications that had appended their own rules that needed to execute after Docker's rules. Move most of Docker's rules out of the filter-FORWARD chain into a new DOCKER-FORWARD chain, so that Docker can append to DOCKER-FORWARD without affecting the order of rules in the FORWARD chain. After daemon startup inserts jumps to DOCKER-USER and DOCKER-FORWARD, the bridge driver will not touch the FORWARD chain again. DOCKER-INGRESS is still added to the FORWARD chain, if used, as it was in 27.x and earlier. Signed-off-by: Rob Murray <[email protected]>
Signed-off-by: Rob Murray <[email protected]>
Merged
d04ff16 to
341cafa
Compare
Contributor
Author
|
Rebased to resolve conflict. |
vvoland
approved these changes
Feb 25, 2025
aevesdocker
pushed a commit
to docker/docs
that referenced
this pull request
Feb 26, 2025
## Description - Describe new iptables chain `DOCKER-FORWARD`, which splits Docker's rules out of the main `FORWARD` chain where they were being antisocial - related to moby/moby#49518 - Update notes about IP Forwarding and the default DROP policy - Only engine < 28.0.0 allows remote access to ports published to the localhost address ## Related issues or tickets ## Reviews <!-- Notes for reviewers here --> <!-- List applicable reviews (optionally @tag reviewers) --> - [ ] Technical review - [ ] Editorial review - [ ] Product review --------- Signed-off-by: Rob Murray <[email protected]>
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 I did
In 28.0.0, Docker appended to the FORWARD chain - breaking other applications that had appended their own rules that needed to execute after Docker's rules.
- How I did it
Move most of Docker's rules out of the filter-FORWARD chain into a new DOCKER-FORWARD chain, so that Docker can append to DOCKER-FORWARD without affecting the order of rules in the FORWARD chain.
After daemon startup inserts jumps to DOCKER-USER and DOCKER-FORWARD, the bridge driver will not touch the FORWARD chain again. DOCKER-INGRESS is still added to the FORWARD chain, if used, as it was in 27.x and earlier.
(Links to code in the generated iptables docs are all out of date ... I'll update them once this is merged and there's something to link to - haven't thought of a better way to deal with that, but I think the links are probably worth keeping.)
- How to verify it
Existing and updated tests.
New test
TestDropInForwardChain- reliably fails without this change.To check removal of rules from the FORWARD chain on upgrade from 27.5.1 ...
Upgrade test detail ...
Networks and containers ...
27.5.1 iptables
27.5.1 - ip6tables
Dev build after upgrade from 27.5.1 - iptables
Dev build after upgrade from 27.5.1- ip6tables
Dev build started after iptables flush - iptables
Dev build started after ip6tables flush - ip6tables
- Human readable description for the release notes