SystemD Service Hardening

roguesecurity.dev

291 points by todsacerdoti 3 days ago


igorramazanov - 3 days ago

Automatic systemd service hardening guided by strace profiling

https://github.com/desbma/shh

jauntywundrkind - 3 days ago

Much better article with very real tips about what options to try than yesterday's (weirdly flagged/dead?) post on the topic. Which while I really enjoyed lacked substance; I was in the comments trying to provide a more useful basis with some real examples, but this is an exemplary list of awesome ways systemd can easily quickly readily provide aassive boost to isolation & security. Great write up!

Yesterday's, just in case: https://us.jlcarveth.dev/post/hardening-systemd.md https://news.ycombinator.com/item?id=44928504

delusional - 3 days ago

Nitpick and title correction: The proper spelling of systemd is systemd, not SystemD. According to their brand page:

Yes, it is written systemd, not system D or System D, or even SystemD. And it isn't system d either. Why? Because it's a system daemon, and under Unix/Linux those are in lower case, and get suffixed with a lower case d. And since systemd manages the system, it's called systemd.

smjburton - 3 days ago

Thanks for sharing this. It looks like you can also use "systemd-analyze" with the "--user" flag to inspect systemd user units as well ("systemd-analyze --user security"). I've started using systemd more now that I've transitioned my containers to Podman, and this will be a helpful utility to improve the security of my systemd unit/container services.

Faaak - 3 days ago

And that's something that's impossible to do with old init scripts, that are all unique in their way and not uniform at all.