Locking down a fresh Linux server: What you actually need to do before bots find it
(unknownuniverse.uk)
More Docker hardening*
Consider rootless docker or Podman. If that is not for you:
- enable usernamespace remapping
- default-drop all container capabilities, then selectively and restrictively add them in (needs trial and error)
- limit container privileges:
security_opt: - no-new-privileges:true - limit your containers' access to system resources such as memory, cpu, etc.
- if possible: set the container filesytem to read-only. The same can be done for data in volumes.
* Note that these tips are less "fire-and-forget, sane defaults" and can be much more finicky. Whether they work well depends on the service in question. They may break container deployments and are often a matter of trial and error until you get them just right. (Feel free to hit me up on details; if I happen to be running the same services as you are, I may be able to tell you what works and what doesn't.)