Skip to content

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

Answered by klamann
klamann asked this question in Q&A
Discussion options

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

Comment options

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

@klamann
Comment options

@klamann
Comment options

@klamann
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@klamann
Comment options

@code-asher
Comment options

@benz0li
Comment options

@DeepCowProductions
Comment options

@klamann
Comment options

Answer selected by klamann
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@klamann
Comment options

Comment options

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

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