Hacker News new | ask | show | jobs
Ask HN: Best practice for storing API keys securely in a B2B SaaS
1 points by securityquest 1572 days ago
My company builds B2B software that has integrations with other systems. These usually require an API key or similar.

When connecting to these systems, we need the API key as plain text.

What is the best practice for storing integrations API keys?

Storing it as plain text in our DB, might be risky in case our DB is compromised.

Thanks

2 comments

API keys are typically stored as environment variables:

https://help.openai.com/en/articles/5112595-best-practices-f...

Deploying them as ENV values and reading from env is the best practice as far as I know. But "deploying" part depends on your infrastructure.
Do you store them as plaintext in the backend db?
Often keys are stored in some sort of secure Key Vault. This is part of the infrastructure, e.g., Azure Key Vault. Or something like https://www.vaultproject.io/docs/secrets