r/linuxadmin • u/Ross_the_nomad • Apr 19 '26
Does anybody else make heavy use of systemd hardening settings? I created a Cockpit dashboard to help visualize my system exposure.
67
Upvotes
r/linuxadmin • u/Ross_the_nomad • Apr 19 '26
17
u/Ross_the_nomad Apr 19 '26 edited Apr 28 '26
The stock "systemd-analyze security" report doesn't offer much in the way of densely packed or easily sorted data. Its high-level mode doesn't mention any specific security settings, and the per-service mode is more verbose than needed once you know what you're doing. I put enough time into hardening my system that I needed a better way to survey my progress.
It started with a bash script and evolved into this Cockpit plugin. You can see Cockpit and the daemon that feeds it this info right in the service list, themselves also hardened as much as I could. The score on the left is taken straight from the systemd-analyze tool.
I recently added an indicator for which services have been confined with AppArmor (ENForce vs COMplain). Any apparmor errors get tallied and the dashboard can drill down to view the detail (ERR column).
There's also a tally / drill down for any mounts inside the mount namespace that are both writable and executable, making it easier to get a handle on RCE exposure risk that could be mitigated with NoExecPaths= or ReadOnlyPaths=.
EDIT: People have been asking for source code so I just put it up on github. I'm running NixOS, so it's not packaged in a way that's going to run out of the box for other distros, apart from the cli script.
https://github.com/mrmanganese/cockpit-systemd-security-dash/tree/main
7
u/revcraigevil Apr 19 '26
Very nice dashboard.
https://github.com/roddhjav/apparmor.d Works great for apparmor security.
For Systemd you could do: https://github.com/synacktiv/shh
For general system hardening: https://github.com/captainzero93/security_harden_linux
5
u/Busy-Examination1148 Apr 19 '26
This looks great! Open source it?
1
u/Electronic-Unit2808 Apr 20 '26
That's really great, but where's the download link?????
How can we test this???
2
u/Mysterious_Doubt_341 Apr 19 '26
Great idea. It's too problematic to ignore.
2
u/[deleted] Apr 19 '26
[removed] — view removed comment