This repository was archived by the owner on Jul 1, 2026. It is now read-only.
fix: stop baking GH_TOKEN into config-svc-be image (PAT leak) - #204
Merged
Conversation
Dockerfile.be wrote the PAT into .npmrc via build-arg and never removed it, baking the credential into a published layer. Switch to BuildKit secret mounts so the token is available only during npm install and is never persisted. Update the be image build steps in both workflows to pass the token via `secrets:` instead of `build-args:`. Signed-off-by: Justus-at-Tazama <jortlepp@contractor.linuxfoundation.org>
Sandy-at-Tazama
approved these changes
Jun 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
packages/config-svc-be/Dockerfile.bereceived the@tazama-lfregistry PAT via abuild-args: GH_TOKEN=...argument, wrote it into.npmrc, and never deleted it. The credential was baked into a published image layer, so anyone pullingtazamaorg/config-svc-becould extract the token. This was the source of one of the leakedghp_tokens flagged on public DockerHub.Fix
Dockerfile.be: add# syntax=docker/dockerfile:1, dropARG GH_TOKEN, and mount the token via BuildKit--mount=type=secret,id=GH_TOKEN,env=GH_TOKENon everynpm install. The.npmrcnow references${GH_TOKEN}from the environment at install time only - nothing is persisted.dockerhub-image-build.yml/dockerhub-image-build-rc.yml: pass the token throughsecrets:instead ofbuild-args:for the be image build.FE images are unaffected - they never needed a token.
Notes