JWT Signing
Challenge solutions are stored in JWT (JSON Web Tokens) signed with either:- Ed25519 (recommended) - Elliptic curve signatures
- HMAC-SHA512 - Symmetric key signing
Ed25519 (Recommended)
Ed25519 provides fast, secure signatures with small key sizes.Generate Key
Configure Anubis
HMAC-SHA512
Symmetric signing using a shared secret.Random Key (Development Only)
If no key is configured, Anubis generates a random key on startup:- Challenges invalidated on restart
- Multi-instance deployments won’t work
- Users must re-solve challenges after deployment
Key Management
Storage Requirements
Keys must be:- Persistent - Survives container/pod restarts
- Secret - Not committed to version control
- Accessible - Readable by Anubis process
File Permissions
Docker/Kubernetes
Docker Secret
Kubernetes Secret
Key Rotation
- Generate new key
- Deploy Anubis with new key
- Existing JWTs remain valid until expiry
- New challenges use new key
Cookie Security
Anubis sets multiple security flags on cookies.Secure Flag
Requires HTTPS:--cookie-secure=false, SameSite automatically downgrades from None to Lax.
SameSite
Controls cross-site cookie sending:| Value | Behavior | Use Case |
|---|---|---|
None | Sent on all requests (requires Secure) | Embedded/third-party use |
Lax | Sent on top-level navigation | Most sites (recommended) |
Strict | Only sent on same-site requests | High-security apps |
Default | Browser default (usually Lax) | Legacy compatibility |
None (with Secure flag)
Partitioned (CHIPS)
Enable Cookies Having Independent Partitioned State:Cookie Domain
Share cookies across subdomains:- Cookie valid for
*.example.com - Set once, works everywhere
- Cookie valid for request domain only
- Users on
www.example.comandapi.example.comget separate cookies
Cookie Expiration
Cookie Prefix
Customize cookie names:JWT Claims
JWT payload contains:Difficulty in JWT
Include challenge difficulty in token:- Track which difficulty was solved
- Audit challenge settings
- Debug multi-difficulty policies
JWT IP Restriction
Bind JWT to specific IP address:- Breaks mobile users (IP changes)
- Issues with carrier-grade NAT
- Only use if your threat model requires it
Security Best Practices
Key Generation
✅ Do:- Use cryptographically secure random number generator
- Store keys in secrets management (Vault, AWS Secrets Manager)
- Rotate keys periodically
- Use Ed25519 (not HMAC-SHA512)
- Commit keys to version control
- Use the same key across environments
- Share keys between services
- Use predictable/weak keys
Cookie Settings
✅ Do:- Use
--cookie-securein production (HTTPS only) - Set appropriate
--cookie-same-sitefor your use case - Use short expiration times (balance security vs UX)
- Enable
--cookie-partitionedfor third-party contexts
- Disable
--cookie-securein production - Use
SameSite=Nonewithout HTTPS - Set extremely long expiration times
- Ignore browser warnings about cookie flags
Deployment
✅ Do:- Always configure signing keys in production
- Use persistent storage backends (bbolt, valkey, s3api)
- Monitor for “generating random key” warnings
- Test key rotation procedure
- Rely on random key generation
- Use memory storage backend in production
- Forget to mount secrets in containers
- Share signing keys across environments
Validation Errors
Key Validation
Conflicting Configuration
Persistent Storage Warning
When using persistent storage without a configured key:- All active users must re-solve challenges after restart
- Degraded user experience
- Potential spike in challenge traffic
Next Steps
- Storage Backends - Configure persistent storage
- Monitoring - Track security events
- Troubleshooting - Debug key/cookie issues