Skip to content

fix(config): harden registry forward auth headers#247

Merged
Agent-Hellboy merged 1 commit into
mainfrom
config/registry_forward_auth_trust
May 23, 2026
Merged

fix(config): harden registry forward auth headers#247
Agent-Hellboy merged 1 commit into
mainfrom
config/registry_forward_auth_trust

Conversation

@Agent-Hellboy
Copy link
Copy Markdown
Owner

Summary

  • disable trusted forwarded headers for the registry Traefik forward-auth middleware
  • add a manifest regression test for both base and HTTP overlay dynamic configs

Root cause

The registry authz endpoint scopes non-admin access from forwarded URI headers, while Traefik was configured to trust client-supplied forwarded headers for the registry forward-auth middleware. A client could spoof an allowed forwarded path while requesting a different registry backend path.

Validation

  • go test ./test/manifest -count=1
  • (cd services/api && go test ./... -count=1)
  • git diff --check
  • pre-commit hooks during commit: gitleaks, go fmt, staticcheck, go vet, generated file drift

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request disables trustForwardHeader for the registry-admin-auth middleware in the Traefik dynamic configuration and adds a regression test to verify this setting. Feedback was provided to improve the test's robustness by replacing an early return with a conditional check, ensuring that future assertions in the test loop are not inadvertently skipped.

Comment thread test/manifest/registry_forward_auth_test.go Outdated
@Agent-Hellboy Agent-Hellboy force-pushed the config/registry_forward_auth_trust branch from d38fdae to 3c3cfaf Compare May 23, 2026 09:44
@Agent-Hellboy Agent-Hellboy merged commit 2dfbaba into main May 23, 2026
15 checks passed
@Agent-Hellboy Agent-Hellboy deleted the config/registry_forward_auth_trust branch May 23, 2026 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant