-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jf pipenv install
might prevent Github secrets masking
#2718
Comments
Hi @sorekz , Could you please try running the same commands outside GitHub and let us know if the issue still occurs? This could help identify the source of the issue. Thanks |
When running locally it does some masking but not in all places. In the code below the Artifactory url, username and token was adjusted to other values of the same length. Local test on Windows 10 using jf --version # 2.71.0
jf c add --url mydomain1234.jfrog.io --user myuser1 --password kaMjLfnOKuiCYKHOehYnGxF7gP2BOWVaidpdiU7xcEJc8lDipeSbsw5ZqomMzzX0
jf pipenv-config --repo-resolve remote-pypi --global
jf pipc --repo-resolve remote-pypi --global
jf pipenv lock # Same Pipfile as in first comment
jf pipenv install --dev --verbose
Password is masked in the last line
Edit: |
Describe the bug
We run the jfrog cli in our Github workflows to setup a pipenv. There we noticed that the
jf pipenv install
command seems to internally create a shell with a column width of 80. This means that after 80 characters it adds a new line, which is also visible in the console and breaks the secret masking.It's important to note that this special case only occurs when:
See the reproduction steps for more
Current behavior
Gitub fails to mask secrets when additional characters like line breaks are added in the log output
The token
DdJwCpuAVENmcStnCKpKZswcOmYjElVPhGabiTnCfGJKCZhMDBbnZsryixishQFzIycKSdCDnK
is not valid but with the same length as a normal token, to showcase the issue.Reproduction steps
Working workflow given the following setup:
vars.JF_URL
is set (as my url is private I replaced it with "acme.jfrog.io" in the logs)remote-pypi
(name is not relevant for the test)secrets.JF_USER
andsecrets.JF_ACCESS_TOKEN
are setRelavant output in the
jf pipenv install --dev
step:As you can see the lines
contain the secret in plain text because Github fails to mask it as the output contains a line break inbetween.
If we use the token without username it is masked because the line width of 80 is not exceeded.
Expected behavior
Expected behaviour is that the output does not add additional line breaks and therefore does not break the Github secret masking.
This probably also happens in other CICD systems and is dangerous as users assume that their secrets are masked.
JFrog CLI version
2.67.0
Operating system type and version
Windows, Linux
JFrog Artifactory version
No response
JFrog Xray version
No response
The text was updated successfully, but these errors were encountered: