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

Add systemd sandboxing #21

Merged
merged 1 commit into from Jun 23, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 25 additions & 0 deletions lib/systemd/system/sdwdate.service
Expand Up @@ -25,7 +25,32 @@ SuccessExitStatus=143
TimeoutSec=30
WatchdogSec=200m
Restart=always

# Hardening.
AmbientCapabilities=CAP_SYS_TIME
CapabilityBoundingSet=CAP_SYS_TIME
ProtectSystem=strict
ReadWriteDirectories=/var/run/sdwdate/
ReadWritePaths=/var/log/sdwdate.log
ProtectHome=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
PrivateTmp=true
PrivateMounts=true
PrivateDevices=true
MemoryDenyWriteExecute=true
NoNewPrivileges=true
RestrictRealtime=true
SystemCallArchitectures=native
RestrictNamespaces=true
RestrictAddressFamilies=AF_UNIX AF_INET

# Broken. Need list of syscalls. Alternative below.
#SystemCallFilter=@clock @ipc @signal

# Blacklist certain syscalls. A whitelist would be stronger.
SystemCallFilter=~@mount @cpu-emulation @debug @keyring @module @obsolete @raw-io

[Install]
WantedBy=multi-user.target