<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[IBM Storage Ceph S3 Security Blog Series]]></title><description><![CDATA[IBM Storage Ceph S3 Security Blog Series]]></description><link>https://ibm-storage-ceph-s3-security-blog-series.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Thu, 26 Nov 2026 11:59:16 GMT</lastBuildDate><atom:link href="https://ibm-storage-ceph-s3-security-blog-series.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Mastering IAM in Ceph: Multi-Tenancy, Access Control, and Why ACLs Must Die]]></title><description><![CDATA[In March 2017, a misconfigured S3 bucket at Verizon exposed the personal information of 14 million customers. The root cause wasn't a sophisticated attack…]]></description><link>https://ibm-storage-ceph-s3-security-blog-series.hashnode.dev/mastering-iam-in-ceph-multi-tenancy-access-control-and-why-acls-must-die</link><guid isPermaLink="true">https://ibm-storage-ceph-s3-security-blog-series.hashnode.dev/mastering-iam-in-ceph-multi-tenancy-access-control-and-why-acls-must-die</guid><category><![CDATA[ceph]]></category><category><![CDATA[IBM]]></category><category><![CDATA[object storage]]></category><dc:creator><![CDATA[Daniel Parkes]]></dc:creator><pubDate>Sun, 04 Jan 2026 20:35:31 GMT</pubDate><content:encoded><![CDATA[<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767549864482/5e07de10-5b83-4de3-a013-fd9c3f77427a.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-introduction-when-security-theater-becomes-a-real-disaster">Introduction: When Security Theater Becomes a Real Disaster</h2>
<p>In March 2017, a misconfigured S3 bucket at Verizon exposed the personal information of 14 million customers. The root cause wasn't a sophisticated attack; it was a simple oversight in access permissions. The bucket was set to be publicly accessible due to S3 permission misconfiguration, and no one noticed because ACLs were managed separately from the company's centralized IAM policies. The security team had implemented careful, identity-based access controls, but a resource-level ACL silently bypassed them by granting access to "All Users."</p>
<p>This scenario repeats constantly across the industry: ACLs creating invisible access paths that security teams don't know exist, buckets accidentally exposed to the public internet, and contractors uploading data that the bucket owner cannot reliably read or administer, while still consuming capacity.</p>
<p>Between 2017 and 2019, major companies exposed hundreds of millions of records via misconfigured S3 permissions (ACLs and/or bucket policies):</p>
<ul>
<li><p><strong>Verizon (2017)</strong>: <a target="_blank" href="https://www.techtarget.com/searchsecurity/news/450422709/Misconfigured-AWS-S3-bucket-exposes-millions-of-Verizon-customers-data">14 million customers</a> - AWS S3 bucket configured for public access exposed names, addresses, account PINs</p>
</li>
<li><p><strong>Facebook (2019)</strong>: <a target="_blank" href="https://www.upguard.com/breaches/facebook-user-data-leak">540 million records</a> - Third-party apps stored user data in publicly accessible S3 buckets</p>
</li>
<li><p><strong>Instagram (2019)</strong>: <a target="_blank" href="https://www.cpomagazine.com/cyber-security/instagram-breach-exposes-personal-data-of-49-million-users/">49 million records</a> - Marketing firm left influencer database unprotected in AWS S3</p>
</li>
</ul>
<p>The AWS response was clear: <a target="_blank" href="https://aws.amazon.com/about-aws/whats-new/2023/04/amazon-s3-security-best-practices-buckets-default/">since April 2023</a>, <strong>all new S3 buckets default to "ACLs disabled"</strong> (BucketOwnerEnforced) and <strong>Block Public Access enabled</strong>. AWS strongly recommends disabling ACLs on existing buckets and migrating to a pure policy-based model with IAM Accounts architecture.</p>
<p>If you're running IBM Storage Ceph Object Gateway (RGW), you have access to the same IAM Accounts model introduced in IBM Storage Ceph 8.1 (Based on Ceph Squid 19.2.0). This post explains why ACLs must be disabled immediately and how to implement modern, secure access control with IAM policies.</p>
<blockquote>
<p><strong>Do This First (Quick Security Wins)</strong></p>
<p>Before reading further, take these two actions on all production buckets:</p>
<ol>
<li><p><strong>Enable Block Public Access</strong> - Prevents public exposure via ACLs or bucket policies</p>
</li>
<li><p><strong>Deny ACL operations</strong> - Add explicit deny for <code>s3:PutObjectAcl</code> and <code>s3:PutBucketAcl</code> as defense-in-depth</p>
</li>
</ol>
<p>These changes prevent the attack patterns described in this post. Continue reading to understand why and how.</p>
</blockquote>
<hr />
<h2 id="heading-why-acls-failed">Why ACLs Failed?</h2>
<p>Access Control Lists (ACLs) were S3's original permission system. They failed for several critical reasons that made them fundamentally unsafe for production use.</p>
<h3 id="heading-public-access-disasters">Public Access Disasters</h3>
<p>The most dangerous ACL failure was a silent public exposure. A single misconfigured ACL could grant the entire internet access to your data, and your security team would never know because ACLs weren't visible in centralized IAM policies.</p>
<p>How it happened:</p>
<pre><code class="lang-bash">$ <span class="hljs-built_in">export</span> RGW_ENDPOINT=<span class="hljs-string">"https://rgw.example.com"</span>

<span class="hljs-comment"># Developer accidentally makes object public during testing</span>
$ aws --profile developer --endpoint-url <span class="hljs-string">"<span class="hljs-variable">$RGW_ENDPOINT</span>"</span> s3api put-object-acl \
  --bucket bucketacl \
  --key hosts \
  --grant-read uri=http://acs.amazonaws.com/groups/global/AllUsers
$ aws --profile developer --endpoint-url <span class="hljs-string">"<span class="hljs-variable">$RGW_ENDPOINT</span>"</span> s3api get-object-acl \
  --bucket bucketacl \ 
  --key hosts
{
    <span class="hljs-string">"Owner"</span>: {
        <span class="hljs-string">"DisplayName"</span>: <span class="hljs-string">"developer"</span>,
        <span class="hljs-string">"ID"</span>: <span class="hljs-string">"developer"</span>
    },
    <span class="hljs-string">"Grants"</span>: [
        {
            <span class="hljs-string">"Grantee"</span>: {
                <span class="hljs-string">"Type"</span>: <span class="hljs-string">"Group"</span>,
                <span class="hljs-string">"URI"</span>: <span class="hljs-string">"http://acs.amazonaws.com/groups/global/AllUsers"</span>
            },
            <span class="hljs-string">"Permission"</span>: <span class="hljs-string">"READ"</span>
        }
    ]
}


<span class="hljs-comment"># Security team checks IAM policies - looks fine (against the same RGW endpoint)</span>
$ aws --profile account-root --endpoint-url <span class="hljs-string">"<span class="hljs-variable">$RGW_ENDPOINT</span>"</span> iam get-user-policy \
  --user-name developer \
  --policy-name S3Access
<span class="hljs-comment"># ✓ Least privilege, no issues detected</span>

<span class="hljs-comment"># Meanwhile, the object is public to anyone who can reach the RGW endpoint:</span>
$ curl <span class="hljs-string">"<span class="hljs-variable">$RGW_ENDPOINT</span>/bucketacl/hosts"</span> 
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.2XX.0.X   ceph01 
<span class="hljs-comment"># Full access, no authentication required</span>


<span class="hljs-comment"># The same risk exists at bucket scope; a public bucket ACL enables unauthenticated listing</span>
<span class="hljs-comment"># which can leak keys and metadata</span>
$ aws --profile developer --endpoint-url <span class="hljs-string">"<span class="hljs-variable">$RGW_ENDPOINT</span>"</span> s3api put-bucket-acl \
--bucket bucketacl --acl public-read
<span class="hljs-comment"># Unauthenticated Access to list bucket contents</span>
$ curl -s <span class="hljs-string">"<span class="hljs-variable">$RGW_ENDPOINT</span>/bucketacl"</span> | xmllint --format -
&lt;?xml version=<span class="hljs-string">"1.0"</span> encoding=<span class="hljs-string">"UTF-8"</span>?&gt;
&lt;ListBucketResult xmlns=<span class="hljs-string">"http://s3.amazonaws.com/doc/2006-03-01/"</span>&gt;
  &lt;Name&gt;bucketacl&lt;/Name&gt;
 ...
  &lt;Contents&gt;
    &lt;Key&gt;hosts&lt;/Key&gt;
    &lt;LastModified&gt;2025-12-31T08:58:21.346Z&lt;/LastModified&gt;
    &lt;ETag&gt;<span class="hljs-string">"71ae31ad9b6e7fda9cb5a8628b2e152a"</span>&lt;/ETag&gt;
    &lt;Size&gt;415&lt;/Size&gt;
    &lt;StorageClass&gt;STANDARD&lt;/StorageClass&gt;
    &lt;Owner&gt;
      &lt;ID&gt;developer&lt;/ID&gt;
      &lt;DisplayName&gt;developer&lt;/DisplayName&gt;
 ...
&lt;/ListBucketResult&gt;
</code></pre>
<p><strong>Why was it catastrophic</strong>?</p>
<ol>
<li><p><strong>Decentralized control</strong>: ACLs could be set per-bucket and per-object, creating millions of potential exposure points</p>
</li>
<li><p><strong>No visibility</strong>: ACLs didn't appear in the IAM console - security teams had no way to audit them centrally</p>
</li>
<li><p><strong>Silent bypasses</strong>: Even perfect IAM policies couldn't prevent an ACL from granting public access</p>
</li>
<li><p><strong>Object-level chaos</strong>: With millions of objects, each having its own ACL, comprehensive auditing was impossible</p>
</li>
</ol>
<p><strong>Real-world impact</strong>: The three breaches in our introduction (Verizon, Facebook, Instagram) all involved publicly accessible S3 data caused by permission misconfiguration (ACLs, bucket policies, or both), combined with weak central visibility and auditing; exactly the problems that policy-based access control solves.</p>
<h3 id="heading-the-object-ownership-problem">The Object Ownership Problem</h3>
<p>Beyond public access, ACLs created an ownership nightmare. When external accounts uploaded objects to your bucket, they owned those objects, not you.</p>
<pre><code class="lang-bash"><span class="hljs-comment"># Contractor uploads data to your bucket</span>
$ aws --endpoint-url <span class="hljs-string">"<span class="hljs-variable">$RGW_ENDPOINT</span>"</span> s3 cp sensitive.pdf s3://company-bucket/contractor-data/ --profile contractor
upload: ./sensitive.pdf to s3://company-bucket/contractor-data/sensitive.pdf

<span class="hljs-comment"># Who owns this object?</span>
$ aws --endpoint-url <span class="hljs-string">"<span class="hljs-variable">$RGW_ENDPOINT</span>"</span> s3api get-object-acl \
  --bucket company-bucket \
  --key contractor-data/sensitive.pdf \
  --profile contractor
{
    <span class="hljs-string">"Owner"</span>: {
        <span class="hljs-string">"DisplayName"</span>: <span class="hljs-string">"Contractor Account"</span>,
        <span class="hljs-string">"ID"</span>: <span class="hljs-string">"contractor"</span>  ← Contractor owns it, not you!
    }
}

<span class="hljs-comment"># You (bucket owner) can't READ the object</span>
$ aws --endpoint-url <span class="hljs-string">"<span class="hljs-variable">$RGW_ENDPOINT</span>"</span> s3 cp s3://company-bucket/contractor-data/sensitive.pdf ./test.pdf --profile company-admin
fatal error: An error occurred (403) when calling the HeadObject operation: Forbidden

<span class="hljs-comment"># You can't even GET the ACL to see permissions</span>
$ aws --endpoint-url <span class="hljs-string">"<span class="hljs-variable">$RGW_ENDPOINT</span>"</span> s3api get-object-acl --bucket company-bucket --key contractor-data/sensitive.pdf --profile company-admin
fatal error: An error occurred (AccessDenied) when calling the GetObjectAcl operation: Access Denied


<span class="hljs-comment"># You can't MODIFY the ACL</span>
$ aws --endpoint-url <span class="hljs-string">"<span class="hljs-variable">$RGW_ENDPOINT</span>"</span> s3api put-object-acl --bucket company-bucket --key contractor-data/sensitive.pdf --acl private --profile company-admin
fatal error: An error occurred (AccessDenied) when calling the PutObjectAcl operation: Access Denied
</code></pre>
<p>For on-premises Ceph deployments, while there's no per-GB billing surprise, the <strong>operational and compliance problems are identical</strong>: you can't read, audit, or manage data in your own infrastructure.</p>
<blockquote>
<p>In Ceph RGW, bucket owners CAN delete objects they don't own. However, they still can't read, view ACLs, or manage those objects, creating operational blind spots and compliance risks.</p>
</blockquote>
<h3 id="heading-the-authenticated-read-trap-over-sharing-inside-the-cluster">The authenticated-read trap (over-sharing inside the cluster)</h3>
<p>ACLs include grants that <em>appear</em> safer than “public” but remain dangerously broad. In S3, <code>authenticated-read</code> grants read access to the <code>AuthenticatedUsers</code> group; in Ceph RGW terms, that can translate to “any identity that can authenticate to this RGW endpoint/cluster,” not “only my team.” On a shared on-premises platform (multiple accounts, tenants, service accounts, CI users, integrations), this can lead to accidental cross-team or cross-tenant data exposure.</p>
<pre><code class="lang-bash">
<span class="hljs-comment"># Finance team uploads "internal" data with authenticated-read</span>
<span class="hljs-comment"># (thinking it's safer than public)</span>
$ aws --endpoint-url <span class="hljs-string">"<span class="hljs-variable">$RGW_ENDPOINT</span>"</span> s3 cp finance-report.pdf \
  s3://company-bucket/finance-report.pdf \
  --acl authenticated-read --profile finance-team

