News for hackers. Stuff that matters.
Re:I got hacked: My Hetzner server started mining Monero by tgtweak on Wednesday December 17, 2025 @05:37PM (#46306552)
Just a note - you can very much limit cpu usage on the docker containers by setting --cpus="0.5" (or cpus:0.5 in docker compose) if you expect it to be a very lightweight container, this isolation can help prevent one roudy container from hitting the rest of the system regardless of whether it's crypto-mining malware, a ddos attempt or a misbehaving service/software.
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.
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.

1: https://github.com/kubernetes/kubernetes/issues/48912

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.
Re:I got hacked: My Hetzner server started mining Monero by freedomben on Wednesday December 17, 2025 @05:57PM (#46306756)
This is true, but it's also easy to set at one point and then later introduce a bursty endpoint that ends up throttled unnecessarily. Always a good idea to be familiar with your app's performance profile but it can be easy to let that get away from you.
Re:I got hacked: My Hetzner server started mining Monero by miladyincontrol on Wednesday December 17, 2025 @06:48PM (#46307219)
Soft and hard memory limits are worth considering too, regardless of container method.
Re:I got hacked: My Hetzner server started mining Monero by fragmede on Wednesday December 17, 2025 @06:01PM (#46306795)
The other thing to note is that docker is for the most part, stateless. So if you're running something that has to deal with questionable user input (images and video or more importantly PDFs), is to stick it on its own VM and then cycle the docker container every hour and the VM every 12, and then still be worried about it getting hacked and leaking secrets.
Re:I got hacked: My Hetzner server started mining Monero by tgtweak on Thursday December 18, 2025 @12:17AM (#46309106)
Most of this is mitigated by running docker in an LXC containers (like proxmox does) which grants a lot more isolation than docker on it's own - closer in nature to running separate VMs.
Re:I got hacked: My Hetzner server started mining Monero by butvacuum on Thursday December 18, 2025 @08:54AM (#46312673)
Too bad it straight doesn't work without heavy mods in pve9
Re:I got hacked: My Hetzner server started mining Monero by tgtweak on Thursday December 18, 2025 @01:36PM (#46316674)
Illumos had a really nice stack for running containers inside jails and zones... I wonder if any of that ever made it into the linux world. If you broke out of the container you'd just be inside a jail which is even more hardened.
Re:I got hacked: My Hetzner server started mining Monero by cyphar on Thursday December 18, 2025 @11:27PM (#46322260)
SmartOS constructed a container-like environment using LX-branded zones, they didn't create an in-kernel equivalent to Linux's namespaces which it then nested in a zone. You're probably thinking of the KVM port to Solaris/illumos, which does run in a zone internally to provide additional protection.

While LX-branded zones were a really cool tech demo, maintaining compatibility with Linux long-term would be incredibly painful and you're bound to find all sorts of horrific bugs in production. I believe that Oxide uses KVM to run their Linux guests.

Linux has always supported nested namespaces and you can run Docker containers inside LXC (or Incus) fairly easily. Note that while it does add some additional protection (in particular, it transparently adds user namespaces which is a critical security feature most people still do not enable in Docker) it is still the same technology as containers and so kernel bugs still pose a similar risk.

Re:I got hacked: My Hetzner server started mining Monero by tgtweak on Friday December 19, 2025 @10:03AM (#46326602)
Yes it was SmartOS - bcantrill worked on it post-oracle. I remembered Illumos since it was the precursor.
Re:I got hacked: My Hetzner server started mining Monero by LiberaVeritas on Tuesday December 30, 2025 @10:27PM (#46440954)
You can now easily import OCI images and create containers with them in pve9.1
Re:I got hacked: My Hetzner server started mining Monero by Koffiepoeder on Thursday December 18, 2025 @02:16AM (#46309784)
If I can get in once, I can do it again an hour later. I'd be inclined to believe that dumb recycling is not very effective against a persistent attacker.
Re:I got hacked: My Hetzner server started mining Monero by Saris on Friday December 19, 2025 @11:18AM (#46327446)
I wonder if a crypto miner like this was a person doing the work, or just an automated thing someone wrote to scan IPs for known vulnerabilities and exploit them automatically.
Re:I got hacked: My Hetzner server started mining Monero by jakelsaunders94 on Wednesday December 17, 2025 @05:59PM (#46306776)
This is a great shout actually. Thanks for pointing it out!
Re:I got hacked: My Hetzner server started mining Monero by moebrowne on Thursday December 18, 2025 @06:51AM (#46311569)
While this is a good idea I wonder if doing this could allow the intrusion to go undetected for longer - how many people/monitoring systems would notice a small increase in CPU usage compared to all CPUs being maxed out.