← Back to Pull requests

Honor the configured credential lifetime for GCS service account impersonation #6187

Open
unknown opened this pull request with 219 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 23, 2026 06:03 UTC
Author

Polaris always requests a one hour source token when it impersonates a GCS service account. A realm configured for 900 seconds therefore still sends 3600 seconds to Google IAM.

Use STORAGE_CREDENTIAL_DURATION_SECONDS for the IAM request in both ordinary impersonation and principal attribution through Workload Identity Federation. With the default configuration Polaris still requests one hour. Direct use of ambient credentials skips IAM impersonation. Polaris reports the expiration on the downscoped token returned by the Google SDK.

Related to #408 and the documentation discussion in #6170.

Verification

I reviewed the change twice. First I traced how Polaris selects the source credentials and how it reports the expiration to the client. Then I ran the new tests against both implementations. The original code failed the 900 second impersonation case and the 1800 second federation case. Both pass with this change.

./gradlew format compileAll and ./gradlew :polaris-core:check passed. The GCS test class had 45 passing tests and 3 tests skipped because they require live GCS credentials. I also regenerated the configuration reference and ran the license and changelog checks. The full local ./gradlew check reported failures in other modules. This environment denies access to Docker and local sockets.

Checklist

[x] Reviewed the security reporting guidance.
[x] Explained the behavior and linked the related issue.
[x] Covered the default, configured durations, direct credentials, and the expiration returned to clients.
[x] Reviewed the existing explanation of the impersonation flow.
[x] Added a changelog entry.
[x] Updated the unreleased configuration reference.

Prepared with assistance from OpenAI Codex.

Diff: 219 lines (+164 / -55) across 2 files Reviewer: dimas-b Review duration: 10624m
All Vouch review confidence checks passed
Residual risk 0.32 = Change Risk (0.60) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.60 · 219 lines diff across 2 files
0.60
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
46%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth shallow_review_depth
0.344
Diff Size diff_size
0.323
Sensitive Paths sensitive_paths
0.060
Real PR Conversation Timeline
1 comments
"Review active on #6187"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 46.7% reviewed sensitive_module
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 59.9% (MEDIUM) · Higher = larger blast radius
59.9%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 46.7% · Lower = rushed or shallow review
46.7%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 31.9% · Safe to merge
31.9%
Repository