Skip to content

Commit 2921c6e

Browse files
committed
securing .gitconfig
1 parent e3184b1 commit 2921c6e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/services/gotty.service

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,16 @@ Environment="GOPATH=/opt/gotty/"
1414
Environment="GOPATH=/opt/gotty/"
1515
Environment="GCC_EXEC_PREFIX=/usr/lib/gcc/"
1616
Environment="GODEBUG=cgocheck=0"
17+
PermissionsStartOnly=true
1718
ExecStartPre=-+/bin/mkdir /sys/fs/cgroup/systemd
1819
ExecStartPre=-+/bin/mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd
1920
ExecStartPre=-+/bin/chgrp -R cgroupusers /sys/fs/cgroup
2021
ExecStartPre=-+/bin/chmod -R u=rwx,g=rwx /sys/fs/cgroup
2122
ExecStartPre=-+/bin/chmod 4755 /usr/bin/nsenter
23+
ExecStartPre=-+/bin/chmod 644 /opt/gotty/.gitconfig
2224
ExecStart=/usr/local/bin/gotty -w --max-connection 2564 --port 80 --title-format "<fmt><title>{{ .command }}</title><jid>{{ encodePID .pid }}</jid></fmt>"
25+
ExecStartPost=/bin/sleep 1
26+
ExecStartPost=/bin/chmod 400 /opt/gotty/.gitconfig
2327
ExecStop=/usr/bin/pkill gotty
2428
LimitNOFILE=4096
2529
#to be filled by environment variables

0 commit comments

Comments
 (0)