DivisionCero
Security in Design and Coding

Secure Management of Secrets and Credentials

How to manage secrets without exposing them

API keys, database passwords and access tokens are high-value targets, and one of the most common mistakes (and most sought after by attackers) is leaving them written directly in source code or in configuration files pushed to a repository. The right practice is to use a dedicated secrets manager, such as Vault, AWS Secrets Manager or similar, which delivers credentials to the application at runtime without them being exposed in the code or the version control history. In addition, each secret should have the minimum necessary scope and be rotated periodically, so that if one leaks, the damage is limited in time and in the scope of compromised systems. Automated scanning tools can detect secrets accidentally committed before they reach production.