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

docker firewall "fails open" when DOCKER-USER chain already exists #2631

Open
khimaros opened this issue Apr 20, 2021 · 0 comments
Open

docker firewall "fails open" when DOCKER-USER chain already exists #2631

khimaros opened this issue Apr 20, 2021 · 0 comments

Comments

@khimaros
Copy link

khimaros commented Apr 20, 2021

when docker is launched, if the DOCKER-USER chain already exists, the jump DOCKER-USER rule is not inserted into the FORWARD chain, which results in the firewall "failing open".

this is potentially very hazardous from a security perspective. all that is required for this to happen is for a iptables/nftables "save" to contain the DOCKER-USER chain, and for the restore service to start before docker is started.

the culprit code is here:

logrus.Warnf("Failed to create %s chain: %v", userChain, err)

one potential fix is to insert the jump even if the chain already exists, though in this case it may also be important to also always insert the return to the DOCKER-USER chain as well if it isn't already there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant