step-ca.service 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. [Unit]
  2. Description=step-ca service
  3. Documentation=https://smallstep.com/docs/step-ca
  4. Documentation=https://smallstep.com/docs/step-ca/certificate-authority-server-production
  5. After=network-online.target
  6. Wants=network-online.target
  7. StartLimitIntervalSec=30
  8. StartLimitBurst=3
  9. ConditionFileNotEmpty=/etc/step-ca/config/ca.json
  10. ConditionFileNotEmpty=/etc/step-ca/password.txt
  11. [Service]
  12. Type=simple
  13. User=step
  14. Group=step
  15. Environment=STEPPATH=/etc/step-ca
  16. WorkingDirectory=/etc/step-ca
  17. ExecStart=/usr/local/bin/step-ca config/ca.json --password-file password.txt
  18. ExecReload=/bin/kill --signal HUP $MAINPID
  19. Restart=on-failure
  20. RestartSec=5
  21. TimeoutStopSec=30
  22. StartLimitInterval=30
  23. StartLimitBurst=3
  24. ; Process capabilities & privileges
  25. AmbientCapabilities=CAP_NET_BIND_SERVICE
  26. CapabilityBoundingSet=CAP_NET_BIND_SERVICE
  27. SecureBits=keep-caps
  28. NoNewPrivileges=yes
  29. ; Sandboxing
  30. ; This sandboxing works with YubiKey PIV (via pcscd HTTP API), but it is likely
  31. ; too restrictive for PKCS#11 HSMs.
  32. ProtectSystem=full
  33. ProtectHome=true
  34. RestrictNamespaces=true
  35. RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
  36. PrivateTmp=true
  37. ProtectClock=true
  38. ProtectControlGroups=true
  39. ProtectKernelTunables=true
  40. ProtectKernelLogs=true
  41. ProtectKernelModules=true
  42. LockPersonality=true
  43. RestrictSUIDSGID=true
  44. RemoveIPC=true
  45. RestrictRealtime=true
  46. PrivateDevices=true
  47. SystemCallFilter=@system-service
  48. SystemCallArchitectures=native
  49. MemoryDenyWriteExecute=true
  50. ReadWriteDirectories=/etc/step-ca/db
  51. [Install]
  52. WantedBy=multi-user.target