Security Model¶
This document describes Trustpoint’s security architecture, trust boundaries, authentication mechanisms, and security-relevant design decisions.
Trust Boundaries¶
NGINX forms the external network boundary, terminating TLS and forwarding authenticated requests to Django via HTTP on 127.0.0.1:8000.
flowchart LR
UNTRUSTED["Untrusted network / devices, browsers, API clients"]
subgraph TRUST_BOUNDARY[Trustpoint container]
NGINX["NGINX / :80 HTTP: CMP, CRL only / :443 HTTPS: all other traffic / TLS 1.2/1.3 / optional mTLS"]
GUNICORN["Gunicorn + Django / :8000 HTTP on loopback / trusted proxy headers"]
STATIC["Static files / /collected_static"]
end
DB[("PostgreSQL / 127.0.0.1:5432 / not externally reachable")]
HSM["HSM or PKCS#11 provider / local or network HSM"]
UNTRUSTED -->|HTTP| NGINX
UNTRUSTED -->|HTTPS + optional client cert| NGINX
NGINX -->|Serve| STATIC
NGINX -->|Proxy with SSL headers| GUNICORN
GUNICORN <--> DB
GUNICORN --> HSM
Security Boundaries¶
Boundary |
Role |
Key Controls |
|---|---|---|
NGINX Perimeter |
External network boundary |
TLS 1.2/1.3, strong ciphers, optional mTLS, HTTP only for CMP/CRL |
Trusted Proxy Headers |
Pass client cert metadata |
Headers set by NGINX only, Django trusts via |
PostgreSQL Isolation |
Database access control |
Listens on 127.0.0.1:5432 only, no external exposure |
HSM Access Control |
Cryptographic key protection |
PKCS#11 access restricted, PIN authentication, keys never exported in production |
File System Permissions |
Protect sensitive files |
Django runs as |
Headers passed by NGINX:
SSL-Client-Cert: Client certificate (PEM, URL-encoded)X-SSL-Client-Verify: Verification statusX-SSL-Client-S-DN: Client certificate subject DN
Authentication Mechanisms¶
Web UI Authentication¶
Method: Django session-based authentication
Login:
/users/login/Security: HTTPS-only cookies, CSRF protection, Argon2 password hashing
Session timeout: Configurable
Password requirements: Minimum 8 characters, Django validators
REST API Authentication¶
Method: JWT (JSON Web Tokens) via
djangorestframework-simplejwtToken endpoints:
POST /rest/auth/login/,POST /rest/auth/refresh/Usage:
Authorization: Bearer <access_token>Token lifetime: Access 5min, Refresh 24h (configurable)
Security: Token rotation, blacklist support, audience/issuer validation
EST Protocol Authentication¶
Method |
Use Case |
Details |
|---|---|---|
HTTP Basic Auth |
Operator enrollment |
Username/password against Django user DB |
Client certificate |
Device authentication |
mTLS with IDevID, subject DN extraction |
Endpoints: /.well-known/est/<domain>/
CMP Protocol Authentication¶
Method |
Use Case |
Details |
|---|---|---|
Shared secret (PBMAC1) |
Bootstrap enrollment |
Pre-shared secret, one-time or per-device |
Client certificate |
Renewal/rekeying |
mTLS certificate-based |
Endpoints: /.well-known/cmp/<domain>/
Other Protocols¶
AOKI: Protocol-specific bootstrap credentials
OPC UA GDS Push: Certificate-based with OPC UA security policies
Known Security Limitations¶
Audit trail: Logs not cryptographically signed or tamper-proof
Certificate Transparency: CT log submission not implemented
Multi-tenancy: No tenant isolation (separate instances required)
Key rollover: Manual CA key rotation requires downtime
Rate limiting: No built-in rate limiting (use reverse proxy)
Brute-force protection: No automatic account lockout
Security Best Practices¶
Use hardware HSM in production - SoftHSM for development only
Enable mutual TLS - Authenticate devices with certificates in sensitive environments
Rotate JWT tokens frequently - Keep access token lifetime short
Forward logs to SIEM - Enable centralized security monitoring
Encrypt database backups - Protect sensitive data at rest
Review approval workflows - Ensure proper segregation of duties
Keep software updated - Apply security patches promptly
Use strong passwords - Enforce complexity and rotation policies
Limit admin access - Apply principle of least privilege
Monitor certificate lifecycle - Alert on anomalous issuance or revocation patterns