Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure systemd security features in keyd.service #616

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions keyd.service
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,41 @@ After=local-fs.target
Type=simple
ExecStart=/usr/bin/keyd

ProtectProc=invisible
ProcSubset=pid
ProtectSystem=strict
ProtectHome=true
ReadOnlyPaths=/etc/keyd
PrivateTmp=true
DeviceAllow=char-input
DeviceAllow=/dev/uinput
ProtectHostname=true
ProtectClock=true

ProtectKernelTunables=true
ProtectKernelModules=true
ProtectKernelLogs=true
ProtectControlGroups=true
RestrictNamespaces=true

RemoveIPC=true
RestrictAddressFamilies=AF_UNIX
PrivateNetwork=true
IPAddressDeny=any

NoNewPrivileges=true
LockPersonality=true
MemoryDenyWriteExecute=true
RestrictRealtime=true
RestrictSUIDSGID=true

SystemCallArchitectures=native
SystemCallFilter=@system-service
SystemCallFilter=~@privileged

CapabilityBoundingSet=CAP_SETGID CAP_SYS_NICE

UMask=177

[Install]
WantedBy=sysinit.target