Glossary
Key Rotation is a basic cybersecurity best practice. It involves the routine changing, replacing, or regenerating of a cryptographic key, credential, or secret to secure data, or to encrypt, launch, or use for authentication or secure connections. Just as you would habitually change your locks even when you think you know (or have not lost) a key, key rotation minimizes the risk of using an old, compromised, or even old and too widely distributed key and unknowingly allowing access.
Keys and secrets are abundant within the digital world. From encryption keys that are protecting the data you’ve declared sensitive, to API keys that allow applications to “talk to each other,” to SSH keys that allow access to your servers. Each of these keys could expose your organization, be stolen, brute-forced, or hacked at any time. By rotating keys regularly, organizations can limit the timeframe that an attacker can gain access or cause some kind of liability from using a compromised key. In short, it gives an organization a better security posture, to uniquely authenticate their communications, by decreasing the risk of using a compromised key. It's a proactive way to defend against potential attacks, and to acknowledge unforeseen threat actor behavior that can happen, as any long-lived secret implies risk.
Why is Key Rotation Important for Modern Security?
The significance of routine key rotation cannot be exaggerated, especially in today’s ever-changing, dynamically influenced, significant threats of the Digital Universe:
Limiting the Impact of Compromise: Compromise will happen, and although there is usually one moment in time when a key can be stolen, having a routine key rotation will mitigate the “time” an attacker will have to exploit a compromised key. Less time means less data exfiltrated, less unauthorized/dirty access, and ultimately less liability.
Limiting the Exposure to Brute-force Attacks: For some keys, the longer they remain exposed increases the risk associated with the chance of brute-forcing or realization of some inline breaking of cryptography. Key rotation is an effective way of resetting the clock.
Adhering to Compliance Standards: Many industry regulations and compliance frameworks (e.g., PCI DSS, HIPAA, GDPR, FedRAMP, SOC 2) require some form of periodic key rotation as part of their relevant security control requirements (the level of required rotation is often based on how sensitive the data protected by the keys is).
Avoiding Service Outage or Downtime: While not as common for direct security concerns, unmanaged key expirations (certificate expirations especially) can cause a significant service outage, break various connections, and/or erode trust, all resulting in business disruption. Regular rotation ensures keys are always in a valid state.
Support Least Privilege and Zero Trust: Key rotation is also aligned well with Zero Trust principles, by diminishing the reliance on implicit trust of long-lived credentials. Regular key rotation supports Least Privilege Access (LPA), in that even if someone was authorized, that access is regularly re-validated.
Lower your insider threat risk: Trusting insiders could (even if accidentally) expose keys or (although rare) misapply the keys for malicious purposes. Regular rotation of keys limits the duration of risk, and therefore the value of any inadvertent or malicious exposure.
Securing automated workflows: With the proliferation of Machine Identities in the form of APIs, microservices, and containers, automated key rotation is valuable to ensure ongoing integrity of these machine-to-machine communications without the need for human action.
Key Rotation in Discipline: The Process
While the details of managing rotation may vary depending on the key type, the process remains similar, and normally you will follow these basic steps:
Create a new key: Create a new cryptographically strong key.
Distribute and Provision (if applicable): The new key needs to be securely sent to all the systems, applications, or users, based on the system, that require it. This could mean changing config files, secrets managers, or key vaults.
Update References/Re-Encrypt (for data encryption keys):
It is very simple for application/system-level authentication or communication keys (like API keys or SSH keys). The systems start using the new key immediately.
For data encryption keys, however, any data that has already been encrypted will likely need to be re-encrypted with a new data encryption key. The process becomes quite complex and likely iterative, particularly for large amounts of data. For this reason, you will be using a master key rotation strategy for data encryption keys. Instead of dealing with the complexities of re-encrypting encrypted data with new keys, you will re-wrap the data encryption keys using a new master key.
Transition Period (Optional but Recommended): Generally speaking, there will be a transition period where both the old and the new key(s) are enumerated to avoid causing service disruptions and to allow for any binding to the new key to take place.
Deprecate/Revoke Old Key: The old key then should be deprecated and formally revoked once all systems have re-keyed (migrated) to using the new key, and the old key can no longer be used for its original purpose.
Audit & Logging: The entire rotation process will need to be logged in full detail for auditability and compliance.
Types of Keys and Credentials That May Require Periodic Rotation
Almost any long-lived secret or credential may warrant periodic rotations, including:
API Keys: Keys that applications use to access services.
Database Credentials: Usernames/passwords used to access a database.
SSH Keys: Keys used to securely remote into servers.
Encryption Keys: Keys used to encrypt data at rest or in-motion (such as symmetric keys, or master keys).
Digital Certificates (SSL/TLS): Certificates used for securing websites, authenticating devices, and code signing.
Service Accounts Passwords: Credentials issued for use by non-human accounts.
Cloud Access Keys: Credentials that enable programmatic access to cloud provider's resources.
Container/Workload Credentials: Secrets and tokens used by containers or cloud workloads to authenticate to other services.
Challenges Associated with Key Rotation
Given its benefits, ensuring key rotation happens timely can be extremely complicated:
Complexity and Scale: Modern IT environments have thousands or even millions of keys across heterogeneous computing environments, making any manual process often impractical and fraught with errors.
Application Downtime: Poorly executed key rotation can cause an application to fail to authenticate or decrypt data, leading to service outages.
Dependency Mapping: It can be very difficult to see all of the systems and applications that depend on any particular key in a complex, distributed architecture.
Manual Process: Manual processes tend to take longer, consume inordinate amounts of labor resources, and ultimately expose your organization to human errors or inadvertently forgetting to perform a rotation.
Key Storage and Rotation: Storing and distributing new keys securely during a rotation without exposing the keys.
Orphaned Keys: Old keys that have not been sufficiently disabled or removed can put your organization in a vulnerable position.
How ReShield Can Securely Automate Key Rotation
ReShield's identity security platform is uniquely situated to help address the challenges associated with Key Rotation by embedding it into an overall Machine Identity Management process.
Centralized Key Management: ReShield can provide a single pane of glass in order to discover, inventory, and manage keys and secrets of all kinds, including API Keys, SSH keys, database credentials, and Cloud Access Keys. This adds visibility to assist in identifying all keys that need to be rotated.
Automate the Entire Lifecycle: Once keys and access to key types are mapped to the ReShield platform, ReShield leverages the robust Machine Identity Management capabilities to automate the lifecycle of every key rotation by capturing the ability to create new keys, securely distribute keys, update configurations to connected systems, and consistently and timely revoke keys. The process of automation significantly reduces manual input, human mistakes, and omission in performing rotations.
Integrate Secrets Vaults: ReShield can integrate with a preferred secrets management tool or service, providing the guarantee that the new keys, once generated, are secured and accessed by applications and services prior to and, more importantly, post key rotation.
Rotations By Policy: Organizations can define more specific policies for keys within ReShield, such as defining rotation periods (e.g., once every 90 days or yearly) along with approval and rotation conditions by different key types. All of this can help organizations comply with Least Privilege Access (LPA) and Zero Trust principles.
Comprehensive Log Files: Each time a key is rotated, information is logged in ReShield to detail the events of the rotation processes for key generation, key distribution, and key revocation. These logs can provide an auditable, immutable record for compliance requirements (PCI DSS, HIPAA, GDPR, etc.) as well as forensic analysis in the event of an incident.
Reduced Likelihood of Downtime: ReShield can help minimize risk to applications and connectivity as we align the rotation process while a provisioning process occurs, moving assets to the new key.
ReShield can make the Key Rotation process less of a dangerous and manual task, and help organizations to automate and dictate a policy framework to manage this process to develop a more secure posture, ensure compliance exists with this process, and allow organizations to run with resilience to changing cyber threats.