From ccd86d96d905ea80fae00683d591d4d0c15eef73 Mon Sep 17 00:00:00 2001 From: jeanvetorello Date: Sun, 3 Aug 2025 03:57:09 -0300 Subject: [PATCH] ceph: fix SignatureDoesNotMatch by using correct secret key (#11115) Ensure bucket.getSecretKey() is used when building the S3 client. Previously, only getAccessKey() was passed for both key and secret, causing V4 signature validation failures during operations such as bucket creation and policy updates. Co-authored-by: Jean Vetorello --- .../datastore/driver/CephObjectStoreDriverImpl.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/storage/object/ceph/src/main/java/org/apache/cloudstack/storage/datastore/driver/CephObjectStoreDriverImpl.java b/plugins/storage/object/ceph/src/main/java/org/apache/cloudstack/storage/datastore/driver/CephObjectStoreDriverImpl.java index 5b5eaa08dc5..23f155c16c5 100644 --- a/plugins/storage/object/ceph/src/main/java/org/apache/cloudstack/storage/datastore/driver/CephObjectStoreDriverImpl.java +++ b/plugins/storage/object/ceph/src/main/java/org/apache/cloudstack/storage/datastore/driver/CephObjectStoreDriverImpl.java @@ -193,19 +193,19 @@ public class CephObjectStoreDriverImpl extends BaseObjectStoreDriverImpl { policyConfig = "{\"Version\":\"2012-10-17\",\"Statement\":[]}"; } - AmazonS3 client = getS3Client(getStoreURL(storeId), bucket.getAccessKey(), bucket.getAccessKey()); + AmazonS3 client = getS3Client(getStoreURL(storeId), bucket.getAccessKey(), bucket.getSecretKey()); client.setBucketPolicy(new SetBucketPolicyRequest(bucket.getName(), policyConfig)); } @Override public BucketPolicy getBucketPolicy(BucketTO bucket, long storeId) { - AmazonS3 client = getS3Client(getStoreURL(storeId), bucket.getAccessKey(), bucket.getAccessKey()); + AmazonS3 client = getS3Client(getStoreURL(storeId), bucket.getAccessKey(), bucket.getSecretKey()); return client.getBucketPolicy(new GetBucketPolicyRequest(bucket.getName())); } @Override public void deleteBucketPolicy(BucketTO bucket, long storeId) { - AmazonS3 client = getS3Client(getStoreURL(storeId), bucket.getAccessKey(), bucket.getAccessKey()); + AmazonS3 client = getS3Client(getStoreURL(storeId), bucket.getAccessKey(), bucket.getSecretKey()); client.deleteBucketPolicy(new DeleteBucketPolicyRequest(bucket.getName())); } @@ -255,7 +255,7 @@ public class CephObjectStoreDriverImpl extends BaseObjectStoreDriverImpl { @Override public boolean setBucketVersioning(BucketTO bucket, long storeId) { - AmazonS3 client = getS3Client(getStoreURL(storeId), bucket.getAccessKey(), bucket.getAccessKey()); + AmazonS3 client = getS3Client(getStoreURL(storeId), bucket.getAccessKey(), bucket.getSecretKey()); try { BucketVersioningConfiguration configuration = new BucketVersioningConfiguration().withStatus("Enabled"); @@ -272,7 +272,7 @@ public class CephObjectStoreDriverImpl extends BaseObjectStoreDriverImpl { @Override public boolean deleteBucketVersioning(BucketTO bucket, long storeId) { - AmazonS3 client = getS3Client(getStoreURL(storeId), bucket.getAccessKey(), bucket.getAccessKey()); + AmazonS3 client = getS3Client(getStoreURL(storeId), bucket.getAccessKey(), bucket.getSecretKey()); try { BucketVersioningConfiguration configuration = new BucketVersioningConfiguration().withStatus("Suspended");