<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: David Kerber</title>
    <description>The latest articles on DEV Community by David Kerber (@david_kerber).</description>
    <link>https://dev.to/david_kerber</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3516583%2Fc632ba2b-1acc-4489-8621-597ed75cc6bb.png</url>
      <title>DEV Community: David Kerber</title>
      <link>https://dev.to/david_kerber</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/david_kerber"/>
    <language>en</language>
    <item>
      <title>Test S3 ABAC locally with iam-lens</title>
      <dc:creator>David Kerber</dc:creator>
      <pubDate>Wed, 10 Dec 2025 13:00:00 +0000</pubDate>
      <link>https://dev.to/david_kerber/test-s3-abac-locally-with-iam-lens-3c7j</link>
      <guid>https://dev.to/david_kerber/test-s3-abac-locally-with-iam-lens-3c7j</guid>
      <description>&lt;h2&gt;
  
  
  tl;dr
&lt;/h2&gt;

&lt;p&gt;AWS just made managing access to S3 much more powerful, and a bit more complicated. S3 &lt;a href="https://aws.amazon.com/blogs/aws/introducing-attribute-based-access-control-for-amazon-s3-general-purpose-buckets/" rel="noopener noreferrer"&gt;now supports attribute-based access control (ABAC) for general-purpose S3 buckets&lt;/a&gt;. With &lt;a href="https://github.com/cloud-copilot/iam-lens" rel="noopener noreferrer"&gt;&lt;code&gt;iam-lens&lt;/code&gt;&lt;/a&gt;, you can simulate and understand exactly how enabling ABAC on a bucket will affect access to a bucket before enabling it. Just add &lt;strong&gt;&lt;code&gt;--s3-abac-override enabled&lt;/code&gt;&lt;/strong&gt; to your &lt;code&gt;simulate&lt;/code&gt; and &lt;code&gt;who-can&lt;/code&gt; commands to see the effects of enabling ABAC on a bucket.&lt;/p&gt;

&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;New S3 Attribute Based Access Control Functionality&lt;/li&gt;
&lt;li&gt;S3 ABAC Support in iam-collect and iam-lens&lt;/li&gt;
&lt;li&gt;
Previewing S3 ABAC Locally

&lt;ul&gt;
&lt;li&gt;Preview ABAC for a principal with iam-lens simulate&lt;/li&gt;
&lt;li&gt;Preview ABAC for a bucket with iam-lens who-can&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Build Confidence Before You Flip the Switch&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  New S3 Attribute Based Access Control Functionality
&lt;/h2&gt;

&lt;p&gt;In November 2025, AWS announced &lt;a href="https://aws.amazon.com/blogs/aws/introducing-attribute-based-access-control-for-amazon-s3-general-purpose-buckets/" rel="noopener noreferrer"&gt;attribute-based access control (ABAC) for Amazon S3 general purpose buckets&lt;/a&gt;. It works more or less as you would expect.  Tags on the bucket can be used with the context keys &lt;code&gt;aws:ResourceTag/&amp;lt;tag-key&amp;gt;&lt;/code&gt; and &lt;code&gt;s3:BucketTag/&amp;lt;tag-key&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For example, this policy will only allow access to buckets (or objects in buckets) where the bucket tag &lt;code&gt;Dept&lt;/code&gt; is &lt;code&gt;Accounting&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"Version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2012-10-17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"Statement"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Sid"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"AccountingBuckets"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"s3:ListBucket"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"s3:GetObject"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"*"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Condition"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"StringEquals"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"aws:ResourceTag/Dept"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Accounting"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There’s one important caveat: Before this policy will work on a bucket, ABAC must be enabled on each S3 bucket. I assume there are concerns about ABAC suddenly working on S3 buckets in your account without you ensuring it has the effects you want. To enable ABAC on a bucket use the &lt;a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAbac.html" rel="noopener noreferrer"&gt;&lt;code&gt;PutBucketAbac&lt;/code&gt;&lt;/a&gt; API. This is available in the console, the &lt;a href="https://docs.aws.amazon.com/cli/latest/reference/s3api/put-bucket-abac.html" rel="noopener noreferrer"&gt;AWS CLI&lt;/a&gt;, &lt;a href="https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3/client/put_bucket_abac.html" rel="noopener noreferrer"&gt;boto3&lt;/a&gt;, and AWS SDKs.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The big question is: what is the impact of enabling ABAC on an S3 bucket?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  S3 ABAC Support in &lt;code&gt;iam-collect&lt;/code&gt; and &lt;code&gt;iam-lens&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/cloud-copilot/iam-collect" rel="noopener noreferrer"&gt;&lt;code&gt;iam-collect&lt;/code&gt;&lt;/a&gt; will now download the ABAC status of every bucket in your account and store the result in &lt;code&gt;abacEnabled&lt;/code&gt; in the bucket metadata. This requires a new permission: &lt;code&gt;s3:GetBucketAbac&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/cloud-copilot/iam-lens" rel="noopener noreferrer"&gt;&lt;code&gt;iam-lens&lt;/code&gt;&lt;/a&gt; will use the bucket information in your &lt;code&gt;iam-collect&lt;/code&gt; data store to enable ABAC when running &lt;code&gt;simulate&lt;/code&gt; or &lt;code&gt;who-can&lt;/code&gt;. So by default, it will do what you expect.&lt;/p&gt;

