- Fix Bearer token extraction to validate prefix (PEN-01) - Add TestExtractBearerFromRequest covering PEN-01 edge cases - Fix flaky TestRenewToken timing (2s → 4s lifetime) - Move default config/install paths to /srv/mcias - Add RUNBOOK.md for operational procedures - Update AUDIT.md with penetration test round 4 Security: extractBearerFromRequest now uses case-insensitive prefix validation instead of fixed-offset slicing, rejecting non-Bearer Authorization schemes that were previously accepted. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
52 lines
1.4 KiB
Desktop File
52 lines
1.4 KiB
Desktop File
[Unit]
|
|
Description=MCIAS Authentication Server
|
|
Documentation=man:mciassrv(1)
|
|
After=network.target
|
|
# Require network to be available before starting.
|
|
# Remove if you bind only to loopback.
|
|
|
|
[Service]
|
|
Type=simple
|
|
User=mcias
|
|
Group=mcias
|
|
|
|
# Configuration and secrets.
|
|
# /srv/mcias/env must contain MCIAS_MASTER_PASSPHRASE=<passphrase>
|
|
# See dist/mcias.env.example for the template.
|
|
EnvironmentFile=/srv/mcias/env
|
|
|
|
ExecStart=/usr/local/bin/mciassrv -config /srv/mcias/mcias.toml
|
|
Restart=on-failure
|
|
RestartSec=5
|
|
|
|
# File descriptor limit. mciassrv keeps one fd per open connection plus
|
|
# the SQLite WAL files; 65536 is generous headroom for a personal server.
|
|
LimitNOFILE=65536
|
|
|
|
# Sandboxing. mcias does not need capabilities; it listens on ports > 1024.
|
|
# If you need port 443 or 8443 on a privileged port (< 1024), either:
|
|
# a) use a reverse proxy (recommended), or
|
|
# b) grant CAP_NET_BIND_SERVICE with: AmbientCapabilities=CAP_NET_BIND_SERVICE
|
|
CapabilityBoundingSet=
|
|
|
|
# Filesystem restrictions.
|
|
# mciassrv reads and writes /srv/mcias (config, TLS cert/key, database).
|
|
ProtectSystem=strict
|
|
ProtectHome=true
|
|
PrivateTmp=true
|
|
ReadWritePaths=/srv/mcias
|
|
|
|
# Additional hardening.
|
|
NoNewPrivileges=true
|
|
PrivateDevices=true
|
|
ProtectKernelTunables=true
|
|
ProtectKernelModules=true
|
|
ProtectControlGroups=true
|
|
RestrictNamespaces=true
|
|
RestrictRealtime=true
|
|
LockPersonality=true
|
|
MemoryDenyWriteExecute=true
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|