Skip to content

Limit token exposure

Hannes Hörl requested to merge hhoerl/no-cred-leaks into main

What does this MR do?

This MR removes the job token, which has previously been stored in different places in the git configuration. git now uses the the token from the environment, via a git credentials helper we set up once.

Why was this MR needed?

To limit unintentional exposure of the job token.

What's the best way to test this MR?

Run a job

  • e.g. with the command 'git config -l'
  • e.g. with the env vars
    • GIT_TRACE=1
    • GIT_CURL_VERBOSE=1
    • GIT_TRANSFER_TRACE=1

and see, that

  • git does not have the job token configured
  • git has a credentials helper configured, which on-demand pulls the token from the environment
  • any other place where the job token leaks into the build output is MASKED (as has been previously)

What are the relevant issue numbers?

Edited by Hannes Hörl

Merge request reports

Loading