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

contrib: import hardened systemd units #113

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
35 changes: 35 additions & 0 deletions contrib/pinnwand-reaper.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[Unit]
Description=Pinnwand Reaper
Documentation=https://pinnwand.readthedocs.io/en/latest/

[Service]
CapabilityBoundingSet=
DevicePolicy=closed
DynamicUser=true
ExecStart=/usr/local/bin/pinnwand --configuration-path /etc/pinnwand.toml -vvvv reap
LockPersonality=true
MemoryDenyWriteExecute=true
PrivateDevices=true
PrivateUsers=true
ProcSubset=pid
ProtectClock=true
ProtectControlGroups=true
ProtectHome=true
ProtectHostname=true
ProtectKernelLogs=true
ProtectKernelModules=true
ProtectKernelTunables=true
ProtectProc=invisible
RestrictAddressFamilies=AF_UNIX
RestrictAddressFamilies=AF_INET
RestrictAddressFamilies=AF_INET6
RestrictNamespaces=true
RestrictRealtime=true
StateDirectory=pinnwand
StateDirectoryMode=0700
SystemCallArchitectures=native
SystemCallFilter=@system-service
SystemCallFilter=~@privileged @resources
UMask=0077
User=pinnwand

13 changes: 13 additions & 0 deletions contrib/pinnwand-reaper.timer
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=Clear expired pastes regularly

[Timer]
AccuracySec=43200s
FixedRandomDelay=true
OnCalendar=daily
Persistent=yes
RandomizedDelaySec=24h
Unit=pinnwand-reaper.service

[Install]
WantedBy=timers.target
38 changes: 38 additions & 0 deletions contrib/pinnwand.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[Unit]
After=network.target
Description=Pinnwannd HTTP Server
Documentation=https://pinnwand.readthedocs.io/en/latest/

[Service]
CapabilityBoundingSet=
DevicePolicy=closed
DynamicUser=true
ExecStart=/usr/local/bin/pinnwand --configuration-path /etc/pinnwand.toml http --port 4100
LockPersonality=true
MemoryDenyWriteExecute=true
PrivateDevices=true
PrivateUsers=true
ProcSubset=pid
ProtectClock=true
ProtectControlGroups=true
ProtectHome=true
ProtectHostname=true
ProtectKernelLogs=true
ProtectKernelModules=true
ProtectKernelTunables=true
ProtectProc=invisible
RestrictAddressFamilies=AF_UNIX
RestrictAddressFamilies=AF_INET
RestrictAddressFamilies=AF_INET6
RestrictNamespaces=true
RestrictRealtime=true
StateDirectory=pinnwand
StateDirectoryMode=0700
SystemCallArchitectures=native
SystemCallFilter=@system-service
SystemCallFilter=~@privileged @resources
UMask=0077
User=pinnwand

[Install]
WantedBy=multi-user.target
9 changes: 0 additions & 9 deletions pinnwand.service-example

This file was deleted.