News for hackers. Stuff that matters.

Ask HN: Best practice for storing API keys securely in a B2B SaaS

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

( 4 comments | on HN )
Re:Ask HN: Best practice for storing API keys securely in a ... by lioeters on Friday February 25, 2022 @04:40PM (#30472692)
API keys are typically stored as environment variables:

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

Re:Ask HN: Best practice for storing API keys securely in a ... by ayi on Friday February 25, 2022 @04:40PM (#30472685)
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.
Re:Ask HN: Best practice for storing API keys securely in a ... by securityquest on Friday February 25, 2022 @05:43PM (#30473278)
Do you store them as plaintext in the backend db?
Re:Ask HN: Best practice for storing API keys securely in a ... by tedyoung on Friday February 25, 2022 @05:47PM (#30473320)
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