Skip to content

Commit

Permalink
Update Systemd security settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Rahul Sundaram committed Mar 5, 2024
1 parent 6189c10 commit 1e1a658
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/units/system/dbus-broker.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,25 @@ Type=notify
Sockets=dbus.socket
OOMScoreAdjust=-900
LimitNOFILE=16384
ProtectSystem=full
PrivateTmp=true
PrivateDevices=true
ExecStart=@bindir@/dbus-broker-launch --scope system --audit
ExecReload=@bindir@/busctl call org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus ReloadConfig
LockPersonality=yes
MemoryDenyWriteExecute=yes
NoNewPrivileges=yes
PrivateDevices=yes
PrivateTmp=true
ProtectClock=yes
ProtectControlGroups=yes
ProtectHome=yes
ProtectHostname=yes
ProtectKernelLogs=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
ProtectSystem=full
RestrictNamespaces=yes
RestrictRealtime=yes
RestrictSUIDSGID=yes
SystemCallArchitectures=native

[Install]
Alias=dbus.service
17 changes: 17 additions & 0 deletions src/units/user/dbus-broker.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,23 @@ Sockets=dbus.socket
ExecStart=@bindir@/dbus-broker-launch --scope user
ExecReload=@bindir@/busctl --user call org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus ReloadConfig
Slice=session.slice
LockPersonality=yes
MemoryDenyWriteExecute=yes
NoNewPrivileges=yes
PrivateDevices=yes
PrivateTmp=true
ProtectClock=yes
ProtectControlGroups=yes
ProtectHome=read-only
ProtectHostname=yes
ProtectKernelLogs=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
ProtectSystem=full
RestrictNamespaces=yes
RestrictRealtime=yes
RestrictSUIDSGID=yes
SystemCallArchitectures=native

[Install]
Alias=dbus.service

0 comments on commit 1e1a658

Please sign in to comment.