Skip to content

fix(istio): gateway-prodのgroups認可を復旧 - #505

Merged
yu-min3 merged 1 commit into
mainfrom
agent/restore-gateway-prod-groups
Aug 11, 2026
Merged

fix(istio): gateway-prodのgroups認可を復旧#505
yu-min3 merged 1 commit into
mainfrom
agent/restore-gateway-prod-groups

Conversation

@yu-min3

@yu-min3 yu-min3 commented Aug 11, 2026

Copy link
Copy Markdown
Owner

概要

kensan.app.yu-min3.comでoauth2-proxy認証後にGatewayのgroup ALLOWへ進めずAccess deniedになる回帰を修正します。

Before / After

項目 Before After
oauth2-proxy認証 ユーザー認証は200 同左
Keycloak Bearer Gateway後段へ転送しない Authorizationとして転送
gateway-prod groups判定 request.auth.claims[groups]を生成できずdeny platform-admin claimを検証可能
native auth apps CUSTOM対象外 影響なし

根本原因

PR #499でBackstage application tokenを保護するため、共有ext_authz providerのheadersToUpstreamOnAllowからauthorizationを削除しました。しかし同じproviderを使うgateway-prodは、oauth2-proxyが返すKeycloak tokenをRequestAuthenticationで検証し、AuthorizationPolicyのgroups判定に使用しています。

BackstageはPR #503でnative OIDCへ移行しCUSTOM policy対象外になったため、Bearer転送を復旧してもBackstage tokenは上書きされません。Argo CDとGrafanaも同様にCUSTOM対象外です。

検証

  • oauth2-proxyログでkensan hostの認証済みリクエストが200であることを確認
  • kensan Route/Deployment/Serviceが正常であることを確認
  • 適用済みgateway-prod ALLOWがrequest.auth.claims[groups]を要求することを確認
  • git diff --check

壊れうるもの / 戻し方

共有oauth2-proxy対象のhostへKeycloak Bearerが再び渡ります。native auth appsは対象外です。問題時は本PRをrevertします。

@yu-min3
yu-min3 merged commit e5a7358 into main Aug 11, 2026
5 checks passed
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