<span class="hljs-comment"># Check the ACL - looks reasonable?</span>
$ aws --endpoint-url <span class="hljs-string">"<span class="hljs-variable">$RGW_ENDPOINT</span>"</span> s3api get-object-acl \
  --bucket company-bucket \
  --key finance-report.pdf --profile finance-team
{
    <span class="hljs-string">"Owner"</span>: {
        <span class="hljs-string">"DisplayName"</span>: <span class="hljs-string">"Finance Team"</span>,
        <span class="hljs-string">"ID"</span>: <span class="hljs-string">"finance-team"</span>
    },
    <span class="hljs-string">"Grants"</span>: [
        {
            <span class="hljs-string">"Grantee"</span>: {
                <span class="hljs-string">"Type"</span>: <span class="hljs-string">"Group"</span>,
                <span class="hljs-string">"URI"</span>: <span class="hljs-string">"http://acs.amazonaws.com/groups/global/AuthenticatedUsers"</span>
            },
            <span class="hljs-string">"Permission"</span>: <span class="hljs-string">"READ"</span>  ← ANY authenticated user on the cluster!
        }
    ]
}

<span class="hljs-comment"># DevOps team (completely different department) can read it!</span>
$ aws --profile devops --endpoint-url <span class="hljs-string">"<span class="hljs-variable">$RGW_ENDPOINT</span>"</span> s3 cp \
  s3://company-bucket/finance-report.pdf ./leaked.pdf
download: s3://company-bucket/finance-report.pdf to ./leaked.pdf

<span class="hljs-comment"># Contractor user(or any other authenticated user) can also access it</span>
$ aws --profile contractor --endpoint-url <span class="hljs-string">"<span class="hljs-variable">$RGW_ENDPOINT</span>"</span> s3 cp \
  s3://company-bucket/finance-report.pdf ./contractor-copy.pdf
download: s3://company-bucket/finance-report.pdf to ./contractor-copy.pdf

<span class="hljs-comment"># Anonymous users are still blocked</span>
$ aws s3 cp s3://company-bucket/finance-report.pdf ./anon.pdf \
  --endpoint-url <span class="hljs-string">"<span class="hljs-variable">$RGW_ENDPOINT</span>"</span> --no-sign-request
fatal error: An error occurred (403) when calling the HeadObject operation: Forbidden
</code></pre>
<h3 id="heading-public-write-is-an-integrity-disaster-not-just-a-leak">Public write is an integrity disaster, not just a leak</h3>
<p>ACL errors are not solely about “read” exposure. With bucket ACLs, <code>public-read-write</code> (or broad write grants) can enable untrusted PUT requests to a bucket. That turns into an integrity incident: poisoned datasets, overwritten “golden” artifacts, malware hosting, or backup tampering. Even On-prem “internal-only” does not save you; it just changes the attacker's vector, but the threat still exists.</p>
<h3 id="heading-writeacp-is-permission-to-rewrite-permissions">WRITE_ACP is “permission to rewrite permissions.”</h3>
<p>ACLs don’t just control data-plane actions; they can delegate control-plane authority over the ACL itself. In Ceph RGW S3 semantics, <code>WRITE_ACP</code> the permission that allows changing a bucket’s ACL (required <code>WRITE_ACP</code> for <code>PUT Bucket ACL</code>). If the wrong principal has it, they can escalate later by granting broader access (including public exposure), and this delegation is distributed across buckets and objects. This is a governance anti-pattern because the system contains a hidden “permission to change permissions.”</p>
<pre><code class="lang-bash"> <span class="hljs-comment"># Step 1: Bucket owner grants contractor WRITE + WRITE_ACP</span>
$ aws --endpoint-url <span class="hljs-string">"<span class="hljs-variable">$RGW_ENDPOINT</span>"</span> s3api put-bucket-acl \
  --bucket company-bucket \
  --grant-write id=contractor \
  --grant-write-acp id=contractor \
  --profile developer

<span class="hljs-comment"># Verify the ACL</span>
$ aws --endpoint-url <span class="hljs-string">"<span class="hljs-variable">$RGW_ENDPOINT</span>"</span> s3api get-bucket-acl \
  --bucket company-bucket --profile developer
{
    <span class="hljs-string">"Owner"</span>: {
        <span class="hljs-string">"DisplayName"</span>: <span class="hljs-string">"developer"</span>,
        <span class="hljs-string">"ID"</span>: <span class="hljs-string">"developer"</span>
    },
    <span class="hljs-string">"Grants"</span>: [
        {
            <span class="hljs-string">"Grantee"</span>: {
                <span class="hljs-string">"DisplayName"</span>: <span class="hljs-string">"Contractor Account"</span>,
                <span class="hljs-string">"ID"</span>: <span class="hljs-string">"contractor"</span>,
                <span class="hljs-string">"Type"</span>: <span class="hljs-string">"CanonicalUser"</span>
            },
            <span class="hljs-string">"Permission"</span>: <span class="hljs-string">"WRITE"</span>
        },
        {
            <span class="hljs-string">"Grantee"</span>: {
                <span class="hljs-string">"DisplayName"</span>: <span class="hljs-string">"Contractor Account"</span>,
                <span class="hljs-string">"ID"</span>: <span class="hljs-string">"contractor"</span>,
                <span class="hljs-string">"Type"</span>: <span class="hljs-string">"CanonicalUser"</span>
            },
            <span class="hljs-string">"Permission"</span>: <span class="hljs-string">"WRITE_ACP"</span>  ← Contractor can modify ACLs!
        },
        {
            <span class="hljs-string">"Grantee"</span>: {
                <span class="hljs-string">"DisplayName"</span>: <span class="hljs-string">"developer"</span>,
                <span class="hljs-string">"ID"</span>: <span class="hljs-string">"developer"</span>,
                <span class="hljs-string">"Type"</span>: <span class="hljs-string">"CanonicalUser"</span>
            },
            <span class="hljs-string">"Permission"</span>: <span class="hljs-string">"FULL_CONTROL"</span>
        }
    ]
}

<span class="hljs-comment"># Step 2: Contractor escalates - makes bucket public!</span>
$ <span class="hljs-built_in">echo</span> <span class="hljs-string">"Step 2: Contractor abuses WRITE_ACP to make bucket PUBLIC"</span>
$ aws --endpoint-url <span class="hljs-string">"<span class="hljs-variable">$RGW_ENDPOINT</span>"</span> s3api put-bucket-acl \
  --bucket company-bucket \
  --acl public-read --profile contractor
<span class="hljs-comment"># Success! Contractor just made the bucket public</span>

<span class="hljs-comment"># Step 3: Verify the escalation</span>
$ aws --endpoint-url <span class="hljs-string">"<span class="hljs-variable">$RGW_ENDPOINT</span>"</span> s3api get-bucket-acl \
  --bucket company-bucket --profile developer
{
    <span class="hljs-string">"Owner"</span>: {
        <span class="hljs-string">"DisplayName"</span>: <span class="hljs-string">"developer"</span>,
        <span class="hljs-string">"ID"</span>: <span class="hljs-string">"developer"</span>
    },
    <span class="hljs-string">"Grants"</span>: [
        {
            <span class="hljs-string">"Grantee"</span>: {
                <span class="hljs-string">"Type"</span>: <span class="hljs-string">"Group"</span>,
                <span class="hljs-string">"URI"</span>: <span class="hljs-string">"http://acs.amazonaws.com/groups/global/AllUsers"</span>
            },
            <span class="hljs-string">"Permission"</span>: <span class="hljs-string">"READ"</span>  ← NOW PUBLIC! Anyone can list contents
        },
        {
            <span class="hljs-string">"Grantee"</span>: {
                <span class="hljs-string">"DisplayName"</span>: <span class="hljs-string">"developer"</span>,
                <span class="hljs-string">"ID"</span>: <span class="hljs-string">"developer"</span>,
                <span class="hljs-string">"Type"</span>: <span class="hljs-string">"CanonicalUser"</span>
            },
            <span class="hljs-string">"Permission"</span>: <span class="hljs-string">"FULL_CONTROL"</span>
        }
    ]
}

<span class="hljs-comment"># Step 4: Anonymous users can now list the bucket</span>
$ aws s3 ls s3://company-bucket/ \
  --endpoint-url <span class="hljs-string">"<span class="hljs-variable">$RGW_ENDPOINT</span>"</span> --no-sign-request
2025-12-31 05:00:00         27 finance-report.pdf
<span class="hljs-comment"># Public exposure complete</span>
</code></pre>
<h2 id="heading-the-solution-stop-using-acls-immediately">The Solution: Stop using ACLs immediately</h2>
<p>AWS and IBM Storage Ceph Object Gateway (RGW) provide controls to disable ACLs entirely. This should be your first action on any production bucket.</p>
<h3 id="heading-step-1-block-public-access">Step 1: Block Public Access</h3>
<p>Enforce public access blocks to prevent bucket ACLs from granting public access.</p>
<blockquote>
<p><strong>Ceph AWS CLI Configuration Note</strong></p>
<p>All <code>aws</code> CLI commands in this guide assume your AWS CLI profile is configured: See the <a target="_blank" href="https://docs.ceph.com/en/latest/radosgw/s3/commons/#aws-cli-setup">Ceph documentation on AWS CLI configuration</a> and <a target="_blank" href="https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html">AWS CLI endpoint configuration</a> for details.</p>
</blockquote>
<p>Bucket-level (Granularity per individual bucket):</p>
<pre><code class="lang-bash"><span class="hljs-comment"># Anon access is enabled on bucket from previous example</span>
$ aws s3 ls s3://company-bucket/ \
  --endpoint-url <span class="hljs-string">"<span class="hljs-variable">$RGW_ENDPOINT</span>"</span> --no-sign-request
                           PRE contractor-data/
2025-12-31 07:13:55         26 finance-report.pdf
<span class="hljs-comment"># We use public-access-block on our bucket</span>
$ aws s3api put-public-access-block \
  --bucket company-bucket \
  --public-access-block-configuration \
    BlockPublicAcls=<span class="hljs-literal">true</span>,IgnorePublicAcls=<span class="hljs-literal">true</span>,BlockPublicPolicy=<span class="hljs-literal">true</span>,RestrictPublicBuckets=<span class="hljs-literal">true</span> \
  --endpoint-url <span class="hljs-string">"<span class="hljs-variable">$RGW_ENDPOINT</span>"</span> \
  --profile developer
<span class="hljs-comment"># Public Access has been removed from the Bucket, a non-authorized request fails after the put-public-access-block</span>
$ aws s3 ls s3://company-bucket/ --endpoint-url <span class="hljs-string">"<span class="hljs-variable">$RGW_ENDPOINT</span>"</span> --no-sign-request
fatal error: An error occurred (AccessDenied) when calling the ListObjectsV2 operation: Access Denied
<span class="hljs-comment"># “Some AWS CLI versions surface certain error responses poorly; if you see a Python exception, re-run with --debug to confirm the underlying HTTP 403/AccessDenied.”</span>
</code></pre>
<p>What each setting does:</p>
<ul>
<li><p><strong>BlockPublicAcls</strong>: Prevents new public ACLs from being applied (redundant if BucketOwnerEnforced, but adds defense in depth)</p>
</li>
<li><p><strong>IgnorePublicAcls</strong>: Ignores existing public ACLs (treats them as private)</p>
</li>
<li><p><strong>BlockPublicPolicy</strong>: Prevents bucket policies that grant public access</p>
</li>
<li><p><strong>RestrictPublicBuckets</strong>: Blocks public access to buckets even if policies exist</p>
</li>
</ul>
<h3 id="heading-step-2-deny-acl-operations-via-iam-policy">Step 2: Deny ACL Operations via IAM Policy</h3>
<p>As the root account administrator, you should establish a security baseline that prevents ACL usage <strong>by default</strong> for all users and groups. This way, even if a developer tries to use ACLs in the future, they'll get an immediate <code>Access Denied</code> error, preventing accidents before they happen.</p>
<p>The governance pattern creates a standard "DenyACLs" policy that you attach to every new user or group you create. This establishes ACL blocking as your organization's security baseline.</p>
<p>Create the standard policy:</p>
<pre><code class="lang-bash">$ cat &gt; deny-acl-operations.json &lt;&lt;<span class="hljs-string">'EOF'</span>
{
  <span class="hljs-string">"Version"</span>: <span class="hljs-string">"2012-10-17"</span>,
  <span class="hljs-string">"Statement"</span>: [
    {
      <span class="hljs-string">"Sid"</span>: <span class="hljs-string">"DenyACLOperations"</span>,
      <span class="hljs-string">"Effect"</span>: <span class="hljs-string">"Deny"</span>,
      <span class="hljs-string">"Action"</span>: [
        <span class="hljs-string">"s3:PutObjectAcl"</span>,
        <span class="hljs-string">"s3:PutObjectVersionAcl"</span>,
        <span class="hljs-string">"s3:PutBucketAcl"</span>
      ],
      <span class="hljs-string">"Resource"</span>: [
        <span class="hljs-string">"arn:aws:s3:::*"</span>,
        <span class="hljs-string">"arn:aws:s3:::*/*"</span>
      ]
    }
  ]
}
EOF
</code></pre>
<p>Here is an example of how to apply the policy to new users as you create them:</p>
<pre><code class="lang-bash"><span class="hljs-comment"># Create a new developer</span>
$ aws iam create-user --user-name alice
{
    <span class="hljs-string">"User"</span>: {
        <span class="hljs-string">"Path"</span>: <span class="hljs-string">"/"</span>,
        <span class="hljs-string">"UserName"</span>: <span class="hljs-string">"alice"</span>,
        <span class="hljs-string">"UserId"</span>: <span class="hljs-string">"4abb3a59-7991-4644-8863-347b02adc48f"</span>,
        <span class="hljs-string">"Arn"</span>: <span class="hljs-string">"arn:aws:iam::RGW89761398048153XXX:user/alice"</span>,
        <span class="hljs-string">"CreateDate"</span>: <span class="hljs-string">"2025-01-03T15:44:06.920034Z"</span>
    }
}
$ aws iam create-access-key --user-name alice

<span class="hljs-comment"># Immediately apply the ACL deny policy (before giving any other permissions)</span>
$ aws iam put-user-policy \
  --user-name alice \
  --policy-name DenyACLs \
  --policy-document file://deny-acl-operations.json

<span class="hljs-comment"># Now grant the user their actual S3 permissions</span>
$ aws iam attach-user-policy --user-name alice --policy-arn arn:aws:iam::aws:policy/AmazonS3FullAccess
</code></pre>
<p>If Alice later tries to configure ACLs on any bucket, she will get <code>Access Denied</code>:</p>
<pre><code class="lang-bash"><span class="hljs-comment"># Create a bucket as Alice, upload an Object and try to apply a public ACL on the Object</span>
$ aws --profile alice --endpoint-url=<span class="hljs-string">"<span class="hljs-variable">$RGW_ENDPOINT</span>"</span> s3 mb s3://alicebucket
$ aws --profile alice --endpoint-url <span class="hljs-string">"<span class="hljs-variable">$RGW_ENDPOINT</span>"</span> s3 cp finance-report.pdf s3://alicebucket
$ aws --profile alice --endpoint-url <span class="hljs-string">"<span class="hljs-variable">$RGW_ENDPOINT</span>"</span> s3api put-object-acl --bucket alicebucket --key finance-report.pdf --acl public-read
<span class="hljs-comment">#  Error: Access Denied</span>
fatal error: An error occurred (AccessDenied) when calling the PutObjectAcl operation: Access Denied
<span class="hljs-comment"># Some AWS CLI versions surface certain error responses poorly; if you see a Python exception, re-run with --debug to confirm the underlying HTTP 403/AccessDenied.</span>
</code></pre>
<h2 id="heading-wait-how-do-i-share-data-now">"Wait, How Do I Share Data Now?"</h2>
<p>With ACLs disabled, you might be wondering: How do I grant cross-account access to share my Datasets?</p>
<p>Previously, you might have used ACLs to grant a contractor account read access to specific objects or allowed a partner account to upload files. With ACLs gone, how do you securely share data between accounts?</p>
<p><strong>Two modern approaches exist</strong>:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Approach</td><td>How It Works</td><td>Access Pattern</td><td>Best For</td></tr>
</thead>
<tbody>
<tr>
<td><strong>Bucket policies</strong></td><td>Resource owner adds bucket policy; requesting account adds identity policy</td><td>Direct, always-on access</td><td>Static, permanent sharing</td></tr>
<tr>
<td><strong>IAM Role assumption</strong></td><td>Resource owner creates an assumable role; requesting account assumes it</td><td>Temporary session (1-12h)</td><td>Dynamic, auditable access</td></tr>
</tbody>
</table>
</div><p><strong>We'll focus on IAM role assumption</strong> because it provides:</p>
<ul>
<li><p><strong>Temporary credentials</strong> that auto-expire (vs. permanent keys)</p>
</li>
<li><p><strong>Detailed audit trails</strong> showing who assumed what role and when (vs. static access logs)</p>
</li>
<li><p><strong>Instant revocation</strong> by deleting the role (vs. updating multiple policies)</p>
</li>
<li><p><strong>Least privilege</strong> with time-bound access (vs. always-on permissions)</p>
</li>
</ul>
<p>This is also AWS's recommended pattern and follows zero-trust principles. Let's see how.</p>
<h2 id="heading-iam-accounts-the-modern-solution">IAM Accounts: The Modern Solution</h2>
<p>IBM Storage Ceph Object Gateway (RGW) implements AWS-compatible IAM Accounts, introduced in IBM Storage Ceph 8.1 (Squid/19.2.0). This provides proper multi-tenancy with policy-based access control instead of ACLs.</p>
<h3 id="heading-what-is-an-iam-account">What is an IAM Account?</h3>
<p>An <strong>IAM Account</strong> provides isolation for identities and access control:</p>
<pre><code class="lang-ini">Account: finance-team (ID: RGW12345678901234567)
├── Users &amp; Groups (isolated per account)
├── Roles (isolated per account)  
├── Policies (fine-grained permissions)
└── S3 Buckets (owned by account)
</code></pre>
<blockquote>
<p>S3 bucket <strong>names</strong> are globally unique across ALL accounts in a flat namespace (just like AWS S3). If Finance creates a bucket called <code>financial-reports</code> No other account can use that name. However, bucket <strong>ownership</strong> and <strong>access control</strong> are account-specific, only Finance can manage their <code>financial-reports</code> bucket.</p>
<p><em>Ceph accounts can optionally belong to a tenant for namespace isolation. Within a tenant, bucket names are unique to that tenant; they are not globally unique across all tenants.</em></p>
</blockquote>
<p>Key distinction:</p>
<ul>
<li><p><strong>Account Root User</strong>: Emergency admin access only, created with <code>--account-root</code> flag</p>
</li>
<li><p><strong>IAM Users</strong>: Day-to-day access, follows the least privilege principle</p>
</li>
</ul>
<p>For this post, we'll assume you have two accounts already set up:</p>
<ul>
<li><p><strong>Finance Account</strong> (ID: <code>RGW00893359550361292</code>)</p>
</li>
<li><p><strong>DevOps Account</strong> (ID: <code>RGW89761398048153888</code>)</p>
</li>
</ul>
<blockquote>
<p>For a complete guide on creating IAM Accounts, users, and basic configuration, see our previous post: <a target="_blank" href="https://ceph.io/en/news/blog/2025/enhancing-ceph-multitenancy-with-iam-accounts/">Enhancing Ceph Multitenancy with IAM Accounts</a>.</p>
</blockquote>
<h2 id="heading-cross-account-sharing-the-modern-way">Cross-Account Sharing: The Modern Way</h2>
<p><strong>Scenario</strong>: Finance needs to give DevOps read-only access to backup data for disaster recovery testing. Previously, this might have been done with ACLs. Now, we use cross-account role assumption.</p>
<p><strong>Requirements</strong>:</p>
<ul>
<li><p>DevOps can read backups, but cannot modify or delete them</p>
</li>
<li><p>Access uses temporary credentials (not long-term keys)</p>
</li>
<li><p>Finance can revoke access instantly</p>
</li>
<li><p>Fully auditable (who accessed what, when)</p>
</li>
</ul>
<h3 id="heading-how-it-works">How It Works</h3>
<p>The key insight: Create a role in the Finance account (same account as the bucket). When DevOps assumes this role, they temporarily "become" a Finance account principal with Finance credentials.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1765907670163/8b060b2d-6f10-4761-82b7-75717606b121.png" alt class="image--center mx-auto" /></p>
<p>This is the same STS pattern we covered in our <a target="_blank" href="https://ibm-storage-ceph-s3-security-blog-series.hashnode.dev/breaking-the-static-key-habit-modernizing-ibm-storage-ceph-s3-security-with-sts">previous post on temporary credentials</a>, but now applied to cross-account access.</p>
<h3 id="heading-implementation">Implementation</h3>
<h4 id="heading-1-finance-creates-cross-account-role-for-the-devops-team">1. Finance Creates Cross-Account Role for the Devops Team</h4>
<p>Finance creates a role called `devops-backup-reader` in their account with two policies:</p>
<p>The Trust Policy (who can assume this role):</p>
<pre><code class="lang-bash">$ cat &gt; trust-policy.json &lt;&lt;<span class="hljs-string">'EOF'</span>
{
  <span class="hljs-string">"Version"</span>: <span class="hljs-string">"2012-10-17"</span>,
  <span class="hljs-string">"Statement"</span>: [{
    <span class="hljs-string">"Effect"</span>: <span class="hljs-string">"Allow"</span>,
    <span class="hljs-string">"Principal"</span>: {
      <span class="hljs-string">"AWS"</span>: <span class="hljs-string">"arn:aws:iam::RGW89761398048153888:user/dave-backup-ops"</span>
    },
    <span class="hljs-string">"Action"</span>: <span class="hljs-string">"sts:AssumeRole"</span>
  }]
}
EOF
</code></pre>
<p>This says: <strong><em>"DevOps account user ‘dave’ can assume this role."</em></strong></p>
<blockquote>
<p>You can use in the trust policy the <code>RGWXXXX:root</code> formatting for the Principal this gives access to all users in the devops account to assume the role, then we could configure in the devops account to allow users from a specific IAM group to be able to assume the finance `devops-backup-reader` role.</p>
</blockquote>
<p>And the Permission Policy (what the role can do):</p>
<pre><code class="lang-bash">$ cat &gt; role-permissions.json &lt;&lt;<span class="hljs-string">'EOF'</span>
{
  <span class="hljs-string">"Version"</span>: <span class="hljs-string">"2012-10-17"</span>,
  <span class="hljs-string">"Statement"</span>: [{
    <span class="hljs-string">"Effect"</span>: <span class="hljs-string">"Allow"</span>,
    <span class="hljs-string">"Action"</span>: [<span class="hljs-string">"s3:GetObject"</span>, <span class="hljs-string">"s3:ListBucket"</span>],
    <span class="hljs-string">"Resource"</span>: [
      <span class="hljs-string">"arn:aws:s3:::finance-backups"</span>,
      <span class="hljs-string">"arn:aws:s3:::finance-backups/*"</span>
    ]
  }]
}
EOF
</code></pre>
<p>This says: <strong>"<em>This role can list &amp; read the finance-backups bucket.</em>"</strong></p>
<p>Once we have the policy files created, we can go ahead and create the IAM role <code>devops-backup-reader</code> :</p>
<pre><code class="lang-bash">$ aws --profile finance-admin s3 mb s3://finance-backups 
$ aws iam create-role \
  --profile finance-admin \
  --role-name devops-backup-reader \
  --assume-role-policy-document file://trust-policy.json

$ aws iam put-role-policy \
  --profile finance-admin \
  --role-name devops-backup-reader \
  --policy-name ReadBackups \
  --policy-document file://role-permissions.json
</code></pre>
<h4 id="heading-2-devops-user-accesses-the-finance-account-dataset">2. DevOps User Accesses the Finance Account Dataset</h4>
<p>Dave from the DevOps team assumes the role and gets temporary Finance credentials:</p>
<pre><code class="lang-bash"><span class="hljs-comment"># Assume Finance role</span>
$ aws --endpoint-url <span class="hljs-string">"<span class="hljs-variable">$RGW_ENDPOINT</span>"</span> sts assume-role \
  --profile dave-backup-ops \
  --role-arn <span class="hljs-string">"arn:aws:iam::RGW00893359550361292:role/devops-backup-reader"</span> \
  --role-session-name david-devops-backup-finance \
  --region default

{
    <span class="hljs-string">"Credentials"</span>: {
        <span class="hljs-string">"AccessKeyId"</span>: <span class="hljs-string">"ASIA****************"</span>,
        <span class="hljs-string">"SecretAccessKey"</span>: <span class="hljs-string">"REDACTED"</span>,
        <span class="hljs-string">"SessionToken"</span>: <span class="hljs-string">"REDACTED"</span>,
        <span class="hljs-string">"Expiration"</span>: <span class="hljs-string">"2025-0X-15TXX:00:00Z"</span>
    }
}

<span class="hljs-comment"># Use temporary credentials</span>
$ <span class="hljs-built_in">export</span> AWS_ACCESS_KEY_ID=ASIA****************
$ <span class="hljs-built_in">export</span> AWS_SECRET_ACCESS_KEY=REDACTED
$ <span class="hljs-built_in">export</span> AWS_SESSION_TOKEN=REDACTED

<span class="hljs-comment"># Access Finance backups (using Finance account credentials!)</span>
$ aws --endpoint-url <span class="hljs-string">"<span class="hljs-variable">$RGW_ENDPOINT</span>"</span> s3 ls s3://finance-backups/
2025-01-14 02:00:00  daily-backup-2025-01-14.tar.gz

