Prerequisites for AWS S3¶
Before proceeding with the AWS S3 setup, ensure that the following prerequisites are met:
Two IAM roles are required to allow access to S3:
- DataServer Pod IAM Role – Assumed by the DataServer pods using IRSA/OIDC.
- DataAccess IAM Role – Contains the required S3 permissions.
The DataServer Pod IAM Role must be granted permission to assume the DataAccess IAM Role, ensuring that the pod identity remains separate from the permissions used for data access.
Follow the steps below to create the required IAM Roles:
-
Create DataServer Pod IAM Role:
- It is an identity-federated role assumed by pods via IRSA/OIDC — its only permission is to assume another role that gives actual data access, keeping pod identity separate from data access.
- Create a new IAM role with the following trust relationship. Replace
<IDENTITY_PROVIDER_ARN>with the ARN of the identity provider:
-
Create DataAccess IAM Role:
- This role holds the actual S3 permissions. This role is assumed by the
DataServer Pod IAM Roleto access the S3 buckets. - Create a new IAM role with the following trust relationship.
- This role holds the actual S3 permissions. This role is assumed by the
-
Create DataAccess IAM Role Policy to Allow Access to S3:
- Create a new IAM role policy with the following permissions:
- Attach the IAM role policy to the above created DataAccess IAM role.
- Create a new IAM role policy with the following permissions:
-
Create DataServer Pod IAM Role Policy:
- Define a Policy for the DataServer Pod IAM Role, that allows it to assume the DataAccess IAM Role to access the data.
An IAM role with the required policies must be created to allow access to S3 as described below. The IAM role should also have a trust relationship with the Privacera DataServer Pod IAM role, allowing it to assume the Data Access Role.
Follow the steps below to create the required IAM Role:
-
Create DataAccess IAM Role:
- It enables the DataServer to access the required data.
- Create a new IAM Role with the following trust relationship.
-
Create a Policy to allow S3 Access:
- Create a Policy for the Role that allows access to the required data.
- Create a Policy for the Role that allows access to the required data.
-
Attach the IAM policy created earlier to the DataAccess IAM Role.
On a runtime plane, the DataServer pod runs as the runtime plane's IAM role, trust3-<runtime-name>-role. For details about this role, see Cloud permissions.
When a profile uses Custom IAM Role, DataServer calls sts:AssumeRole as the runtime plane's IAM role to assume the target role named in the profile's IAM Role ARN field. AWS checks both sides of that call:
- The trust policy of the target role must allow the runtime plane's IAM role.
- The runtime plane's IAM role must have
sts:AssumeRolepermission on the target role.
If either side is missing, S3 requests through DataServer fail with an AccessDenied error for sts:AssumeRole. This applies whether the target role is in the same AWS account as the runtime plane or in a different one.
Perform the following steps for each target role:
-
Add the following statement to the trust policy of the target role. Keep the existing statements.
-
Add an inline policy to the runtime plane's IAM role that lets it assume the target role:
-
Attach the S3 permissions to the target role. For an example policy, see the DataAccess IAM role policy in the Self-Managed and Data Plane tab.
If you set an External ID on the profile, add a matching sts:ExternalId condition to the trust policy statement of the target role.
- Prev topic: Access Management Overview
- Next topic: Setup