&lt;h2&gt;
  
  
  Previewing S3 ABAC Locally
&lt;/h2&gt;

&lt;p&gt;Seeing ABAC after it's enabled is great, but the key question is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How will access change if ABAC is enabled for a bucket?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let's say we have a role &lt;code&gt;arn:aws:iam::111111111111:role/BobInAccounting&lt;/code&gt; that has this inline policy attached:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"Version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2012-10-17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"Statement"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Sid"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"AccountingBuckets"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"s3:ListBucket"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"s3:GetObject"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"*"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Condition"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"StringEquals"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"aws:ResourceTag/Dept"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Accounting"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This policy grants access to list and get objects in any bucket that has ABAC enabled and the &lt;code&gt;Dept&lt;/code&gt; tag is set to &lt;code&gt;Accounting&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Let's say we have a bucket called &lt;code&gt;arn:aws:s3:::accounts-receivable&lt;/code&gt; with the &lt;code&gt;Dept&lt;/code&gt; set to &lt;code&gt;Accounting&lt;/code&gt;, but ABAC is NOT enabled.&lt;/p&gt;

&lt;h3&gt;
  
  
  Preview ABAC for a principal with &lt;code&gt;iam-lens simulate&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;You can test this access using the &lt;code&gt;simulate&lt;/code&gt; command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;iam-lens simulate &lt;span class="nt"&gt;--principal&lt;/span&gt; arn:aws:iam::111111111111:role/BobInAccounting &lt;span class="se"&gt;\&lt;/span&gt;
                  &lt;span class="nt"&gt;--resource&lt;/span&gt; arn:aws:s3:::accounts-receivable &lt;span class="se"&gt;\&lt;/span&gt;
                  &lt;span class="nt"&gt;--action&lt;/span&gt; s3:ListBucket
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Implicitly Denied
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This returns implicitly denied because even though the tags match, ABAC is not enabled on the bucket, so &lt;code&gt;BobInAccounting&lt;/code&gt; does not have access.&lt;/p&gt;

&lt;p&gt;To test what effective access would be if you did enable ABAC add the &lt;code&gt;--s3-abac-override&lt;/code&gt; argument.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;iam-lens simulate &lt;span class="nt"&gt;--principal&lt;/span&gt; arn:aws:iam::111111111111:role/BobInAccounting &lt;span class="se"&gt;\&lt;/span&gt;
                  &lt;span class="nt"&gt;--resource&lt;/span&gt; arn:aws:s3:::accounts-receivable &lt;span class="se"&gt;\&lt;/span&gt;
                  &lt;span class="nt"&gt;--action&lt;/span&gt; s3:ListBucket &lt;span class="se"&gt;\&lt;/span&gt;
                  &lt;span class="nt"&gt;--s3-abac-override&lt;/span&gt; enabled
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Allowed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do the same thing with &lt;code&gt;s3:GetObject&lt;/code&gt; by using an S3 object ARN:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;iam-lens simulate &lt;span class="nt"&gt;--principal&lt;/span&gt; arn:aws:iam::111111111111:role/BobInAccounting &lt;span class="se"&gt;\&lt;/span&gt;
                  &lt;span class="nt"&gt;--resource&lt;/span&gt; arn:aws:s3:::accounts-receivable/invoice.pdf &lt;span class="se"&gt;\&lt;/span&gt;
                  &lt;span class="nt"&gt;--action&lt;/span&gt; s3:GetObject
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Implicitly Denied

iam-lens simulate &lt;span class="nt"&gt;--principal&lt;/span&gt; arn:aws:iam::111111111111:role/BobInAccounting &lt;span class="se"&gt;\&lt;/span&gt;
                  &lt;span class="nt"&gt;--resource&lt;/span&gt; arn:aws:s3:::accounts-receivable/invoice.pdf &lt;span class="se"&gt;\&lt;/span&gt;
                  &lt;span class="nt"&gt;--action&lt;/span&gt; s3:GetObject &lt;span class="se"&gt;\&lt;/span&gt;
                  &lt;span class="nt"&gt;--s3-abac-override&lt;/span&gt; enabled
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Allowed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using this, you can preview how your policies behave before actually updating your sensitive buckets or manually updating data in your &lt;code&gt;iam-collect&lt;/code&gt; data store.&lt;/p&gt;

&lt;h3&gt;
  
  
  Preview ABAC for a bucket with &lt;code&gt;iam-lens who-can&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;who-can&lt;/code&gt; lets you flip the question: instead of asking what one role can do, it tells you who can access a given resource.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;who-can&lt;/code&gt; starts with a resource and determines which principals have access to it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let's use the same bucket and see what we find.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;who-can &lt;span class="nt"&gt;--resource&lt;/span&gt; arn:aws:s3:::accounts-receivable &lt;span class="se"&gt;\&lt;/span&gt;
        &lt;span class="nt"&gt;--actions&lt;/span&gt; s3:ListBucket
&lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="s2"&gt;"simulationCount"&lt;/span&gt;: 42,
  &lt;span class="s2"&gt;"allowed"&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;
    &lt;span class="o"&gt;{&lt;/span&gt;
      &lt;span class="s2"&gt;"principal"&lt;/span&gt;: &lt;span class="s2"&gt;"arn:aws:iam::111111111111:role/aws-reserved/sso.amazonaws.com/AWSReservedSSO_AdministratorAccess_demo"&lt;/span&gt;,
      &lt;span class="s2"&gt;"service"&lt;/span&gt;: &lt;span class="s2"&gt;"s3"&lt;/span&gt;,
      &lt;span class="s2"&gt;"action"&lt;/span&gt;: &lt;span class="s2"&gt;"ListBucket"&lt;/span&gt;,
      &lt;span class="s2"&gt;"level"&lt;/span&gt;: &lt;span class="s2"&gt;"list"&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
  &lt;span class="o"&gt;]&lt;/span&gt;,
  &lt;span class="s2"&gt;"allAccountsChecked"&lt;/span&gt;: &lt;span class="nb"&gt;false&lt;/span&gt;,
  &lt;span class="s2"&gt;"accountsNotFound"&lt;/span&gt;: &lt;span class="o"&gt;[]&lt;/span&gt;,
  &lt;span class="s2"&gt;"organizationsNotFound"&lt;/span&gt;: &lt;span class="o"&gt;[]&lt;/span&gt;,
  &lt;span class="s2"&gt;"organizationalUnitsNotFound"&lt;/span&gt;: &lt;span class="o"&gt;[]&lt;/span&gt;,
  &lt;span class="s2"&gt;"principalsNotFound"&lt;/span&gt;: &lt;span class="o"&gt;[]&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Similar to what we found using &lt;code&gt;simulate&lt;/code&gt;, since ABAC is not enabled on the bucket &lt;code&gt;BobInAccounting&lt;/code&gt; does not have access to list the bucket.&lt;/p&gt;

&lt;p&gt;You can override this using the &lt;code&gt;--s3-abac-override&lt;/code&gt; argument:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;who-can &lt;span class="nt"&gt;--resource&lt;/span&gt; arn:aws:s3:::accounts-receivable &lt;span class="se"&gt;\&lt;/span&gt;
        &lt;span class="nt"&gt;--actions&lt;/span&gt; s3:ListBucket &lt;span class="se"&gt;\&lt;/span&gt;
        &lt;span class="nt"&gt;--s3-abac-override&lt;/span&gt; enabled
&lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="s2"&gt;"simulationCount"&lt;/span&gt;: 42,
  &lt;span class="s2"&gt;"allowed"&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;
    &lt;span class="o"&gt;{&lt;/span&gt;
      &lt;span class="s2"&gt;"principal"&lt;/span&gt;: &lt;span class="s2"&gt;"arn:aws:iam::111111111111:role/aws-reserved/sso.amazonaws.com/AWSReservedSSO_AdministratorAccess_demo"&lt;/span&gt;,
      &lt;span class="s2"&gt;"service"&lt;/span&gt;: &lt;span class="s2"&gt;"s3"&lt;/span&gt;,
      &lt;span class="s2"&gt;"action"&lt;/span&gt;: &lt;span class="s2"&gt;"ListBucket"&lt;/span&gt;,
      &lt;span class="s2"&gt;"level"&lt;/span&gt;: &lt;span class="s2"&gt;"list"&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;,
    &lt;span class="c"&gt;# 🪣 BobInAccounting is included in the output now because we are simulating ABAC being enabled on the bucket.&lt;/span&gt;
    &lt;span class="o"&gt;{&lt;/span&gt;
      &lt;span class="s2"&gt;"principal"&lt;/span&gt;: &lt;span class="s2"&gt;"arn:aws:iam::111111111111:role/BobInAccounting"&lt;/span&gt;,
      &lt;span class="s2"&gt;"service"&lt;/span&gt;: &lt;span class="s2"&gt;"s3"&lt;/span&gt;,
      &lt;span class="s2"&gt;"action"&lt;/span&gt;: &lt;span class="s2"&gt;"ListBucket"&lt;/span&gt;,
      &lt;span class="s2"&gt;"level"&lt;/span&gt;: &lt;span class="s2"&gt;"list"&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;,
  &lt;span class="o"&gt;]&lt;/span&gt;,
  &lt;span class="s2"&gt;"allAccountsChecked"&lt;/span&gt;: &lt;span class="nb"&gt;false&lt;/span&gt;,
  &lt;span class="s2"&gt;"accountsNotFound"&lt;/span&gt;: &lt;span class="o"&gt;[]&lt;/span&gt;,
  &lt;span class="s2"&gt;"organizationsNotFound"&lt;/span&gt;: &lt;span class="o"&gt;[]&lt;/span&gt;,
  &lt;span class="s2"&gt;"organizationalUnitsNotFound"&lt;/span&gt;: &lt;span class="o"&gt;[]&lt;/span&gt;,
  &lt;span class="s2"&gt;"principalsNotFound"&lt;/span&gt;: &lt;span class="o"&gt;[]&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do the same thing for S3 object access using an S3 object ARN:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# This will not include BobInAccounting&lt;/span&gt;
who-can &lt;span class="nt"&gt;--resource&lt;/span&gt; arn:aws:s3:::accounts-receivable/invoice.pdf &lt;span class="se"&gt;\&lt;/span&gt;
        &lt;span class="nt"&gt;--actions&lt;/span&gt; s3:GetObject

&lt;span class="c"&gt;# This will include BobInAccounting&lt;/span&gt;
who-can &lt;span class="nt"&gt;--resource&lt;/span&gt; arn:aws:s3:::accounts-receivable/invoice.pdf &lt;span class="se"&gt;\&lt;/span&gt;
        &lt;span class="nt"&gt;--actions&lt;/span&gt; s3:GetObject &lt;span class="se"&gt;\&lt;/span&gt;
        &lt;span class="nt"&gt;--s3-abac-override&lt;/span&gt; enabled
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If no &lt;code&gt;--actions&lt;/code&gt; are specified, &lt;code&gt;who-can&lt;/code&gt; will automatically test all actions for the resource. You can use simple bash tools to preview the effects of enabling ABAC on a bucket and its objects.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Test all bucket actions without and with ABAC&lt;/span&gt;
who-can &lt;span class="nt"&gt;--resource&lt;/span&gt; arn:aws:s3:::accounts-receivable &lt;span class="se"&gt;\&lt;/span&gt;
        &lt;span class="nt"&gt;--sort&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; bucket.json

who-can &lt;span class="nt"&gt;--resource&lt;/span&gt; arn:aws:s3:::accounts-receivable &lt;span class="se"&gt;\&lt;/span&gt;
        &lt;span class="nt"&gt;--sort&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
        &lt;span class="nt"&gt;--s3-abac-override&lt;/span&gt; enabled &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; bucket-abac.json

&lt;span class="c"&gt;# Test all object actions without and with ABAC&lt;/span&gt;
who-can &lt;span class="nt"&gt;--resource&lt;/span&gt; arn:aws:s3:::accounts-receivable/invoice.pdf &lt;span class="se"&gt;\&lt;/span&gt;
        &lt;span class="nt"&gt;--sort&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; object.json

who-can &lt;span class="nt"&gt;--resource&lt;/span&gt; arn:aws:s3:::accounts-receivable/invoice.pdf &lt;span class="se"&gt;\&lt;/span&gt;
        &lt;span class="nt"&gt;--sort&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
        &lt;span class="nt"&gt;--s3-abac-override&lt;/span&gt; enabled &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; object-abac.json

&lt;span class="c"&gt;# 👀 Compare bucket access with and without ABAC enabled&lt;/span&gt;
diff bucket.json bucket-abac.json
10a11,16
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;       &lt;span class="s2"&gt;"principal"&lt;/span&gt;: &lt;span class="s2"&gt;"arn:aws:iam::111111111111:role/BobInAccounting"&lt;/span&gt;,
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;       &lt;span class="s2"&gt;"service"&lt;/span&gt;: &lt;span class="s2"&gt;"s3"&lt;/span&gt;,
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;       &lt;span class="s2"&gt;"action"&lt;/span&gt;: &lt;span class="s2"&gt;"ListBucket"&lt;/span&gt;,
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;       &lt;span class="s2"&gt;"level"&lt;/span&gt;: &lt;span class="s2"&gt;"list"&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;     &lt;span class="o"&gt;}&lt;/span&gt;,
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;     &lt;span class="o"&gt;{&lt;/span&gt;

&lt;span class="c"&gt;# 👀 Compare object access with and without ABAC enabled&lt;/span&gt;
diff object.json object-abac.json
10a11,16
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;       &lt;span class="s2"&gt;"principal"&lt;/span&gt;: &lt;span class="s2"&gt;"arn:aws:iam::111111111111:role/BobInAccounting"&lt;/span&gt;,
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;       &lt;span class="s2"&gt;"service"&lt;/span&gt;: &lt;span class="s2"&gt;"s3"&lt;/span&gt;,
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;       &lt;span class="s2"&gt;"action"&lt;/span&gt;: &lt;span class="s2"&gt;"GetObject"&lt;/span&gt;,
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;       &lt;span class="s2"&gt;"level"&lt;/span&gt;: &lt;span class="s2"&gt;"read"&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;     &lt;span class="o"&gt;}&lt;/span&gt;,
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;     &lt;span class="o"&gt;{&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Build Confidence Before You Flip the Switch
&lt;/h2&gt;

&lt;p&gt;S3 ABAC is a long-awaited and powerful way to manage access to S3 at scale. We hope &lt;a href="https://github.com/cloud-copilot/iam-lens" rel="noopener noreferrer"&gt;&lt;code&gt;iam-lens&lt;/code&gt;&lt;/a&gt; helps you move faster and make the internet a little bit safer for all of us while leveraging it.&lt;/p&gt;

&lt;p&gt;If you have any questions or feedback please &lt;a href="https://github.com/cloud-copilot/iam-lens/issues" rel="noopener noreferrer"&gt;file an issue&lt;/a&gt; or join our &lt;a href="https://discord.gg/FRwyKk5MV9" rel="noopener noreferrer"&gt;Discord&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>security</category>
      <category>aws</category>
      <category>iam</category>
      <category>s3</category>
    </item>
    <item>
      <title>Fantastic AWS Policies and Where to Find Them</title>
      <dc:creator>David Kerber</dc:creator>
      <pubDate>Wed, 24 Sep 2025 11:19:05 +0000</pubDate>
      <link>https://dev.to/aws-builders/fantastic-aws-policies-and-where-to-find-them-38f9</link>
      <guid>https://dev.to/aws-builders/fantastic-aws-policies-and-where-to-find-them-38f9</guid>
      <description>&lt;h2&gt;
  
  
  tl;dr
&lt;/h2&gt;

&lt;p&gt;You can't secure what you can't see.&lt;/p&gt;

&lt;p&gt;AWS has dozens of policy types scattered across dozens of services, regions, and accounts.&lt;br&gt;
&lt;a href="https://github.com/cloud-copilot/iam-collect" rel="noopener noreferrer"&gt;iam-collect&lt;/a&gt; is built to find them all.&lt;/p&gt;

&lt;p&gt;Answer your questions, secure your accounts, and make your customers safer.&lt;/p&gt;
&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;📚 So Many Policies, So Little Time&lt;/li&gt;
&lt;li&gt;👤 Who's Doing What Around Here? (Principal Policies)&lt;/li&gt;
&lt;li&gt;🔓 Who Left the Door Open? (Resource Policies)&lt;/li&gt;
&lt;li&gt;🧟‍♂️ Oh Look, Even More Policies&lt;/li&gt;
&lt;li&gt;📦 Fine, Just Download Everything - iam-collect&lt;/li&gt;
&lt;li&gt;
🔍 Okay, Now What?

&lt;ul&gt;
&lt;li&gt;🛠 Inspect Your Resources&lt;/li&gt;
&lt;li&gt;🤖 Data and AI, like peanut butter and chocolate&lt;/li&gt;
&lt;li&gt;✨ Build Your Own Magic&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;🚀 The End is the Beginning&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  📚 So Many Policies, So Little Time
&lt;/h2&gt;

&lt;p&gt;One of the best things about AWS IAM is it allows you to do almost anything. One of the challenging things about AWS IAM is it allows you to do almost anything. This flexibility is made possible through several different policy types. If you are in charge of any kind of AWS security or governance, it's critical you understand all of these and their impact.&lt;/p&gt;

&lt;p&gt;So what are all these policies and how do we get them?&lt;/p&gt;
&lt;h2&gt;
  
  
  👤 Who's Doing What Around Here? (Principal Policies)
&lt;/h2&gt;

&lt;p&gt;A principal is any entity that can take actions on AWS resources. It can be a user, a service, a role, or even a GitHub Action. These are in your account as IAM Users and Roles.&lt;/p&gt;

&lt;p&gt;On their own, principal policies can only grant access to resources in the same account as the principal.&lt;/p&gt;
&lt;h3&gt;
  
  
  Managed Policies
&lt;/h3&gt;

&lt;p&gt;These are the managed policies that can be used for multiple users, roles, and groups in your account. Every account comes with AWS Managed Policies that AWS creates and manages. Policies that you create and manage are called Customer Managed Policies.&lt;/p&gt;
&lt;h3&gt;
  
  
  User and Role Policies
&lt;/h3&gt;

&lt;p&gt;Users and roles in AWS can have managed policies applied to them. They can also have inline policies attached directly to a single IAM user or role.&lt;/p&gt;
&lt;h3&gt;
  
  
  Group Policies
&lt;/h3&gt;

&lt;p&gt;IAM users can be placed into groups. Groups can have both managed and inline policies, and every policy attached to a group applies to all users in that group.&lt;/p&gt;
&lt;h3&gt;
  
  
  Permission Boundaries
&lt;/h3&gt;

&lt;p&gt;A permission boundary is a special managed policy that can be applied to a user or role to limit their overall access. Permission boundaries don't grant access, they define the outer limits of what a principal can do, even if other policies would normally allow it.&lt;/p&gt;
&lt;h3&gt;
  
  
  Service Control Policies
&lt;/h3&gt;

&lt;p&gt;Service Control Policies (SCPs) are an AWS Organizations policy type that applies to principals in your organization. They can be applied to individual AWS accounts or groups of accounts called Organizational Units. SCPs can't grant access, they can only limit access.&lt;sup id="fnref1"&gt;1&lt;/sup&gt; They are useful to enforce broad security rules across all your principals and can be significantly customized.&lt;/p&gt;
&lt;h2&gt;
  
  
  🔓 Who Left the Door Open? (Resource Policies)
&lt;/h2&gt;

&lt;p&gt;With principal policies, you start with the principal and manage what resources they have access to. Resource policies are reversed, they start from the resource and manage what principals have access.&lt;/p&gt;

&lt;p&gt;Resource policies unlock new capabilities, such as sharing a resource with a principal in another account, or an AWS service. Not every resource type supports resource policies.&lt;/p&gt;

&lt;p&gt;Most resource policies apply to a single resource, but like all things AWS, it depends.&lt;/p&gt;

&lt;p&gt;Resource policies are required for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Key Management Service (KMS) keys&lt;/li&gt;
&lt;li&gt;IAM Roles - the policies are called "trust policies"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For other resources, resource policies are optional.&lt;/p&gt;
&lt;h3&gt;
  
  
  IAM Role Trust Policies
&lt;/h3&gt;

&lt;p&gt;Every IAM role has a trust policy that defines who can assume it. This policy controls access for &lt;code&gt;sts:AssumeRole&lt;/code&gt;, &lt;code&gt;sts:AssumeRoleWithWebIdentity&lt;/code&gt;, and &lt;code&gt;sts:AssumeRoleWithSAML&lt;/code&gt; calls. A principal must be allowed in the trust policy to assume the role, no matter what other policies say.&lt;sup id="fnref2"&gt;2&lt;/sup&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Key Management Service Key Policies
&lt;/h3&gt;

&lt;p&gt;Every key in Key Management Service (KMS) must have a resource policy defining what principals or accounts have access to that specific key. If access isn't granted through the KMS key policy, it won't happen—not even for the root user. It's possible to completely lock yourself out of a KMS key this way so be careful.&lt;/p&gt;
&lt;h3&gt;
  
  
  VPC Endpoint Policies
&lt;/h3&gt;

&lt;p&gt;This is a kind of resource policies related to Private Link.  When you create a VPC endpoint inside your VPC, a policy is always required.  This policy determines what identities can send traffic through the endpoint and what resources they can access. By default all traffic is allowed but this can be customized with a policy document.&lt;/p&gt;
&lt;h3&gt;
  
  
  S3 Bucket and Access Point Policies
&lt;/h3&gt;

&lt;p&gt;S3 buckets can have their own policies granting fine-grained access to the bucket or even specific prefixes with the bucket.&lt;/p&gt;

&lt;p&gt;As bucket policies grew more complex, AWS introduced access points to "simplify" access management. Access points have their own policies. This way consumers can access a bucket through a dedicated access point that has its own detailed access point policy. There are single region and multi-region access points.&lt;/p&gt;

&lt;p&gt;S3 also has object lambda access points that can be configured to run a lambda every time an S3 access point is used. Those have their own policies as well.&lt;/p&gt;

&lt;p&gt;Different "S3" bucket types have different support for bucket policies and access points:&lt;br&gt;
| Bucket Type | Bucket Policies | Access Points |&lt;br&gt;
|-------------|----------------|---------------|&lt;br&gt;
| General Purpose Buckets | ✅ | ✅ |&lt;br&gt;
| S3 Table Buckets | ✅ | ❌ |&lt;br&gt;
| S3 Vector Buckets | ✅ | ❌ |&lt;br&gt;
| S3 Express Directory Buckets | ✅ | ✅ |&lt;br&gt;
| S3 Outpost Buckets | ✅ | ✅ |&lt;/p&gt;

&lt;p&gt;S3 Buckets also have per bucket and per account settings for &lt;a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-control-block-public-access.html" rel="noopener noreferrer"&gt;Block Public Access&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  Organizations Resource Policy
&lt;/h3&gt;

&lt;p&gt;Typically AWS Organizations APIs can only be used from the management account of an organization. AWS has created &lt;a href="https://docs.aws.amazon.com/organizations/latest/userguide/security_iam_resource-based-policy-examples.html" rel="noopener noreferrer"&gt;this unfortunately named policy&lt;/a&gt; that allows you to delegate organizations API access to principals in other accounts.&lt;/p&gt;
&lt;h3&gt;
  
  
  Organizations Delegated Administrators
&lt;/h3&gt;

&lt;p&gt;Many actions that are only allowed in the organization management account by default can be delegated to delegated administrator accounts, it's critical to know which accounts these are and what services they can manage.&lt;/p&gt;
&lt;h3&gt;
  
  
  Simple Email Service (SES) Sending and Identity Authorization Policies
&lt;/h3&gt;

&lt;p&gt;In SES you can create resource policies for specific email identities (domains or email addresses) that allow other AWS accounts to send email from those identities. This is useful for organizations with a centralized identity management account that handles email domains.&lt;/p&gt;

&lt;p&gt;You can also create a sending authorization policy that applies to your entire account. This is useful if you want to allow another account to send email on your behalf without having to create a resource policy for each identity.&lt;/p&gt;
&lt;h3&gt;
  
  
  Other Resource Policies
&lt;/h3&gt;

&lt;p&gt;Tons of other resources support resource policies such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;API Gateway REST APIs&lt;/li&gt;
&lt;li&gt;Backup Vaults&lt;/li&gt;
&lt;li&gt;DynamoDB Tables and Streams&lt;/li&gt;
&lt;li&gt;ECR Registries - the registry for the entire region and account.&lt;/li&gt;
&lt;li&gt;ECR Repositories - every individual repository&lt;/li&gt;
&lt;li&gt;EFS File Systems&lt;/li&gt;
&lt;li&gt;Glacier Vaults&lt;/li&gt;
&lt;li&gt;Lambda Functions and Layer Version - Every layer version can have its own policy 😳&lt;/li&gt;
&lt;li&gt;SNS Topics&lt;/li&gt;
&lt;li&gt;SQS Queues&lt;/li&gt;
&lt;li&gt;Secrets Manager Secrets&lt;/li&gt;
&lt;li&gt;SSM Incident Manager Contacts and Response Plans&lt;/li&gt;
&lt;li&gt;Serverless Application Repositories&lt;/li&gt;
&lt;li&gt;Rekognition Projects&lt;/li&gt;
&lt;li&gt;Migration Hub Refactor Spaces&lt;/li&gt;
&lt;li&gt;Lex Bots&lt;/li&gt;
&lt;li&gt;Elemental Media Stores&lt;/li&gt;
&lt;li&gt;CodeBuild Report Groups and Artifact Repositories&lt;/li&gt;
&lt;li&gt;Signer Profiles&lt;/li&gt;
&lt;li&gt;Kinesis Data Streams&lt;/li&gt;
&lt;li&gt;Event Bridge Schema Registries and Buses&lt;/li&gt;
&lt;li&gt;CloudWatch Delivery Destinations&lt;/li&gt;
&lt;li&gt;CloudTrail Dashboards, Channels, and Event Data Stores&lt;/li&gt;
&lt;li&gt;Redshift Serverless Namespaces&lt;/li&gt;
&lt;li&gt;Redshift Namespaces&lt;/li&gt;
&lt;li&gt;OpenSearch Domains&lt;/li&gt;
&lt;li&gt;Managed Streaming for Kafka Clusters&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Resource-&lt;em&gt;ish&lt;/em&gt; Policies
&lt;/h3&gt;

&lt;p&gt;Some custom policies in AWS don't apply directly to a single resource or account but are somewhere in between.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AWS Entity Resolution allows custom policies for sharing multiple kinds of resources.&lt;/li&gt;
&lt;li&gt;AWS IoT allows a centralized policy for managing access to different IoT Resources&lt;/li&gt;
&lt;li&gt;CloudWatch Account Policies are managed at the account level for delegating access to CloudWatch Log Groups.&lt;/li&gt;
&lt;li&gt;AWS Glue has a per-region policy that can be used to manage access to any Glue resource in that region.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  AWS Resource Access Manager
&lt;/h3&gt;

&lt;p&gt;As you can see, lots of AWS resources allow you to attach policies to resources. Resource Access Manager (RAM) enables sharing resources when the service doesn't directly support resource policies.&lt;/p&gt;

&lt;p&gt;You can think of RAM as "resource policies as a service". It allows you to share resources outside their account even if the service doesn't support resource policies. It has to be enabled by your AWS organization first. It supports 70+ resource types notably subnets, security groups, and firewalls.&lt;/p&gt;
&lt;h3&gt;
  
  
  Resource Control Polices
&lt;/h3&gt;

&lt;p&gt;Finally there are resource control policies (RCPs), an AWS Organizations feature that allows you define policies that apply to all resources in an account or organization unit.&lt;/p&gt;

&lt;p&gt;Remember: SCPs apply to &lt;em&gt;principals&lt;/em&gt; in your organization, while RCPs apply to the &lt;em&gt;resources&lt;/em&gt; themselves. Together, they help close the loop on what's allowed—and by whom.&lt;/p&gt;
&lt;h2&gt;
  
  
  🧟‍♂️ Oh Look, Even More Policies
&lt;/h2&gt;
&lt;h3&gt;
  
  
  IAM Identity Center Permission Sets
&lt;/h3&gt;

&lt;p&gt;IAM Identity Center is used as a single sign on solution for accessing multiple roles in multiple AWS accounts from a single place.  It provides user management or you can connect your own identity provider, such as Okta or Entra ID.&lt;/p&gt;

&lt;p&gt;Within Identity Center you can create permission sets that define a set of policies (AWS managed, customer managed, inline, or a permission boundary) that can then be assigned to multiple user/account pairs. To know what permissions a user in Identity Center has, you need to have all of the permissions sets that apply to that user.&lt;/p&gt;
&lt;h2&gt;
  
  
  📦 Fine, Just Download Everything - iam-collect
&lt;/h2&gt;

&lt;p&gt;That’s a lot of policies. And a lot of places for risk to hide.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/cloud-copilot/iam-collect" rel="noopener noreferrer"&gt;iam-collect&lt;/a&gt; downloads &lt;a href="https://github.com/cloud-copilot/iam-collect?tab=readme-ov-file#supported-services-and-data" rel="noopener noreferrer"&gt;IAM policies, organization policies, resource policies, RAM shares, and SSO permission sets&lt;/a&gt;, across every account,  in one place.&lt;/p&gt;

&lt;p&gt;Here is the quickest way to get started:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install&lt;/span&gt;
npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; @cloud-copilot/iam-collect
&lt;span class="c"&gt;# Make a configuration file&lt;/span&gt;
iam-collect init
&lt;span class="c"&gt;# Download data for the current account&lt;/span&gt;
iam-collect download
&lt;span class="c"&gt;# Look at your data&lt;/span&gt;
&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; ./iam-data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you have a full snapshot of IAM reality instead of assumptions or best guesses based on staring at Terraform.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💬 &lt;em&gt;Real-world feedback:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;iam-collect (and the accompanying iam-lens) were simple to stand up quickly and let us get straight to the interesting part: analyzing our tangled web of IAM policies. David has been incredibly receptive to feedback and quick to add new features as we've needed them. We're excited to use these tools even more in the future.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Jeremy Talis, Security Lead @ Pinterest&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;By default, it uses the credentials in your environment and saves data to the &lt;code&gt;iam-data&lt;/code&gt; folder. &lt;a href="https://github.com/cloud-copilot/iam-collect/blob/main/src/aws/collect-policy.json" rel="noopener noreferrer"&gt;It requires a minimum set of permissions to operate&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;A single folder can hold data for an unlimited number of AWS accounts and organizations across multiple partitions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Customizing Data and Auth
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/cloud-copilot/iam-collect" rel="noopener noreferrer"&gt;iam-collect&lt;/a&gt; is built to be ridiculously configurable.  You can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select which accounts, services, and regions data will be collected from&lt;/li&gt;
&lt;li&gt;Assume a role in each account to collect data&lt;/li&gt;
&lt;li&gt;Assume an initial role before assuming roles in other accounts&lt;/li&gt;
&lt;li&gt;Have separate auth for each account&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Storage Options
&lt;/h3&gt;

&lt;p&gt;iam-collect can store data in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A folder on your local disk&lt;/li&gt;
&lt;li&gt;An S3 bucket with any prefix&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🔍 Okay, Now What?
&lt;/h2&gt;

&lt;p&gt;The primary purpose of iam-collect is to power &lt;a href="https://github.com/cloud-copilot/iam-lens" rel="noopener noreferrer"&gt;iam-lens&lt;/a&gt;. We'll talk more about that in a future post and there is a lot you can do with it in the mean time.&lt;/p&gt;

&lt;p&gt;Whether you're:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a security lead trying to reduce audit time,&lt;/li&gt;
&lt;li&gt;a platform engineer building IAM tooling,&lt;/li&gt;
&lt;li&gt;or a consultant trying to answer “who can do what”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;iam-collect&lt;/code&gt; gives you a clean, reliable starting point.&lt;/p&gt;

&lt;h3&gt;
  
  
  🛠 Inspect Your Resources
&lt;/h3&gt;

&lt;p&gt;Using a bit of cli and utilities like &lt;code&gt;jq&lt;/code&gt; you can quickly get information. Want to find all customer managed policies in your SSO permission sets? Try this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls &lt;/span&gt;collect/aws/aws/accounts/&lt;span class="k"&gt;*&lt;/span&gt;/sso/permissionset/&lt;span class="k"&gt;*&lt;/span&gt;/customermanagedpolicies.json   | xargs &lt;span class="nt"&gt;-n1&lt;/span&gt; jq &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="s1"&gt;'.[].arn'&lt;/span&gt; | &lt;span class="nb"&gt;uniq&lt;/span&gt; | &lt;span class="nb"&gt;sort&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🤖 Data and AI, like peanut butter and chocolate
&lt;/h3&gt;

&lt;p&gt;There are an infinite number of questions you might want answered with your IAM data. So iam-collect has a set of detailed agent instructions to use with your downloaded data.&lt;/p&gt;

&lt;p&gt;Simply download the agent instructions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-O&lt;/span&gt; https://raw.githubusercontent.com/cloud-copilot/iam-collect/main/docs/AgentInstructions.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then use these instructions to answer questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What trust polices allow a Principal "*" to assume the role?&lt;/li&gt;
&lt;li&gt;What RAM shares are sharing resources outside of my organization?&lt;/li&gt;
&lt;li&gt;What managed policies that are in use use a wildcard "*" action?&lt;/li&gt;
&lt;li&gt;What AWS managed policies are in use?&lt;/li&gt;
&lt;li&gt;Are there any users in my root account without permission boundaries?&lt;/li&gt;
&lt;li&gt;What principals have a policy with the action "iam:PassRole" with a "*" resource?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These questions are about what the policies &lt;em&gt;contain&lt;/em&gt;—not necessarily their full effect, which is harder for models to reason about. That's where &lt;a href="https://github.com/cloud-copilot/iam-lens" rel="noopener noreferrer"&gt;iam-lens&lt;/a&gt; comes in later.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✨ Build Your Own Magic
&lt;/h3&gt;

&lt;p&gt;Every year, new tools emerge to help analyze IAM policies, SCPs, and other access controls. They all start with the same first step: downloading policies from from AWS.&lt;/p&gt;

&lt;p&gt;“First download all the policies” is often an annoying large part of the work; especially if you want to do it across multiple accounts and organizations.&lt;/p&gt;

&lt;p&gt;I hope that by having a tool that just downloads the policies - which people may already have done - you can start with the most valuable step: &lt;em&gt;bringing your industry expertise to AWS policies.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🚀 The End is the Beginning
&lt;/h2&gt;

&lt;p&gt;No more guessing, clicking through the console, or trying to remember if that wildcard was "just for testing."&lt;/p&gt;

&lt;p&gt;Start with the truth. Then secure it.&lt;/p&gt;

&lt;p&gt;See the &lt;a href="https://github.com/cloud-copilot/iam-collect" rel="noopener noreferrer"&gt;documentation&lt;/a&gt; to get started.&lt;/p&gt;

&lt;h2&gt;
  
  
  Footnotes
&lt;/h2&gt;




&lt;ol&gt;

&lt;li id="fn1"&gt;
&lt;p&gt;The way SCPs can limit access may include not having an &lt;code&gt;Allow&lt;/code&gt; statement. &lt;a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps.html" rel="noopener noreferrer"&gt;See the full SCP documentation&lt;/a&gt; for details. ↩&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn2"&gt;
&lt;p&gt;You can use &lt;code&gt;arn:aws:iam::ACCOUNT_ID:root&lt;/code&gt; to allow any principal in an account to assume a role. The principal still needs access to the &lt;code&gt;sts:AssumeRole&lt;/code&gt; action in their own policies. ↩&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;

</description>
      <category>security</category>
      <category>aws</category>
      <category>cloudsecurity</category>
      <category>iam</category>
    </item>
  </channel>
</rss>
