Skip to content

ceph-rgw: security and error handling fixes for the object store driver - #14740

Draft
wido wants to merge 10 commits into
apache:mainfrom
wido:fix/ceph-object-store-driver
Draft

wido wants to merge 10 commits into
apache:mainfrom
wido:fix/ceph-object-store-driver

Conversation

@wido

@wido wido commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes for the Ceph RGW object store driver, one per commit:

  • keep existing account details when storing the RGW keys
  • encrypt the RGW keys of an account, keep them per object store and hide secret keys in listAccounts
  • apply bucket encryption and object lock
  • refuse to delete a bucket which is not empty
  • report failures of the RGW admin API instead of hiding them
  • reuse the S3 and RGW admin clients
  • warn about a RGW URL without HTTPS, strip its trailing slash
  • create the RGW user with a display name
  • don't allow anonymous listing of a public bucket, refuse unknown policies
  • unit tests

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Unit tests only, not yet tested against a live RGW.

wido added 10 commits November 21, 2026 06:36
AccountDetailsDao.persist() removes every detail of the account before it
writes the given ones, so the first bucket of an account removed its
account-scoped settings.
… store

The keys were stored in plain text under one name per account, so a second
Ceph object store replaced the keys of the first one. They are now stored
encrypted with the ID of the store in their name; keys stored before are
still read. Secret keys in the account details are no longer returned by
listAccounts.
Both were accepted and recorded on the bucket, but never set in RGW.
The admin API removed the bucket with all its objects. The S3 API fails
with BucketNotEmpty instead.
- a failed lookup of the RGW user was taken for a missing user
- an existing RGW user without stored keys made the bucket creation fail
  with a NullPointerException, its keys are stored now
- the error of an existing bucket was wrapped twice
- adding an object store without credentials failed without the cause
A new client, with its own connection pool, was built for every call and
never closed.
…lash

The admin access key and the names of all buckets are no longer logged
when the object store is added.
The public policy allowed everyone to list the objects of the bucket, it
now only allows reading them. A policy other than public or private was
applied as private and is refused now.
@codecov

codecov Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 62.74510% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 20.81%. Comparing base (8ee3da5) to head (5747ea3).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...ge/datastore/driver/CephObjectStoreDriverImpl.java 74.41% 9 Missing and 2 partials ⚠️
...astore/lifecycle/CephObjectStoreLifeCycleImpl.java 0.00% 7 Missing ⚠️
server/src/main/java/com/cloud/api/ApiDBUtils.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #14740      +/-   ##
============================================
+ Coverage     20.78%   20.81%   +0.03%     
- Complexity    20858    20927      +69     
============================================
  Files          6053     6053              
  Lines        548237   548440     +203     
  Branches      78619    73281    -5338     
============================================
+ Hits         113935   114175     +240     
+ Misses       420953   420900      -53     
- Partials      13349    13365      +16     
Flag Coverage Δ
uitests 3.86% <ø> (-0.01%) ⬇️
unittests 22.25% <62.74%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant