I just ran a run0 lynis audit system and it mentioned a lot of vulnerable/insecure systemd services.
- NetworkManager-dispatcher.service (value=9.6) [ INSECURE ]
- NetworkManager.service (value=7.8) [ VULNERABLE ]
- audiobookshelf.service (value=9.2) [ INSECURE ]
- dbus.service (value=9.6) [ INSECURE ]
- display-manager.service (value=9.6) [ INSECURE ]
- emergency.service (value=9.5) [ INSECURE ]
- fancontrol.service (value=9.6) [ INSECURE ]
- getty@tty1.service (value=9.6) [ INSECURE ]
- getty@tty7.service (value=9.6) [ INSECURE ]
- libvirtd.service (value=9.6) [ INSECURE ]
- mullvad-daemon.service (value=9.6) [ INSECURE ]
- nix-daemon.service (value=9.6) [ INSECURE ]
- nscd.service (value=8.2) [ VULNERABLE ]
- ntpd-rs.service (value=8.3) [ VULNERABLE ]
- reload-systemd-vconsole-setup.service (value=9.6) [ INSECURE ]
- rescue.service (value=9.5) [ INSECURE ]
- run-p56404-i56704.service (value=9.6) [ INSECURE ]
- scx.service (value=9.6) [ INSECURE ]
- spice-vdagentd.service (value=9.6) [ INSECURE ]
- system76-power.service (value=9.6) [ INSECURE ]
- system76-scheduler.service (value=9.6) [ INSECURE ]
- systemd-ask-password-console.service (value=9.4) [ INSECURE ]
- systemd-ask-password-wall.service (value=9.4) [ INSECURE ]
- udisks2.service (value=9.6) [ INSECURE ]
- user@1002.service (value=9.4) [ INSECURE ]
- virtlockd.service (value=9.6) [ INSECURE ]
- virtlogd.service (value=9.6) [ INSECURE ]
- virtlxcd.service (value=9.6) [ INSECURE ]
- virtqemud.service (value=9.6) [ INSECURE ]
- virtvboxd.service (value=9.6) [ INSECURE ]
- virtxend.service (value=9.6) [ INSECURE ]
As an example, this is how NetworkManager.service looks like:
NAME DESCRIPTION EXPOSURE
β RootDirectory=/RootImage= Service runs within the host's root directory 0.1
SupplementaryGroups= Service runs as root, option does not matter
RemoveIPC= Service runs as root, option does not apply
β User=/DynamicUser= Service runs as root user 0.4
β NoNewPrivileges= Service processes may acquire new privileges 0.2
β CapabilityBoundingSet=~CAP_SYS_TIME Service processes cannot change the system clock
β AmbientCapabilities= Service process does not receive ambient capabilities
β PrivateDevices= Service potentially has access to hardware devices 0.2
β ProtectClock= Service may write to the hardware clock or system clock 0.2
β CapabilityBoundingSet=~CAP_KILL Service may send UNIX signals to arbitrary processes 0.1
NAME DESCRIPTION EXPOSURE
β RootDirectory=/RootImage= Service runs within the host's root directory 0.1
SupplementaryGroups= Service runs as root, option does not matter
RemoveIPC= Service runs as root, option does not apply
β User=/DynamicUser= Service runs as root user 0.4
β NoNewPrivileges= Service processes may acquire new privileges 0.2
β CapabilityBoundingSet=~CAP_SYS_TIME Service processes cannot change the system clock
β AmbientCapabilities= Service process does not receive ambient capabilities
β PrivateDevices= Service potentially has access to hardware devices 0.2
β ProtectClock= Service may write to the hardware clock or system clock 0.2
β CapabilityBoundingSet=~CAP_KILL Service may send UNIX signals to arbitrary processes 0.1
β ProtectKernelLogs= Service may read from or write to the kernel log ring buffer 0.2
β CapabilityBoundingSet=~CAP_(DAC_*|FOWNER|IPC_OWNER) Service may override UNIX file/IPC permission checks 0.2
β CapabilityBoundingSet=~CAP_BPF Service may not load BPF programs
β ProtectControlGroups= Service may modify the control group file system 0.2
β ProtectKernelModules= Service may load or read kernel modules 0.2
β CapabilityBoundingSet=~CAP_SYS_MODULE Service may load kernel modules 0.2
β CapabilityBoundingSet=~CAP_SYS_CHROOT Service may issue chroot() 0.1
β SystemCallArchitectures= Service may execute system calls with all ABIs 0.2
β MemoryDenyWriteExecute= Service may create writable executable memory mappings 0.1
β RestrictNamespaces=~user Service may create user namespaces 0.3
β RestrictNamespaces=~pid Service may create process namespaces 0.1
β RestrictNamespaces=~net Service may create network namespaces 0.1
β RestrictNamespaces=~uts Service may create hostname namespaces 0.1
β RestrictNamespaces=~mnt Service may create file system namespaces 0.1
β RestrictNamespaces=~cgroup Service may create cgroup namespaces 0.1
β RestrictSUIDSGID= Service may create SUID/SGID files 0.2
β RestrictNamespaces=~ipc Service may create IPC namespaces 0.1
β ProtectHostname= Service may change system host/domainname 0.1
β CapabilityBoundingSet=~CAP_SET(UID|GID|PCAP) Service may change UID/GID identities/capabilities 0.3
β LockPersonality= Service may change ABI personality 0.1
β ProtectKernelTunables= Service may alter kernel tunables 0.2
β RestrictAddressFamilies=~AF_PACKET Service may allocate packet sockets 0.2
β RestrictAddressFamilies=~AF_NETLINK Service may allocate netlink sockets 0.1
β RestrictAddressFamilies=~AF_UNIX Service may allocate local sockets 0.1
β RestrictAddressFamilies=~β¦ Service may allocate exotic sockets 0.3
β RestrictAddressFamilies=~AF_(INET|INET6) Service may allocate Internet sockets 0.3
β RestrictRealtime= Service may acquire realtime scheduling 0.1
β ProtectHome= Service has read-only access to home directories 0.1
β CapabilityBoundingSet=~CAP_SYS_RAWIO Service has no raw I/O access
β CapabilityBoundingSet=~CAP_SYS_PTRACE Service has no ptrace() debugging abilities
β CapabilityBoundingSet=~CAP_SYS_(NICE|RESOURCE) Service has no privileges to change resource use parameters
β DeviceAllow= Service has no device ACL 0.2
β CapabilityBoundingSet=~CAP_SYS_ADMIN Service has no administrator privileges
β CapabilityBoundingSet=~CAP_SYSLOG Service has no access to kernel logging
β CapabilityBoundingSet=~CAP_NET_ADMIN Service has network configuration privileges 0.2
β ProtectSystem= Service has limited write access to the OS file hierarchy 0.1
β ProtectProc= Service has full access to process tree (/proc hidepid=) 0.2
β ProcSubset= Service has full access to non-process /proc files (/proc subset=) 0.1
β CapabilityBoundingSet=~CAP_NET_(BIND_SERVICE|BROADCAST|RAW) Service has elevated networking privileges 0.1
β CapabilityBoundingSet=~CAP_AUDIT_* Service has audit subsystem access 0.1
β PrivateNetwork= Service has access to the host's network 0.5
β PrivateUsers= Service has access to other users 0.2
β PrivateTmp= Service has access to other software's temporary files 0.2
β KeyringMode= Service doesn't share key material with other services
β Delegate= Service does not maintain its own delegated control group subtree
β SystemCallFilter=~@clock Service does not filter system calls 0.2
β SystemCallFilter=~@cpu-emulation Service does not filter system calls 0.1
β SystemCallFilter=~@debug Service does not filter system calls 0.2
β SystemCallFilter=~@module Service does not filter system calls 0.2
β SystemCallFilter=~@mount Service does not filter system calls 0.2
β SystemCallFilter=~@obsolete Service does not filter system calls 0.1
β SystemCallFilter=~@privileged Service does not filter system calls 0.2
β SystemCallFilter=~@raw-io Service does not filter system calls 0.2
β SystemCallFilter=~@reboot Service does not filter system calls 0.2
β SystemCallFilter=~@resources Service does not filter system calls 0.2
β SystemCallFilter=~@swap Service does not filter system calls 0.2
β IPAddressDeny= Service does not define an IP address allow list 0.2
β NotifyAccess= Service child processes cannot alter service state
β CapabilityBoundingSet=~CAP_SYS_PACCT Service cannot use acct()
β CapabilityBoundingSet=~CAP_WAKE_ALARM Service cannot program timers that wake up the system
β CapabilityBoundingSet=~CAP_LINUX_IMMUTABLE Service cannot mark files immutable
β CapabilityBoundingSet=~CAP_IPC_LOCK Service cannot lock memory into RAM
β CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG Service cannot issue vhangup()
β CapabilityBoundingSet=~CAP_SYS_BOOT Service cannot issue reboot()
β PrivateMounts= Service cannot install system mounts
β CapabilityBoundingSet=~CAP_BLOCK_SUSPEND Service cannot establish wake locks
β CapabilityBoundingSet=~CAP_LEASE Service cannot create file leases
β CapabilityBoundingSet=~CAP_MKNOD Service cannot create device nodes
β CapabilityBoundingSet=~CAP_(CHOWN|FSETID|SETFCAP) Service cannot change file ownership/access mode/capabilities
β CapabilityBoundingSet=~CAP_MAC_* Service cannot adjust SMACK MAC
β UMask= Files created by service are world-readable by default 0.1
β Overall exposure level for NetworkManager.service: 7.8 EXPOSED π
(btw funny that they use Emojis)
So what to do about this? I am sure it is not good manner to run all these services as root