zlacker

[return to "I got hacked: My Hetzner server started mining Monero"]
1. 3np+pm[view] [source] 2025-12-17 23:18:27
>>jakels+(OP)
> I also enabled UFW (which I should have done ages ago)

I disrecommend UFW.

firewalld is a much better pick in current year and will not grow unmaintainable the way UFW rules can.

    firewall-cmd --persistent --set-default-zone=block
    firewall-cmd --persistent --zone=block --add-service=ssh
    firewall-cmd --persistent --zone=block --add-service=https
    firewall-cmd --persistent --zone=block --add-port=80/tcp
    firewall-cmd --reload
Configuration is backed by xml files in /etc/firewalld and /usr/lib/firewalld instead of the brittle pile of sticks that is the ufw rules files. Use the nftables backend unless you have your own reasons for needing legacy iptables.

Specifically for docker it is a very common gotcha that the container runtime can and will bypass firewall rules and open ports anyway. Depending on your configuration, those firewall rules in OP may not actually do anything to prevent docker from opening incoming ports.

Newer versions of firewalld gives an easy way to configure this via StrictForwardPorts=yes in /etc/firewalld/firewalld.conf.

◧◩
2. except+3q[view] [source] 2025-12-17 23:45:50
>>3np+pm

  > Specifically for docker it is a very common gotcha that the container runtime can and will bypass firewall rules and open ports anyway. 
Like I said in another comment, drop Docker, install podman.
◧◩◪
3. 3np+Dr[view] [source] 2025-12-17 23:57:52
>>except+3q
This affects podman too.
◧◩◪◨
4. jshear+bu[view] [source] 2025-12-18 00:18:53
>>3np+Dr
Not if you run it in rootless mode, which is more of a first class citizen in Podman compared to Docker.
◧◩◪◨⬒
5. 3np+ru[view] [source] 2025-12-18 00:21:13
>>jshear+bu
> Not if you run it in rootless mode.

Same as for docker, yes?

https://docs.docker.com/engine/security/rootless/

◧◩◪◨⬒⬓
6. wasmit+wl1[view] [source] 2025-12-18 09:56:43
>>3np+ru
Rootless exists in Docker, yes, but as OP said, it's not first-class. The setup process is clunky, things break more often. In podman it just works, and podman is leading with features like quadlets, which make docker services just services like any other.
◧◩◪◨⬒⬓⬔
7. newsof+o63[view] [source] 2025-12-18 19:39:04
>>wasmit+wl1
No one wants, nor asked for, quadlets.
[go to top]