$ aws --endpoint-url <span class="hljs-string">"<span class="hljs-variable">$RGW_ENDPOINT</span>"</span> s3 cp s3://finance-backups/daily-backup-2025-01-14.tar.gz .
download: s3://finance-backups/daily-backup-2025-01-14.tar.gz to ./daily-backup-2025-01-14.tar.gz
</code></pre>
<h3 id="heading-why-this-works-and-why-no-bucket-policy-is-needed">Why This Works (And Why No Bucket Policy Is Needed)</h3>
<p>The role <code>devops-backup-reader</code> Is in the Finance account (same account as the bucket). When Dave assumes this role, he receives temporary Finance account credentials. From the bucket's perspective, this is same-account access → only the role's policy is required; no bucket policy is needed.</p>
<p>The cross-account part: Only the AssumeRole action crosses accounts. The actual bucket access is the same account (role and bucket), both in Finance.</p>
<h3 id="heading-security-benefits-of-this-approach">Security Benefits of This Approach</h3>
<ul>
<li><p><strong>Temporary credentials</strong>: Expire after 1 hour (configurable up to 12 hours)</p>
</li>
<li><p><strong>No shared secrets</strong>: DevOps never sees Finance's long-term keys</p>
</li>
<li><p><strong>Instant revocation</strong>: Finance deletes the role → all access stops immediately</p>
</li>
<li><p><strong>Audit trail</strong>: Logs show role name, session name, and requesting account</p>
</li>
<li><p><strong>Least privilege</strong>: Role has only read permissions, nothing more</p>
</li>
<li><p><strong>Better than ACLs</strong>: Centralized control, no object-level chaos</p>
</li>
</ul>
<h3 id="heading-what-the-audit-logs-show">What the Audit Logs Show</h3>
<p>IBM Storage Ceph Object Gateway (RGW) audit logs capture the complete cross-account access pattern. Here's what you will see:</p>
<blockquote>
<p><strong>Note</strong>: Ensure RGW audit logging is enabled. See the <a target="_blank" href="https://docs.ceph.com/en/latest/radosgw/config-ref/#bucket-and-object-audit-logging">Ceph documentation on bucket and object audit logging</a>(OPS logs) for configuration details.</p>
</blockquote>
<p>Example audit log extract when DevOps assumes the Finance role:</p>
<pre><code class="lang-json">$ tail -f /var/log/ceph/ops-log-ceph-client.rgw.default.ceph02.fvqogr.log | jq .
{
...
  <span class="hljs-attr">"time"</span>: <span class="hljs-string">"2025-01-04T17:34:07.711570Z"</span>,
  <span class="hljs-attr">"time_local"</span>: <span class="hljs-string">"2025-01-04T17:34:07.711570+0000"</span>,
  <span class="hljs-attr">"remote_addr"</span>: <span class="hljs-string">"10.251.0.21"</span>,
  <span class="hljs-attr">"user"</span>: <span class="hljs-string">"98b5e284-bd74-4a54-922e-cf1ee1d460c2"</span>,
  <span class="hljs-attr">"operation"</span>: <span class="hljs-string">"assume_role"</span>,
  <span class="hljs-attr">"uri"</span>: <span class="hljs-string">"POST / HTTP/1.1"</span>,
  <span class="hljs-attr">"http_status"</span>: <span class="hljs-string">"200"</span>,
  <span class="hljs-attr">"bytes_sent"</span>: <span class="hljs-number">999</span>,
  <span class="hljs-attr">"user_agent"</span>: <span class="hljs-string">"aws-cli/1.38.34 md/Botocore#1.37.34 ua/2.1 os/linux#5.14.0-496.el9.x86_64 md/arch#x86_64 lang/python#3.9.19 md/pyimpl#CPython m/N cfg/retry-mode#legacy botocore/1.37.34"</span>,
  <span class="hljs-attr">"referrer"</span>: <span class="hljs-string">""</span>,
  <span class="hljs-attr">"trans_id"</span>: <span class="hljs-string">"tx000001bb92497c13eba06-00695aa48f-494246-default"</span>,
  <span class="hljs-attr">"access_key_id"</span>: <span class="hljs-string">"MPUWRVKZFH9XXXXXXX"</span>,
  <span class="hljs-attr">"temp_url"</span>: <span class="hljs-literal">false</span>
}

# We can then get any specific details on this user
$ radosgw-admin user info --access-key=MPUWRVKZFH9XXXXXXX
{
    <span class="hljs-attr">"user_id"</span>: <span class="hljs-string">"98b5e284-bd74-4a54-922e-cf1ee1d460c2"</span>,
    <span class="hljs-attr">"display_name"</span>: <span class="hljs-string">"dave-backup-ops"</span>,
    <span class="hljs-attr">"email"</span>: <span class="hljs-string">""</span>,
    <span class="hljs-attr">"suspended"</span>: <span class="hljs-number">0</span>,
    <span class="hljs-attr">"max_buckets"</span>: <span class="hljs-number">1000</span>,
    ...
}
</code></pre>
<p>Example audit log extract: When Dave from the DevOps Account accesses the Finance bucket:</p>
<pre><code class="lang-json">{
  <span class="hljs-attr">"bucket"</span>: <span class="hljs-string">"finance-backups"</span>,
  <span class="hljs-attr">"object"</span>: <span class="hljs-string">"daily-backup-2025-01-14.tar.gz"</span>,
  <span class="hljs-attr">"time"</span>: <span class="hljs-string">"2026-01-04T17:42:35.956711Z"</span>,
  <span class="hljs-attr">"time_local"</span>: <span class="hljs-string">"2026-01-04T17:42:35.956711+0000"</span>,
  <span class="hljs-attr">"remote_addr"</span>: <span class="hljs-string">"10.251.0.21"</span>,
  <span class="hljs-attr">"object_owner"</span>: <span class="hljs-string">"RGW00893359550361292"</span>,
  <span class="hljs-attr">"user"</span>: <span class="hljs-string">"98b5e284-bd74-4a54-922e-cf1ee1d460c2"</span>,
  <span class="hljs-attr">"operation"</span>: <span class="hljs-string">"get_obj"</span>,
  <span class="hljs-attr">"uri"</span>: <span class="hljs-string">"GET /finance-backups/daily-backup-2025-01-14.tar.gz HTTP/1.1"</span>,
  <span class="hljs-attr">"http_status"</span>: <span class="hljs-string">"200"</span>,
  <span class="hljs-attr">"bytes_sent"</span>: <span class="hljs-number">26</span>,
  <span class="hljs-attr">"bytes_received"</span>: <span class="hljs-number">0</span>,
  <span class="hljs-attr">"object_size"</span>: <span class="hljs-number">26</span>,
  <span class="hljs-attr">"total_time"</span>: <span class="hljs-number">3</span>,
  <span class="hljs-attr">"user_agent"</span>: <span class="hljs-string">"aws-cli/1.38.34 md/Botocore#1.37.34 ua/2.1 os/linux#5.14.0-496.el9.x86_64 md/arch#x86_64 lang/python#3.9.19 md/pyimpl#CPython m/N cfg/retry-mode#legacy botocore/1.37.34"</span>,
  <span class="hljs-attr">"trans_id"</span>: <span class="hljs-string">"tx00000a13eeac4ce551ce2-00695aa68b-494246-default"</span>,
  <span class="hljs-attr">"authentication_type"</span>: <span class="hljs-string">"STS"</span>,
  <span class="hljs-attr">"sts_info"</span>: {
    <span class="hljs-attr">"role_name"</span>: <span class="hljs-string">"$devops-backup-reader"</span>,
    <span class="hljs-attr">"role_session"</span>: <span class="hljs-string">"david-devops-backup-finance"</span>
  },
  <span class="hljs-attr">"temp_url"</span>: <span class="hljs-literal">false</span>
}
</code></pre>
<p>What this tells you:</p>
<ul>
<li><p><strong>Who</strong>: Dave from DevOps (identified by role session name and the user uid)</p>
</li>
<li><p><strong>When</strong>: <code>2026-01-04T17:42:35.956711Z</code> (exact UTC timestamp)</p>
</li>
<li><p><strong>What</strong>: Downloaded <code>daily-backup-2025-01-14.tar.gz</code> from <code>finance-backups</code> bucket</p>
</li>
<li><p><strong>How</strong>: Via STS temporary credentials (authentication_type: "STS")</p>
<ul>
<li><p>Assumed role: <code>devops-backup-reader</code></p>
</li>
<li><p>Session: <code>david-devops-backup-finance</code></p>
</li>
</ul>
</li>
<li><p><strong>From where</strong>: IP address <code>10.251.0.21</code></p>
</li>
<li><p><strong>Bucket owner</strong>: Finance account <code>RGW00893359550361292</code></p>
</li>
<li><p><strong>Status</strong>: Success (<code>http_status: 200</code>, 26 bytes transferred)</p>
</li>
</ul>
<p>Key security insights from this log:</p>
<ol>
<li><p><strong>Authentication type is explicitly marked as "STS"</strong> - You can easily filter all temporary credential access</p>
</li>
<li><p><strong>User who assumed the role is identified</strong> - (<code>98b5e284-bd74-4a54-922e-cf1ee1d460c2</code>)</p>
</li>
<li><p><strong>Role name is captured</strong> - You know which role was used (<code>devops-backup-reader</code>)</p>
</li>
<li><p><strong>Session name is captured</strong> - You can trace back to who initiated the session (Dave via <code>david-devops-backup-finance</code>)</p>
</li>
<li><p><strong>Object owner is logged</strong> - Confirms the bucket belongs to the Finance account, not the accessor</p>
</li>
<li><p><strong>Full HTTP details</strong> - User agent shows it was AWS CLI, complete with version</p>
</li>
</ol>
<blockquote>
<p>Compared to ACLs: With ACLs, you had no audit trail showing who from which account accessed what. The logs only showed "someone accessed the object" with no attribution to the originating account or session context.</p>
</blockquote>
<p>Comparison of IAM Roles Versus ACLs:</p>
<ul>
<li><p>ACLs: Decentralized, object-level, permanent, no audit trail of cross-account access</p>
</li>
<li><p>IAM Roles: Centralized, temporary, revocable, full audit trail with account attribution</p>
</li>
</ul>
<h2 id="heading-understanding-policy-evaluation">Understanding Policy Evaluation</h2>
<p>To use IAM effectively, you need to understand how permissions are evaluated.</p>
<h3 id="heading-the-basic-rule">The Basic Rule</h3>
<p>When a user requests access to an S3 resource, it follows the following workflow, taking into account that any <code>DENY</code> always wins over <code>ALLOW</code></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1765908590713/83e2782a-fffe-4b8b-a03c-8017778ba232.png" alt class="image--center mx-auto" /></p>
<blockquote>
<p>Explicit DENY always wins, even if there are multiple ALLOW statements.</p>
</blockquote>
<h3 id="heading-same-account-vs-cross-account">Same-Account vs Cross-Account</h3>
<p><strong>Same-Account Access</strong> (user and bucket in the same account):</p>
<ul>
<li><p>Permission needed in either the bucket policy or the identity policy</p>
</li>
<li><p>One <code>ALLOW</code> is sufficient</p>
</li>
</ul>
<p><strong>Cross-Account Access</strong> (using role assumption):</p>
<ul>
<li><p>Permission needed for AssumeRole (on both sides - trust policy + identity policy)</p>
</li>
<li><p>Role's identity policy grants bucket access (same-account from bucket's perspective)</p>
</li>
<li><p>No bucket policy needed</p>
</li>
</ul>
<h2 id="heading-the-security-roadmap-enterprise-s3-security-coming-to-ceph">The Security Roadmap: Enterprise S3 Security Coming to Ceph</h2>
<p>The Ceph community is making a significant investment in enterprise S3 security. Several critical features are under active development to bring Ceph RGW to full feature parity with AWS S3's modern security model. Here's what's coming and why it matters.</p>
<h3 id="heading-bucketownerenforced-disabling-acls-coming-in-ibm-storage-ceph-91">BucketOwnerEnforced: Disabling ACLs (Coming in IBM Storage Ceph 9.1)</h3>
<p>Status: Merged into Ceph v20.3.0 (IBM Storage Ceph 9.1 / Tentacle) (<a target="_blank" href="https://tracker.ceph.com/issues/63323">Issue #63323)</a></p>
<p>What it does: The <code>PutBucketOwnershipControls</code> API with <code>BucketOwnerEnforced</code> Setting disables ACLs entirely and forces all objects to be owned by the bucket owner—regardless of who uploaded them.</p>
<p>The problem it solves:</p>
<p>Before (with ACLs):</p>
<ul>
<li><p>Contractor uploads → contractor owns object → you, as the owner of the bucket, can't delete it</p>
</li>
<li><p>Developer sets ACL to public → bucket exposed to the internet</p>
</li>
<li><p>Objects disappear from inventory (owned by other accounts)</p>
</li>
</ul>
<p>After (BucketOwnerEnforced):</p>
<ul>
<li><p>Anyone uploads → you own the object → you control it completely</p>
</li>
<li><p>ACLs are ignored → impossible to make the bucket public accidentally via ACLs</p>
</li>
<li><p>All objects visible in your inventory reports</p>
</li>
</ul>
<p>How it will work:</p>
<pre><code class="lang-bash"><span class="hljs-comment"># Enable BucketOwnerEnforced on a bucket</span>
$ aws s3api put-bucket-ownership-controls \
  --bucket company-data \
  --ownership-controls <span class="hljs-string">'Rules=[{ObjectOwnership=BucketOwnerEnforced}]'</span>
</code></pre>
<blockquote>
<p>Once enabled, any requests that include ACL headers (e.g., <code>--acl public-read</code>) will fail. Applications must be audited before enabling this feature on their buckets because if the application <strong>is using ACLs</strong> in their workflow the application requests using the ACL headers will start failing .</p>
</blockquote>
<h3 id="heading-s3control-api-block-public-access-coming-soon">S3Control API Block Public Access (Coming Soon)</h3>
<p>Status: Active development, <a target="_blank" href="https://github.com/ceph/ceph/pull/64293">PR #64293</a> under review</p>
<p>You've disabled ACLs in your Finance account. You've enabled Block Public Access. Your security team is confident the Finance buckets are locked down. Then someone in the Marketing Account creates a new IAM user, spins up a bucket, and accidentally makes it public during a website deployment test. Your Finance settings didn't apply to Marketing's account because each account manages its own configuration independently.</p>
<p>This is where account-level controls become critical. While individual buckets can have their own Block Public Access settings, managing hundreds or thousands of buckets individually is error-prone. The S3Control API allows you to set account-level defaults that apply automatically to all buckets in that account, both existing and any new bucket created in the future.</p>
<p>Account-level enforcement prevents all public access:</p>
<pre><code class="lang-bash"><span class="hljs-comment"># Block all public access for entire account</span>
$ aws s3control put-public-access-block \
  --account-id RGW11111111111111111 \
  --public-access-block-configuration \
    BlockPublicAcls=<span class="hljs-literal">true</span>,\
    IgnorePublicAcls=<span class="hljs-literal">true</span>,\
    BlockPublicPolicy=<span class="hljs-literal">true</span>,\
    RestrictPublicBuckets=<span class="hljs-literal">true</span>
</code></pre>
<blockquote>
<p>Once the account administrator sets this policy using S3Control, regular account users cannot override it. If a user later tries to disable Block Public Access on a specific bucket, make a bucket public via ACL, or add a public bucket policy, all those attempts will fail with "Access Denied." The account-level setting takes precedence and cannot be bypassed by bucket-level operations. This creates a secure-by-default environment in which enabling public access using ACLs at the bucket-level is impossible.</p>
</blockquote>
<p>What each setting will do:</p>
<ul>
<li><p><strong>BlockPublicAcls</strong>: Prevents new public ACLs from being applied to buckets/objects</p>
</li>
<li><p><strong>IgnorePublicAcls</strong>: Ignores existing public ACLs (treats them as private)</p>
</li>
<li><p><strong>BlockPublicPolicy</strong>: Prevents bucket policies that grant public access</p>
</li>
<li><p><strong>RestrictPublicBuckets</strong>: Blocks public access even if policies exist</p>
</li>
</ul>
<blockquote>
<p>Account-level Block Public Access is enforced by the account administrator on regular users within that account, but the account administrator themselves can still modify or disable it. For enforcement from a <strong>higher authority</strong>, you need organization-level controls. See the next section on Organizational Units and SCPs, which enable Ceph/RGW cluster administrators to enforce immutable policies across all accounts.</p>
</blockquote>
<h3 id="heading-organizational-units-and-service-control-policies-future">Organizational Units and Service Control Policies (Future)</h3>
<p><strong>Status</strong>: Roadmap item for future Ceph releases</p>
<p><strong>What it will do</strong>: Enable cluster administrators to enforce immutable security policies across multiple accounts—policies that even account administrators cannot disable or modify.</p>
<p><strong>The problem it solves</strong>: Account-level controls rely on administrator discipline. A determined (or compromised) account administrator can disable Block Public Access or re-enable ACLs. Organization-level controls provide actual enforcement from a higher authority that cannot be bypassed.</p>
<p><strong>Example use cases</strong> (when available):</p>
<ul>
<li><p><strong>Immutable Block Public Access</strong>: Cluster admin sets organization-wide "no public buckets" policy → account admins cannot disable it</p>
</li>
<li><p><strong>Required encryption</strong>: Force all objects to use encryption → accounts cannot opt out</p>
</li>
<li><p><strong>Cross-account access policies</strong>: Restrict which accounts can share data with external accounts</p>
</li>
<li><p><strong>Audit requirements</strong>: Enforce logging and monitoring so that accounts cannot be disabled</p>
</li>
</ul>
<p>This will provide enterprise multi-tenant governance that scales to thousands of accounts with immutable top-down policy enforcement.</p>
<h2 id="heading-conclusion-cephs-enterprise-security-transformation">Conclusion: Ceph's Enterprise Security Transformation</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767550127997/3f2532cb-2bac-45d2-b99c-b69ff3f7fec6.png" alt class="image--center mx-auto" /></p>
<p>The migration from ACLs to IAM represents a fundamental shift in S3 security philosophy: from decentralized, object-level chaos to centralized, policy-based control.</p>
<p>Available today in IBM Storage Ceph 8.1:</p>
<ol>
<li><p>IAM Accounts: Multi-tenant isolation with proper account boundaries</p>
</li>
<li><p>Cross-account role assumption: Secure data sharing with temporary credentials</p>
</li>
<li><p>Comprehensive audit logging: Full visibility into who accessed what, when, and how</p>
</li>
</ol>
<p>Coming soon (active development):</p>
<ol start="4">
<li><p>BucketOwnerEnforced (Ceph 9.1): Disable ACLs, fix ownership chaos</p>
</li>
<li><p>S3Control Block Public Access (Tentacle/U): Account-level public access prevention</p>
</li>
<li><p>Organizational Units &amp; SCPs (future): Immutable cluster-wide security policies</p>
</li>
</ol>
<p>IBM and the Ceph community are making a substantial investment to bring Ceph Object Gateway (RGW) to full feature parity with AWS S3's modern security model. The roadmap is clear, and the commitment is real.</p>
<p>The modern S3 security model is simpler, safer, and more auditable than ACLs ever were. ACLs created invisible access paths that security teams couldn't see. IAM policies are explicit, centralized, and visible in one place.</p>
<p><strong>Disable ACLs today</strong>. Your future self will thank you.</p>
]]></content:encoded></item><item><title><![CDATA[Breaking the Static Key Habit: Modernizing IBM Storage Ceph S3 Security with STS]]></title><description><![CDATA[In late 2016, Uber learned that intruders had accessed a trove of personal data stored in an Amazon S3 bucket. The entry point was painfully mundane…]]></description><link>https://ibm-storage-ceph-s3-security-blog-series.hashnode.dev/breaking-the-static-key-habit-modernizing-ibm-storage-ceph-s3-security-with-sts</link><guid isPermaLink="true">https://ibm-storage-ceph-s3-security-blog-series.hashnode.dev/breaking-the-static-key-habit-modernizing-ibm-storage-ceph-s3-security-with-sts</guid><category><![CDATA[S3]]></category><category><![CDATA[ceph]]></category><category><![CDATA[IBM]]></category><category><![CDATA[sds]]></category><category><![CDATA[Security]]></category><category><![CDATA[AWS]]></category><category><![CDATA[storage]]></category><dc:creator><![CDATA[Daniel Parkes]]></dc:creator><pubDate>Mon, 15 Dec 2025 13:14:52 GMT</pubDate><content:encoded><![CDATA[<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1765804320558/be4215b8-cbd0-48f0-9f21-5bd3e4fffd6d.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-introduction-the-148-million-lesson">Introduction: The $148 Million Lesson</h2>
<p>In late 2016, <a target="_blank" href="https://www.uber.com/en-CH/newsroom/2016-data-incident/">Uber</a> learned that intruders had accessed a trove of personal data stored in an Amazon S3 bucket. The entry point was painfully mundane: attackers accessed Uber's source code on GitHub using stolen credentials, found an AWS credential, and used it to access Uber’s data. That single, long-lived credential exposed data on roughly 57 million users and 600,000 drivers.</p>
<p>The breach was bad; the <em>duration</em> risk was worse. Static access keys do not expire. Once leaked, they remain active until someone notices, locates every instance in use, and rotates them. That makes credential theft uniquely dangerous in cloud and S3-style storage, because an attacker can repeatedly return, automate access, and quietly expand their footprint.</p>
<p>Uber ultimately agreed to a $148 million multistate settlement related to how the incident was handled and disclosed. The exact dollar figure is not the main lesson, though. The lesson is this: a single static key can turn a small mistake into a durable breach.</p>
<p>If you are running IBM Storage Ceph Object Gateway (RGW), you face the same pattern: S3 credentials in an application configuration file <code>config.yaml</code>, embedded in scripts, or stored in CI/CD variables. Each one is a long-lived credential that, once copied, can be used from anywhere the S3 endpoint is reachable.</p>
<p>This post shows you how to eliminate static credentials using Security Token Service (STS) with temporary credentials that expire automatically. By the end, you'll understand how to implement the same security model that prevented these breaches from being even worse, and how to adapt it for Ceph RGW.</p>
<h2 id="heading-the-static-credential-problem">The Static Credential Problem</h2>
<p>Let's take a look at some examples of how most applications access S3 storage today:</p>
<pre><code class="lang-yaml"><span class="hljs-comment"># app-config.yaml (application config file)</span>
<span class="hljs-attr">s3:</span>
  <span class="hljs-attr">endpoint:</span> <span class="hljs-string">https://s3.example.com</span>
  <span class="hljs-attr">access_key:</span> <span class="hljs-string">AKIA1234567890ABCDEF</span>
  <span class="hljs-attr">secret_key:</span> <span class="hljs-string">wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY</span>
  <span class="hljs-attr">bucket:</span> <span class="hljs-string">production-data</span>
</code></pre>
<p>Or with the credentials embedded directly in code:</p>
<pre><code class="lang-python"><span class="hljs-comment"># backup.py</span>
<span class="hljs-keyword">import</span> boto3

