Imagine you are developing an application that uses a third-party API requiring an API key for access. How would you securely store and use this API key?
- Store the API key in plain text within the application's source code.
- Store the API key in a configuration file that is part of the version control system.
- Encrypt the API key and store it in a database with restricted access.
- Utilize environment variables or a secure key management system for storage.
The correct approach to securely store and use an API key is to utilize environment variables or a secure key management system. Storing API keys in plain text or in version-controlled files is insecure and should be avoided. Encrypting and storing in a restricted database could be an option but may not be as secure as using dedicated key management solutions.
Loading...
Related Quiz
- What are the common strategies used for API versioning?
- Compliance with _____ ensures that APIs handling healthcare data meet the necessary privacy and security standards.
- How does compliance with regulations like GDPR or HIPAA affect the design of APIs?
- What does CSRF stand for in the context of API vulnerabilities?
- Which library is commonly used with GraphQL to build a client-side application?