← Back to Pull requests

Validate AWS endpoint URIs and apply S3 endpoint restrictions on catalog create and update #6163

Open
unknown opened this pull request with 381 lines diff across 4 files
View on GitHub
unknown unknown commented on Nov 20, 2026 10:13 UTC
Author

Summary

Applies one set of AWS endpoint checks on every catalog create and update, covering the storage configuration endpoint, endpointInternal and stsEndpoint, and the SigV4 connection stsEndpoint. Each value must be an absolute http or https URI with a host, and plain http logs a WARN. A new flag, VALIDATE_AWS_ENDPOINT_URIS, turns the URI checks off.

Why

Issue #6051 and the dev-list discussion (https://lists.apache.org/thread.html/zzwbgp4vod02w44y0fjltf85sv8s319r) show that AWS endpoint settings are checked inconsistently:

  • The URI checks for the SigV4 connection stsEndpoint from #6035 do not cover the storage configuration endpoint, endpointInternal or stsEndpoint.

  • ALLOW_SETTING_S3_ENDPOINTS checks storage endpoints only when an update includes storageConfigInfo. The SigV4 stsEndpoint is checked only on create.
  • Current behavior

  • Storage endpoint values are not parsed on create or update. A malformed value fails late, when credentials are vended or the S3 client is used, and http values are not logged.

  • With ALLOW_SETTING_S3_ENDPOINTS=false, an update that omits storageConfigInfo skips the storage endpoint check, and a SigV4 stsEndpoint is not rechecked on update.
  • Expected behavior

  • A new AwsEndpointCatalogConfigValidator runs on every catalog create and update. It applies ALLOW_SETTING_S3_ENDPOINTS and the URI checks to the full merged catalog.

  • Plain http values log a WARN on every validation.

  • VALIDATE_AWS_ENDPOINT_URIS (default true) skips the URI checks.
  • Behavior changes

  • Updates to existing catalogs with a malformed endpoint are rejected while VALIDATE_AWS_ENDPOINT_URIS is true. Operators can fix the value with an update or set the flag to false.

  • With ALLOW_SETTING_S3_ENDPOINTS=false, updates are rejected for catalogs with S3 endpoint settings or a SigV4 stsEndpoint, even when the update does not change them. Upgrade notes are in the changelog fragment.
  • Changes

  • AwsEndpointCatalogConfigValidator (new), with AwsEndpointCatalogConfigValidatorTest.

  • FeatureConfiguration: new VALIDATE_AWS_ENDPOINT_URIS flag. The ALLOW_SETTING_S3_ENDPOINTS description is updated.

  • PolarisServiceImpl and PolarisServiceImplTest: moved endpoint checks and their tests are removed.
  • Testing

  • ./gradlew format compileAll: passes

  • ./gradlew :polaris-core:check: passes

  • Targeted runtime tests: AwsEndpointCatalogConfigValidatorTest, ManagementServiceTest, PolarisServiceImplTest

  • ./gradlew checkChangelogFragments: passes
  • Checklist


  • 🛡️ Don't disclose security issues! (contact security@apache.org)

  • 🔗 Clearly explained why the changes are needed, or linked related issues: Fixes #6051

  • 🧪 Added/updated tests with good coverage, or manually tested (and explained how)

  • 💡 Added comments for complex logic

  • 🧾 Added a changelog entry in changelog.d/ (if needed, see changelog.d/README.md)

  • 📚 Updated documentation in site/content/in-dev/unreleased (if needed)
  • Diff: 381 lines (+285 / -96) across 4 files Reviewer: dimas-b Review duration: 14694m
    All Vouch review confidence checks passed
    Residual risk 0.23 = Change Risk (0.43) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 381 lines diff across 4 files
    0.43
    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
    Diff Size diff_size
    0.356
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #6163"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    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: 43.0% (MEDIUM) · Higher = larger blast radius
    43.0%
    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: 22.9% · Safe to merge
    22.9%
    Repository