s3 = boto3.client(
    <span class="hljs-string">'s3'</span>,
    endpoint_url=<span class="hljs-string">'https://s3.example.com'</span>,
    aws_access_key_id=<span class="hljs-string">'AKIA1234567890ABCDEF'</span>,
    aws_secret_access_key=<span class="hljs-string">'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'</span>
)
</code></pre>
<p>Or in environment variables (slightly better, but not by much):</p>
<pre><code class="lang-bash"><span class="hljs-built_in">export</span> AWS_ACCESS_KEY_ID=AKIA1234567890ABCDEF
<span class="hljs-built_in">export</span> AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
</code></pre>
<h2 id="heading-why-this-is-dangerous">Why This Is Dangerous?</h2>
<h3 id="heading-the-permanence-problem">The Permanence Problem</h3>
<p>The fundamental issue with static credentials is that they never expire. Once created, these keys authenticate requests indefinitely, working the same on day one as they do five years later. This creates a dangerous organizational memory gap. Keys made in 2020 still work in 2025, but no one remembers which application uses them, what permissions they have, or whether they're even still needed. When rotation finally becomes necessary, it requires coordinated updates across all applications simultaneously, often in the middle of an incident when coordination is most difficult.</p>
<h3 id="heading-key-proliferation">Key Proliferation</h3>
<p>Static credentials spread like a virus through an organization's infrastructure. They start in a configuration file for a single application, then get copied into container images where they're baked into immutable layers. They're added to CI/CD pipelines where they're shared across multiple projects. Developers copy them to their laptops for testing, where they sync to cloud backup services. They end up in documentation and internal wikis, pasted as "helpful examples" for other teams. Each copy represents another attack vector, another place where the credentials might leak.</p>
<h3 id="heading-the-revocation-nightmare">The Revocation Nightmare</h3>
<p>When credentials are eventually stolen, and with this level of exposure, it's "when," not "if”. The response options are all bad. The credentials work from anywhere where the S3 endpoint is accessible, so there's no easy way to distinguish legitimate requests from attacker activity. Revoking them immediately breaks every application that depends on those keys, forcing an emergency deployment across potentially dozens of services. The alternative is to leave them active while attackers maintain access, then race to update applications before further damage occurs. Organizations need to coordinate emergency updates during an active security incident, precisely when coordination is hardest.</p>
<h3 id="heading-the-permission-accumulation-problem">The Permission Accumulation Problem</h3>
<p>Static keys tend to accumulate permissions over time. They start with minimal access, but as requirements evolve, it's easier to grant permissions than to audit what's truly necessary carefully. "<em>This key needs to read and write, just to be safe.</em>" "<em>Let's give it access to all buckets; we might expand to new ones later.</em>" No one wants to risk disrupting production by restricting access, mainly when credentials are spread across so many systems that tracking down every usage point seems impossible.</p>
<h3 id="heading-the-real-cost">The Real Cost</h3>
<p>The Uber incident shows the real cost of a leaked static key. A single exposed AWS access key exposed sensitive data to roughly 57 million users and 600,000 drivers, and Uber later agreed to a $148 million multistate settlement related to the incident and its handling.</p>
<p>The uncomfortable truth is that static keys turn small mistakes into persistent breaches because credentials do not naturally “die.” Without expiration, containment depends entirely on detection and coordinated rotation across every place that the key has spread.</p>
<h2 id="heading-the-solution-temporary-credentials-via-sts">The Solution: Temporary Credentials via STS</h2>
<p>Security Token Service (STS) fundamentally reimagines how applications authenticate with S3. Instead of using permanent credentials that live forever, applications request temporary credentials that expire automatically after a defined window, typically between fifteen minutes and twelve hours. This simple shift transforms the entire security model.</p>
<p>The mechanics work like this: Applications maintain a minimal service account that is authorized to assume a role. When the application needs to access S3, it calls the STS service using those service account credentials to request temporary credentials for a specific role. STS validates that the service account is authorized to assume that role, then issues time-limited credentials. The application uses these temporary credentials for actual S3 operations. When they expire, the application requests fresh credentials. The entire process is transparent to the application's business logic.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1765556720423/0fc6ed00-9af8-4902-9966-0d2685f68648.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-the-security-transformation">The Security Transformation</h3>
<p>With static keys, credentials remain valid indefinitely. Once stolen, they persist indefinitely. STS eliminates these problems through automatic expiration. When an application calls AssumeRole, it specifies a <code>DurationSeconds</code> parameter (defaulting to 3600 seconds, or one hour). The temporary credentials returned include an expiration timestamp that cannot be modified or extended. If an attacker steals temporary credentials from a compromised server or intercepts them in transit, those credentials become worthless the moment they expire.</p>
<p>The audit trail improves dramatically as well. Instead of seeing generic access key IDs that could be used by any application anywhere, the RGW OPS logs now show which specific role was assumed (<code>role_name</code>) and the session name provided when the role was assumed (<code>role_session_name</code>). When applications use descriptive session names that include the application name and a timestamp, security teams can immediately identify which application and which specific execution generated each request. This attribution becomes critical during incident response, when distinguishing legitimate traffic from attacker activity can mean the difference between containing a breach and suffering a complete data exfiltration.</p>
<p>Consider the compromise scenario: An attacker gains access to a production server and dumps memory, capturing the application's current S3 credentials. With static keys, this can represent full, ongoing access to your data, potentially for months before detection. With STS, the attacker has at most one hour before those credentials expire and become useless. STS is not a silver bullet; it will not stop an attacker already on the host. It does put every stolen credential on a timer, which sharply limits persistence and reduces the “evergreen access key” problem. The application continues to operate normally, automatically refreshing its credentials; incident response can focus on evicting the attacker and preventing further refreshes rather than racing to replace long-lived keys everywhere.</p>
<p><strong>"Wait, aren't we still using a static key to assume the role?"</strong></p>
<p>Yes, but with a critical difference. The service account (e.g., <code>backup-service</code>) possesses a static Access Key and Secret Key, but this user has zero permissions to access S3 data. It cannot list buckets, read objects, or delete data.</p>
<p>Its <em>only</em> capability is to call the STS API to assume a specific Role. If these credentials are leaked, an attacker cannot directly steal data. They would have to know <em>which</em> Role to assume and <em>how</em> to use it, which would add significant friction. Furthermore, you have traces in the audit logs, and you can rotate these service keys without disrupting the application's active S3 sessions.</p>
<h2 id="heading-quick-primer-understanding-roles-just-what-you-need-for-sts">Quick Primer: Understanding Roles (Just What You Need for STS)</h2>
<p>Roles are part of the IAM (Identity and Access Management) API, which IBM Storage Ceph Object Gateway (RGW) implements to provide AWS-compatible identity management. In this post, we focus on how roles enable STS-based authentication. We'll dive deeper into the full IAM capabilities, including users, groups, policies, and account-level governance, in a specific IAM security post coming soon.</p>
<h3 id="heading-the-role-structure">The Role Structure</h3>
<p>Every role has two policies:</p>
<ol>
<li><p><strong>Trust Policy</strong> - Defines who can assume the role</p>
</li>
<li><p><strong>Permission Policy</strong> - Defines what the role can do once assumed</p>
</li>
</ol>
<p>Here's the complete flow: Your application holds a minimal service account that is authorized to assume a role (via the role trust policy, an identity policy, or both). When it needs to work (e.g., access S3 resources), it calls STS to assume a role (e.g., "backup-reader"). STS checks the role's trust policy, validates the request, and issues temporary credentials (access key, secret key, session token) that inherit the role's permissions. Those credentials expire after one hour. The application uses them for S3 operations and automatically requests new credentials as needed.</p>
<p>Example Trust Policy (who can assume the role) allowing the user backup-service to assume the role:</p>
<pre><code class="lang-json">{
  <span class="hljs-attr">"Version"</span>: <span class="hljs-string">"2012-10-17"</span>,
  <span class="hljs-attr">"Statement"</span>: [{
    <span class="hljs-attr">"Effect"</span>: <span class="hljs-string">"Allow"</span>,
    <span class="hljs-attr">"Principal"</span>: {<span class="hljs-attr">"AWS"</span>: <span class="hljs-string">"arn:aws:iam::123456:user/backup-service"</span>},
    <span class="hljs-attr">"Action"</span>: <span class="hljs-string">"sts:AssumeRole"</span>
  }]
}
</code></pre>
<p>Example Permission Policy (what the role can do), allowing read-only access to the bucket <code>backups</code> :</p>
<pre><code class="lang-json">{
  <span class="hljs-attr">"Version"</span>: <span class="hljs-string">"2012-10-17"</span>,
  <span class="hljs-attr">"Statement"</span>: [{
    <span class="hljs-attr">"Effect"</span>: <span class="hljs-string">"Allow"</span>,
    <span class="hljs-attr">"Action"</span>: [<span class="hljs-string">"s3:GetObject"</span>, <span class="hljs-string">"s3:ListBucket"</span>],
    <span class="hljs-attr">"Resource"</span>: [
      <span class="hljs-string">"arn:aws:s3:::backups"</span>,
      <span class="hljs-string">"arn:aws:s3:::backups/*"</span>
    ]
  }]
}
</code></pre>
<p>In this post, we'll use inline policies (policies embedded directly in the role). There are other canned policy types available in the IAM API, which we'll cover in the future IAM post.</p>
<h3 id="heading-beyond-service-accounts-single-sign-on-authentication-with-oidc-integration">Beyond Service Accounts: Single Sign-on Authentication with OIDC Integration</h3>
<p>The pattern we'll implement uses a service account with static credentials to assume roles. However, RGW also supports <code>AssumeRoleWithWebIdentity</code>, which allows applications to assume roles using tokens from an enterprise identity provider (such as RHSSO (Keycloak), IBM Security Verify, etc.) via OpenID Connect (OIDC). This eliminates the need for static credentials: applications authenticate via your existing SSO system to obtain a JWT, which they then use to request a temporary credential directly from the STS API. This is the most secure option for organizations with mature identity infrastructure, though it requires additional OIDC provider configuration in RGW. We'll cover this advanced pattern in a future post on identity federation.</p>
<h2 id="heading-implementing-sts-in-ceph-rgw-step-by-step">Implementing STS in Ceph RGW: Step by Step</h2>
<p>This implementation builds on the IAM foundation covered in <a target="_blank" href="https://ceph.io/en/news/blog/2025/enhancing-ceph-multitenancy-with-iam-accounts/">Enhancing Ceph Multitenancy with IAM Accounts</a>. If you're new to Ceph IAM accounts, that post covers account creation, user management, and policy basics. Here, we focus specifically on enabling STS and using roles for temporary credentials.</p>
<p>For additional STS configuration details and advanced scenarios, see Chapter 7 of the <a target="_blank" href="https://www.redbooks.ibm.com/abstracts/redp5715.html">IBM Storage Ceph Solutions Guide</a>.</p>
<p>Let's build on an example use case. We'll create a role for a backup service that needs read-only access to a specific bucket.</p>
<p>To follow this guide, you will need:</p>
<ul>
<li><p><strong>Admin Access to the Ceph Cluster:</strong> SSH access to a node where you can run <code>ceph</code> and <code>radosgw-admin</code> commands.</p>
</li>
<li><p><strong>AWS CLI:</strong> Installed on your workstation to interact with the RGW S3 endpoint.</p>
</li>
<li><p><strong>Python 3 &amp; Boto3:</strong> For running the automation scripts (<code>pip install boto3</code>).</p>
</li>
<li><p><strong>IBM Storage Ceph 7.1+:</strong> While basic STS works on older versions, the IAM Accounts feature used in this guide requires Ceph Squid (19.2.0) or newer (IBM Storage Ceph 7.1+).</p>
</li>
</ul>
<h3 id="heading-step-1-enable-sts-in-rgw-configuration">Step 1: Enable STS in RGW Configuration</h3>
<p>STS must be explicitly enabled in your RGW configuration. The configuration uses the Ceph config database and requires two settings.</p>
<p>Generate a secure STS key (must be exactly 16 characters):</p>
<pre><code class="lang-bash"><span class="hljs-comment"># Generate a 16-character random key</span>
$ openssl rand -hex 8
<span class="hljs-comment"># Example output: 0a1b2c3d4e5f6789</span>
</code></pre>
<p>Configure RGW to use STS:</p>
<p>Most deployments use <code>client.rgw.default</code> as the RGW client identifier. If your deployment uses a custom service name, replace <code>default</code> with your service name.</p>
<pre><code class="lang-bash"><span class="hljs-comment"># Set the STS encryption key (MUST be exactly 16 characters)</span>
$ ceph config <span class="hljs-built_in">set</span> client.rgw.default rgw_sts_key 0a1b2c3d4e5f6789

<span class="hljs-comment"># Enable STS authentication</span>
$ ceph config <span class="hljs-built_in">set</span> client.rgw.default rgw_s3_auth_use_sts <span class="hljs-literal">true</span>
</code></pre>
<blockquote>
<p><strong>Ceph-Specific Configuration Note</strong></p>
<p>Unlike AWS, where STS is a global service enabled by default, Ceph requires you to explicitly configure the encryption key used to sign the session tokens.</p>
<p><strong>Critical Requirement:</strong> The <code>rgw_sts_key</code> <strong>must be exactly 16 characters long</strong>. If it is 15 or 17 characters, the STS handshake will fail silently or with opaque 500 errors.</p>
</blockquote>
<p>Restart RGW to apply changes:</p>
<pre><code class="lang-bash"><span class="hljs-comment"># For default service</span>
$ ceph orch restart client.rgw
</code></pre>
<p>Verify the configuration:</p>
<pre><code class="lang-bash">$ ceph config get client.rgw.default rgw_s3_auth_use_sts
$ ceph config get client.rgw.default rgw_sts_key
</code></pre>
<h3 id="heading-step-2-create-iam-account-root-user-and-service-user">Step 2: Create IAM Account, Root User, and Service User</h3>
<p>IAM accounts provide multi-tenancy and resource organization. We'll create an account, a root user for administrative tasks, and a restricted service user for applications.</p>
<p>Create the IAM account:</p>
<pre><code class="lang-bash">$ radosgw-admin account create  --account-name=backup-team 
{
    <span class="hljs-string">"id"</span>: <span class="hljs-string">"RGW89761398048153888"</span>,
    <span class="hljs-string">"tenant"</span>: <span class="hljs-string">""</span>,
    <span class="hljs-string">"name"</span>: <span class="hljs-string">"backup-team"</span>,
    <span class="hljs-string">"email"</span>: <span class="hljs-string">""</span>,
    <span class="hljs-string">"quota"</span>: {
        <span class="hljs-string">"enabled"</span>: <span class="hljs-literal">false</span>,
        <span class="hljs-string">"check_on_raw"</span>: <span class="hljs-literal">false</span>,
        <span class="hljs-string">"max_size"</span>: -1,
        <span class="hljs-string">"max_size_kb"</span>: 0,
        <span class="hljs-string">"max_objects"</span>: -1
    },
    <span class="hljs-string">"bucket_quota"</span>: {
        <span class="hljs-string">"enabled"</span>: <span class="hljs-literal">false</span>,
        <span class="hljs-string">"check_on_raw"</span>: <span class="hljs-literal">false</span>,
        <span class="hljs-string">"max_size"</span>: -1,
        <span class="hljs-string">"max_size_kb"</span>: 0,
        <span class="hljs-string">"max_objects"</span>: -1
    },
    <span class="hljs-string">"max_users"</span>: 1000,
    <span class="hljs-string">"max_roles"</span>: 1000,
    <span class="hljs-string">"max_groups"</span>: 1000,
    <span class="hljs-string">"max_buckets"</span>: 1000,
    <span class="hljs-string">"max_access_keys"</span>: 4
}
</code></pre>
<p>Create the Account Root User (for administrative tasks)</p>
<p>The account root user has full permissions on all resources within the account by default, including the ability to use the IAM API to create roles and manage policies. This is built into the account system; no additional capabilities are needed.</p>
<p>Create the root user for the account:</p>
<pre><code class="lang-bash">$ radosgw-admin user create   --account-id=RGW89761398048153888   --uid=backup-admin   --display-name=<span class="hljs-string">"Backup-Team-Admin"</span>   --account-root   --gen-access-key   --gen-secret
</code></pre>
<p>The <code>--account-root</code> The flag is critical: it designates this user as the account's root user, granting full administrative permissions within the account's scope.</p>
<blockquote>
<p><strong>Ceph documentation</strong>: <em>"Account owners are encouraged to use this account root user for management only, and create users and roles with fine-grained permissions for specific applications."</em></p>
</blockquote>
<p>For this tutorial, we'll use the root user for setup tasks to keep things simple. In production, you typically use the root user to provision IAM users with specific permissions, then revoke or restrict the root user's credentials.</p>
<h4 id="heading-create-the-backup-service-user-for-applications">Create the Backup Service User (for applications)</h4>
<p>This user will have minimal permissions, only the ability to assume roles. No direct access to S3 resources.</p>
<pre><code class="lang-bash">$ radosgw-admin user create \
  --account-id=RGW89761398048153888 \
  --uid=backup-service \
  --display-name=<span class="hljs-string">"backup-service"</span> \
  --gen-access-key \
  --gen-secret
