4
0

step-ca.service 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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/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. ;
  33. ; NOTE: Comment out the rest of this section for troubleshooting.
  34. ProtectSystem=full
  35. ProtectHome=true
  36. RestrictNamespaces=true
  37. RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
  38. PrivateTmp=true
  39. ProtectClock=true
  40. ProtectControlGroups=true
  41. ProtectKernelTunables=true
  42. ProtectKernelLogs=true
  43. ProtectKernelModules=true
  44. LockPersonality=true
  45. RestrictSUIDSGID=true
  46. RemoveIPC=true
  47. RestrictRealtime=true
  48. PrivateDevices=true
  49. SystemCallFilter=@system-service
  50. SystemCallArchitectures=native
  51. MemoryDenyWriteExecute=true
  52. ReadWriteDirectories=/etc/step-ca/db
  53. [Install]
  54. WantedBy=multi-user.target