Security
Encrypted at Rest Is Not the Same as Safe After Boot
Full-disk encryption protects a powered-off system, but runtime security requires separate controls for credentials, short-lived access tokens, and deliberate recovery paths.
- System Security
- Cryptography
- Access Control
- Infrastructure Design
- Threat Modeling
Full-disk encryption protects a system when it is powered off. The moment it boots and unlocks, that protection evaporates. Credentials live in memory, private keys sit in the filesystem, and configuration data is readable by any process running with sufficient privilege. Encryption at rest answers one threat model—someone with physical access to a powered-off drive—but it does not answer the questions that matter once the system is running: Who can read secrets? How long do they remain valid? What happens when someone forgets the unlock passphrase?
The gap between “encrypted on disk” and “safe while running” is where most hardening work actually happens. Conflating the two leads to systems that pass a compliance checkbox but fail in practice.
Start with threat model, not mechanism
Before choosing an encryption scheme or unlock method, define who you are defending against and what you are defending.
If the threat is a stolen laptop, full-disk encryption is appropriate. If the threat is a compromised application or a co-tenant in a shared system reading your secrets at runtime, encryption does nothing—the data must be in memory to be used.
When designing a secure system, separate these concerns:
- Confidentiality at rest: Who can read the drive if it is powered off and removed?
- Confidentiality in transit: Who can intercept data moving between services?
- Confidentiality at runtime: Who can read secrets or private data while the system is running?
- Access control and audit: Which actions require logging? Which require pre-approval?
Each concern has its own control. Encryption handles the first and partially the second. Runtime controls—file permissions, process isolation, ephemeral access tokens, and observability—handle the third and fourth.
Boot-time unlock options and their tradeoffs
How a system decrypts its disk at boot determines how long it stays unattended, whether it can restart automatically, and what happens in recovery scenarios.
Passphrase entry at console: An operator must be present and authenticate manually at boot. This is the highest security boundary but the lowest availability. Unattended restarts fail. If an operator forgets the passphrase, recovery requires a cold start from external media and manual key recovery—a slow, error-prone process.
Hardware security module or TPM: The system stores the unlock key in a hardware-backed store that releases the key only if the firmware and boot chain match a known configuration. This binds the unlock to the integrity of the boot process, catching some classes of tampering. Availability is higher than manual entry, but the recovery path is still expensive if the TPM state becomes unreliable or the configuration drifts.
Unencrypted keyfile stored locally: The system boots, finds an unencrypted keyfile, and uses it to unlock the disk. This enables fully automatic restart but pushes all security onto file permissions and the threat model of the file itself. If an attacker gains filesystem access, the key is readable. This is a tradeoff: you are trading physical-removal security for availability.
Network-based key delivery: At boot, the system requests the unlock key from a secure key server over the network. This requires the network to be available and adds complexity around bootstrap authentication (How does an unbooted system authenticate?) and recovery (What if the key server is unreachable?). It is powerful when the threat model includes insider access or drive replication to a foreign environment.
None of these is universally correct. The choice depends on your blast radius: Is this a developer laptop, a production database server, or a VM in a shared tenancy? The recovery cost, availability target, and threat model drive the decision.
Credential separation and short-lived access
Once the system boots, encryption offers no protection against a process that runs as root or an attacker who compromises a service. The fix is not stronger encryption; it is reducing who can read secrets and for how long.
Never store credentials long-term on disk. Credentials should be obtained at runtime from a secure source: a key server, a secret manager, or a temporary credential issued by an identity provider. The credential lifetime should be as short as practical—minutes or hours, not days.
Separate the credential by role. A web service does not need the same credentials as a database administrator. Use different keys for different components. If one service is compromised, the blast radius is constrained to that service’s scope.
Rotate credentials regularly, not just on compromise. Scheduled rotation means that a leaked credential has a known expiration. This shifts the threat model from “prevent leaks” (usually impossible) to “detect leaks and respond before expiration.”
Store credentials in memory only when in use. Some systems dump secrets to log files, environment variables, or debug output. Use a credential management library or agent that keeps secrets in protected memory and erases them when no longer needed.
Recovery and availability tradeoffs
Security measures introduce complexity that must be paid back during recovery. A system with a 32-character passphrase and a TPM-sealed boot key cannot be recovered from an external USB without planning.
Define your recovery scenarios before you lock down:
- Cold-start recovery: If the system will not boot, how do you restore it? Do you need an external media set? A console connection? A way to break the seal and extract the key manually?
- Credential loss or rotation: If an unlock passphrase is forgotten or a key is revoked, how do you regain access? Is there an out-of-band recovery channel?
- Failover or replication: If this is a production system with a standby, how do credentials move between systems? Are they in sync? Is there a window where the standby is without access?
- Operational visibility: Can you audit who accessed the system, when, and what they did? Encryption at rest tells you nothing about who read a secret at runtime.
Document these scenarios explicitly. Run a recovery drill at least once before the system enters production. A security control that cannot be recovered from is a liability, not an asset.
Pre-deployment hardening checklist
Before shipping a system with encrypted storage or secrets management:
- Threat model is written and includes runtime, at-rest, and in-transit scenarios.
- Unlock mechanism chosen matches the availability and recovery targets.
- All long-lived credentials are eliminated or marked for immediate rotation.
- Credential lifetime is defined and enforced in code.
- File permissions and process isolation are verified to match role separation.
- Recovery procedures exist for each unlock method and have been tested.
- Secrets are not present in logs, environment output, or core dumps.
- Audit logging is enabled for all access to sensitive resources.
- A backup of the unlock mechanism (passphrase, key material, or recovery key) is stored in a separate, secure location.
- Documentation includes the recovery procedure and the names of people who hold each part of the recovery chain.
The boundary remains operational
Encryption at rest is a useful tool for a specific threat: an attacker with unsupervised physical access to a powered-off system. It is not a security model. The real work happens after boot: controlling who runs as root, limiting what credentials are available at any moment, and building observability so you can detect when the controls fail.
When you evaluate a system’s security, ask what happens at runtime, not just what happens when it is shut down. A weakly secured boot process that leads to better credential rotation and logging is often a better choice than a cryptographically strong boot process with no controls on what happens after.