Skip to content

Commit

Permalink
chore: systemd hardening
Browse files Browse the repository at this point in the history
加固 dbus 进程
  • Loading branch information
zsien committed Jun 26, 2024
1 parent 48e5ee4 commit 4c91a37
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,39 @@
[Unit]
Description=dde-dconfig-daemon service

# Ask for the dbus socket.
Wants=dbus.socket
After=dbus.socket

[Service]
Type=dbus
User=dde-dconfig-daemon
BusName=org.desktopspec.ConfigManager
ExecStart=/usr/bin/dde-dconfig-daemon
Environment=DSG_DATA_DIRS=/usr/share/dsg:/persistent/linglong/entries/share/dsg

ReadOnlyPaths=/usr/share/dsg -/persistent/linglong/entries/share/dsg
StateDirectory=dde-dconfig-daemon

DevicePolicy=closed

ProtectSystem=full
ProtectHome=yes
PrivateTmp=yes
#PrivateDevices=yes
PrivateNetwork=yes
ProtectHostname=yes
ProtectClock=yes
ProtectKernelTunables=yes
ProtectKernelModules=yes
ProtectKernelLogs=yes
ProtectControlGroups=yes
RestrictAddressFamilies=AF_UNIX
RestrictNamespaces=yes
LockPersonality=yes
RestrictRealtime=yes
RestrictSUIDSGID=yes
RemoveIPC=yes

[Install]
Alias=dbus-org.desktopspec.ConfigManager.service
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Name=org.desktopspec.ConfigManager
Exec=/usr/bin/dde-dconfig-daemon
User=dde-dconfig-daemon
SystemdService=dde-dconfig-daemon.service
SystemdService=dbus-org.desktopspec.ConfigManager.service
6 changes: 0 additions & 6 deletions debian/dde-dconfig-daemon.tmpfiles

This file was deleted.

1 change: 0 additions & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ override_dh_auto_configure:
override_dh_auto_install:
dh_auto_install
dh_installsysusers dde-dconfig-daemon.sysusers
dh_installtmpfiles dde-dconfig-daemon.tmpfiles

0 comments on commit 4c91a37

Please sign in to comment.