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 24, 2024
1 parent 83b3e45 commit ded87cf
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
Name=org.deepin.dde.SoundThemePlayer1
Exec=/usr/lib/deepin-api/sound-theme-player
User=deepin-sound-player
SystemdService=dbus-org.deepin.dde.SoundThemePlayer1.service
40 changes: 40 additions & 0 deletions misc/systemd/system/deepin-sound-theme-player.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[Unit]
Description=Deepin Sound Theme Player

Requisite=sound.target
After=sound.target

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

[Service]
Type=dbus
BusName=org.deepin.dde.SoundThemePlayer1
User=deepin-sound-player
ExecStart=/usr/lib/deepin-api/sound-theme-player

DevicePolicy=closed
DeviceAllow=char-alsa rw

ProtectSystem=full
ProtectHome=true
ReadWritePaths=/var/lib/deepin-sound-player
PrivateTmp=true
#PrivateDevices=true
PrivateNetwork=true
ProtectHostname=true
ProtectClock=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectKernelLogs=true
ProtectControlGroups=true
RestrictAddressFamilies=AF_UNIX
RestrictNamespaces=true
LockPersonality=true
RestrictRealtime=true
RestrictSUIDSGID=true
RemoveIPC=true

[Install]
Alias=dbus-org.deepin.dde.SoundThemePlayer1.service

0 comments on commit ded87cf

Please sign in to comment.