-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
openvpn-auth-oauth2.service
59 lines (53 loc) · 1.61 KB
/
openvpn-auth-oauth2.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
[Unit]
Description=OpenVPN authenticator
Documentation=https://github.com/jkroepke/openvpn-auth-oauth2
Wants=network-online.target openvpn.service
After=network-online.target openvpn.service openvpn@.service openvpn-server@.service
PartOf=openvpn.service openvpn@.service openvpn-server@.service
[Service]
# Run as an unprivileged user with random user id.
DynamicUser=true
User=openvpn-auth-oauth2-dynamic
Group=openvpn-auth-oauth2-dynamic
SupplementaryGroups=openvpn-auth-oauth2
ExecStart=/usr/bin/openvpn-auth-oauth2 --config ${CONFIG_FILE}
NoExecPaths=/
ExecPaths=/usr/bin/openvpn-auth-oauth2
Environment=CONFIG_FILE=/etc/openvpn-auth-oauth2/config.yaml
EnvironmentFile=-/etc/sysconfig/openvpn-auth-oauth2
#LoadCredential=openvpn-auth-oauth2:/etc/openvpn-auth-oauth2/
#ConfigurationDirectory=openvpn-auth-oauth2
#ConfigurationDirectoryMode=0750
ReadWritePaths=-/run/openvpn -/run/openvpn-server
RestartSec=5s
Restart=on-failure
# We don't need write access anywhere.
AmbientCapabilities=
CapabilityBoundingSet=
MemoryDenyWriteExecute=true
NoNewPrivileges=true
LockPersonality=true
PrivateDevices=true
PrivateTmp=true
PrivateUsers=true
ProcSubset=pid
ProtectClock=true
ProtectControlGroups=true
ProtectHome=true
ProtectHostname=true
ProtectKernelLogs=true
ProtectKernelModules=true
ProtectKernelTunables=true
ProtectProc=noaccess
ProtectSystem=strict
RemoveIPC=true
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
RestrictNamespaces=true
RestrictRealtime=true
RestrictSUIDSGID=true
SystemCallArchitectures=native
SystemCallFilter=@system-service
SystemCallFilter=~@privileged @resources
UMask=0027
[Install]
WantedBy=multi-user.target