-
-
Save Zoddo/11aa3d9ef98f25fd4f2d4e90e774c0a9 to your computer and use it in GitHub Desktop.
A systemd file for a python SimpleHTTPServer with some hardening
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based of https://gist.github.com/funzoneq/737cd5316e525c388d51877fb7f542de | |
[Unit] | |
Description=Job that runs the python SimpleHTTPServer daemon | |
Documentation=man:SimpleHTTPServer(1) | |
After=network.target | |
[Service] | |
Type=simple | |
AmbientCapabilities=CAP_NET_BIND_SERVICE | |
WorkingDirectory=/home/deluge/Downloads/ | |
ExecStart=/usr/bin/python -m SimpleHTTPServer 80 | |
# Hardening | |
DynamicUser=true | |
ProtectSystem=strict | |
ProtectHome=tmpfs | |
BindReadOnlyPaths=/home/deluge/Downloads/ | |
PrivateDevices=true | |
CapabilityBoundingSet=CAP_NET_BIND_SERVICE | |
[Install] | |
Alias=http.service | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment