Hardening NixOS After I Got Hacked

Preface On the night of 2026-10-14, I suddenly got an alarm from Alertmanager about persistent high CPU usage on one of my servers: That's weird, as that server doesn't run any services that is expected to have continuous CPU usage. Then, when I logged on to the server to check what's going on, I indeed found a process, python3 - , consuming all the CPU. The dash sign - in python3 - means the Python process will read the code it's supposed to execute from standard input. However, I always save the code as a .py file before running it, and had never run any code like that. Nevertheless, if you have used AI/LLM agents before, you might have noticed that python3 - is a characteristic of AI agents, as they love to run code in the following way:...