Skip to content

feat(googlecdn): propagate request metadata to googlecdn audit logs

What does this MR do?

Related to #1188

Similar to #1187

This MR propagates new query params in the googlecdn signed redirect url sent from the registry when a blob is requested (but served via googlecdn).

Passing the query params to the signed redirect url allows for the query param key value pairs to be present in the google cdn request auditlogs as explained in https://gitlab.com/groups/gitlab-org/-/epics/8732#gcs

All gcs and googlecdn integration tests were run locally against a dedicated google cloud cdn and gcs bucket

Sample Result

Sample resulting signed url issued at Friday, Friday, February 16, 2024 2:02:11 PM

http://XX.XXX.XX.XX/tmp/TestURLFor_Download3267502983/001/foo/bar?URLPrefix=aHR0cDovLzM1LjI0MS4xMS40My90bXAvVGVzdFVSTEZvcl9Eb3dubG9hZDMyNjc1MDI5ODMvMDAxL2Zvby9iYXI=&Expires=1708093331&KeyName=sahmed-cdn-signing-key&Signature=DFqaW6zCn30jdmD32-j9wWE_7hM=&gitlab-auth-type=pat&gitlab-namespace=gitlab-org&gitlab-project=gitlab-org%2Fcontainer-registry

Following the sample url (Before url expiry)

content

Following the sample url (After url expiry - Friday, Friday, February 16, 2024 2:22:11 PM)

Error: Forbidden
Your client does not have permission to get URL /tmp/TestURLFor_Download1880108205/001/foo/bar from this server.

Author checklist

  • Feature flags
    • Added feature flag:
    • This feature does not require a feature flag
  • I added unit tests or they are not required
  • I added documentation (or it's not required)
  • I followed code review guidelines
  • I followed Go Style guidelines
  • For database changes including schema migrations:
    • Manually run up and down migrations in a postgres.ai production database clone and post a screenshot of the result here.
    • If adding new queries, extract a query plan from postgres.ai and post the link here. If changing existing queries, also extract a query plan for the current version for comparison.
    • Do not include code that depends on the schema migrations in the same commit. Split the MR into two or more.
  • Ensured this change is safe to deploy to individual stages in the same environment (cny -> prod). State-related changes can be troublesome due to having parts of the fleet processing (possibly related) requests in different ways.

Reviewer checklist

  • Ensure the commit and MR tittle are still accurate.
  • If the change contains a breaking change, apply the breaking change label.
  • If the change is considered high risk, apply the label high-risk-change
  • Identify if the change can be rolled back safely. (note: all other reasons for not being able to rollback will be sufficiently captured by major version changes).

If the MR introduces database schema migrations:

  • Ensure the commit and MR tittle start with fix:, feat:, or perf: so that the change appears on the Changelog
If the changes cannot be rolled back follow these steps:
  • If not, apply the label cannot-rollback.
  • Add a section to the MR description that includes the following details:
    • The reasoning behind why a release containing the presented MR can not be rolled back (e.g. schema migrations or changes to the FS structure)
    • Detailed steps to revert/disable a feature introduced by the same change where a migration cannot be rolled back. (note: ideally MRs containing schema migrations should not contain feature changes.)
    • Ensure this MR does not add code that depends on these changes that cannot be rolled back.

Related to #1188

Edited by Suleimi Ahmed

Merge request reports