This document describes Egide's security architecture and threat model.
Egide is designed with defense-in-depth principles:
- Encryption at rest: All data is encrypted before storage (implemented)
- Encryption in transit: TLS terminated at a reverse proxy in front of Egide; server-side TLS is planned, not implemented yet
- Access control: bearer-token authentication with root-only gating for administrative operations (implemented); path-based policies are planned
- Audit logging: planned for 0.2.0, not implemented yet
- Seal/Unseal: Master key protection (implemented)
| Threat | Mitigation |
|---|---|
| Unauthorized access | Authentication + root-only authorization (path-based policies planned) |
| Data theft at rest | AES-256-GCM encryption |
| Data theft in transit | TLS at the reverse proxy (server-side TLS planned) |
| Privilege escalation | Root/non-root separation today; least privilege policies planned |
| Insider threats | Separation of duties on unseal shares; audit logging planned for 0.2.0 |
| Key compromise | Key rotation, versioning |
| Threat | Reason |
|---|---|
| Physical access to server | Requires physical security |
| Compromise of all unseal key holders | Requires organizational security |
| Side-channel attacks | Requires specialized hardware |
| Zero-day in crypto libraries | Requires upstream fixes |
┌─────────────────────┐
│ Master Key │
│ (Shamir protected) │
└──────────┬──────────┘
│
┌────────────────┼────────────────┐
│ │ │
┌────────▼────────┐ ┌─────▼─────┐ ┌───────▼───────┐
│ Data Encryption │ │ Key │ │ Token │
│ Key (DEK) │ │ Encryption│ │ Encryption │
└────────┬────────┘ │ Key (KEK) │ │ Key │
│ └───────────┘ └───────────────┘
│
┌────────▼────────┐
│ Encrypted Data │
│ (secrets, keys) │
└─────────────────┘
The master key is protected using Shamir's Secret Sharing:
- Split: Key divided into N shares
- Threshold: K shares required to reconstruct
- Distribution: Each share given to different custodian
Example (5 shares, 3 threshold):
- Any 3 of 5 key holders can unseal
- Compromise of 2 shares reveals nothing
- No single person can unseal alone
| Purpose | Algorithm |
|---|---|
| Data encryption | AES-256-GCM (the only algorithm Transit implements) |
| Datakey wrapping | AES-256-GCM (under the transit key) |
| Signatures | Planned with the KMS engine (0.3.0): Ed25519, ECDSA, RSA-PSS |
| Key derivation | HKDF-SHA256 |
| Token hashing | Argon2id (root token hash at rest) |
| Random generation | OS CSPRNG |
When sealed:
- Master key not in memory
- All data inaccessible
- Only system endpoints respond (health, status, init, unseal); secrets and transit return
503 - No read/write operations possible
- Administrator provides unseal key share
- Share validated and stored temporarily
- When threshold reached, master key reconstructed
- Master key loaded into memory
- Data becomes accessible
- Master key only in memory when unsealed
- Unseal keys never stored on server
- Memory cleared on seal
Today, authorization is a binary root/non-root distinction: administrative operations (init, seal, transit key management, service token management) require the root token; secrets and transit data operations are open to any authenticated token (root or service token).
Status: planned, not implemented yet. Path-based, least-privilege policies (path patterns, capabilities, explicit deny) do not exist today; see Authentication. The principles below describe the target model:
- Default deny: No access without explicit policy
- Specific paths: Grant access to specific resources only
- Time-limited tokens: Short TTLs for temporary access
- Tokens are cryptographically random
- Service tokens can be revoked immediately (
DELETE /v1/auth/service-tokens/{token_id}) - The service token identifier (
token_id) acts as a non-sensitive reference for listing and revocation without exposing the token - Token TTLs at creation time are planned, not implemented yet
Status: planned for 0.2.0, not implemented yet. Role ID / Secret ID credentials, TTL and use limits, and CIDR binding describe the target design.
Status: planned, not implemented yet. Certificate-based mutual authentication is not available today.
Status: planned for 0.2.0, not implemented yet. An append-only, HMAC-signed audit log recording every request (timestamp, identity, path, method, status, with sensitive data redacted) is on the roadmap. Today,
tracingrequest logs on stderr are the only operational log output; they are not tamper-evident.
Egide does not terminate TLS itself (server-side TLS is planned, not implemented yet); apply these settings at the reverse proxy or load balancer in front of it:
- TLS 1.3 only (or TLS 1.2 minimum)
- Strong cipher suites
- Certificate validation
- HSTS headers
- Deploy in private network
- Use firewall rules
- Limit exposure to trusted networks
- Consider service mesh for internal traffic
For production initialization:
- Prepare: Secure room, multiple witnesses
- Initialize: Generate unseal keys
- Distribute: Give each key to different custodian
- Verify: Test unseal process
- Document: Record process (not keys!)
| Component | Frequency |
|---|---|
| TLS certificates (at the reverse proxy) | 90 days |
| Encryption keys | 90-365 days |
| Unseal keys | Annually or on compromise |
| Access tokens | As short as practical |
On suspected compromise:
- Seal Egide immediately
- Revoke potentially compromised tokens
- Rotate affected keys
- Audit logs for unauthorized access
- Investigate root cause
- Unseal after securing
- Terminate TLS in front of Egide in production
- Rotate keys regularly
- Revoke service tokens that are no longer needed
- Monitor server logs
- Test disaster recovery
- Keep Egide updated
- Run in dev mode in production
- Store unseal keys digitally
- Use root token for normal operations
- Expose Egide to public internet
- Ignore server logs
- Skip key rotation
Release builds, including the published Docker image, refuse dev mode by design: there is no way to run dev mode in production, even by mistake. See the production checklist.
- Compliance: Regulatory compliance
- Production Deployment: Production setup