How does your application store and protect API keys?
Explanation & Context
Explanation of the Question
This question is asking about the methods and measures your organization uses to store and safeguard API keys within your application. API keys are unique identifiers used to authenticate and authorize requests to an API. They are critical for ensuring that only legitimate users and applications can access API services. Improper storage and protection of API keys can lead to unauthorized access, data breaches, and other security incidents.
Why It Matters
Understanding how API keys are stored and protected is essential because these keys often grant significant access to sensitive data and functionality. If an attacker gains access to an API key, they can potentially perform actions on behalf of the legitimate user or application, leading to data theft, service disruption, or other malicious activities. Therefore, it’s crucial to employ strong security practices to ensure that API keys are stored securely and are not exposed to unauthorized entities.
Example of Evidence
To demonstrate fulfillment of this question, you might provide documentation or configurations showing that API keys are stored in a secure, encrypted vault rather than being hard-coded into the application. For instance, you could show that your organization uses a secrets management service like AWS Secrets Manager, Azure Key Vault, or HashiCorp Vault to store and retrieve API keys. Additionally, you might provide evidence of access controls and logging mechanisms in place to monitor and restrict who can access these keys.
Example Responses
Example Response 1
Our application stores API keys in Heroku's Config Vars, which are encrypted at rest and not exposed in the application code. Access to Heroku's dashboard is restricted to authorized team members via two-factor authentication.
Example Response 2
API keys are stored in AWS Secrets Manager, which provides automatic rotation and encryption using AWS KMS. Access to these secrets is tightly controlled via IAM policies, ensuring only necessary services and personnel can retrieve them.
Example Response 3
As our software is deployed on-premises and does not utilize cloud-based APIs, the storage and protection of API keys is not applicable to our environment. However, we ensure that any sensitive information is stored securely using industry-standard encryption practices.

