Skip to content

Gitaly token rotation

To disable enforcement of gitaly authentication:

  • Disable enforcement of gitaly authentication by setting default_attributes['omnibus-gitlab']['gitlab_rb']['gitaly']['auth_transitioning'] = true in gprd-base-stor-gitaly
"default_attributes": {
[...]
"omnibus-gitlab": {
"gitlab_rb": {
[...]
"gitaly": {
"auth_transitioning": true,
[...]

Backup and replace the current auth_token

  • Save the current auth_token in case we need to revert.
    • ./bin/gkms-vault-show gitlab-omnibus-secrets gprd | jq -r '.["omnibus-gitlab"].gitlab_rb.gitaly.auth_token' within chef-repo
    • Save it it 1Password and document the name it was saved under.
    • Also backup the whole file locally in case it gets corrupted later during the change ./bin/gkms-vault-show gitlab-omnibus-secrets gprd > gitlab-omnibus-secrets.bak
  • Create a new random token echo "$(pwgen 16 1)-gprdtoken"
  • Update the auth token in the gitlab-omnibus-secrets gprd vault by setting gitaly['auth_token']
  • Update the auth token in the gitlab-omnibus-secrets gprd vault for the application by setting ["omnibus-gitlab"].gitlab_rb.gitlab_rails.gitaly_token
  • and apply that to the fleet
    • knife ssh -C3 roles:gprd-base-stor-gitaly 'sudo chef-client'
    • knife ssh -C3 roles:gprd-base-console-node 'sudo chef-client'
  • Follow instructions provided for our Kubernetes Infrastructure: https://gitlab.com/gitlab-com/gl-infra/k8s-workloads/gitlab-com/-/blob/master/README.md#secret-rotation

Verify that the tokens are updated in all the places and ensure that authentication is working as expected.

Follow the execution steps, but instead of creating a new token via pwgen set the old token in the vault.