Skip to content

My code-server got hacked; I have no idea how #6930

Answered by klamann
klamann asked this question in Q&A

You must be logged in to vote

Docker and ufw use iptables in ways that make them incompatible with each other. When you publish a container's ports using Docker, traffic to and from that container gets diverted before it goes through the ufw firewall settings. (...) Packets are routed before the firewall rules can be applied, effectively ignoring your firewall configuration.

https://docs.docker.com/network/packet-filtering-firewalls/#docker-and-ufw

I didn't know this. I've been using docker for so many years now, and all this time, my ufw rules were useless. This was the point of entry, code-server was exposed on port 8443 all along, I just never checked because I was so certain that I can rely on my ufw rules.

For …

Replies: 6 comments 12 replies

You must be logged in to vote
4 replies
@code-asher

@klamann

@klamann

@klamann

You must be logged in to vote
0 replies

You must be logged in to vote
6 replies
@klamann

@code-asher

@benz0li

@DeepCowProductions

@klamann

Answer selected by klamann

You must be logged in to vote
0 replies

You must be logged in to vote
1 reply
@klamann

You must be logged in to vote
1 reply
@code-asher

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants