Skip to content

Fix capitalization of project name in cosign verification logic

Balasankar 'Balu' C requested to merge fix-cosign-certificate-identity-case into master

What does this MR do?

Fix capitalization of project name in cosign verification logic. Even though the image reference has cng in it, the project path might be in uppercase - CNG. For example, https://gitlab.com/gitlab-org/build/CNG uses uppercase, but https://gitlab.com/gitlab-community/build/cng uses lowercase. However, CI_REGISTRY_IMAGE variable, which we use to create image references, will have only lowercase characters. So, we can't know for sure how the project path was just from the image reference. OIDC verification requires correct case to be used in the certificate identity. So, we attempt to cover the known case which use uppercase. We also provide a variable to help forks of this project to do the same, without having to make code changes.

Related issues

Closes: #631 (closed)

Checklist

See Definition of done.

For anything in this list which will not be completed, please provide a reason in the MR discussion

Required

  • Merge Request Title, and Description are up to date, accurate, and descriptive
  • MR targeting the appropriate branch
  • MR has a green pipeline on GitLab.com
  • When ready for review, MR is labeled "~workflow::ready for review" per the Distribution MR workflow

Expected (please provide an explanation if not completing)

  • Test plan indicating conditions for success has been posted and passes
  • Documentation created/updated
  • Integration tests added to GitLab QA
  • The impact any change in container size has should be evaluated
  • New dependencies are managed with dependencies.io
Edited by Robert Marshall

Merge request reports