</code></pre>
<blockquote>
<p>The service account has no S3 permissions and no IAM capabilities. It can only assume roles that explicitly trust it.</p>
</blockquote>
<h4 id="heading-configure-aws-cli-profiles">Configure AWS CLI Profiles</h4>
<p>Configure two AWS CLI profiles - one for each user. Each profile contains the user's credentials and the RGW/STS endpoint URL, so we don’t need to specify the endpoint on each <code>aws</code> cli command. See <a target="_blank" href="https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html">AWS CLI configuration</a> for details.</p>
<p><strong>AWS Profile summary for this setup</strong>:</p>
<ul>
<li><p><code>backup-admin</code> profile: Uses root user credentials, S3/IAM/STS endpoint <code>https://s3.cephlabs.com</code></p>
</li>
<li><p><code>backup-service</code> profile: Uses service account credentials, S3/IAM/STS endpoint <code>https://s3.cephlabs.com</code></p>
</li>
</ul>
<blockquote>
<p>Example for the .aws/config</p>
<pre><code class="lang-ini">$ cat ~/.aws/config

<span class="hljs-section">[profile backup-admin]</span>
<span class="hljs-attr">region</span> = default
<span class="hljs-attr">output</span> = json
<span class="hljs-attr">services</span> = ceph-rgw

<span class="hljs-section">[profile backup-service]</span>
<span class="hljs-attr">region</span> = default
<span class="hljs-attr">output</span> = json
<span class="hljs-attr">services</span> = ceph-rgw

<span class="hljs-section">[services ceph-rgw]</span>
<span class="hljs-attr">s3</span> =
  <span class="hljs-attr">endpoint_url</span> = https://s3.cephlabs.com
<span class="hljs-attr">s3api</span> =
  <span class="hljs-attr">endpoint_url</span> = https://s3.cephlabs.com
<span class="hljs-attr">iam</span> =
  <span class="hljs-attr">endpoint_url</span> = https://s3.cephlabs.com
<span class="hljs-attr">sts</span> =
  <span class="hljs-attr">endpoint_url</span> = https://s3.cephlabs.com
</code></pre>
</blockquote>
<p>Verify both profiles:</p>
<pre><code class="lang-bash"><span class="hljs-comment"># Test root user (should work - has full permissions)</span>
$ aws s3 ls --profile backup-admin

<span class="hljs-comment"># Test service user (should fail - has no S3 permissions yet)</span>
$ aws s3 ls --profile backup-service
<span class="hljs-comment"># Expect: AccessDenied in RGW logs</span>
argument of <span class="hljs-built_in">type</span> <span class="hljs-string">'NoneType'</span> is not iterable
</code></pre>
<p><strong>Identity Summary</strong>:</p>
<p>At this point, you have two users in the IAM account:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>User</td><td>Type</td><td>Permissions</td><td>Used For</td></tr>
</thead>
<tbody>
<tr>
<td><strong>backup-admin</strong></td><td>Account root user (<code>--account-root</code>)</td><td>Full permissions on all account resources + IAM API access</td><td>Creating buckets, creating/managing roles via AWS CLI</td></tr>
<tr>
<td><strong>backup-service</strong></td><td>Regular user</td><td>None (can only assume roles)</td><td>Running backup applications with temporary credentials</td></tr>
</tbody>
</table>
</div><h3 id="heading-step-3-create-the-backup-bucket">Step 3: Create the Backup Bucket</h3>
<p>Run this as the backup admin user (who has S3 permissions):</p>
<pre><code class="lang-bash">$ aws s3 mb s3://backups --profile backup-admin
</code></pre>
<p>Why the admin user? The service account (<code>backup-service</code>) has no S3 permissions yet; it can only assume roles. The admin user creates the infrastructure (buckets), then creates roles that grant specific permissions to those buckets.</p>
<p>Verify the bucket exists:</p>
<pre><code class="lang-bash">$ aws s3 ls --profile backup-admin
2025-12-12 17:09:25 backups
</code></pre>
<h3 id="heading-step-4-create-the-role">Step 4: Create the Role</h3>
<p>Run these commands as the account root user (backup-admin), who has full IAM API permissions.</p>
<p>Create a role trust policy (who can assume this role):</p>
<pre><code class="lang-bash">cat &gt; trust-policy.json &lt;&lt;<span class="hljs-string">'EOF'</span>
{
  <span class="hljs-string">"Version"</span>: <span class="hljs-string">"2012-10-17"</span>,
  <span class="hljs-string">"Statement"</span>: [{
    <span class="hljs-string">"Effect"</span>: <span class="hljs-string">"Allow"</span>,
    <span class="hljs-string">"Principal"</span>: {<span class="hljs-string">"AWS"</span>: <span class="hljs-string">"arn:aws:iam::RGW89761398048153888:user/backup-service"</span>},
    <span class="hljs-string">"Action"</span>: <span class="hljs-string">"sts:AssumeRole"</span>
  }]
}
EOF
</code></pre>
<blockquote>
<p>ARNs in IAM Accounts (Ceph Object Gateway): In the IAM Accounts model, the user ARN is built from the account ID plus the user name; in Ceph this “name” corresponds to the user’s display-name (not the <code>--uid</code>). If your <code>--uid</code> and <code>--display-name</code> differ, make sure your trust policy <code>Principal</code> ARN uses the display-name value, or the AssumeRole request will not match.</p>
<p>Authorization to assume a role can be granted in two ways. In this tutorial we grant it via the role trust policy by naming the service user as the <code>Principal</code>. In same-account setups, this is sufficient; no user policy is required. If you instead trust the whole account or you are doing cross-account access, attach an identity policy to the user or group allowing <code>sts:AssumeRole</code> on the specific role ARN.</p>
</blockquote>
<p>Create the role:</p>
<pre><code class="lang-bash">$ aws iam create-role \
  --profile backup-admin \
  --role-name backup-reader \
  --assume-role-policy-document file://trust-policy.json
</code></pre>
<p>Create permission policy (what the role can do):</p>
<pre><code class="lang-bash">cat &gt; permissions-policy.json &lt;&lt;<span class="hljs-string">'EOF'</span>
{
  <span class="hljs-string">"Version"</span>: <span class="hljs-string">"2012-10-17"</span>,
  <span class="hljs-string">"Statement"</span>: [{
    <span class="hljs-string">"Effect"</span>: <span class="hljs-string">"Allow"</span>,
    <span class="hljs-string">"Action"</span>: [
      <span class="hljs-string">"s3:GetObject"</span>,
      <span class="hljs-string">"s3:ListBucket"</span>
    ],
    <span class="hljs-string">"Resource"</span>: [
      <span class="hljs-string">"arn:aws:s3:::backups"</span>,
      <span class="hljs-string">"arn:aws:s3:::backups/*"</span>
    ]
  }]
}
EOF
</code></pre>
<p>Attach permissions to role:</p>
<pre><code class="lang-bash">$ aws iam put-role-policy \
  --profile backup-admin \
  --role-name backup-reader \
  --policy-name backup-read-policy \
  --policy-document file://permissions-policy.json
</code></pre>
<p>Verify the role was created:</p>
<pre><code class="lang-bash">$ aws iam get-role \
  --profile backup-admin \
  --role-name backup-reader
{
    <span class="hljs-string">"Role"</span>: {
        <span class="hljs-string">"Path"</span>: <span class="hljs-string">"/"</span>,
        <span class="hljs-string">"RoleName"</span>: <span class="hljs-string">"backup-reader"</span>,
        <span class="hljs-string">"RoleId"</span>: <span class="hljs-string">"8c8eec8c-c647-42bb-8a53-36c6d2fc747a"</span>,
        <span class="hljs-string">"Arn"</span>: <span class="hljs-string">"arn:aws:iam::RGW89761398048153888:role/backup-reader"</span>,
        <span class="hljs-string">"CreateDate"</span>: <span class="hljs-string">"2025-12-12T22:10:18.644Z"</span>,
        <span class="hljs-string">"AssumeRolePolicyDocument"</span>: {
            <span class="hljs-string">"Version"</span>: <span class="hljs-string">"2012-10-17"</span>,
            <span class="hljs-string">"Statement"</span>: [
                {
                    <span class="hljs-string">"Effect"</span>: <span class="hljs-string">"Allow"</span>,
                    <span class="hljs-string">"Principal"</span>: {
                        <span class="hljs-string">"AWS"</span>: <span class="hljs-string">"arn:aws:iam::RGW89761398048153888:user/backup-service"</span>
                    },
                    <span class="hljs-string">"Action"</span>: <span class="hljs-string">"sts:AssumeRole"</span>
                }
            ]
        },
        <span class="hljs-string">"Description"</span>: <span class="hljs-string">""</span>,
        <span class="hljs-string">"MaxSessionDuration"</span>: 3600
    }
}

$ aws --profile backup-service sts assume-role --role-arn <span class="hljs-string">"arn:aws:iam::RGW89761398048153888:role/backup-reader"</span> --output json --role-session-name testbr
{
    <span class="hljs-string">"Credentials"</span>: {
        <span class="hljs-string">"AccessKeyId"</span>: <span class="hljs-string">"reUwxxxxxxn"</span>,
        <span class="hljs-string">"SecretAccessKey"</span>: <span class="hljs-string">"CQGxxxxxxx"</span>,
        <span class="hljs-string">"SessionToken"</span>: <span class="hljs-string">"nADwRdQ5xxxx90qMZlDPl4ozBjcQKF1tceytgNVGD5D4h2FpoMvjybl31cXI9uh/nUrQePW+Ob3TmpMa4QXdXfml/gQYSYeQLJEzNncQPUQB9+QUl5TShDy4RYYziRulTMWrkYokL6kI0uN0LksQ56/qOyd59A1qbWtsBNYBdvxUUi7r3lhrifn4MNWQbErJKCVNdVOBSzN1L34JDMvjEqN2QyKWLQI16D+XhCq8V05OnQFMHsf128BealrX+KkWS6+74G960WzoHzWDwHF1uO08VlFYCdHO0A=="</span>,
        <span class="hljs-string">"Expiration"</span>: <span class="hljs-string">"2025-12-12T23:34:00.247844317Z"</span>
    },
    <span class="hljs-string">"AssumedRoleUser"</span>: {
        <span class="hljs-string">"Arn"</span>: <span class="hljs-string">"arn:aws:sts::RGW89761398048153888:assumed-role/backup-reader/testbr"</span>
    },
    <span class="hljs-string">"PackedPolicySize"</span>: 0
}
</code></pre>
<h3 id="heading-step-5-write-application-code-python-example">Step 5: Write Application Code (Python Example)</h3>
<p><strong>This code runs with the service account credentials</strong> (<code>backup-service</code>), which have no direct S3 access. The application calls STS to assume the <code>backup-reader</code> role and receives temporary credentials for S3 operations.</p>
<p><strong>Identity flow</strong>:</p>
<ol>
<li><p>The application starts with <code>backup-service</code> credentials (long-term, minimal permissions)</p>
</li>
<li><p>Calls <code>AssumeRole</code> using those credentials to request the <code>backup-reader</code> role</p>
</li>
<li><p>Receives temporary credentials (access key + secret + session token)</p>
</li>
<li><p>Uses temporary credentials for all S3 operations</p>
</li>
<li><p>Temporary credentials expire after 1 hour (or configured duration)</p>
</li>
<li><p>Application manually checks expiration before each operation and refreshes if needed</p>
</li>
</ol>
<p>Upload test file (as admin user who has write permissions):</p>
<pre><code class="lang-bash">$ <span class="hljs-built_in">echo</span> <span class="hljs-string">"test backup data"</span> &gt; test-backup.txt
$ aws s3 cp test-backup.txt s3://backups/ --profile backup-admin
</code></pre>
<p>Running the script: download the script from GitHub Gist, and export the variables of the backup-service user:</p>
<pre><code class="lang-bash"><span class="hljs-comment">#Download script</span>
$ wget -O backup_service.py https://gist.githubusercontent.com/likid0/f7c40c4851bf32c595c7a5e63cf21f35/raw/137bfeea46c20d46d37fa026e29f1b5193c3e281/gistfile1.txt
<span class="hljs-comment"># Make it executable</span>
$ chmod +x backup_service.py
<span class="hljs-comment"># Export Vars</span>
$ <span class="hljs-built_in">export</span> AWS_ACCESS_KEY_ID=<span class="hljs-string">'AKIAIOSFODNN7EXAMPLE'</span>
$ <span class="hljs-built_in">export</span> AWS_SECRET_ACCESS_KEY=<span class="hljs-string">'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'</span>
$ <span class="hljs-built_in">export</span> S3_ENDPOINT_URL=<span class="hljs-string">'https://s3.example.com'</span>
</code></pre>
<p>Run the example <code>backup_service.py</code> Script:</p>
<pre><code class="lang-bash">$ python backup_service.py

