Repository navigation
S3 client check initial url in backup client - #123114
Conversation
`PocoHTTPClient` for S3 only checks redirect targets against `RemoteHostFilter`, and `BackupIO_S3` never validated the user-supplied endpoint, so `BACKUP ... TO S3(url)` and `RESTORE ... FROM S3(url)` could reach hosts that `s3` and `url` refuse with `UNACCEPTABLE_URL`. Validate the backup URL in `makeS3Client`, the same way `StorageS3Configuration::check` does for the `s3` table function. The test is moved into `test_backup_restore_s3`. ClickHouse/clickhouse-private#69102 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Workflow [PR], commit [bfb0592] Summary: ✅
AI ReviewSummaryThis PR closes a real gap: PR Metadata
Final Verdict
LLVM Coverage ReportMeasured on commit bfb0592.
Changed lines: Changed C/C++ lines covered: 4/4 (100.00%) · Uncovered code |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units7 translation units recompiled, 10 s compile time in total, 7 of them have a recent master baseline. |
Backport #123114 to 26.8: S3 client check initial url in backup client
Backport #123114 to 26.9: S3 client check initial url in backup client
Backport #123114 to 26.7: S3 client check initial url in backup client
Cherry pick #123114 to 26.3: S3 client check initial url in backup client
Backport #123114 to 26.3: S3 client check initial url in backup client
`RemoteHostFilter` only matches the host of a URL, so on a shared path-style endpoint such as `s3.us-west-2.amazonaws.com` it can either allow every bucket in the region or none. After #123114 made `BACKUP`/`RESTORE` to `S3` honor the filter, Cloud instances with `remote_url_allow_hosts` could no longer reach the platform backup bucket, and allowing the whole host would defeat the setting. Add an `s3_bucket` entry of the form `host/bucket` or `host:port/bucket`. S3 URLs are checked through `S3::URI::checkRemoteHostFilter`, which accepts the URL when the parsed endpoint host and bucket are listed, and otherwise falls back to the host check. The bucket comes from the parser, so the entry matches both path-style and virtual-hosted-style URLs. Used by the `s3` table functions and engines, the `S3` database engine, `BACKUP`/`RESTORE` to `S3` and the redirect check in `S3::Client`. Related: #123114 Related: ClickHouse/clickhouse-private#78644 Co-Authored-By: Claude Fable 5.1 <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
S3 client check initial url in backup client
Workflow [PR]
Sync PR [sync-upstream/pr/123114]
Version info
26.10.1.1110-master(included in26.10and later)26.9.8.4,26.8.15.18,26.7.19.5,26.3.40.13