[Unit] Description=CIS490 mTLS bootstrap endpoint (auto-issue client certs to enrolled lab hosts) Documentation=https://maxgit.wg/spectral/CIS490 After=network-online.target Wants=network-online.target [Service] Type=simple # Runs as root because the wg-pki CA private key is root-only. The # service shells out to issue-cis490-client-cert.sh per mint and # never touches anything else under /var/lib. User=root Group=root WorkingDirectory=/opt/cis490 ExecStart=/opt/cis490/.venv/bin/python -m bootstrap \ --listen-host 127.0.0.1 \ --listen-port 8446 \ --issuer-script /opt/wg-pki/scripts/issue-cis490-client-cert-wrapper.sh \ --issued-root /var/lib/wg-pki/issued Restart=on-failure RestartSec=5 # Hardening — narrower than receiver because this binary's only job # is to call openssl + tar via the issuer script, then serve files. NoNewPrivileges=true PrivateTmp=true ProtectSystem=strict # /home/max/.env/wg-pki/scripts/ holds the issuer script the wrapper # exec's. ProtectHome={read-only,tmpfs} both *hide* /home contents # instead of restricting them to read-only — so we leave /home # accessible. ProtectSystem=strict still keeps everything outside # /var/lib/wg-pki write-protected. ProtectHome=no ReadWritePaths=/var/lib/wg-pki ProtectKernelTunables=true ProtectKernelModules=true ProtectControlGroups=true LockPersonality=true RestrictNamespaces=true RestrictRealtime=true SystemCallArchitectures=native [Install] WantedBy=multi-user.target