Commit Graph

8567 Commits

Author SHA1 Message Date
Chris An 4e624f4d24 perf(gateway): avoid duplicate authz and stack cloning on object reads (#9761)
* perf(gateway): avoid duplicate authz and stack cloning on object reads

* fix(gateway): capture ODM read generation before early policy evaluation

* fix(server): keep exclusive edge dispatch shape via Arc::make_mut
2026-11-29 20:07:57 +08:00
Hauser Zhi 1a2825265e fix(targets): retain queued events after replay read failures (#9765)
* fix(targets): retain queued events after replay read failures

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>
Co-Authored-By: qunjiazhu <qunjiazhu@gmail.com>

* perf(targets): replay built-in queue entries with one read

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>
Co-Authored-By: qunjiazhu <qunjiazhu@gmail.com>

* perf(targets): skip replay scans while queue entries cool down

Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>
Co-Authored-By: qunjiazhu <qunjiazhu@gmail.com>

---------

Co-authored-by: heihutu <heihutu@gmail.com>
Co-authored-by: zhi22915 <qiuzgang@gmail.com>
Co-authored-by: qunjiazhu <qunjiazhu@gmail.com>
2026-11-29 18:12:13 +08:00
Chris An 46592d67e9 fix(s3): prevent snowball extract path errors from downgrading to 500 (#9760) 2026-11-29 18:08:06 +08:00
Chris An f45b2c07e8 fix(server): raise internode HTTP/2 reset limit for cluster peers (#9759)
* fix(server): raise internode HTTP/2 reset limit for cluster peers

* fix(server): make peer IP DNS refresh non-blocking with strict TTL expiry
2026-11-29 18:07:52 +08:00
GatewayJ 0b7988c37d feat: add S3 Vectors service integration (#9476)
* feat(vector): integrate S3 Vectors catalog and APIs

Add scoped Vector resources, managed Lance storage, IAM checks, and
Gateway REST JSON operations with compatibility and recovery tests.

* fix(vector): adapt owned requests and preserve native quota errors

* test(ci): exercise Vector KMS archive consumers

* feat(vector): add maintenance and recovery workflows

* test(multipart): assert typed quota refusal causes

Verify the retained quota cause and its current and limit values alongside the existing refusal-order assertions. Remove the retired authentication compatibility entry after the main rebase.

* fix(vector): move maintenance dispatch guard ownership

Retain the namespace guard in the returned maintenance owner. Synchronize Gateway dependencies for corpus recording and format the existing audit test in its external module.

* feat(vector): add shared pagination sessions

* fix(vector): bound managed request and catalog futures

* test(vector): adapt managed fixtures to Gateway request envelopes

* test(vector): verify maintenance across uniform deployments

* test: simplify SSE-C counting and Catalog fixture ownership

* fix(test): propagate owned device validation errors

* fix(auth): bound early authorization futures

* feat(vector): complete resource pagination and bucket retirement

* fix(vector): harden bucket lifecycle, retirement, authz, and layering

Preserve continuous bucket incarnation fencing across Vector bucket Catalog parent initialization, map deleted-bucket races during DeleteVectorBucket to NotFoundException, and re-evaluate IAM, resource policies, and ABAC bucket tags inside the storage bucket lock across all five Vector bucket mutations.

Scale used-bucket Catalog retirement proof, plan, and execution linearly across multi-resource multi-page histories, sweep uncommitted pre-authority page artifacts before rewriting authority records, enforce manifest completeness and immutable delete-intent source-copy identity, and allow same-name recreation over v4 deleted Vector tombstones.

Make ListVectorBuckets and ListIndexes resilient to concurrent deletions with single-pass bucket authorization and bounded sparse-prefix scan budgets, preserve literal plus characters when decoding UntagResource tagKeys query parameters to match Gateway SigV4 canonicalization, and normalize operation-scoped Kms*Exception codes across all 21 S3 Vectors APIs.

Extract ManagedLanceObjects into app::vector_usecase::managed_objects, inject background node admission into Vector maintenance startup to eliminate the app-composition cycle, and widen scripts/check_layer_dependencies.sh to detect inline reverse-layer crate paths while recording the 12 pre-existing non-Vector inline edges from main in scripts/layer-dependency-baseline.txt (backlog#1834) with zero Vector exemptions.

* chore(vector): remove Batch 1 dead code and test debug residue

* chore(vector): remove Batch 2 dead test code and gate test-only APIs

* refactor(vector,iam): simplify dead branches and pass-through wrappers

* fix(object,test): bound PutObject futures and cover reconciled routes

* feat(vector,object,connect): activate S3 Vectors and fix CI regressions

* test(object,vector): fix copy future size check and vector dispatch test
2026-11-29 18:07:23 +08:00
Zhi Zhi 5a331bacae perf(ecstore): trace object write and delete spans (#9771)
Set explicit trace level on 60 object write, delete, and multipart span call sites across the facade, store, set, disk, and Swift protocol layers. Lifecycle and admin spans keep their existing INFO level.

This avoids recording bucket and object span fields on hot paths at the default INFO log level while leaving error events and lifecycle observability unchanged.
2026-11-29 18:06:23 +08:00
Ramakrishna Chilaka 5a778cbe72 fix(ecstore,s3): restore GET metadata early-stop and inline body reuse on prepared readers (#9767)
Route single-pool Store::prepare_get_object_reader calls through SetDisks::prepare_get_object_reader_metadata with the request range and MetadataReadPurpose::GetObjectReader, and keep conditional read context active during DefaultObjectUsecase reader preparation. This restores QuorumSelected metadata cache hits, verified_inline_body reuse, and metadata early-stop regressed by #9680 while preserving pre-unwrap SSE-KMS authorization.
2026-11-29 18:05:58 +08:00
Hauser Zhi 88a99339c6 chore(deps): update flake.lock (#9762) 2026-11-29 15:13:19 +08:00
唐小鸭 fc3a216725 fix(ecstore,sse): close m-compatible interop gaps and rename feature (#9684)
* fix(ecstore,sse): close rio-v2 interop gaps on imported drive sets

A rio-v2 build that takes over a drive set written in the compatible format could not start once a KMS was configured, and several object reads and writes disagreed with what the other server stores or expects.

- Startup: the IAM migration now opens KMS-sealed IAM records. The record path is part of the key context, so the migration callback receives it, and the context text is escaped the way it was sealed.
- GET of a single-part encrypted object: whether an object holds one cipher stream per part is read from the marker the object records, not guessed from the ETag length. A sealed ETag is longer than an MD5 and sent these objects down the per-part path, which failed authentication.
- ETag: a sealed ETag is opened for GET and HEAD responses.
- HEAD: the public SSE headers are derived from the stored sealing metadata, and the KMS key id is answered in ARN form on GET and HEAD.
- Content length: an object sealed under an object key records no plaintext size when it is a single-part upload; the size is derived from the stored size of its parts.
- Compression: the compression and actual-size keys are also written in the casing the other server looks up.
- User metadata is stored under the x-amz-meta- prefix so it comes back as user metadata on both sides. Keys starting with "internal-" keep their bare form, because the prefixed form falls into a namespace reads hide.
- Replication: the metadata comparison skips the prefixed user metadata, which the target's HEAD answers without the prefix and which therefore never compared equal.
- ListObjectVersions and the metadata listing extension report the plaintext size of encrypted and compressed versions. This is the only intended behaviour change in a default build.

Three differences stay as they are: the other server cannot read SSE-S3 objects this build writes, listings do not open sealed ETags, and an SSE-KMS write is refused when only a static master key is configured.

Each fix has a regression test that fails without it.

* build: rename cargo feature rio-v2 to m-compatible

The feature selects the stored layout a build reads and writes, not a version of the stream crate, so it is named after that. The rename covers the feature key in every crate that forwards it, all cfg attributes, the CI job ids, names and artifacts, the CI gate and its tests, the validation scripts, the compat compose build argument, the debug launch configuration and the documentation.

The crate rustfs-rio-v2, its path and module name, the tests named after that reader implementation, and the backend_name() strings are unchanged. There is no alias: a build that passed --features rio-v2 must pass --features m-compatible.

No behaviour change in either build.

* refactor(ecstore,sse): select the build variant at one point per module

The m-compatible feature was tested at about 220 places, most of them inside function bodies. Each area that differs between the two builds now has a pair of modules exporting the same functions, and one place that picks between them, so call sites no longer name the build.

- ecstore: io_support/rio.rs selects rio/{native,m_compatible}.rs for the stream readers and writers, the compression scheme and index encoding, and the write-side encryptors. object_api/readers.rs selects readers/{native,m_compatible}.rs for range plans, the multipart layout, plaintext sizes that are not recorded, empty parts and the decompressed stream.
- sse: the sealed-ETag branch moves out of core/read.rs into core/keying/, where this crate keeps its build-specific code, and decrypt_kms_sealed_config is exported in both builds.
- utils: the four checks in metadata_compat.rs become one predicate.
- Tests that exist in only one build move to tests/native.rs and tests/m_compatible.rs child modules, gated once where they are declared. The set of test names is unchanged apart from one rename.

The attribute now appears 95 times; in ecstore it is left on the two selection points and on tests. crates/ecstore/AGENTS.md records the convention.

scripts/error-other-format-baseline.txt changes because that ratchet counts per file: 11 existing call sites moved from object_api/readers.rs (19 to 8) into the new readers/m_compatible.rs (11). The total stays at 564.

No behaviour change in either build. docs/architecture/minio-file-format-compat.md gains a table of where the variant lives and a corrected statement of what a default build can read.

* fix(s3): compare read preconditions with the answered ETag

A HEAD or GET of an object whose stored ETag is sealed answers with the ETag clients were shown for it, but If-Match and If-None-Match were still compared with the stored form. A client sending back the ETag HEAD answered with got 412 for If-Match and no 304 for If-None-Match.

- HEAD and GET compare the ETag conditions with the ETag the response carries, and a 304 carries that ETag.
- The storage layer ends a conditional read on the stored ETag before a body is opened, and cannot await the answered one. For a stored ETag in sealed form it no longer ends the read on an ETag condition and leaves the decision to the request layer. Without this a matching If-Match ended the read with no body to answer with.
- A default build stores no sealed ETag: the form test is constant false there and its behaviour is unchanged.

Tests: a round trip on a real store takes the ETag from HEAD and sends it back to GET and HEAD as If-Match and If-None-Match, and sends the stored form to show it matches nothing; unit tests cover the precondition helper, the storage-layer decision and the form test in both builds. With either half of the fix switched off the round trip fails.

* fix(s3): compare copy-source conditions with the answered ETag

x-amz-copy-source-if-match and x-amz-copy-source-if-none-match on CopyObject and UploadPartCopy were compared with the stored ETag of the source. For a source whose stored ETag is sealed that is not the ETag a read answers with, so the ETag from HEAD was refused with 412.

Both compare the ETag a read of the source answers with, as GET and HEAD do since the previous commit. It is resolved after the source's key authorization and only when the request names an ETag. A default build stores no sealed ETag and is unchanged.

Tests: on a real store, a customer-key source with a sealed stored ETag is copied with the ETag from HEAD as copy-source-if-match through both operations; the stored form as if-match and the answered ETag as if-none-match are refused. The fixture is shared with the read round trip. With either call site switched back the test fails.

* fix(s3): answer a date-conditioned GET 304 with the answered ETag

A GET that carried only If-Modified-Since resolved no answered ETag, because the lookup was limited to requests naming an ETag, and its 304 fell back to the stored ETag. For an object whose stored ETag is sealed the 304 then carried a different validator than HEAD answers with.

GET resolves the answered ETag for every conditional request, so a 304 carries it whichever condition produced it. HEAD already did. An unconditional GET still skips the lookup, and a default build stores no sealed ETag and is unchanged.

Tests: the sealed-ETag round trip takes Last-Modified from HEAD, sends it back as If-Modified-Since to GET and HEAD, and requires the 304 of both to carry the ETag HEAD answered with. With the lookup limited to ETag conditions again, the GET half fails.

---------

Co-authored-by: overtrue <anzhengchao@gmail.com>
2026-11-29 11:50:24 +08:00
Chris An b23f69402d fix(gateway): restore object retention and metadata listing admission (#9758) 2026-11-29 11:22:05 +08:00
唐小鸭 6bd7d2f0a4 test(ecstore): wait for io_uring owner release in memory tests (#9757)
The io_uring driver thread counts a read out of `in_flight` before it
drops the completed entry, and that entry's owner still holds a clone of
the read's memory reservation. Two background-memory tests waited only
for `in_flight == 0` and then asserted the exact budget figure, so a
driver thread preempted between the decrement and the drop left one
chunk's reservation visible. A merge-queue run failed that way with
13311 instead of 8192: 5119 is one 4096-byte O_DIRECT chunk at offset 17
with 512-byte alignment.

Wait for the budget itself to settle (bounded) before each exact
assertion, including after the last slice of a single-operation read is
dropped, where the owner shares the returned allocation's receipt. The
exact assertions are unchanged.
2026-11-29 11:04:26 +08:00
RustFS af6020607b ci: stop Actions cache thrashing, fix orphan keys, and trim paid runner waste (#9740)
* ci: stop Actions cache thrashing, fix orphan keys, and trim paid runner waste

Consolidate sm-standard-4 and ubuntu-latest shared Rust caches, fix six orphan cache-shared-key references and rust-cache env-hash mismatches, archive e2e_test once in dual-stack-nightly, move prebuilt fuzz and nixl-check lanes to ubuntu-latest (guarding fuzz metadata probe with RUSTUP_AUTO_INSTALL=0), and deduplicate artifact-only manual packaging runs.

Refs: https://github.com/rustfs/backlog/issues/3379

* test(ci): merge step-level env in nightly e2e workflow provenance test

Align BinaryProvenanceTests.test_nightly_workflow_builds_and_runs_matching_features with GitHub Actions env precedence (workflow -> job -> step) while keeping RUSTFS_E2E_LOG_DIR pointed at the gitignored fixture target dir, and assert RUSTFS_BUILD_FEATURES stays out of job-level env so Swatinem/rust-cache keys match cache-warm.yml.
2026-11-29 11:04:18 +08:00
Chris An b26ec5c9c3 fix(s3,kms): pre-auth KMS decrypt, widen SigV4 hoist, strict types (#9680)
* fix(s3,kms): pre-auth KMS decrypt, widen SigV4 hoist, strict types

Pre-authorize SSE-KMS object reads before DEK unwrapping across all S3
GetObject and CopyObject read paths, widen SigV4 query hoisting to cover
allowlisted S3 request properties with matching authorization and header
fallbacks, and reject unknown fields on the remaining KMS key-metadata
request types.

- Authorize `kms:Decrypt` on prepared metadata snapshots before entering
  `into_reader()` / `into_reader_for_copy()` across GetObject (cache
  disabled, cache enabled, cold-fill producer, bypass fallback, and
  mid-stream resume) and CopyObject, normalizing mixed-case encryption
  metadata and resolving default KMS key IDs in `rustfs_sse`.
- Widen `hoist_signed_query_params` for SigV4 requests to an explicit
  allowlist of S3 request properties (`x-amz-object-lock-*`, `x-amz-acl`,
  `x-amz-grant-*`, `x-amz-tagging*`, `x-amz-storage-class`,
  `x-amz-website-redirect-location`, `x-amz-copy-source*`,
  `x-amz-metadata-directive`, `x-amz-checksum-*`,
  `x-amz-snowball-auto-extract`, managed SSE headers) while preserving
  SigV2 non-widening, unsigned-header rejection, payload-hash handling,
  and Object Lock / tagging authorization and handler validation.
- Add `#[serde(deny_unknown_fields)]` to `UpdateKeyDescriptionRequest`,
  `TagKeyRequest`, and `UntagKeyRequest` in `rustfs-kms`.

Refs: rustfs/backlog#2702, rustfs/backlog#3143, rustfs/backlog#1641

* fix(s3): preserve signed copy conditions and POST upload semantics

* fix(ci): stop sending deprecated policy field in s3-tests add-user

rustfs/rustfs#9677 hardened /rustfs/admin/v3/add-user to fail closed when a non-empty deprecated policy field is provided. scripts/s3-tests/run.sh was still passing policy=readwrite in the add-user body even though it immediately calls set-user-or-group-policy right after, and awscurl returned exit 0 on XML <Error> responses so provisioning silently failed and broke all alt-user s3-tests.

Remove the deprecated policy field from the add-user payload, check awscurl responses for XML <Error> elements in provisioning, and add a regression unit test in scripts/s3-tests/test_runner_tools.py.

Refs: rustfs/backlog#1246

* fix(ci): fail S3 user provisioning on HTTP errors without logging responses

* fix(iceberg): reject repeated warehouses before validating bucket names

* test(ecstore): wait for relaxed writes on the foreground lane

* test(quota): isolate concurrent real-disk probes in CI

* test(ecstore): scope upload lock identity helper to its Linux test

* ci: allow cold builds to finish all fuzz binaries

* test(s3): exercise the streaming reader callback on resume
2026-11-29 11:03:57 +08:00
Ramakrishna Chilaka 58147f3c29 perf(obs): borrow static metric names and subsystem labels (#9750)
* perf(obs): borrow static metric names and subsystem labels

* fix(obs): keep public MetricName/MetricSubsystem as_str String return types
2026-11-29 10:46:43 +08:00
Ramakrishna Chilaka 451926414a perf(madmin): avoid redundant key and map clones in metrics merges (#9749)
* perf(madmin): avoid redundant key and map clones in metrics merges

* fix(madmin): retain sort on existing source vectors when merging empty peer lists
2026-11-29 10:46:30 +08:00
Ramakrishna Chilaka d3569f6360 perf(s3select-query): short-circuit projection aliasing and UDF lookups (#9756) 2026-11-29 10:45:58 +08:00
Ramakrishna Chilaka eea2be63a3 perf(log-analyzer): avoid per-event String allocs in rule eval and observe (#9754) 2026-11-29 10:45:39 +08:00
Ramakrishna Chilaka 551bfab922 perf(keystone): avoid redundant KeystoneToken clones and tenant prefix allocs (#9753) 2026-11-29 10:45:21 +08:00
Ramakrishna Chilaka 798391899c perf(s3-client): stream composite checksums and borrow error bodies (#9752) 2026-11-29 10:45:10 +08:00
Ramakrishna Chilaka 1e1e9ddbf7 perf(config): avoid redundant map lookups and key clones in ServerConfig (#9751) 2026-11-29 10:45:00 +08:00
Ramakrishna Chilaka e1d00ef393 perf(kms): decrypt ciphers in place and fast-path single-entry context AAD (#9748) 2026-11-29 10:44:22 +08:00
Ramakrishna Chilaka 2b8e2264de perf(targets): avoid temporary Vec and String allocs in ARN, net, and store keys (#9747)
* perf(targets): avoid temporary Vec and String allocs in ARN, net, and store keys

* fix(targets): reject lone-dot hosts while preserving trailing-dot FQDNs
2026-11-29 10:44:08 +08:00
Ramakrishna Chilaka 6e1816700e perf(audit): share EntityTarget across fan-out targets and avoid target id allocs (#9746) 2026-11-29 10:43:49 +08:00
Ramakrishna Chilaka e0f6e223e1 perf(scanner-metrics): reuse latency ring buffer and avoid eviction key clones (#9745)
* perf(scanner-metrics): reuse latency ring buffer and avoid eviction key clones

* fix(scanner-metrics): restore 60-slot ring length when totals was drained
2026-11-29 10:43:36 +08:00
Ramakrishna Chilaka f6d372ccb1 perf(object-capacity): avoid redundant disk lookups and timeout recalculations (#9744) 2026-11-29 10:43:22 +08:00
Ramakrishna Chilaka 849f56a4a9 perf(trusted-proxies): borrow forwarding headers and avoid redundant IP parsing (#9743) 2026-11-29 10:43:09 +08:00
RustFS 093533295e perf(build): parallelize release codegen for top-level rustfs crate (#9742)
Set [profile.release.package.rustfs] codegen-units = 16 while preserving codegen-units = 1 and lto = "thin" across all storage, erasure-coding, crypto, and I/O workspace crates so forced rustfs/build.rs rebuilds in release/nightly workflows parallelize LLVM codegen across multi-core runners.

Refs: https://github.com/rustfs/backlog/issues/3379
2026-11-29 10:42:55 +08:00
Ramakrishna Chilaka c249183ae2 perf(data-usage): avoid redundant entry clones and key allocs in usage cache (#9741) 2026-11-29 10:42:41 +08:00
Ramakrishna Chilaka 1490c0c57b perf(common): fast-path MRF coalescer hits and reuse Arc keys on release (#9739) 2026-11-29 10:42:30 +08:00
Ramakrishna Chilaka 72baa7973f perf(credentials): fast-path service account checks and Masked formatting (#9738) 2026-11-29 10:42:16 +08:00
Ramakrishna Chilaka ac922fb514 perf(notify): fast-path empty subscriber checks and zero-alloc glob matching (#9737) 2026-11-29 10:42:03 +08:00
Ramakrishna Chilaka 1469af9f2a perf(io-metrics): cache S3 operation counter handles and borrow static labels (#9736) 2026-11-29 10:41:49 +08:00
Ramakrishna Chilaka 2576307d01 perf(lifecycle): filter rules by reference and deduplicate tag and lock checks (#9735) 2026-11-29 10:41:36 +08:00
Ramakrishna Chilaka 5236d31055 perf(replication): avoid rule clones and repeated tag decoding in rule evaluation (#9734)
* perf(replication): avoid rule clones and repeated tag decoding in rule evaluation

* fix(replication): pass compare_actionable_rules directly to sort_by
2026-11-29 10:41:24 +08:00
Ramakrishna Chilaka 7110cf1d88 perf(s3-types): avoid single-frame copy in store_all_limited and pre-size error XML (#9732) 2026-11-29 10:41:10 +08:00
Ramakrishna Chilaka c5796f2c05 perf(checksums): encode base64 header values on stack without String allocation (#9731) 2026-11-29 10:40:57 +08:00
Ramakrishna Chilaka 82e595aad6 perf(policy): defer variable resolver cloning and fast-path static resource matching (#9726) 2026-11-29 10:40:09 +08:00
Ramakrishna Chilaka 2de04eeaf9 perf(filemeta): avoid redundant clones and reallocations in metacache (#9725)
* perf(filemeta): avoid redundant clones and reallocations in metacache

* fix(filemeta): avoid Copy derive on MetaCacheHealCandidateKind
2026-11-29 10:39:55 +08:00
Ramakrishna Chilaka 93eca3e79d perf(io-core): make progress and backpressure state checks lock-free (#9724) 2026-11-29 10:39:40 +08:00
Ramakrishna Chilaka 8a5fd2c260 perf(utils): avoid string allocations in header classifiers and path helpers (#9723) 2026-11-29 10:39:20 +08:00
RustFS d620ecfa5f fix(ecstore): enforce WORM delete and sync peer rebalance completion (#9710)
* fix(ecstore): enforce WORM lock before rebalance delete skip

Evaluate read-only Object Lock deletion admission on rebalancing and suspended pools before writer pool-lookup skipping or batch rebalance source-pool skipping so WORM-protected versions deterministically fail with PrefixAccessDenied (HTTP 403 AccessDenied) instead of SlowDown (HTTP 503), VersionNotFound (HTTP 204), or false batch Deleted entries.

Fixes rustfs/backlog#3383

* fix(ecstore): propagate terminal rebalance reload to peer nodes

Broadcast notification_sys.load_rebalance_meta_failures(false) after autonomous pool rebalance workers persist Completed or Failed terminal state, and merge same-run metadata reloads monotonically so peer nodes clear is_pool_rebalancing without clobbering active pool progress.
2026-11-29 10:38:49 +08:00
Chris An 9170a88dc8 fix(gateway): preserve Object Lock offset, enforce metadata listing SSE/metrics, and synthesize Host in early authorizer (#9705)
* fix(gateway): align Object Lock offset, metadata listing SSE/metrics, and H2/H3 Host authz

Signed-off-by: Chris An <anzhengchao@gmail.com>

* fix(gateway): align Object Lock offset, metadata listing SSE/metrics, and H2/H3 Host authz

Signed-off-by: Chris An <anzhengchao@gmail.com>

* fix(gateway): align Object Lock offset, metadata listing SSE/metrics, and H2/H3 Host authz

Signed-off-by: Chris An <anzhengchao@gmail.com>

* fix(gateway): align Object Lock offset, metadata listing SSE/metrics, and H2/H3 Host authz

Signed-off-by: Chris An <anzhengchao@gmail.com>

* fix(gateway): align Object Lock offset, metadata listing SSE/metrics, and H2/H3 Host authz

Signed-off-by: Chris An <anzhengchao@gmail.com>

* fix(gateway): align Object Lock offset, metadata listing SSE/metrics, and H2/H3 Host authz

Signed-off-by: Chris An <anzhengchao@gmail.com>

---------

Signed-off-by: Chris An <anzhengchao@gmail.com>
Co-authored-by: Hauser Zhi <housemecn@gmail.com>
2026-11-29 10:38:28 +08:00
Chris An 5a0bdfcf1c fix(security): harden RPC, proxies, egress DNS, and OIDC (#9682)
* fix(security): harden RPC, proxies, egress DNS, and OIDC

Harden internode RPC authentication/quotas, trusted-proxy allowlisting,
protocol IAM policy conditions, outbound DNS egress pinning, and OIDC
redirect and HTTPS enforcement:

- Trusted proxies: replace broad private/link-local peer trust in simple
  mode with the configured trusted-proxy allowlist (defaulting to
  loopback-only) and update proxy integration coverage.
- Protocol gateways & FTPS: populate standard IAM condition keys
  (SourceIp, SecureTransport, CurrentTime, EpochTime, UserAgent,
  Referer, principal metadata) in gateway authorization and replace the
  unchecked FTPS fallback IP parse with explicit connection context.
- Bucket listing RPC: fail closed with entry index diagnostics instead
  of silently dropping malformed BucketInfo entries on encode/decode.
- Internode RPC streams & replay cache: add framed HMAC-SHA256 response
  authentication with sequence/digest/EOF verification and
  post-verification endpoint pinning for read_file_stream and walk_dir,
  plus canonicalized per-peer entry and memory-budget replay cache
  isolation.
- Outbound DNS egress: unify storage/tier, remote S3 replication
  targets, on-demand migration HTTP, Azure Blob, GCS, Keystone, and OIDC
  outbound checks onto OutboundPolicy and connection-time
  OutboundDnsResolver (with redirect blocking on Keystone) to stop DNS
  rebinding to loopback/link-local/metadata targets.
- OIDC redirects & transport security: trust forwarded scheme/host only
  from verified trusted proxies, never reflect untrusted request headers
  into STS credential or logout redirects, and reject plaintext http://
  OIDC URLs for non-loopback hosts unless explicitly opted in via
  RUSTFS_IDENTITY_OPENID_ALLOW_INSECURE_TRANSPORT.

Refs: rustfs/backlog#1470, rustfs/backlog#1473, rustfs/backlog#1472, rustfs/backlog#1506

* fix(egress): restrict GCS endpoints and restore tier compatibility

* ci: tighten the GCS error-format baseline

* fix(ci): stop sending deprecated policy field in s3-tests add-user

rustfs/rustfs#9677 hardened /rustfs/admin/v3/add-user to fail closed when a non-empty deprecated policy field is provided. scripts/s3-tests/run.sh was still passing policy=readwrite in the add-user body even though it immediately calls set-user-or-group-policy right after, and awscurl returned exit 0 on XML <Error> responses so provisioning silently failed and broke all alt-user s3-tests.

Remove the deprecated policy field from the add-user payload, check awscurl responses for XML <Error> elements in provisioning, and add a regression unit test in scripts/s3-tests/test_runner_tools.py.

Refs: rustfs/backlog#1246

* fix(ci): fail S3 user provisioning on HTTP errors without logging responses

* fix(iceberg): reject repeated warehouses before validating bucket names

* test(ecstore): wait for relaxed writes on the foreground lane

* test(quota): isolate concurrent real-disk probes in CI

* test(ecstore): scope upload lock identity helper to its Linux test

* fix(oidc): preserve HTTPS in dynamic callbacks

* ci: allow cold builds to finish all fuzz binaries
2026-11-29 10:23:40 +08:00
Chris An 21fc821938 chore(deps): bump rustfs/gateway pin to b6007d13 (#9683)
* chore(deps): bump rustfs/gateway pin to b6007d13

* fix(ci): stop sending deprecated policy field in s3-tests add-user

rustfs/rustfs#9677 hardened /rustfs/admin/v3/add-user to fail closed when a non-empty deprecated policy field is provided. scripts/s3-tests/run.sh was still passing policy=readwrite in the add-user body even though it immediately calls set-user-or-group-policy right after, and awscurl returned exit 0 on XML <Error> responses so provisioning silently failed and broke all alt-user s3-tests.

Remove the deprecated policy field from the add-user payload, check awscurl responses for XML <Error> elements in provisioning, and add a regression unit test in scripts/s3-tests/test_runner_tools.py.

Refs: rustfs/backlog#1246

* fix(ci): fail S3 user provisioning on HTTP errors without logging responses

* fix(iceberg): reject repeated warehouses before validating bucket names

* test(ecstore): wait for relaxed writes on the foreground lane

* test(quota): isolate concurrent real-disk probes in CI

* test(ecstore): scope upload lock identity helper to its Linux test

* ci: allow cold builds to finish all fuzz binaries
2026-11-29 09:50:12 +08:00
Chris An e91d961f45 test(security): expand authz, OIDC, table LIST, and audit coverage (#9686)
* test(security): expand authz, OIDC, table LIST, and audit coverage

Add end-to-end, integration, and property-based security regression suites
closing in-repo RustFS test gaps across authorization, table-bucket LIST
isolation, OIDC web-identity federation, streaming SigV4 chunks, multipart
checksum algebra, and auth-failure audit delivery:

- Add table-bucket LIST isolation E2E tests across ListObjectsV2,
  ListObjectVersions, and ListMultipartUploads covering delimiter
  CommonPrefixes, opaque cursor confidentiality, cursor-attack rejection,
  and >1000-object all-hidden raw page traversal.
- Wire fast delete_authorization_test, table_list_isolation_test,
  oidc_web_identity_e2e_test, and auth_failure_audit_test cases into
  .config/nextest.toml e2e-smoke (updating e2e-smoke/e2e-full selection
  digests and raising security-smoke-floor to 29).
- Expand delete_authorization_test with anonymous force-delete / spoofed
  REPLICA denial and Object Lock (GOVERNANCE bypass, COMPLIANCE, Legal
  Hold) enforcement regressions.
- Add OIDC AssumeRoleWithWebIdentity E2E matrix (E2E-01..E2E-13, multi-
  audience, inline session-policy intersection) and rustfs-iam web-identity
  integration tests (tampered payload, alg=none, HS256 confusion,
  malformed/missing-iss tokens, OTHER_AUDIENCES, concurrent JWKS rotation,
  multi-provider routing, refresh_token flow, and iat/exp/nbf boundaries).
- Add signed aws-chunked truncated-terminator and reordered-chunk negative
  E2E tests (PutObject and UploadPart), multipart ETag-of-ETags and
  COMPOSITE/FULL_OBJECT checksum proptests in rustfs-rio and rustfs-ecstore,
  live audit webhook denial delivery tests (with honest characterization of
  gateway SignatureDoesNotMatch auditing), and fuzz/proptest + GHSA
  regression admission rules in AGENTS.md and adversarial-validation.md.

Refs: rustfs/backlog#2675, rustfs/backlog#2724, rustfs/backlog#1151

* test(security): bound listing checks and allow new audit events

* fix(ci): stop sending deprecated policy field in s3-tests add-user

rustfs/rustfs#9677 hardened /rustfs/admin/v3/add-user to fail closed when a non-empty deprecated policy field is provided. scripts/s3-tests/run.sh was still passing policy=readwrite in the add-user body even though it immediately calls set-user-or-group-policy right after, and awscurl returned exit 0 on XML <Error> responses so provisioning silently failed and broke all alt-user s3-tests.

Remove the deprecated policy field from the add-user payload, check awscurl responses for XML <Error> elements in provisioning, and add a regression unit test in scripts/s3-tests/test_runner_tools.py.

Refs: rustfs/backlog#1246

* fix(ci): fail S3 user provisioning on HTTP errors without logging responses

* fix(iceberg): reject repeated warehouses before validating bucket names

* test(ecstore): wait for relaxed writes on the foreground lane

* test(quota): isolate concurrent real-disk probes in CI

* test(ecstore): scope upload lock identity helper to its Linux test

* ci: allow cold builds to finish all fuzz binaries
2026-11-29 09:50:04 +08:00
Chris An c673245190 fix(helm): provide writable temporary storage for scanner restores (#9687)
* fix(helm): provide writable temporary storage for scanner restores

Paged usage checkpoints larger than 1 MiB need a temporary file during restore. Mount a disk-backed emptyDir at /tmp in each RustFS pod and honor existing mounts on upgrade.

Fixes #9672

* fix(ci): stop sending deprecated policy field in s3-tests add-user

rustfs/rustfs#9677 hardened /rustfs/admin/v3/add-user to fail closed when a non-empty deprecated policy field is provided. scripts/s3-tests/run.sh was still passing policy=readwrite in the add-user body even though it immediately calls set-user-or-group-policy right after, and awscurl returned exit 0 on XML <Error> responses so provisioning silently failed and broke all alt-user s3-tests.

Remove the deprecated policy field from the add-user payload, check awscurl responses for XML <Error> elements in provisioning, and add a regression unit test in scripts/s3-tests/test_runner_tools.py.

Refs: rustfs/backlog#1246

* fix(ci): fail S3 user provisioning on HTTP errors without logging responses

* fix(iceberg): reject repeated warehouses before validating bucket names

* test(ecstore): wait for relaxed writes on the foreground lane

* test(quota): isolate concurrent real-disk probes in CI

* test(ecstore): scope upload lock identity helper to its Linux test

* ci: allow cold builds to finish all fuzz binaries
2026-11-29 09:49:55 +08:00
Ramakrishna Chilaka 312e1bc6f6 perf(crypto): encrypt and decrypt stream_io fragments in place (#9733) 2026-11-29 09:49:47 +08:00
Ramakrishna Chilaka 39065bb10c perf(signer): avoid redundant string and vector allocations in SigV4 signing (#9728) 2026-11-29 09:49:39 +08:00
Ramakrishna Chilaka 9807dd884c perf(lock): eliminate redundant allocations, clock calls, and guard unregistrations (#9720)
* perf(lock): eliminate redundant allocations, clock calls, and guard unregistrations

* fix(lock): scope GlobalLockManager fast inherent helpers to crate
2026-11-29 09:49:30 +08:00
Ramakrishna Chilaka daf7d280d7 perf(ecstore): defer destination preflight on fused non-inline commits (#9716)
* perf(ecstore): defer destination preflight on fused non-inline commits

Extend deferred destination preflight to non-inline fused rename_data commits on Linux, skip descriptor-cache part path construction and invalidation when committing inline objects, and use io_get_object_open_path for staged multipart data directories on Linux.

* fix(ecstore): gate can_defer_dst_preflight with cfg(target_os = "linux")
2026-11-29 09:49:22 +08:00