Re:I got hacked: My Hetzner server started mining Monero
by tracker1 on Wednesday December 17, 2025 @06:10PM
(#46306892)
Another is running containers in read-only mode, assuming they support this configuration... will minimize a lot of potential attack surface.
[ Parent
| on HN ]
Re:I got hacked: My Hetzner server started mining Monero
by 3eb7988a1663 on Wednesday December 17, 2025 @11:15PM
(#46308846)
Never looked into this. I would expect the majority of images would fail in this configuration. Or am I unduly pessimistic?
Re:I got hacked: My Hetzner server started mining Monero
by s_ting765 on Thursday December 18, 2025 @12:48AM
(#46309293)
Depends on specific app use case. Nginx doesn't work with it but valkey will.
Re:I got hacked: My Hetzner server started mining Monero
by hxtk on Thursday December 18, 2025 @01:07AM
(#46309404)
Many fail if you do it without any additional configuration. In Kubernetes you can mostly get around it by mounting `emptyDir` volumes to the specific directories that need to be writable, `/tmp` being a common culprit. If they need to be writable and have content that exists in the base image, you'd usually mount an emptyDir to `/tmp` and copy the content into it in an `initContainer`, then mount the same `emptyDir` volume to the original location in the runtime container.
Unfortunately, there is no way to specify those `emptyDir` volumes as `noexec` [1].
I think the docker equivalent is `--tmpfs` for the `emptyDir` volumes.
Re:I got hacked: My Hetzner server started mining Monero
by flowerthoughts on Thursday December 18, 2025 @01:48AM
(#46309608)
Readonly and rootless are my two requirements for Docker containers. Most images can't run readonly because they try to create a user in some startup script. Since I want my UIDs unique to isolate mounted directories, this is meaningless. I end up having to wrap or copy Dockerfiles to make them behave reasonably.
Having such a nice layered buildsystem with mountpoints, I'm amazed Docker made readonly an afterthought.
Re:I got hacked: My Hetzner server started mining Monero
by subscribed on Thursday December 18, 2025 @02:59AM
(#46310028)
I like steering docker runs with docker-compose, especially with .env files - easy to store in repositories, easy to customise and have sane defaults.
Re:I got hacked: My Hetzner server started mining Monero
by flowerthoughts on Thursday December 18, 2025 @06:53AM
(#46311578)
Yeah agreed. I use docker-compose. But it doesn't help if the Docker images try to update /etc/passwd, or force a hardcoded UID, or run some install.sh at runtime instead of buildtime.
Re:I got hacked: My Hetzner server started mining Monero
by subscribed on Thursday December 25, 2025 @09:50AM
(#46384729)
Oh, absolutely. Some things some images try to do are just silly.
Re:I got hacked: My Hetzner server started mining Monero
by tracker1 on Thursday December 18, 2025 @03:48PM
(#46318479)
It's hit or miss... you sometimes have to make /tmp writable or another data directory... some images just don't operate right because of initialization steps that happen on first run. It's hit or miss and depends... but a lot of your own apps can definitely be made to work with limited, or no write surface.