Repository navigation
Also mask JFrog token in configure-npm.sh and add a regression test for CI secret masking - #2334
Merged
Merged
Conversation
configure-npm.sh writes JFROG_ACCESS_TOKEN verbatim into ~/.npmrc and ~/.yarnrc.yml. It did not mask the value itself, so it relied on jfrog-oidc-token.sh having run first in the same job. Add the same ::add-mask:: call configure-pip.sh uses so the script is self-contained. Co-authored-by: Isaac <no-reply@databricks.com>
The JFrog credential scripts must emit ::add-mask:: for each secret before the value reaches GITHUB_ENV, GITHUB_OUTPUT or an rc file, or the value ends up in public Actions logs (see b4cec4e). Add a hermetic bash test that runs jfrog-oidc-token.sh, configure-npm.sh and configure-pip.sh as steps of one job, with a stubbed curl and fake credentials. A DEBUG/EXIT trap loaded via BASH_ENV checks, before every command, that each secret already in a sink has a matching mask line earlier in the job log. This also catches a mask that is moved after the export. Control scripts confirm the checker flags unmasked, late-masked and unmasked-derived values, and accepts a correct one. Run it on pull requests from a new workflow with contents: read and no secrets. Co-authored-by: Isaac <no-reply@databricks.com>
The workflow was written on release/3.x, which indents .github YAML with four spaces. On main, .github/.prettierrc.yml sets tabWidth 2 and every other workflow follows it. Whitespace only. Co-authored-by: Isaac <no-reply@databricks.com>
Contributor
|
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
Contributor
|
🤖 Integration tests ✅ passed for |
rclarey
marked this pull request as ready for review
November 20, 2026 10:58
abdelrahmanomar1515
approved these changes
Nov 20, 2026
This branch was successfully deployed
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changes
Port of #2315 (
release/3.x) tomain. It is a follow-up to #2291. The three credential scripts are identical onmainandrelease/3.x, so both commits cherry-picked without conflicts.configure-npm.shmasks the token itself. It writesJFROG_ACCESS_TOKENinto~/.npmrcand~/.yarnrc.ymlbut relied onjfrog-oidc-token.shhaving masked it earlier in the same job. It now calls::add-mask::itself, the same wayconfigure-pip.shdoes. Every current caller already runsjfrog-oidc-token.shfirst, so this does not change behavior..github/scripts/tests/secret-masking.sh. It runsjfrog-oidc-token.sh,configure-npm.shandconfigure-pip.shas steps of a simulated job, with a stubbedcurland fake tokens. A DEBUG/EXIT trap checks, before every command, that any secret already written toGITHUB_ENV,GITHUB_OUTPUT,~/.npmrcor~/.yarnrc.ymlhas an::add-mask::line earlier in the job log. Values built from the token, such asPIP_INDEX_URL, are checked as whole values. Control scripts confirm that the checker flags a missing mask, a mask placed after the export, and an unmasked derived value.secret-masking-test.yml. It runs the test on pull requests withcontents: read, no secrets, andpersist-credentials: false.The only difference from #2315 is whitespace: the workflow is indented with two spaces, as
.github/.prettierrc.ymland the other workflows onmainare. The parsed YAML is identical to therelease/3.xfile.Tests
bash .github/scripts/tests/secret-masking.shpasses on this branch.main, that the test fails if the token mask is removed fromjfrog-oidc-token.sh, if that mask is moved after theGITHUB_ENVwrite, or if thePIP_INDEX_URLmask is removed fromconfigure-pip.sh.main.This pull request and its description were written by Isaac.