The Docker registry auth value is the credential that docker login stores in config.json for a container registry. It is not encrypted. It is a base64 encoding of a username and a password or token joined together, so anyone who reads the file can decode it in one command and sign in to the registry as that user. Depending on the registry and the account, they can pull private images, which often contain source code and configuration, and push images that your servers will later run. Rotate the underlying credential first, then check what was pulled or pushed.
Check your GitHub account for leaked secrets — free
- Provider
- Docker
- Severity
- Critical
- Impact
- Source code and build access
- Checked live by LeakWatch
- No
What a Docker Registry Auth looks like
The file is ~/.docker/config.json, or a .dockerconfigjson secret in Kubernetes, with an entry per registry. Each entry has a field named auth whose value is a base64 string:
{ "auths" : { "registry.example.com" : { "auth" : "XXXXXXXX…" } } }
Decoded, that value reads username:secret, where the secret is a password, a personal access token or a registry-issued key. So the value has no prefix of its own, and its length depends on the credential. The registry key can be Docker Hub, GitHub Container Registry, GitLab, Amazon ECR, Google, Azure or a self-hosted one. When Docker uses a credential helper or the system keychain, the file holds no secret, which is the safe setup. A related but different secret is a Docker Hub access token, which has its own guide: the token is often what sits inside the decoded value.
How Docker Registry Auths get leaked
- A committed config file. A
config.jsonor.dockerfolder added to a repository, often through a dotfiles project. - Image layers. A Dockerfile that copies the file into an image to pull private base images, then publishes that image.
- Kubernetes manifests. An image pull secret written as YAML with the encoded value and committed to a deployment repository.
- CI artifacts and logs. A job that logs in, then archives the home folder or prints the file during debugging.
- Shared troubleshooting. The file pasted into an issue or chat when a login or pull fails.
What to do in the first hour
- Decode what it holds. Base64-decode the value locally to learn the username, the registry and what kind of secret it is. Do not paste it into an online decoder.
- Revoke the credential at its source. For Docker Hub, delete the access token or change the password. For another registry, revoke the token or key there (see the link below for the registry that issued it).
- Create a replacement with the least access that works, preferably read-only for pull-only jobs, and add it to your CI secret store.
- Review pushes and pulls. Check the registry’s activity or audit log for the period since the exposure: new tags on images you publish, pushes you did not make, and pulls from unknown addresses.
- Check your images. If the credential could push, compare the digests of recent tags with your build records, and rebuild and republish any image you cannot account for.
- Look inside the images that were exposed. Private images may contain environment variables or files with other secrets, so rotate those as well.
- Clean up. Remove the file and the layer that held it, and switch to a credential helper. See I accidentally pushed an API key to GitHub.
Not sure what else leaked from the same repository? Run a free scan.
Revoke it at Docker
Where to revoke depends on the registry named in the file. For Docker Hub, access tokens are managed from the security settings of your Docker account, after you sign in; delete the token whose name matches, or change the password if a password was used. For any other registry, use that vendor’s own token page. Signing out locally with docker logout only removes the file entry on one machine and does not revoke anything. A person has not confirmed the exact menu wording for this guide, and the interface can change, so look for the section where access tokens are listed, and follow the registry’s documentation.
How LeakWatch detects it
The rule is called Docker Registry Auth (base64). It needs the text auth followed by a quote and a colon, then, later on the same line, a quote and a run of base64 characters in valid groups of four, with optional padding. That is a loose shape: it matches the auth field of a config file, but it does not read the decoded content or the registry name, so some matches are not real credentials, and a value that is split over several lines is missed. The severity is critical. This type is not checked live: LeakWatch does not decode the value or send any request to a registry.
LeakWatch detects this format but does not check it live: it can tell you the key is exposed, not whether it still works. Assume it does until you have revoked it.
FAQ
Is the value in config.json encrypted?
No. It is base64, which is an encoding anyone can reverse. Treat the file as holding a plain username and password.
Does docker logout fix a leaked file?
No. It removes the entry on that machine only. The credential stays valid until you revoke it at the registry that issued it.
How do I avoid storing it?
Use a credential helper or the system keychain, and in CI use short-lived tokens passed through the login command, never a saved file.