-
Notifications
You must be signed in to change notification settings - Fork 0
/
shift-tutor.service
88 lines (66 loc) · 2.11 KB
/
shift-tutor.service
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
[Unit]
Description=Filter suboptimal shift combinations
Documentation=https://github.com/gsauthof/shift-tutor
[Service]
User=root
Group=root
Type=notify
EnvironmentFile=-/etc/sysconfig/shift-tutor
ExecStart=/usr/local/bin/shift-tutor --systemd $opts
# Restart the service if it exited cleanly/dirty/because of a signal/timeout
Restart=always
# Sleep X seconds between a Restart= triggered restart
RestartSec=59
# NB: On a SELinux enabled system we are running this service
# unconfined since no domain transition is defined
# for the executable's default label.
# However, below systemd settings sandbox the process.
# no new privileges via exec setuid etc.
NoNewPrivileges=true
# We need access to the input device ...
#PrivateDevices=true
DeviceAllow=char-input rw
DeviceAllow=/dev/uinput rw
PrivateTmp=true
# Mount all system directories read-only except for /dev|/proc|/sys|/tmp
# NOTE: Not available on CentOS 7 - but on e.g. Fedora 29
ProtectSystem=strict
# Make /home|/root|/run/user inaccessible/empty
ProtectHome=true
ProtectClock=true
ProtectHostname=true
ProtectKernelTunables=true
ProtectKernelModules=true
# disallow reading/writing kernel ring buffer
ProtectKernelLogs=true
# disallow modifying control groups
ProtectControlGroups=true
ProtectProc=invisible
# many services need to read _some_thing from /proc/ but this one doesn't
ProcSubset=pid
SystemCallArchitectures=native
SystemCallFilter=@default @basic-io @file-system @io-event @network-io sysinfo ioctl rt_sigaction
SystemCallFilter=~@process
# python calls prctl
SystemCallFilter=prctl
SystemCallFilter=~@ipc
SystemCallFilter=uname
# 'Service runs as root, option does not apply', though
RemoveIPC=true
# assign the empty set
CapabilityBoundingSet=
# overkill, since AF_INET* are blacklisted
IPAddressDeny=any
# AF_UNIX is required for systemd startup notification ...
RestrictAddressFamilies=AF_UNIX
RestrictNamespaces=true
# kind of implied by User=/NoNewPrivileges= setting
RestrictRealtime=true
RestrictSUIDSGID=true
PrivateNetwork=true
MemoryDenyWriteExecute=true
LockPersonality=true
PrivateUsers=true
UMask=0077
[Install]
WantedBy=multi-user.target