> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oleria.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AWS IAM and S3

Connect your AWS organization or a single AWS account to Oleria so it can build a continuously updated map of IAM users, roles, policies, EC2 instances, S3 bucket access, and CloudTrail activity. This page covers both integration approaches; the organization-level approach is recommended for production.

## Prerequisites

* AWS Admin role

<Note>Use a service account (and not an employee account) with the suggested privileges for the integration to ensure continuity.</Note>

## Integration Approaches

Oleria currently supports two approaches. Follow the one that is most appropriate for your organization.

* [Integrate AWS Organization](#integrate-aws-organization) (recommended)
* [Integrate AWS Account](#integrate-aws-account)

## Integrate AWS Organization

<Steps>
  <Step title="Log in to the AWS Management Account">
    Log in as an admin user to the AWS Management Account (also known as the master account) that will be connected to Oleria.

    Select the user in the top right corner, and select **Organization**.

    <img src="https://mintcdn.com/oleria/JQNzbB9a7dBTORxV/images/integrations/aws/step-11.png?fit=max&auto=format&n=JQNzbB9a7dBTORxV&q=85&s=8289dc09f74b6d6284aa704cbfee8405" alt="Select the user on the top right corner, and select Organization" width="563" height="490" data-path="images/integrations/aws/step-11.png" />
  </Step>

  <Step title="Copy the Root ID">
    Copy the **Root** ID for your organization from the AWS Organizations console.

    <img src="https://mintcdn.com/oleria/SJ5fQgUDZEmf9zu9/images/integrations/aws/step-12.png?fit=max&auto=format&n=SJ5fQgUDZEmf9zu9&q=85&s=fd991534c1507fab475dc82fa1c31a40" alt="Step 2: Copy the Root ID for your organization (shown in the AWS Organizations console)." width="2926" height="872" data-path="images/integrations/aws/step-12.png" />
  </Step>

  <Step title="Launch AWS CloudFormation from Oleria">
    Log in to your Oleria workspace. Select **Integrations** → select **AWS IAM and S3**. A side page opens - select **Organization (Recommended)**, paste the Root ID where the integration asks for the organization unit ID, and select **Launch AWS CloudFormation**.

    <img src="https://mintcdn.com/oleria/JQNzbB9a7dBTORxV/images/integrations/aws/step-13.png?fit=max&auto=format&n=JQNzbB9a7dBTORxV&q=85&s=85df571ba9ea46f9b48d45d2364bae7d" alt="Oleria workspace AWS integration panel with Organization scope and Root ID field" width="800" height="316" data-path="images/integrations/aws/step-13.png" />
  </Step>

  <Step title="Create the CloudFormation stack">
    You will be redirected to your AWS instance. The stack name **Oleria-Plugin-SaaS-Connector** is preselected. Acknowledge and select **Create Stack**.

    <img src="https://mintcdn.com/oleria/JQNzbB9a7dBTORxV/images/integrations/aws/step-14.png?fit=max&auto=format&n=JQNzbB9a7dBTORxV&q=85&s=d8801a759bb8d2e403af02ef40bc92b8" alt="AWS CloudFormation stack creation with Oleria-Plugin-SaaS-Connector pre-selected" width="800" height="532" data-path="images/integrations/aws/step-14.png" />
  </Step>

  <Step title="Wait for stack creation">
    The Cloud Stack creation will complete in approximately 1 minute.

    <img src="https://mintcdn.com/oleria/JQNzbB9a7dBTORxV/images/integrations/aws/step-15.png?fit=max&auto=format&n=JQNzbB9a7dBTORxV&q=85&s=3b2d677430072a577ec6c892d574323d" alt="Step 5: You will see the Cloud Stack creation completed. It takes ~1min." width="800" height="327" data-path="images/integrations/aws/step-15.png" />

    <Note>
      The account used for Oleria integration must have the following privileges:

      * cloudformation:CreateStack
      * cloudformation:CreateUploadBucket
      * cloudformation:DescribeStacks
      * cloudformation:DescribeStackEvents
      * cloudformation:GetStackPolicy
      * cloudformation:GetTemplateSummary
      * cloudformation:ListStacks
      * cloudformation:ListStackResources
      * iam:AttachRolePolicy
      * iam:CreatePolicy
      * iam:CreateRole
      * iam:ListRoles
      * iam:GetRole
      * iam:DeleteRolePolicy
      * iam:PutRolePolicy
      * s3:GetObject
      * s3:CreateBucket
      * s3:PutObject
      * sns:ListTopics

      To enable remediations for removing users from groups and reversing decisions, also grant:

      * iam:AddUserToGroup
      * iam:RemoveUserFromGroup
    </Note>

    <Note>
      Before adding stacks, verify the StackSet's configuration. For the integration to automatically apply to new AWS accounts added to your organization in the future, ensure auto-deployment is active.

      In the CloudFormation console, open **StackSets** from the left menu. Select the **Oleria-Plugin-SaaS-Connector-Org** StackSet. Under **Deployment configuration**, select **Edit automatic deployment** and set **Automatic deployment** to **Activated**.
    </Note>

    <img src="https://mintcdn.com/oleria/JQNzbB9a7dBTORxV/images/integrations/aws/step-16.png?fit=max&auto=format&n=JQNzbB9a7dBTORxV&q=85&s=3e2f16248770254a21aaced68e733e7f" alt="CloudFormation StackSets page with Oleria-Plugin-SaaS-Connector selected" width="800" height="380" data-path="images/integrations/aws/step-16.png" />
  </Step>

  <Step title="Navigate to the oleriaConnectorRole">
    Select the **Resources** tab and navigate to the **oleriaConnectorRole**.

    <img src="https://mintcdn.com/oleria/JQNzbB9a7dBTORxV/images/integrations/aws/step-4.png?fit=max&auto=format&n=JQNzbB9a7dBTORxV&q=85&s=05593b537cb60d2729ecf27d13383285" alt="Step 6: Select the Resources tab and navigate to the oleriaConnectorRole." width="800" height="332" data-path="images/integrations/aws/step-4.png" />
  </Step>

  <Step title="Copy the Role ARN">
    Copy the **oleriaConnectorRole** ARN.

    <img src="https://mintcdn.com/oleria/JQNzbB9a7dBTORxV/images/integrations/aws/step-5.png?fit=max&auto=format&n=JQNzbB9a7dBTORxV&q=85&s=309e33f8d7dc3a50dbff20f8d1f81b46" alt="Step 7: Copy the oleriaConnectorRole ARN" width="800" height="329" data-path="images/integrations/aws/step-5.png" />
  </Step>

  <Step title="Update the KMS key policy (if applicable)">
    This step is required only if the S3 bucket is encrypted with a KMS key. Update the KMS key policy to allow access to the Oleria connector role. Repeat these CloudTrail and KMS key policy steps for each AWS account that uses an encrypted trail.

    Search **CloudTrail** → select **Management Events**.

    <img src="https://mintcdn.com/oleria/JQNzbB9a7dBTORxV/images/integrations/aws/step-6.png?fit=max&auto=format&n=JQNzbB9a7dBTORxV&q=85&s=cdd9e9ed70ba69a812f2233e4444800e" alt="Search CloudTrail →  select Management Events" width="784" height="459" data-path="images/integrations/aws/step-6.png" />

    <Note>If you have multiple trails, select the first trail and check for an encrypted KMS key. If S3 is encrypted, you will see a KMS key link.</Note>

    Select the **AWS KMS key** link.

    <img src="https://mintcdn.com/oleria/JQNzbB9a7dBTORxV/images/integrations/aws/step-7.png?fit=max&auto=format&n=JQNzbB9a7dBTORxV&q=85&s=d8938b00c1d49457d0e458261968343c" alt="Select the AWS KMS key link" width="800" height="490" data-path="images/integrations/aws/step-7.png" />

    Update the KMS key policy as shown below. Replace **accountID** with your **AWS account ID**.

    ```json theme={null}
    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Sid": "AllowOleriaConnectorAccess",
          "Effect": "Allow",
          "Principal": {
            "AWS": "arn:aws:iam::<accountID>:role/oleriaConnectorRole"
          },
          "Action": [
            "kms:Decrypt",
            "kms:DescribeKey"
          ],
          "Resource": "*"
        }
      ]
    }
    ```

    <img src="https://mintcdn.com/oleria/JQNzbB9a7dBTORxV/images/integrations/aws/step-8.png?fit=max&auto=format&n=JQNzbB9a7dBTORxV&q=85&s=f412fc9579c231d8f555d6b5386a3794" alt="Replace accountID with your AWS account ID." width="800" height="417" data-path="images/integrations/aws/step-8.png" />

    This policy allows the Oleria connector role to use `kms:Decrypt` and `kms:DescribeKey` for KMS-encrypted S3 access.
  </Step>

  <Step title="Provide the Role ARN in Oleria">
    Return to your Oleria workspace. Provide the **Role ARN** copied above. Select the checkbox and select **Authenticate**.

    <img src="https://mintcdn.com/oleria/JQNzbB9a7dBTORxV/images/integrations/aws/step-9.png?fit=max&auto=format&n=JQNzbB9a7dBTORxV&q=85&s=c845687628bb672b8cbd42cc21965057" alt="Oleria workspace with Role ARN field and checkboxes for S3 and CloudTrail enabled" width="800" height="335" data-path="images/integrations/aws/step-9.png" />
  </Step>

  <Step title="Select the AWS region">
    In your Oleria workspace, select the AWS region where you launched the CloudFormation stack. Select the checkbox and select **Authenticate**.
  </Step>

  <Step title="Confirm the connection">
    Find the newly integrated AWS IAM and S3 in your Oleria workspace connected integrations.

    <img src="https://mintcdn.com/oleria/JQNzbB9a7dBTORxV/images/integrations/aws/step-10.png?fit=max&auto=format&n=JQNzbB9a7dBTORxV&q=85&s=7411d067df3f5b392e1c5dd737bd1987" alt="Oleria workspace Connected Integrations showing newly added AWS IAM and S3" width="702" height="274" data-path="images/integrations/aws/step-10.png" />
  </Step>
</Steps>

## Integrate AWS Account

<Warning>
  This approach connects a single AWS account and is intended for POC use only. You will not get the full value of Oleria with this method. For production deployments and complete visibility across your AWS environment, Oleria recommends the **Integrate AWS Organization** approach above.
</Warning>

<Steps>
  <Step title="Log in to the AWS Management Account">
    Log in as an admin user to the AWS Management Account (also known as the master account) that will be connected to Oleria.
  </Step>

  <Step title="Launch AWS CloudFormation from Oleria">
    In the same browser, open a new tab and log in to your Oleria workspace. Select **Integrations** → select **AWS IAM and S3**. A side page opens - select **Account** from the Connector scope dropdown and select **Launch AWS CloudFormation**.

    <img src="https://mintcdn.com/oleria/JQNzbB9a7dBTORxV/images/integrations/aws/step-1.png?fit=max&auto=format&n=JQNzbB9a7dBTORxV&q=85&s=7675de7c371a1e6711280d9c839cd1e2" alt="Oleria workspace AWS integration panel with account-level scope selected" width="800" height="294" data-path="images/integrations/aws/step-1.png" />
  </Step>

  <Step title="Create the CloudFormation stack">
    You will be redirected to your AWS instance. The stack name **Oleria-Plugin-SaaS-Connector** is preselected. Acknowledge and select **Create Stack**.

    <img src="https://mintcdn.com/oleria/JQNzbB9a7dBTORxV/images/integrations/aws/step-2.png?fit=max&auto=format&n=JQNzbB9a7dBTORxV&q=85&s=091d3565676ed7032d187958f39417d9" alt="AWS CloudFormation stack creation page for account-level integration" width="641" height="759" data-path="images/integrations/aws/step-2.png" />
  </Step>

  <Step title="Wait for stack creation">
    The Cloud Stack creation will complete shortly.

    <img src="https://mintcdn.com/oleria/JQNzbB9a7dBTORxV/images/integrations/aws/step-3.png?fit=max&auto=format&n=JQNzbB9a7dBTORxV&q=85&s=98232d3ec2c21a3a6af4f7ba1be98948" alt="Step 4: You will see the Cloud Stack creation completes" width="800" height="490" data-path="images/integrations/aws/step-3.png" />

    <Note>
      The account used for Oleria integration must have the following privileges:

      * cloudformation:CreateStack
      * cloudformation:CreateUploadBucket
      * cloudformation:DescribeStacks
      * cloudformation:DescribeStackEvents
      * cloudformation:GetStackPolicy
      * cloudformation:GetTemplateSummary
      * cloudformation:ListStacks
      * cloudformation:ListStackResources
      * iam:AttachRolePolicy
      * iam:CreatePolicy
      * iam:CreateRole
      * iam:ListRoles
      * iam:GetRole
      * iam:DeleteRolePolicy
      * iam:PutRolePolicy
      * s3:GetObject
      * s3:CreateBucket
      * s3:PutObject
      * sns:ListTopics

      To enable remediations for removing users from groups and reversing decisions, also grant:

      * iam:AddUserToGroup
      * iam:RemoveUserFromGroup
    </Note>
  </Step>

  <Step title="Navigate to the oleriaConnectorRole">
    Select the **Resources** tab and navigate to the **oleriaConnectorRole**.

    <img src="https://mintcdn.com/oleria/JQNzbB9a7dBTORxV/images/integrations/aws/step-4.png?fit=max&auto=format&n=JQNzbB9a7dBTORxV&q=85&s=05593b537cb60d2729ecf27d13383285" alt="Step 5: Select the Resources tab and navigate to the oleriaConnectorRole." width="800" height="332" data-path="images/integrations/aws/step-4.png" />
  </Step>

  <Step title="Copy the Role ARN">
    Copy the **oleriaConnectorRole** ARN.

    <img src="https://mintcdn.com/oleria/JQNzbB9a7dBTORxV/images/integrations/aws/step-5.png?fit=max&auto=format&n=JQNzbB9a7dBTORxV&q=85&s=309e33f8d7dc3a50dbff20f8d1f81b46" alt="Step 6: Copy the oleriaConnectorRole ARN" width="800" height="329" data-path="images/integrations/aws/step-5.png" />
  </Step>

  <Step title="Update the KMS key policy (if applicable)">
    This step is required only if the S3 bucket is encrypted with a KMS key. Update the KMS key policy to allow access to the Oleria connector role.

    Search **CloudTrail** → select **Management Events**.

    <img src="https://mintcdn.com/oleria/JQNzbB9a7dBTORxV/images/integrations/aws/step-6.png?fit=max&auto=format&n=JQNzbB9a7dBTORxV&q=85&s=cdd9e9ed70ba69a812f2233e4444800e" alt="Search CloudTrail →  select Management Events" width="784" height="459" data-path="images/integrations/aws/step-6.png" />

    <Note>If you have multiple trails, select the first trail and check for an encrypted KMS key. If S3 is encrypted, you will see a KMS key link.</Note>

    Select the **AWS KMS key** link.

    <img src="https://mintcdn.com/oleria/JQNzbB9a7dBTORxV/images/integrations/aws/step-7.png?fit=max&auto=format&n=JQNzbB9a7dBTORxV&q=85&s=d8938b00c1d49457d0e458261968343c" alt="Select the AWS KMS key link" width="800" height="490" data-path="images/integrations/aws/step-7.png" />

    Update the KMS key policy as shown below. Replace **accountID** with your **AWS account ID**.

    ```json theme={null}
    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Sid": "AllowOleriaConnectorAccess",
          "Effect": "Allow",
          "Principal": {
            "AWS": "arn:aws:iam::<accountID>:role/oleriaConnectorRole"
          },
          "Action": [
            "kms:Decrypt",
            "kms:DescribeKey"
          ],
          "Resource": "*"
        }
      ]
    }
    ```

    <img src="https://mintcdn.com/oleria/JQNzbB9a7dBTORxV/images/integrations/aws/step-8.png?fit=max&auto=format&n=JQNzbB9a7dBTORxV&q=85&s=f412fc9579c231d8f555d6b5386a3794" alt="Replace accountID with your AWS account ID." width="800" height="417" data-path="images/integrations/aws/step-8.png" />

    This policy allows the Oleria connector role to use `kms:Decrypt` and `kms:DescribeKey` for KMS-encrypted S3 access.
  </Step>

  <Step title="Provide the Role ARN in Oleria">
    Return to your Oleria workspace. Provide the **Role ARN** copied above. Select the checkbox and select **Authenticate**.

    <img src="https://mintcdn.com/oleria/JQNzbB9a7dBTORxV/images/integrations/aws/step-9.png?fit=max&auto=format&n=JQNzbB9a7dBTORxV&q=85&s=c845687628bb672b8cbd42cc21965057" alt="Oleria workspace with Role ARN field and checkboxes for S3 and CloudTrail" width="800" height="335" data-path="images/integrations/aws/step-9.png" />
  </Step>

  <Step title="Confirm the connection">
    Find the newly integrated AWS IAM and S3 in your Oleria workspace connected integrations.

    <img src="https://mintcdn.com/oleria/JQNzbB9a7dBTORxV/images/integrations/aws/step-10.png?fit=max&auto=format&n=JQNzbB9a7dBTORxV&q=85&s=7411d067df3f5b392e1c5dd737bd1987" alt="Oleria workspace Connected Integrations showing newly added AWS IAM and S3" width="702" height="274" data-path="images/integrations/aws/step-10.png" />
  </Step>
</Steps>

## Contact us

For questions about this integration, contact us at [support@oleria.com](mailto:support@oleria.com).