================================================================================
 Backup Service - STS Temporary Credentials Demo
================================================================================

Configuration:
  Endpoint: https://s3.cephlabs.com
  User:     backup-service
  Key:      VQQPNR4XOW...

Note: These are the service account<span class="hljs-string">'s PERMANENT credentials
      They have NO direct S3 permissions (can only assume roles)

================================================================================
Calling AssumeRole API to get temporary credentials...
================================================================================

AssumeRole Parameters:
  RoleArn:         arn:aws:iam::RGW89761398048153888:role/backup-reader
  RoleSessionName: backup-job-1765579042
  DurationSeconds: 3600 (1 hour)

Authentication:  Using service account credentials (backup-service)
                 AccessKey: VQQPNR4XOW...

Calling STS endpoint: https://s3.cephlabs.com

SUCCESS! Received temporary credentials:
  AccessKeyId:     YAhacPIIT4BcUWiyPC0M...
  SecretAccessKey: S4VSWFTM2U... (redacted)
  SessionToken:    Yn3A4Mt4VGQoIvloer2ByH3aecQAeP... (redacted)
  Expiration:      2025-12-12 23:37:22.878813+00:00
================================================================================


 Listing backups in bucket '</span>backups<span class="hljs-string">'...
   Found 1 object(s):

    test-backup.txt
      Size: 0.00 MB (17 bytes)
      Modified: 2025-12-12 22:11:23.474000+00:00


================================================================================
Demo completed successfully!
================================================================================</span>
</code></pre>
<blockquote>
<p>This example script uses manual credential checking: the <code>_check_credentials()</code> method checks expiration time before each operation and calls <code>_refresh_credentials()</code> when needed. This is simple and works well for most use cases.</p>
<p>For long-running jobs (hours or days), see the "<a class="post-section-overview" href="#handling-long-running-jobs-credential-refresh-strategies">Handling Long-Running Jobs: Credential Refresh Strategies</a>" section later in this post, which covers automatic credential refresh using boto3's <code>RefreshableCredentials</code>. With automatic refresh, boto3 handles the timing and renewal for you so you never have to think about expiration.</p>
</blockquote>
<h2 id="heading-handling-long-running-jobs-credential-refresh-strategies">Handling Long-Running Jobs: Credential Refresh Strategies</h2>
<p>A critical consideration for production deployments is handling jobs that run longer than the credential lifetime.</p>
<h3 id="heading-the-challenge">The Challenge</h3>
<p>By default, STS credentials expire after 1 hour (3600 seconds). If your backup job takes 4 hours, the credentials will expire mid-job, causing authentication failures.</p>
<p>The <code>DurationSeconds</code> Parameter controls how long the temporary credentials remain valid:</p>
<ul>
<li><p><strong>Minimum</strong>: 900 seconds (15 minutes) - configurable via <code>rgw_sts_min_session_duration</code></p>
</li>
<li><p><strong>Default</strong>: 3600 seconds (1 hour)</p>
</li>
<li><p><strong>Maximum</strong>: Limited by the role's <code>max_session_duration</code> attribute (defaults to 3600)</p>
</li>
</ul>
<p>When a role is created, it has a <code>max_session_duration</code> of 3600 seconds by default. This means even if you request <code>DurationSeconds=7200</code> (2 hours), The request will be limited to the role's maximum. To allow longer sessions, you would need to modify the role's <code>max_session_duration</code> when creating it (though for security, shorter durations are recommended).</p>
<p>Here, we share three example strategies for handling this.</p>
<h3 id="heading-strategy-1-increase-token-duration-up-to-12-hours">Strategy 1: Increase Token Duration (Up to 12 Hours)</h3>
<p>The most straightforward approach is to request longer-lived credentials and configure the role to allow them.</p>
<p><strong>Configure maximum session duration on the role</strong>:</p>
<p>When creating the role, you can set a maximum session duration:</p>
<pre><code class="lang-bash">$ aws iam create-role \
  --profile backup-admin \
  --role-name backup-reader \
  --assume-role-policy-document file://trust-policy.json \
  --max-session-duration 43200  <span class="hljs-comment"># 12 hours</span>
</code></pre>
<p>Or modify an existing role:</p>
<pre><code class="lang-bash">$ aws iam update-role \
  --profile backup-admin \
  --role-name backup-reader \
  --max-session-duration 43200  <span class="hljs-comment"># 12 hours</span>
</code></pre>
<p>Verify the setting:</p>
<pre><code class="lang-python">$ aws iam get-role \
  --profile backup-admin \
  --role-name backup-reader \
  --query <span class="hljs-string">'Role.MaxSessionDuration'</span>
</code></pre>
<p>RGW Configuration. The following ceph config option controls the global maximum:</p>
<pre><code class="lang-bash">ceph config <span class="hljs-built_in">set</span> client.rgw.default rgw_sts_max_session_duration 43200
</code></pre>
<p><strong>Limitations</strong>:</p>
<ul>
<li><p>Maximum duration in Ceph RGW: 12 hours (43,200 seconds)</p>
</li>
<li><p>Not an ideal solution, as it extends the duration of the tokens to twelve hours</p>
</li>
<li><p>Suitable for jobs that can be completed within 12 hours</p>
</li>
</ul>
<h3 id="heading-strategy-2-automatic-credential-refresh-with-refreshablecredentials">Strategy 2: Automatic Credential Refresh with RefreshableCredentials</h3>
<p>For jobs longer than 12 hours, or to avoid managing token duration, implement automatic refresh using botocore's <code>RefreshableCredentials</code>. This pattern continuously calls <code>AssumeRole</code> to get fresh credentials before expiration.</p>
<p>Enhanced BackupService script example with STS token Auto-Refresh, download from github: <a target="_blank" href="https://gist.github.com/likid0/25519b2f46b63de89f7fe0d2dc9ff283">https://gist.github.com/likid0/25519b2f46b63de89f7fe0d2dc9ff283</a></p>
<p><strong>How it works</strong>:</p>
<ol>
<li><p><code>RefreshableCredentials</code> Wraps your credential fetching logic</p>
</li>
<li><p>Before each AWS API call, boto3 checks if credentials are expired or expiring soon</p>
</li>
<li><p>If needed, boto3 automatically calls <code>_refresh_credentials()</code> to get fresh credentials</p>
</li>
<li><p>Your application never sees authentication errors due to expiration</p>
</li>
<li><p>Each refresh calls <code>AssumeRole</code> using the original service account credentials</p>
</li>
</ol>
<p><strong>Key Advantages</strong>:</p>
<ul>
<li><p>Works for jobs of any length (days, weeks)</p>
</li>
<li><p>No manual credential management needed</p>
</li>
<li><p>Boto3 handles refresh timing automatically</p>
</li>
<li><p>Original service account credentials remain secure (never exposed to S3 operations)</p>
</li>
</ul>
<p><strong>Important Notes</strong>:</p>
<ul>
<li><p>The service account's long-term credentials must remain valid for the entire job</p>
</li>
<li><p>Each refresh makes a new <code>AssumeRole</code> call to STS</p>
</li>
<li><p>Credentials are cached in memory only (not written to disk)</p>
</li>
</ul>
<h3 id="heading-strategy-3-use-third-party-libraries">Strategy 3: Use Third-Party Libraries</h3>
<p>If you prefer not to work with botocore internals, use a well-maintained library:</p>
<p>Install the library aws-assume-role-lib:</p>
<pre><code class="lang-bash">pip install aws-assume-role-lib
</code></pre>
<p>Reference the library in code:</p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> boto3
<span class="hljs-keyword">import</span> aws_assume_role_lib

<span class="hljs-comment"># Create session with automatic refresh</span>
parent_session = boto3.Session(
    aws_access_key_id=<span class="hljs-string">'BACKUP_SERVICE_KEY'</span>,
    aws_secret_access_key=<span class="hljs-string">'your-secret-key'</span>
)

<span class="hljs-comment"># This session automatically refreshes expired credentials</span>
assumed_role_session = aws_assume_role_lib.assume_role(
    parent_session, 
    <span class="hljs-string">'arn:aws:iam::RGW12345678901234567:role/backup-reader'</span>
)

<span class="hljs-comment"># Use it like any boto3 session</span>
s3 = assumed_role_session.client(<span class="hljs-string">'s3'</span>, endpoint_url=<span class="hljs-string">'https://s3.example.com'</span>)
s3.list_buckets()  <span class="hljs-comment"># Credentials auto-refresh as needed</span>
</code></pre>
<h2 id="heading-static-key-rotation-completing-the-security-model">Static Key Rotation: Completing the Security Model</h2>
<p>You've now implemented STS for temporary credentials, but there's one final layer to complete the security architecture: <strong>rotating the service account's static keys</strong>.</p>
<h3 id="heading-background-the-createdate-field">Background: The <code>create_date</code> Field</h3>
<p>Starting with <strong>IBM Storage Ceph 8.1</strong>, Ceph RGW now includes a <code>create_date</code> timestamp for each access key in the user metadata. This addition enables programmatic key age tracking and automated rotation - a critical capability for eliminating static credential risk.</p>
<p><strong>Example output</strong> from <code>radosgw-admin user info</code>:</p>
<pre><code class="lang-json">{
    <span class="hljs-attr">"user_id"</span>: <span class="hljs-string">"backup-service"</span>,
    <span class="hljs-attr">"keys"</span>: [{
        <span class="hljs-attr">"user"</span>: <span class="hljs-string">"backup-service"</span>,
        <span class="hljs-attr">"access_key"</span>: <span class="hljs-string">"XXXXXXXX"</span>,
        <span class="hljs-attr">"secret_key"</span>: <span class="hljs-string">"XtDhTWsb6vkNOsAnWBXSIhDhqdRBYXXXXXXX"</span>,
        <span class="hljs-attr">"active"</span>: <span class="hljs-literal">true</span>,
        <span class="hljs-attr">"create_date"</span>: <span class="hljs-string">"2025-12-12T22:02:16.628205Z"</span>  ← Key creation timestamp
    }]
}
</code></pre>
<h3 id="heading-recommended-approach-use-a-secrets-manager">Recommended Approach: Use a Secrets Manager</h3>
<p>The best way to implement key rotation is with a secrets manager such as HashiCorp Vault, IBM GKLM, AWS Secrets Manager, Google Secret Manager, or Azure Key Vault. This approach enables zero-downtime rotation without code changes.</p>
<p><strong>How it works</strong>:</p>
<ol>
<li><p><strong>Application queries secrets manager</strong> (no hardcoded credentials):</p>
<ul>
<li><p>Application starts up and queries Vault/secrets manager for credentials</p>
</li>
<li><p>Gets current <code>access_key</code> and <code>secret_key</code></p>
</li>
<li><p>Uses these to call AssumeRole and get temporary STS credentials</p>
</li>
</ul>
</li>
<li><p><strong>When keys rotate</strong> (automated monthly rotation using the <code>create_date</code> field time stamp):</p>
<ul>
<li><p>Generate a new Ceph access key with <code>radosgw-admin key create</code></p>
</li>
<li><p>Update the secret in Vault/secrets manager with new credentials</p>
</li>
<li><p>Keep both old and new keys active in Ceph for a 7-day transition period</p>
</li>
<li><p>After 7 days, remove the old key from Ceph</p>
</li>
</ul>
</li>
<li><p><strong>Application automatically gets new keys</strong>:</p>
<ul>
<li><p>The next time the application restarts or refreshes credentials, it queries the secrets manager</p>
</li>
<li><p>Gets the new credentials automatically</p>
</li>
<li><p><strong>No code changes required</strong> - application doesn't know rotation happened</p>
</li>
<li><p>No downtime - old key still works during transition</p>
</li>
</ul>
</li>
</ol>
<h2 id="heading-migration-strategy-from-static-to-temporary">Migration Strategy: From Static to Temporary</h2>
<p>You can't flip a switch and convert all applications overnight. The transition requires methodical planning, careful testing, and phased rollout. Organizations that rush this process end up with broken applications, emergency rollbacks, and frustrated teams. The ones that succeed treat it as a deliberate migration project with clear phases and success criteria.</p>
<p>The challenge isn't technical; the STS implementation is straightforward once you understand roles. The challenge is organizational: identifying where static credentials exist, understanding what each application actually needs, and coordinating updates across teams that may not even realize they're using S3. This is why the first phase isn't about changing anything; it's about understanding what you have.</p>
<h2 id="heading-coming-in-the-next-post"><strong>Coming in the Next Post</strong></h2>
<p>You now have STS working in your Ceph environment. Your applications use temporary credentials that expire automatically, dramatically reducing the blast radius of credential theft. The permanent credentials your applications hold can't access S3 directly; they can only assume specific roles with limited permissions. Each role follows least privilege. Every access is logged with full attribution.</p>
<p>We kept the IAM explanation minimal in this post, just enough to implement STS. In the next post, we'll dive into IAM architecture and access control patterns. We'll cover the new IAM Accounts model introduced in Ceph Squid, how it creates proper multi-tenancy, and why the distinction between Account Root and IAM Users matters for security. We'll explore advanced least privilege patterns, trust policy design for cross-account access, and how to test policies before deployment. We'll also examine organizational mandates, such as blocking ACLs entirely and using the new S3Control API for account-level governance.</p>
]]></content:encoded></item></channel></rss>