Skip to content

fix(rbac): use principal impersonation for region/flavor/image access#384

Merged
spjmurray merged 2 commits intomainfrom
impersonation
Mar 12, 2026
Merged

fix(rbac): use principal impersonation for region/flavor/image access#384
spjmurray merged 2 commits intomainfrom
impersonation

Conversation

@spjmurray
Copy link
Contributor

The region service removed its FilterRegions handler-level hack that
manually filtered regions by checking Security.Organizations against the
principal's OrganizationID. It now relies on RBAC-driven filtering when
the request carries an impersonation signal (X-Impersonate header).

Kubernetes holds global region-read permissions as a system account, so
without impersonation the region service would return all regions rather
than only those accessible to the calling user.

Add NewImpersonateContext to the regions, flavors and images proxy
handler methods so that outbound calls to region carry the user's
identity and region's RBAC middleware correctly scopes the results.

Bumps identity and region to pick up the impersonation implementation.

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

@codecov
Copy link

codecov bot commented Mar 11, 2026

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 4.50%. Comparing base (6db543c) to head (ed7dc49).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
pkg/server/handler/handler.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main    #384      +/-   ##
========================================
- Coverage   4.50%   4.50%   -0.01%     
========================================
  Files         59      59              
  Lines       5751    5754       +3     
========================================
  Hits         259     259              
- Misses      5454    5457       +3     
  Partials      38      38              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

spjmurray and others added 2 commits March 12, 2026 15:46
The region service removed its FilterRegions handler-level hack that
manually filtered regions by checking Security.Organizations against the
principal's OrganizationID. It now relies on RBAC-driven filtering when
the request carries an impersonation signal (X-Impersonate header).

Kubernetes holds global region-read permissions as a system account, so
without impersonation the region service would return all regions rather
than only those accessible to the calling user.

Add NewImpersonateContext to the regions, flavors and images proxy
handler methods so that outbound calls to region carry the user's
identity and region's RBAC middleware correctly scopes the results.

Bumps identity and region to pick up the impersonation implementation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@spjmurray spjmurray merged commit 33c53f1 into main Mar 12, 2026
9 checks passed
@spjmurray spjmurray deleted the impersonation branch March 12, 2026 15:55
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