Hardening¶
Security hardening for rninja deployments.
Run as Non-Root¶
# Create user
useradd -r -s /bin/false rninja
# Set permissions
chown -R rninja:rninja /var/lib/rninja-cache
Systemd Hardening¶
[Service]
User=rninja
Group=rninja
# Security restrictions
NoNewPrivileges=true
ProtectSystem=strict
ProtectHome=true
PrivateTmp=true
PrivateDevices=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
RestrictNamespaces=true
RestrictRealtime=true
RestrictSUIDSGID=true
MemoryDenyWriteExecute=true
LockPersonality=true
ReadWritePaths=/var/lib/rninja-cache
Network Restrictions¶
Firewall¶
Listen Address¶
File Permissions¶
Checklist¶
- Run as non-root
- Apply systemd restrictions
- Configure firewall
- Restrict listen address
- Set proper file permissions
- Enable audit logging