Authentication
Use JWT-based authentication with RSA key pairs so only authorized users interact with the platform. Single sign-on via OIDC or SAML 2.0 can be layered on when needed. Actionable steps:- Generate an RSA key pair (example):
- Validate JWTs in your backend with the public key.
- Rotate signing keys every 30-90 days for long-running deployments.
Secrets management
Centralize and encrypt sensitive data such as passwords, API keys, and tokens.- HashiCorp Vault for RBAC, audit logs, and encrypted storage.
- Store a secret:
vault kv put secret/dbpassword value="your-secure-password" - Retrieve secrets via Vault APIs or client libraries.
- Store a secret:
- Docker Swarm secrets for encrypted in-transit and at-rest injection.
- Create and use a secret:
Network security
Run backend services on private overlay networks and expose only NGINX to the internet. Actionable steps:- Create a private overlay network:
- Harden firewall rules to allow only the necessary ports (80/443) and block the rest, for example:
TLS configuration
Encrypt all traffic with TLS 1.2 or higher and plan for seamless certificate rotation.- Enforce strong TLS in NGINX:
- Maintain at least two certificates to rotate without downtime.
Additional security measures
- Rate limiting: protect against abuse or DDoS using NGINX rate limits:
- IP allowlisting: restrict access to sensitive services:
- Log monitoring: collect and monitor logs (e.g., Prometheus alerts, Grafana dashboards, ELK/Loki) to detect suspicious activity.