Safeguard
Security Guides•

Which files on a developer laptop hold credentials?

A map of the config files where common developer tools keep tokens and keys, which ones are plaintext, and the safer option for each. Check yours today.

Safeguard Security Team
4 min read

Most developer tools keep credentials in a config file in your home directory, and several of those files are plain text. The AWS CLI, Terraform, npm, gcloud and others each have one. Knowing the paths, and the safer storage option for each tool, is the fastest way to shrink what a stolen laptop or a malicious package can read.

Why this list matters

A malicious install script or a compromised editor extension runs with your user rights. It does not need to break anything. It only needs to read files you already own. So the useful question is not "is my laptop locked down" but "what is sitting in plain text in my home directory right now".

The map

ToolWhere the credential landsSafer option
AWS CLIconfig and credentials files, which AWS documents as plaintext filesIAM Identity Center sign in, which caches a token under ~/.aws/sso/cache and renews short term credentials
Dockerconfig.json, base64 encoded if no credential store is foundA credential store helper such as osxkeychain, wincred or pass
TerraformA credentials block in the CLI config file after terraform loginTF_TOKEN_ environment variables or a credentials_helper
GitHub CLISystem credential store by default, plain text file as fallbackKeep the system store working; avoid --insecure-storage
Google Cloud ADC$HOME/.config/gcloud/application_default_credentials.json on Linux and macOSShort lived user credentials for local work, attached service accounts in production
npm.npmrc files, including $HOME/.npmrcRegistry scoped, narrowly permitted tokens

Base64 is an encoding, not encryption. Anyone who can read the Docker file can recover what is in it.

Steps to audit your own machine

  1. List the files above that exist on your machine. A quick ls -la ~ plus a look inside ~/.aws, ~/.docker, ~/.config/gcloud and ~/.npmrc covers most of it.
  2. For each one, ask whether it holds a long lived secret or a short lived one. Short lived is better.
  3. Move long lived secrets into the tool's credential store or helper where one exists.
  4. Delete credentials for accounts you no longer use. Old tokens are the ones nobody remembers to rotate.
  5. Revoke, do not just delete, any token you find that should not have been on disk.

What this does not fix

Moving a token into the OS keychain helps against casual file reads, but code running as you can often ask the keychain too. Short lifetimes and narrow scopes are the stronger control, because a stolen token that expires in hours or can only touch one registry is worth far less.

Related reading: AWS CLI sign in or long lived keys, does gh auth login store your token in plain text, is Docker config.json encrypted and Terraform credential options.

Safeguard scans project dependencies and produces SBOMs, which helps you see which packages could run code on a machine like this. You can try a free scan at gold.safeguard.sh/scan.

Quick check

Is the OS keychain always safer than a file?

Usually, yes, against casual reads and backups. It is not a complete defense, because software running as your user may be able to request items from it. Short lifetimes help more.

Do I need to do this on every laptop?

Yes. Credentials are per machine, and old laptops or spare machines tend to hold the oldest tokens.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.