Where should a D2C brand store API keys, passwords and other secrets?
Where small D2C teams should keep API keys, database passwords and tokens: secrets managers, encrypted settings, password managers and rotation.
Anadoris Digital · · 4 min read

A typical D2C brand depends on dozens of secrets: Shopify app credentials, payment gateway keys, courier and marketplace API tokens, email and WhatsApp provider keys, database passwords and cloud credentials. In many small teams, these end up scattered across code files, spreadsheets, WhatsApp chats and developers' laptops. Each copy is a potential leak, and nobody can say for certain where they all are.
Putting secrets in the right place is not complicated, and it makes everything else easier: onboarding, offboarding, rotation after an incident and switching vendors. It also means a lost laptop or a departing contractor is an inconvenience rather than an emergency.
Two kinds of secrets, two kinds of storage
It helps to separate secrets used by software from secrets used by people. Applications need to read keys automatically at runtime, so they need a secrets manager or encrypted platform settings. People need to log in to dashboards, so they need a password manager with shared vaults and multi-factor login.
- Application secrets: AWS Secrets Manager, Systems Manager Parameter Store, or your PaaS's encrypted environment variables.
- Human logins: a company password manager such as 1Password, Bitwarden or similar, with shared vaults by team.
- Cloud access for people: single sign-on through IAM Identity Center rather than stored passwords.
- Cloud access for apps: IAM roles, which need no stored secret at all.
Using AWS Secrets Manager and Parameter Store
Secrets Manager stores secrets encrypted, controls access with IAM, logs every read in CloudTrail, and can rotate some secrets automatically, such as database passwords. Parameter Store offers a simpler option for configuration and secrets, with encrypted parameters. Both let apps fetch secrets when they start or when needed, so nothing sensitive sits in code or build files. Check current AWS pricing; costs depend on the number of secrets and requests.
- Name secrets clearly by environment and purpose, such as prod/courier/api-key.
- Keep separate secrets for staging and production, never shared.
- Grant each app's role access only to the secrets it uses.
- Cache secrets in the app briefly rather than fetching on every request, to control cost and latency.
- Turn on automatic rotation where the service supports it.
Places secrets should never be
- Code repositories, including private ones, since access and history are hard to control.
- Front-end code or mobile apps, where anyone can extract them.
- Spreadsheets, documents and notes apps.
- Chat messages, email threads and support tickets.
- Log files and error messages.
- Personal password managers owned by individual staff or contractors.
If secrets are in any of these places today, plan to move them, and rotate each one as you do, since you cannot be sure who has seen the old copy.
Access and rotation
Decide who can read each secret, and keep that list short. Developers may need staging secrets but not production ones. Rotate secrets on a schedule for the most sensitive ones, and always when someone with access leaves, when a vendor changes, or after any suspected leak. Keep an inventory listing each secret, its owner, where it is used and when it was last rotated. That inventory turns an emergency rotation from a day of searching into an hour of work.
Getting secrets to your apps safely
Apps on AWS should read secrets at runtime using their IAM role. Deployment pipelines should pull secrets from the secrets manager or the CI tool's encrypted settings, and never print them in build logs. For local development, use separate development keys with limited permissions, not production secrets copied onto laptops. If a laptop is lost or a contractor's machine is compromised, only low-value test keys are exposed, and nothing needs emergency rotation.
Common mistakes small teams make
The most frequent problem is a single shared login or key used by everyone, which cannot be revoked for one person without breaking things for all. Close behind are production keys copied into staging, keys with far more permissions than needed, such as a full-access payment key used only to read order status, and secrets that nobody can rotate because nobody knows where they are used.
Another common mistake is relying on one developer's personal password manager or laptop. When that person leaves, the brand loses access to its own services. Company-owned vaults, named access and a written inventory prevent this. None of these fixes needs new technology; they need someone to own the list and keep it current, reviewing it during each quarterly access review.
Where to start
Make a list of every secret your business uses, where it lives today and who can see it. Set up a company password manager for human logins and move shared passwords there. Then move application secrets into Secrets Manager or Parameter Store, one app at a time, rotating each secret as it moves. Finally, turn on secret scanning in your code host to catch any that slip back into code.
Related service: AWS & Cloud Management · More on this topic: AWS & Cloud Management articles
