fix(s3): redirect a request signed for another Region than its bucket's (#9606)

S3 answers a bucket only in its own Region. A SigV4 request signed for
another Region now gets 301 PermanentRedirect with the bucket's Region in
x-amz-bucket-region and Bucket and Endpoint in the error, and a HEAD gets
the status and header with no body, which is what the SDKs' redirect
handling follows. ListBuckets, GetBucketLocation and CreateBucket are served
from every Region, and unsigned, presigned and SigV4A requests and buckets in
another partition are served as before. A bucket stored without a Region is
redirected from the default one, where ListBuckets reports it.

floci-duck now signs each bucket's requests for that bucket's Region through
temporary DuckDB secrets that end with the request, so Athena, S3 Select,
Redshift and the CUR reports keep reading and writing buckets outside the
default Region.

floci.services.s3.region-redirect (FLOCI_SERVICES_S3_REGION_REDIRECT,
default true) turns the redirect off.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
This commit is contained in:
Hector Ventura authored and GitHub committed 2026-11-27 17:53:43 -04:00
1 parent 498986be7a
commit e4fa93d7c3
22 files changed
+730 -26

No files matched your search

@@ -115,7 +115,10 @@ func TestS3LocationConstraint(t *testing.T) {
euBucket := "go-test-bucket-eu"
t.Cleanup(func() {
svc.DeleteBucket(ctx, &s3.DeleteBucketInput{Bucket: aws.String(euBucket)})
// S3 answers a bucket only in its own Region, so the delete signs for eu-central-1.
svc.DeleteBucket(ctx, &s3.DeleteBucketInput{Bucket: aws.String(euBucket)}, func(o *s3.Options) {
o.Region = "eu-central-1"
})
})
t.Run("CreateBucketWithLocationConstraint", func(t *testing.T) {
@@ -1,9 +1,12 @@
package com.floci.test;
import org.junit.jupiter.api.*;
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
import software.amazon.awssdk.core.ResponseBytes;
import software.amazon.awssdk.core.ResponseInputStream;
import software.amazon.awssdk.core.sync.RequestBody;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.s3.S3Client;
import software.amazon.awssdk.services.s3.model.AbortMultipartUploadRequest;
import software.amazon.awssdk.services.s3.model.BucketLocationConstraint;
@@ -68,6 +71,9 @@ import static org.assertj.core.api.Assertions.*;
class S3Test {
private static S3Client s3;
// S3 answers a bucket only in its own Region (301 PermanentRedirect elsewhere), so the located
// bucket is deleted by a client signing for its Region.
private static S3Client locatedS3;
private static final String BUCKET = "sdk-test-bucket";
private static final String LOCATED_BUCKET = "sdk-test-bucket-located";
// Only the us-east-1 endpoint creates a bucket in another region; any other endpoint takes its own.
@@ -82,6 +88,12 @@ class S3Test {
@BeforeAll
static void setup() {
s3 = TestFixtures.s3Client();
locatedS3 = S3Client.builder()
.endpointOverride(TestFixtures.endpoint())
.region(Region.of(LOCATION))
.credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("test", "test")))
.forcePathStyle(true)
.build();
}
@AfterAll
@@ -94,9 +106,10 @@ class S3Test {
s3.deleteBucket(DeleteBucketRequest.builder().bucket(BUCKET).build());
} catch (Exception ignored) {}
try {
s3.deleteBucket(DeleteBucketRequest.builder().bucket(LOCATED_BUCKET).build());
locatedS3.deleteBucket(DeleteBucketRequest.builder().bucket(LOCATED_BUCKET).build());
} catch (Exception ignored) {}
s3.close();
locatedS3.close();
}
}
@@ -407,7 +420,7 @@ class S3Test {
@Test
@Order(24)
void deleteLocatedBucket() {
s3.deleteBucket(DeleteBucketRequest.builder().bucket(LOCATED_BUCKET).build());
locatedS3.deleteBucket(DeleteBucketRequest.builder().bucket(LOCATED_BUCKET).build());
}
@Test
@@ -40,13 +40,14 @@ describe('S3', () => {
afterAll(async () => {
// Cleanup buckets
for (const bucket of [bucketName, euBucketName, signedRegionBucket]) {
// The eu-central-1 buckets answer only a client signing for their Region.
for (const [bucket, client] of [[bucketName, s3], [euBucketName, euS3], [signedRegionBucket, euS3]] as const) {
try {
const list = await s3.send(new ListObjectsV2Command({ Bucket: bucket }));
const list = await client.send(new ListObjectsV2Command({ Bucket: bucket }));
for (const obj of list.Contents || []) {
await s3.send(new DeleteObjectCommand({ Bucket: bucket, Key: obj.Key }));
await client.send(new DeleteObjectCommand({ Bucket: bucket, Key: obj.Key }));
}
await s3.send(new DeleteBucketCommand({ Bucket: bucket }));
await client.send(new DeleteBucketCommand({ Bucket: bucket }));
} catch {
// ignore
}
@@ -268,7 +269,7 @@ describe('S3', () => {
it('should delete bucket', async () => {
await s3.send(new DeleteBucketCommand({ Bucket: bucketName }));
await s3.send(new DeleteBucketCommand({ Bucket: euBucketName }));
await euS3.send(new DeleteBucketCommand({ Bucket: euBucketName }));
await euS3.send(new DeleteBucketCommand({ Bucket: signedRegionBucket }));
bucketName = '';
euBucketName = '';
@@ -295,6 +295,7 @@ See [Initialization Hooks](./initialization-hooks.md) for lifecycle phases and s
| `FLOCI_SERVICES_S3_ENABLED` | `true` | Enable the S3 service |
| `FLOCI_SERVICES_S3_DEFAULT_PRESIGN_EXPIRY_SECONDS` | `3600` | Default pre-signed URL expiry when none is specified |
| `FLOCI_SERVICES_S3_GLOBAL_BUCKET_NAMESPACE` | `false` | When `true`, bucket/object resolution spans every account's partition so a bucket created in one account is visible cross-account (a single global namespace), matching real S3's global bucket names. Off by default keeps buckets isolated per account |
| `FLOCI_SERVICES_S3_REGION_REDIRECT` | `true` | Answer a SigV4 request signed for a region other than its bucket's with `301 PermanentRedirect` and the bucket's region in `x-amz-bucket-region`, as S3 does. `false` serves every bucket to every region |
| `FLOCI_SERVICES_S3_LIFECYCLE_SWEEP_ENABLED` | `true` | Apply bucket lifecycle expiration rules (`Expiration`, `NoncurrentVersionExpiration`, `AbortIncompleteMultipartUpload`) in the background |
| `FLOCI_SERVICES_S3_LIFECYCLE_SWEEP_INTERVAL_SECONDS` | `60` | How often the lifecycle sweep runs |
+17
View File
@@ -377,6 +377,22 @@ raw-HTTP client that signs for another region and sends an empty body has to add
answers an empty constraint only for `us-east-1`. See [AWS Partitions](../configuration/partitions.md)
for how this applies in China and GovCloud.
### Region Redirects
A bucket answers only in its own region, as on AWS. A request whose SigV4 credential scope names
another region of the same partition gets `301 PermanentRedirect`, with the bucket's region in the
`x-amz-bucket-region` header and the bucket and its regional endpoint in the error body. `HeadBucket`
and `HeadObject` get the status and the header with no body. `ListBuckets`, `GetBucketLocation` and
`CreateBucket` are served from every region.
The SDKs re-sign for the bucket's region and retry: boto3 and the AWS CLI always, the Java SDK v2
with `crossRegionAccessEnabled(true)`, and the JavaScript SDK v3 with `followRegionRedirects: true`.
A client in the bucket's region, including one signing for `us-east-1` against a bucket created
without a `LocationConstraint`, is unaffected.
Unsigned requests, presigned URLs and SigV4A requests are served from any region. Set
`FLOCI_SERVICES_S3_REGION_REDIRECT=false` to serve every bucket to every region.
## Global Bucket Namespace
Object deletion, including `DeleteObjects` batches, uses the named bucket's owning account for
@@ -583,6 +599,7 @@ operation, so neither creates, lists nor deletes the bucket.
| `FLOCI_SERVICES_S3_ENFORCE_AUTH` | `false` | Verify SigV4 signatures and evaluate bucket policies and ACLs, including for anonymous callers (see [Signature Verification](#signature-verification)) |
| `FLOCI_AUTH_VALIDATE_SIGNATURES` | `false` | Verify SigV4 signatures without evaluating bucket policies or ACLs (see [Signature Verification](#signature-verification)) |
| `FLOCI_SERVICES_S3_GLOBAL_BUCKET_NAMESPACE` | `false` | Enable cross-account bucket and object resolution |
| `FLOCI_SERVICES_S3_REGION_REDIRECT` | `true` | Answer a request signed for another region than its bucket's with `301 PermanentRedirect` (see [Region Redirects](#region-redirects)) |
| `FLOCI_SERVICES_S3_LIFECYCLE_SWEEP_ENABLED` | `true` | Apply bucket lifecycle expiration rules in the background (see [Lifecycle Expiration](#lifecycle-expiration)) |
| `FLOCI_SERVICES_S3_LIFECYCLE_SWEEP_INTERVAL_SECONDS` | `60` | How often the lifecycle sweep runs |
@@ -1687,6 +1687,15 @@ public interface EmulatorConfig {
@WithDefault("false")
boolean globalBucketNamespace();
/**
* Answer a SigV4 request signed for a Region other than its bucket's with S3's
* {@code 301 PermanentRedirect} and the bucket's Region in {@code x-amz-bucket-region}.
* When off, every bucket is served from every Region.
* Env: FLOCI_SERVICES_S3_REGION_REDIRECT
*/
@WithDefault("true")
boolean regionRedirect();
/** Seconds before RestoreObject reports a completed temporary copy. */
@WithDefault("0")
long restoreCompletionDelaySeconds();
@@ -4,7 +4,9 @@ import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.floci.aws.config.EmulatorConfig;
import io.floci.aws.core.common.docker.ContainerReachableEndpoint;
import io.floci.aws.services.s3.S3Service;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.inject.Instance;
import jakarta.inject.Inject;
import java.net.URI;
@@ -13,8 +15,15 @@ import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.function.Function;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Stream;
/**
* HTTP client for the floci-duck sidecar.
@@ -26,22 +35,44 @@ import java.util.Map;
@ApplicationScoped
public class FlociDuckClient {
/** A bucket an {@code s3://} path in the SQL, the setup or the output path names. */
private static final Pattern S3_BUCKET = Pattern.compile("s3://([a-z0-9][a-z0-9.-]{1,62})");
private final FlociDuckManager duckManager;
private final EmulatorConfig config;
private final ContainerReachableEndpoint containerEndpoint;
private final ObjectMapper mapper;
private final HttpClient httpClient;
private final Function<String, Optional<String>> bucketRegions;
@Inject
public FlociDuckClient(FlociDuckManager duckManager,
EmulatorConfig config,
ContainerReachableEndpoint containerEndpoint,
ObjectMapper mapper) {
ObjectMapper mapper,
Instance<S3Service> s3Service) {
// Looked up per call: S3 Select, a part of S3, uses this client.
this(duckManager, config, containerEndpoint, mapper, bucket -> s3Service.get().findBucketRegion(bucket));
}
FlociDuckClient(FlociDuckManager duckManager,
EmulatorConfig config,
ContainerReachableEndpoint containerEndpoint,
ObjectMapper mapper) {
this(duckManager, config, containerEndpoint, mapper, bucket -> Optional.empty());
}
FlociDuckClient(FlociDuckManager duckManager,
EmulatorConfig config,
ContainerReachableEndpoint containerEndpoint,
ObjectMapper mapper,
Function<String, Optional<String>> bucketRegions) {
this.duckManager = duckManager;
this.config = config;
this.containerEndpoint = containerEndpoint;
this.mapper = mapper;
this.httpClient = HttpClient.newHttpClient();
this.bucketRegions = bucketRegions;
}
/**
@@ -84,7 +115,8 @@ public class FlociDuckClient {
String accessKeyId, String secretAccessKey, String sessionToken) {
String duckUrl = duckManager.ensureReady();
String effectiveSetup = injectSessionToken(setupDdl, sessionToken);
String effectiveSetup = withBucketRegions(injectSessionToken(setupDdl, sessionToken),
accessKeyId, secretAccessKey, sessionToken, sql, setupDdl, outputS3Path);
Map<String, Object> body = buildBaseBody(sql, effectiveSetup, accessKeyId, secretAccessKey);
if (outputS3Path != null) {
body.put("output_s3_path", outputS3Path);
@@ -122,7 +154,8 @@ public class FlociDuckClient {
String accessKeyId, String secretAccessKey, String sessionToken) {
String duckUrl = duckManager.ensureReady();
String effectiveSetup = injectSessionToken(setupDdl, sessionToken);
String effectiveSetup = withBucketRegions(injectSessionToken(setupDdl, sessionToken),
accessKeyId, secretAccessKey, sessionToken, sql, setupDdl, null);
Map<String, Object> body = buildBaseBody(sql, effectiveSetup, accessKeyId, secretAccessKey);
String responseBody = post(duckUrl + "/query", body, "query");
@@ -137,6 +170,54 @@ public class FlociDuckClient {
return setupDdl == null || setupDdl.isBlank() ? setToken : setToken + setupDdl;
}
/**
* S3 answers a bucket only in its own Region, and DuckDB signs every request for its one {@code s3_region}: it
* re-signs a read that gets 301 PermanentRedirect but not a write. Each bucket the statement names in another
* Region than the default therefore gets a secret scoped to it and signed for its Region, with the request's
* credentials; DuckDB picks the secret whose scope matches a path and the {@code s3_*} settings for the rest.
* The secrets are temporary, and floci-duck runs every request in a DuckDB instance of its own, so no other
* request, of this account or another, can see or use them, even one running at the same time
* ({@code FlociDuckBucketRegionSidecarIntegrationTest} holds the pinned image to that).
*/
String withBucketRegions(String setupDdl, String accessKeyId, String secretAccessKey, String sessionToken,
String... statements) {
Set<String> buckets = new LinkedHashSet<>();
for (String text : Stream.of(statements).filter(t -> t != null && !t.isEmpty()).toList()) {
Matcher matcher = S3_BUCKET.matcher(text);
while (matcher.find()) {
buckets.add(matcher.group(1));
}
}
StringBuilder secrets = new StringBuilder();
URI endpoint = URI.create(containerEndpoint.baseUrl());
int index = 0;
for (String bucket : buckets) {
Optional<String> region = bucketRegions.apply(bucket);
if (region.isEmpty() || region.get().equals(config.defaultRegion())) {
continue;
}
secrets.append("CREATE OR REPLACE TEMPORARY SECRET floci_bucket_").append(index++).append(" (TYPE s3")
.append(", KEY_ID ").append(literal(accessKeyId == null || accessKeyId.isEmpty() ? "test" : accessKeyId))
.append(", SECRET ").append(literal(secretAccessKey == null || secretAccessKey.isEmpty()
? "test" : secretAccessKey));
if (sessionToken != null && !sessionToken.isBlank()) {
secrets.append(", SESSION_TOKEN ").append(literal(sessionToken));
}
secrets.append(", REGION ").append(literal(region.get()))
.append(", ENDPOINT ").append(literal(endpoint.getAuthority()))
.append(", URL_STYLE 'path', USE_SSL ").append("https".equals(endpoint.getScheme()))
.append(", SCOPE ").append(literal("s3://" + bucket)).append(");\n");
}
if (secrets.isEmpty()) {
return setupDdl;
}
return setupDdl == null || setupDdl.isBlank() ? secrets.toString() : secrets + setupDdl;
}
private static String literal(String value) {
return "'" + value.replace("'", "''") + "'";
}
// ── internals ─────────────────────────────────────────────────────────────
private Map<String, Object> buildBaseBody(String sql, String setupDdl) {
@@ -315,10 +315,7 @@ public class S3Controller {
rejectUnservedSubresource("HEAD", uriInfo);
s3Service.authorizeBucketRead(bucket, "s3:ListBucket", authorization);
s3Service.headBucket(bucket);
String bucketRegion = s3Service.getBucketRegion(bucket);
if (bucketRegion == null || bucketRegion.isBlank()) {
bucketRegion = regionResolver.getDefaultRegion();
}
String bucketRegion = s3Service.findBucketRegion(bucket).orElse(regionResolver.getDefaultRegion());
return Response.ok()
.header("x-amz-bucket-region", bucketRegion)
.build();
@@ -61,9 +61,10 @@ import java.util.Optional;
*
* <h2>Deliberate deviations from real AWS</h2>
* <ul>
* <li>The credential scope's region is not checked against the bucket's region. Floci resolves
* a request's region <em>from</em> that scope, so pinning it would be circular. Whether the
* label is a region at all is checked upstream, in {@code AccountContextFilter}.</li>
* <li>The credential scope's region is not checked against the bucket's region here:
* {@link S3RegionRedirectFilter} answers a mismatch with {@code PermanentRedirect} before this
* filter runs, unless {@code floci.services.s3.region-redirect} is off. Whether the label is
* a region at all is checked upstream, in {@code AccountContextFilter}.</li>
* <li>The per-chunk signatures of an {@code aws-chunked} upload are not verified; only the seed
* signature over the headers is. The controller strips the chunk framing itself.</li>
* <li>The well-known local-dev {@code test}/{@code test} credential pair is honoured, mirroring
@@ -0,0 +1,122 @@
package io.floci.aws.services.s3;
import io.floci.aws.config.EmulatorConfig;
import io.floci.aws.core.common.AwsEndpoints;
import io.floci.aws.core.common.AwsPartitions;
import io.floci.aws.core.common.MemoizedSupplier;
import io.floci.aws.core.common.RegionResolver;
import io.floci.aws.core.common.ResteasyRequests;
import io.floci.aws.core.common.SigV4CredentialScope;
import io.floci.aws.core.common.XmlBuilder;
import io.floci.aws.core.common.auth.SigV4aSignature;
import jakarta.annotation.Priority;
import jakarta.enterprise.inject.Instance;
import jakarta.inject.Inject;
import jakarta.ws.rs.Priorities;
import jakarta.ws.rs.container.ContainerRequestContext;
import jakarta.ws.rs.container.ContainerRequestFilter;
import jakarta.ws.rs.container.ResourceInfo;
import jakarta.ws.rs.core.Context;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.MultivaluedMap;
import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.ext.Provider;
import java.util.Optional;
/**
* Answers a request signed for a Region other than its bucket's with S3's
* {@code 301 PermanentRedirect}, carrying the bucket's Region in {@code x-amz-bucket-region}, as
* S3 does. The SDKs follow it: botocore's {@code S3RegionRedirectorv2} re-signs for the header's
* Region, and the Java SDK v2 does the same when {@code crossRegionAccessEnabled} is set
* ({@code CrossRegionUtils}). A HEAD request gets the status and the header without a body, the
* case botocore handles as {@code is_special_head_bucket} / {@code is_special_head_object}.
*
* <p>Served from any Region, as on AWS: ListBuckets (no bucket), GetBucketLocation (the S3 model:
* "In other Regions, the bucket policy doesn't apply") and CreateBucket, whose Region rules are
* {@link S3Controller#bucketRegionForCreate}'s. Only a SigV4 {@code Authorization} header is
* checked: an unsigned request, a presigned URL and a SigV4A request (signed for a Region set)
* are served as before, since no source shows how S3 redirects them. A bucket in another
* partition is not redirected either, because S3's Regions redirect only within one.
*
* <p>Off with {@code floci.services.s3.region-redirect: false}, which serves every bucket from
* every Region.
*/
@Provider
@Priority(Priorities.AUTHENTICATION - 50)
public class S3RegionRedirectFilter implements ContainerRequestFilter {
private static final String MESSAGE = "The bucket you are attempting to access must be addressed using the "
+ "specified endpoint. Please send all future requests to this endpoint.";
private final S3Service s3Service;
// Resolved on first use: JAX-RS providers are built before the runtime config mappings exist.
private final MemoizedSupplier<EmulatorConfig> config;
private final RegionResolver regionResolver;
private final ResourceInfo resourceInfo;
@Inject
public S3RegionRedirectFilter(S3Service s3Service,
Instance<EmulatorConfig> config,
RegionResolver regionResolver,
@Context ResourceInfo resourceInfo) {
this.s3Service = s3Service;
this.config = new MemoizedSupplier<>(config::get);
this.regionResolver = regionResolver;
this.resourceInfo = resourceInfo;
}
@Override
public void filter(ContainerRequestContext ctx) {
if (!config.get().services().s3().regionRedirect() || !S3SignatureFilterScope.routedToS3(resourceInfo)) {
return;
}
String authorization = ctx.getHeaderString("Authorization");
if (authorization == null || authorization.trim().startsWith(SigV4aSignature.ALGORITHM + " ")
|| !"s3".equals(SigV4CredentialScope.serviceName(authorization).orElse(null))) {
return;
}
String signingRegion = regionResolver.resolveRegionFromAuthOrNull(authorization);
MultivaluedMap<String, String> pathParameters = ctx.getUriInfo().getPathParameters();
String bucket = pathParameters.getFirst("bucket");
if (signingRegion == null || bucket == null || bucket.isEmpty()) {
return;
}
boolean bucketRequest = pathParameters.getFirst("key") == null;
MultivaluedMap<String, String> query = ResteasyRequests.queryParameters(ctx);
if (bucketRequest && servedFromAnyRegion(ctx.getMethod(), query)) {
return;
}
Optional<String> bucketRegion = s3Service.findBucketRegion(bucket);
if (bucketRegion.isEmpty() || bucketRegion.get().equals(signingRegion)
|| !AwsPartitions.forRegionOrCommercial(bucketRegion.get()).id()
.equals(AwsPartitions.forRegionOrCommercial(signingRegion).id())) {
return;
}
ctx.abortWith(redirect(ctx.getMethod(), bucket, bucketRegion.get()));
}
private static boolean servedFromAnyRegion(String method, MultivaluedMap<String, String> query) {
if ("GET".equals(method) && query.containsKey("location")) {
return true;
}
return "PUT".equals(method) && query.keySet().stream().allMatch("x-id"::equals);
}
static Response redirect(String method, String bucket, String bucketRegion) {
Response.ResponseBuilder response = Response.status(301).header("x-amz-bucket-region", bucketRegion);
if ("HEAD".equals(method)) {
return response.build();
}
String xml = new XmlBuilder()
.raw("<?xml version=\"1.0\" encoding=\"UTF-8\"?>")
.start("Error")
.elem("Code", "PermanentRedirect")
.elem("Message", MESSAGE)
.elem("Bucket", bucket)
.elem("Endpoint", AwsEndpoints.s3RegionalHost(bucket, bucketRegion))
.end("Error")
.build();
return response.entity(xml).type(MediaType.APPLICATION_XML).build();
}
}
@@ -3392,6 +3392,22 @@ public class S3Service implements Resettable, ResourceProvider {
return resolveBucket(bucketName).map(Bucket::getRegion).orElse(null);
}
/**
* The Region the bucket lives in, empty when no bucket of that name resolves. A bucket stored before buckets
* recorded their Region is in the default one, as {@code ListBuckets} reports it.
*/
public Optional<String> findBucketRegion(String bucketName) {
Optional<Bucket> bucket = resolveBucket(bucketName);
if (bucket.isEmpty()) {
return Optional.empty();
}
String region = bucket.get().getRegion();
if (region != null && !region.isBlank()) {
return Optional.of(region);
}
return regionResolver == null ? Optional.empty() : Optional.of(regionResolver.getDefaultRegion());
}
// --- Batch Delete ---
public record DeleteResult(String key, String versionId, boolean deleteMarker, String deleteMarkerVersionId) {
+1
View File
@@ -497,6 +497,7 @@ floci:
enforce-auth: false
default-presign-expiry-seconds: 3600
global-bucket-namespace: false
region-redirect: true # FLOCI_SERVICES_S3_REGION_REDIRECT - 301 PermanentRedirect for a request signed for another Region than its bucket's
restore-completion-delay-seconds: 0 # FLOCI_SERVICES_S3_RESTORE_COMPLETION_DELAY_SECONDS
lifecycle-sweep-enabled: true # FLOCI_SERVICES_S3_LIFECYCLE_SWEEP_ENABLED - apply lifecycle expiration rules in the background
lifecycle-sweep-interval-seconds: 60 # FLOCI_SERVICES_S3_LIFECYCLE_SWEEP_INTERVAL_SECONDS
@@ -77,8 +77,9 @@ class FirehoseFlushRegionTest {
"BucketARN": "arn:aws:s3:::%s",
"BufferingHints": {"SizeInMBs": 5, "IntervalInSeconds": 60}}}
""".formatted(stream, account, bucket)).statusCode(200);
// The delivery creates the bucket in the stream's Region, which answers only a request signed for it.
cleanup.register(() -> EnforcementFixtures.removeBucket(baseUri.getPort(),
EnforcementFixtures.auth(account, "s3"), bucket));
EnforcementFixtures.auth(account, REGION, "s3"), bucket));
cleanup.register(() -> firehose(account, "DeleteDeliveryStream",
"{\"DeliveryStreamName\": \"" + stream + "\"}"));
firehose(account, "PutRecord", "{\"DeliveryStreamName\": \"" + stream + "\", \"Record\": {\"Data\": \""
@@ -0,0 +1,124 @@
package io.floci.aws.services.floci.duck;
import io.floci.aws.services.s3.S3Service;
import io.floci.aws.testing.SidecarContainersProfile;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.TestProfile;
import io.quarkus.test.junit.mockito.InjectSpy;
import jakarta.inject.Inject;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doAnswer;
/**
* S3 answers a bucket only in its own Region, so floci-duck, which Floci drives for Athena, S3 Select, Redshift and
* the CUR reports, must sign each bucket's requests for that bucket's Region. One query reads buckets of two Regions
* here, through the real sidecar.
*/
@QuarkusTest
@TestProfile(SidecarContainersProfile.class)
class FlociDuckBucketRegionSidecarIntegrationTest {
@Inject
FlociDuckClient duck;
@InjectSpy
S3Service s3Service;
private final String suffix = UUID.randomUUID().toString().substring(0, 8);
private final String euBucket = "duck-region-eu-" + suffix;
private final String usBucket = "duck-region-us-" + suffix;
@BeforeAll
static void requireDocker() {
SidecarContainersProfile.requireDocker();
}
@AfterEach
void deleteBuckets() {
for (String bucket : List.of(euBucket, usBucket)) {
try {
s3Service.deleteObject(bucket, "rows.csv");
s3Service.deleteBucket(bucket);
} catch (RuntimeException ignored) {
// The bucket was never created because the test failed first; nothing to remove.
}
}
}
@Test
void aQueryReadsBucketsOfTwoRegionsEachSignedForItsOwn() {
s3Service.createBucket(euBucket, "eu-west-1");
s3Service.putObject(euBucket, "rows.csv", "id,name\n1,eu\n".getBytes(StandardCharsets.UTF_8),
"text/csv", null);
s3Service.createBucket(usBucket, "us-east-1");
s3Service.putObject(usBucket, "rows.csv", "id,name\n2,us\n".getBytes(StandardCharsets.UTF_8),
"text/csv", null);
List<Map<String, Object>> rows = duck.query("SELECT CAST(id AS VARCHAR) AS id, name FROM read_csv('s3://"
+ euBucket + "/rows.csv') UNION ALL SELECT CAST(id AS VARCHAR), name FROM read_csv('s3://"
+ usBucket + "/rows.csv') ORDER BY id", null);
assertEquals(List.of(Map.of("id", "1", "name", "eu"), Map.of("id", "2", "name", "us")), rows);
}
/**
* The secrets carry the caller's credentials, so a request running at the same time, as another account, must
* not see them: floci-duck runs every request in a DuckDB instance of its own. The first request is held inside
* its read, after its secret exists, while the second looks.
*/
@Test
void aConcurrentRequestSeesNoneOfAnotherRequestsBucketSecrets() throws Exception {
s3Service.createBucket(euBucket, "eu-west-1");
s3Service.putObject(euBucket, "held.csv", "id,name\n1,eu\n".getBytes(StandardCharsets.UTF_8),
"text/csv", null);
CountDownLatch reading = new CountDownLatch(1);
CountDownLatch release = new CountDownLatch(1);
doAnswer(invocation -> {
reading.countDown();
assertTrue(release.await(30, TimeUnit.SECONDS), "the held read was never released");
return invocation.callRealMethod();
}).when(s3Service).headObject(eq(euBucket), eq("held.csv"), any());
CompletableFuture<List<Map<String, Object>>> held = CompletableFuture.supplyAsync(() -> duck.query(
"SELECT CAST(id AS VARCHAR) AS id FROM read_csv('s3://" + euBucket + "/held.csv')", null));
try {
assertTrue(reading.await(30, TimeUnit.SECONDS), "the first request never read its bucket");
assertEquals(List.of(Map.of("n", "0")), duck.query(
"SELECT CAST(count(*) AS VARCHAR) AS n FROM duckdb_secrets()", null, "222222222222",
"secret-of-222", null));
} finally {
release.countDown();
}
try {
assertEquals(List.of(Map.of("id", "1")), held.get(30, TimeUnit.SECONDS));
} finally {
s3Service.deleteObject(euBucket, "held.csv");
}
}
@Test
void aQueryWritesItsResultToABucketOfAnotherRegion() {
s3Service.createBucket(euBucket, "eu-west-1");
duck.execute("SELECT 7 AS answer", null, "s3://" + euBucket + "/results/out.csv");
String written = new String(s3Service.getObject(euBucket, "results/out.csv").getData(), StandardCharsets.UTF_8);
assertEquals("answer\n7\n", written);
s3Service.deleteObject(euBucket, "results/out.csv");
}
}
@@ -15,6 +15,7 @@ import org.junit.jupiter.api.parallel.ResourceLock;
import java.net.InetSocketAddress;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicReference;
@@ -178,4 +179,28 @@ class FlociDuckClientServiceTest {
assertEquals("SET s3_session_token = 'a''b';\nINSTALL x;",
FlociDuckClient.injectSessionToken("INSTALL x;", "a'b"));
}
@Test
void aBucketOutsideTheDefaultRegionGetsASecretSignedForItsRegion() {
EmulatorConfig config = mock(EmulatorConfig.class);
EmbeddedDnsServer embeddedDnsServer = mock(EmbeddedDnsServer.class);
when(config.defaultRegion()).thenReturn("us-east-1");
when(config.hostname()).thenReturn(Optional.of("floci.internal"));
when(config.tls()).thenReturn(mock(EmulatorConfig.TlsConfig.class));
when(embeddedDnsServer.getServerIp()).thenReturn(Optional.of("127.0.0.1"));
Map<String, String> regions = Map.of("eu-data", "eu-west-1", "us-data", "us-east-1");
FlociDuckClient client = new FlociDuckClient(mock(FlociDuckManager.class), config,
new ContainerReachableEndpoint(config, mock(DockerHostResolver.class), embeddedDnsServer, null, 4566),
new ObjectMapper(), bucket -> Optional.ofNullable(regions.get(bucket)));
String setup = client.withBucketRegions("SET threads = 1;", "111111111111", "o'secret", "token",
"SELECT * FROM read_csv('s3://eu-data/a.csv') JOIN read_csv('s3://us-data/b.csv') USING (id)",
null, "s3://eu-data/out/");
assertEquals("CREATE OR REPLACE TEMPORARY SECRET floci_bucket_0 (TYPE s3, KEY_ID '111111111111', SECRET 'o''secret', "
+ "SESSION_TOKEN 'token', REGION 'eu-west-1', ENDPOINT 'floci.internal:4566', URL_STYLE 'path', "
+ "USE_SSL false, SCOPE 's3://eu-data');\nSET threads = 1;", setup);
assertEquals("SET threads = 1;", client.withBucketRegions("SET threads = 1;", null, null, null,
"SELECT * FROM read_csv('s3://us-data/b.csv') JOIN read_csv('s3://unknown/c.csv') USING (id)"));
}
}
@@ -7,6 +7,7 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.NullSource;
import org.junit.jupiter.params.provider.ValueSource;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.s3.S3Client;
import software.amazon.awssdk.services.s3.model.Bucket;
import software.amazon.awssdk.services.s3.model.ListBucketsResponse;
@@ -76,7 +77,10 @@ class S3ListBucketsRegionIntegrationTest {
assertNull(bucket.bucketArn());
}
} finally {
client.deleteBucket(request -> request.bucket(explicitBucket));
// S3 redirects a request for an eu-central-1 bucket signed for us-east-1.
try (S3Client home = S3TestClients.pathStyle(Region.EU_CENTRAL_1)) {
home.deleteBucket(request -> request.bucket(explicitBucket));
}
}
} finally {
client.deleteBucket(request -> request.bucket(defaultBucket));
@@ -255,7 +255,7 @@ class S3PresignedPostIamOnlyEnforcementIntegrationTest {
.body("Error.Code", equalTo("AccessDenied"));
trailWriter.flushNow();
List<JsonNode> records = trailRecords(logBucket);
List<JsonNode> records = trailRecords(logBucket, region);
assertTrue(records.stream().anyMatch(record -> "PostObject".equals(record.path("eventName").asText())
&& "AccessDenied".equals(record.path("errorCode").asText())
&& bucket.equals(record.path("requestParameters").path("bucketName").asText())
@@ -375,10 +375,13 @@ class S3PresignedPostIamOnlyEnforcementIntegrationTest {
.statusCode(200);
}
/** Every record in the log files the trail delivered to {@code logBucket}. */
private static List<JsonNode> trailRecords(String logBucket) throws IOException {
/**
* Every record in the log files the trail delivered to {@code logBucket}, read with requests signed for the
* bucket's {@code region}: S3 redirects a request signed for any other.
*/
private static List<JsonNode> trailRecords(String logBucket, String region) throws IOException {
String listing = given()
.header("Authorization", auth("test", "s3"))
.header("Authorization", auth("test", "s3", region))
.when()
.get("/" + logBucket + "?list-type=2")
.then()
@@ -388,7 +391,7 @@ class S3PresignedPostIamOnlyEnforcementIntegrationTest {
Matcher key = Pattern.compile("<Key>([^<]+\\.json\\.gz)</Key>").matcher(listing);
while (key.find()) {
byte[] compressed = given()
.header("Authorization", auth("test", "s3"))
.header("Authorization", auth("test", "s3", region))
.when()
.get("/" + logBucket + "/" + key.group(1))
.then()
@@ -0,0 +1,77 @@
package io.floci.aws.services.s3;
import io.floci.aws.config.EmulatorConfig;
import io.floci.aws.core.common.RegionResolver;
import jakarta.enterprise.inject.Instance;
import jakarta.ws.rs.container.ContainerRequestContext;
import jakarta.ws.rs.container.ResourceInfo;
import jakarta.ws.rs.core.MultivaluedHashMap;
import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.core.UriInfo;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor;
import java.util.Optional;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
/** The off switch, {@code floci.services.s3.region-redirect: false}, serves every bucket to every Region. */
class S3RegionRedirectFilterTest {
private static final String EU_WEST_1_AUTH =
"AWS4-HMAC-SHA256 Credential=test/20260325/eu-west-1/s3/aws4_request, SignedHeaders=host;x-amz-date, Signature=test";
@Test
void withTheRedirectOffABucketIsServedToARequestSignedForAnotherRegion() {
ContainerRequestContext request = getBucketSignedForEuWest1();
filter(false).filter(request);
verify(request, never()).abortWith(any());
}
@Test
void withTheRedirectOnTheSameRequestIsPermanentlyRedirected() {
ContainerRequestContext request = getBucketSignedForEuWest1();
filter(true).filter(request);
ArgumentCaptor<Response> response = ArgumentCaptor.forClass(Response.class);
verify(request).abortWith(response.capture());
assertEquals(301, response.getValue().getStatus());
assertEquals("us-east-1", response.getValue().getHeaderString("x-amz-bucket-region"));
}
@SuppressWarnings("unchecked")
private static S3RegionRedirectFilter filter(boolean regionRedirect) {
EmulatorConfig config = mock(EmulatorConfig.class, RETURNS_DEEP_STUBS);
when(config.services().s3().regionRedirect()).thenReturn(regionRedirect);
Instance<EmulatorConfig> configs = mock(Instance.class);
when(configs.get()).thenReturn(config);
S3Service s3Service = mock(S3Service.class);
when(s3Service.findBucketRegion("bucket")).thenReturn(Optional.of("us-east-1"));
ResourceInfo resourceInfo = mock(ResourceInfo.class);
when(resourceInfo.getResourceClass()).thenAnswer(invocation -> S3Controller.class);
return new S3RegionRedirectFilter(s3Service, configs, new RegionResolver("us-east-1", "000000000000"),
resourceInfo);
}
private static ContainerRequestContext getBucketSignedForEuWest1() {
ContainerRequestContext request = mock(ContainerRequestContext.class);
UriInfo uriInfo = mock(UriInfo.class);
MultivaluedHashMap<String, String> path = new MultivaluedHashMap<>();
path.putSingle("bucket", "bucket");
when(uriInfo.getPathParameters()).thenReturn(path);
when(uriInfo.getQueryParameters()).thenReturn(new MultivaluedHashMap<>());
when(request.getUriInfo()).thenReturn(uriInfo);
when(request.getMethod()).thenReturn("GET");
when(request.getHeaderString("Authorization")).thenReturn(EU_WEST_1_AUTH);
return request;
}
}
@@ -0,0 +1,169 @@
package io.floci.aws.services.s3;
import io.floci.aws.testing.EnforcementFixtures;
import io.floci.aws.testing.S3TestClients;
import io.quarkus.test.junit.QuarkusTest;
import org.junit.jupiter.api.Test;
import software.amazon.awssdk.core.sync.RequestBody;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.s3.S3Client;
import software.amazon.awssdk.services.s3.model.S3Exception;
import static io.restassured.RestAssured.given;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.emptyString;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
/**
* A request signed for a Region other than its bucket's is answered with S3's 301 PermanentRedirect and the
* bucket's Region in {@code x-amz-bucket-region} (botocore's {@code S3RegionRedirectorv2} and its functional
* fixture in {@code tests/functional/test_s3.py}; the Java SDK's {@code CrossRegionUtils}). RestAssured is told not
* to follow the 301 itself, so the test sees the redirect S3 sends.
*/
@QuarkusTest
class S3RegionRedirectIntegrationTest {
private static final String US_EAST_1_AUTH = EnforcementFixtures.auth("test", "us-east-1", "s3");
private static final String EU_WEST_1_AUTH = EnforcementFixtures.auth("test", "eu-west-1", "s3");
@Test
void requestSignedForAnotherRegionIsPermanentlyRedirected() {
String bucket = "redirect-us-east-1-bucket";
given().header("Authorization", US_EAST_1_AUTH).when().put("/" + bucket).then().statusCode(200);
try {
given().redirects().follow(false).header("Authorization", EU_WEST_1_AUTH)
.when()
.get("/" + bucket)
.then()
.statusCode(301)
.header("x-amz-bucket-region", equalTo("us-east-1"))
.body(containsString("<Code>PermanentRedirect</Code>"))
.body(containsString("<Bucket>" + bucket + "</Bucket>"))
.body(containsString("<Endpoint>" + bucket + ".s3.us-east-1.amazonaws.com</Endpoint>"));
given().redirects().follow(false).header("Authorization", EU_WEST_1_AUTH)
.body("data")
.when()
.put("/" + bucket + "/key.txt")
.then()
.statusCode(301)
.header("x-amz-bucket-region", equalTo("us-east-1"));
given().header("Authorization", US_EAST_1_AUTH)
.when()
.get("/" + bucket)
.then()
.statusCode(200)
.body(containsString("<Name>" + bucket + "</Name>"));
} finally {
given().header("Authorization", US_EAST_1_AUTH).when().delete("/" + bucket).then().statusCode(204);
}
}
@Test
void headBucketSignedForAnotherRegionGetsTheRegionWithoutABody() {
String bucket = "redirect-head-bucket";
given().header("Authorization", US_EAST_1_AUTH).when().put("/" + bucket).then().statusCode(200);
try {
given().redirects().follow(false).header("Authorization", EU_WEST_1_AUTH)
.when()
.head("/" + bucket)
.then()
.statusCode(301)
.header("x-amz-bucket-region", equalTo("us-east-1"))
.body(emptyString());
} finally {
given().header("Authorization", US_EAST_1_AUTH).when().delete("/" + bucket).then().statusCode(204);
}
}
@Test
void bucketInARegionalHomeRedirectsAUsEast1Signer() {
String bucket = "redirect-eu-west-1-bucket";
given().header("Authorization", EU_WEST_1_AUTH)
.contentType("application/xml")
.body("<CreateBucketConfiguration><LocationConstraint>eu-west-1</LocationConstraint></CreateBucketConfiguration>")
.when()
.put("/" + bucket)
.then()
.statusCode(200);
try {
given().redirects().follow(false).header("Authorization", US_EAST_1_AUTH)
.when()
.get("/" + bucket)
.then()
.statusCode(301)
.header("x-amz-bucket-region", equalTo("eu-west-1"))
.body(containsString("<Endpoint>" + bucket + ".s3.eu-west-1.amazonaws.com</Endpoint>"));
} finally {
given().header("Authorization", EU_WEST_1_AUTH).when().delete("/" + bucket).then().statusCode(204);
}
}
@Test
void locationAndListBucketsAreServedFromEveryRegion() {
String bucket = "redirect-exempt-bucket";
given().header("Authorization", US_EAST_1_AUTH).when().put("/" + bucket).then().statusCode(200);
try {
given().header("Authorization", EU_WEST_1_AUTH)
.when()
.get("/" + bucket + "?location")
.then()
.statusCode(200)
.body(containsString("LocationConstraint"));
given().header("Authorization", EU_WEST_1_AUTH)
.when()
.get("/")
.then()
.statusCode(200)
.body(containsString("<Name>" + bucket + "</Name>"));
} finally {
given().header("Authorization", US_EAST_1_AUTH).when().delete("/" + bucket).then().statusCode(204);
}
}
@Test
void unsignedRequestIsServedWhateverTheBucketsRegion() {
String bucket = "redirect-unsigned-bucket";
given().header("Authorization", EU_WEST_1_AUTH)
.contentType("application/xml")
.body("<CreateBucketConfiguration><LocationConstraint>eu-west-1</LocationConstraint></CreateBucketConfiguration>")
.when()
.put("/" + bucket)
.then()
.statusCode(200);
try {
given().when().get("/" + bucket).then().statusCode(200);
} finally {
given().when().delete("/" + bucket).then().statusCode(204);
}
}
@Test
void sdkClientWithCrossRegionAccessFollowsTheRedirect() {
String bucket = "redirect-sdk-bucket";
try (S3Client home = S3TestClients.pathStyle(Region.US_EAST_1);
S3Client wrongRegion = S3TestClients.pathStyle(Region.EU_WEST_1);
S3Client crossRegion = S3TestClients.pathStyle(Region.EU_WEST_1, true)) {
home.createBucket(request -> request.bucket(bucket));
try {
home.putObject(request -> request.bucket(bucket).key("hello.txt"), RequestBody.fromString("hello"));
S3Exception redirected = assertThrows(S3Exception.class,
() -> wrongRegion.getObjectAsBytes(request -> request.bucket(bucket).key("hello.txt")));
assertEquals(301, redirected.statusCode());
assertEquals("us-east-1",
redirected.awsErrorDetails().sdkHttpResponse().firstMatchingHeader("x-amz-bucket-region").orElse(null));
assertEquals("hello",
crossRegion.getObjectAsBytes(request -> request.bucket(bucket).key("hello.txt")).asUtf8String());
} finally {
home.deleteObject(request -> request.bucket(bucket).key("hello.txt"));
home.deleteBucket(request -> request.bucket(bucket));
}
}
}
}
@@ -47,6 +47,7 @@ import java.util.HexFormat;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CountDownLatch;
@@ -477,6 +478,29 @@ class S3ServiceTest {
assertEquals("InvalidBucketName", ex.getErrorCode());
}
@Test
void bucketStoredWithoutARegionIsInTheDefaultRegion() {
// A bucket persisted before buckets recorded their Region is in the default one, as
// ListBuckets reports it, so the region redirect still applies to it.
InMemoryStorage<String, Bucket> bucketStore = new InMemoryStorage<>();
S3Service service = new S3Service(bucketStore, new InMemoryStorage<>(), tempDir.resolve("legacy-region"),
false, (LambdaService) null, new RegionResolver("eu-west-2", "000000000000"));
Bucket unrecorded = new Bucket("legacy-null-region");
unrecorded.setRegion(null);
bucketStore.put(unrecorded.getName(), unrecorded);
Bucket blank = new Bucket("legacy-blank-region");
blank.setRegion("");
bucketStore.put(blank.getName(), blank);
Bucket recorded = new Bucket("recorded-region");
recorded.setRegion("ap-south-1");
bucketStore.put(recorded.getName(), recorded);
assertEquals(Optional.of("eu-west-2"), service.findBucketRegion("legacy-null-region"));
assertEquals(Optional.of("eu-west-2"), service.findBucketRegion("legacy-blank-region"));
assertEquals(Optional.of("ap-south-1"), service.findBucketRegion("recorded-region"));
assertEquals(Optional.empty(), service.findBucketRegion("no-such-bucket"));
}
@Test
void listBucketsWithoutPaginationParametersReturnsMoreThanTenThousandBucketsOnOnePage() {
InMemoryStorage<String, Bucket> bucketStore = new InMemoryStorage<>();
@@ -22,11 +22,25 @@ public final class S3TestClients {
/** A path-style client in us-east-1 for account {@code 741624100001}. */
public static S3Client pathStyle() {
return pathStyle(Region.US_EAST_1);
}
/** A path-style client in {@code region} for account {@code 741624100001}. */
public static S3Client pathStyle(Region region) {
return pathStyle(region, false);
}
/**
* {@link #pathStyle(Region)} with the SDK's cross-Region access on or off: on, it follows S3's 301
* PermanentRedirect to a bucket in another Region.
*/
public static S3Client pathStyle(Region region, boolean crossRegionAccess) {
return S3Client.builder()
.endpointOverride(URI.create("http://localhost:" + RestAssured.port))
.httpClientBuilder(UrlConnectionHttpClient.builder())
.forcePathStyle(true)
.region(Region.US_EAST_1)
.region(region)
.crossRegionAccessEnabled(crossRegionAccess)
.credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("741624100001", "test")))
.build();
}
+1
View File
@@ -154,6 +154,7 @@ floci:
enforce-auth: false
default-presign-expiry-seconds: 3600
global-bucket-namespace: false
region-redirect: true
restore-completion-delay-seconds: 0
lifecycle-sweep-enabled: false # tests run the sweep themselves, so no bucket's rules apply behind another test's back
lifecycle-sweep-interval-seconds: 60