Configure an Amazon S3 Integration and Create an S3 Data Source
Private preview
The Amazon S3 integration is available to select accounts. Reach out to your Immuta representative for details.
graph LR
A(Authenticate) --> B(Configure integration) --> C(Map users and create policies) --> D(Register metadata);
style A fill:#fff
style B fill:#2F6BA7,color:#fff
style C fill:#fff
style D fill:#fff
click A "../../getting-started/#authenticate-with-the-api" _blank
click C "../../getting-started/#protect-data" _blank
click D "../../getting-started/#register-s3-data" _blank
The Amazon S3 resource allows you to create, configure, and manage your S3 integration. In this integration, Immuta provides coarse-grained access controls for data in S3 by performing permission grants using the Access Grants API so that users don't have to manage individual IAM policies themselves.
Use the /integrations
endpoint to
- configure an S3 integration
- get an S3 integration
- get all integrations
- delete an S3 integration
- create an S3 data source
Requirements
- S3 integration enabled in Immuta; contact your Immuta representative to enable this integration
- Write policies private preview enabled for your account; contact your Immuta representative to get this feature enabled
- No location is registered in your AWS Access Grants instance before configuring the integration in Immuta
Permissions
APPLICATION_ADMIN
Immuta permission to configure the integrationCREATE_S3_DATASOURCE
Immuta permission to register S3 data sources-
The AWS account credentials or optional AWS IAM role you provide Immuta when configuring the integration must
- have ownership of the buckets Immuta will enforce policies on
-
have the following permissions to create locations and issue grants:
s3:CreateAccessGrant
s3:CreateAccessGrantsLocation
s3:DeleteAccessGrant
s3:DeleteAccessGrantsLocation
s3:GetAccessGrant
s3:GetAccessGrantsInstance
s3:GetAccessGrantsInstanceForPrefix
s3:GetAccessGrantsInstanceResourcePolicy
s3:GetAccessGrantsLocation
s3:ListAccessGrants
s3:ListAccessGrantsInstances
s3:ListAccessGrantsLocations
iam:PassRole
iam:GetRole
Set up S3 Access Grants instance
- Follow AWS documentation to create an Access Grants instance using the S3 console, AWS CLI, AWS SDKs, or the REST API. AWS supports one Access Grants instance per region per AWS account.
-
Follow the instructions at the top of the "Register a location" page in AWS documentation to create an AWS IAM role and give the S3 Access Grants service principal access to this role in the resource policy file. You will add this role to your integration configuration in Immuta so that Immuta can register this role with your Access Grants location. The AWS documentation linked above gives a complete policy example, but your policy should include the following permissions:
sts:AssumeRole
sts:SetSourceIdentity
sts:SetContext
-
Follow the instructions at the top of the "Register a location" page in AWS documentation to create an IAM policy with the following permissions, and attach the policy to the IAM role you created to grant the permissions to the role. The AWS documentation linked above gives a complete example, but the policy should at least include the following permissions:
s3:GetObject
s3:GetObjectVersion
s3:GetObjectAcl
s3:GetObjectVersionAcl
s3:ListMultipartUploadParts
s3:PutObject
s3:PutObjectAcl
s3:PutObjectVersionAcl
s3:DeleteObject
s3:DeleteObjectVersion
s3:AbortMultipartUpload
s3:ListBucket
s3:ListAllMyBuckets
iam:passRole
If you use server-side encryption with AWS Key Management Service (AWS KMS) keys to encrypt your data, the following permissions are required for the IAM role in the policy. If you do not use this feature, do not include these permissions in your IAM policy:
kms:Decrypt
kms:GenerateDataKey
-
Opt to create an AWS IAM role that Immuta can use to create Access Grants locations and issue grants. This role must have the S3 permissions listed in the permissions section.
Configure the integration in Immuta
This request configures the integration using the AWS access key authentication method.
curl -X 'POST' \
'https://www.organization.immuta.com/integrations' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: 846e9e43c86a4ct1be14290d95127d13f' \
-d '{
"type": "Native S3",
"autoBootstrap": false,
"config": {
"name": "S3 integration",
"awsAccountId": "123456789",
"awsRegion": "us-east-1",
"awsLocationRole": "arn:aws:iam::123456789:role/access-grants-instance-role",
"awsLocationPath": "s3://",
"authenticationType": "accessKey",
"awsAccessKeyId": "123456789",
"awsSecretAccessKey": "123456789"
}
}'
- Copy the request example. The example uses JSON format, but the request also accepts YAML.
- Replace the Immuta URL and API key with your own.
-
Change the config values to your own, where
- name is the name for the integration that is unique across all Amazon S3 integrations configured in Immuta.
- awsAccountId is the ID of your AWS account.
- awsRegion is the account's AWS region (such as
us-east1
). - awsLocationRole is the AWS IAM role ARN assigned to the base access grants location. This is the role the AWS Access Grants service assumes to vend credentials to the grantee.
- awsLocationPath is the base S3 location prefix that Immuta will use for this connection when registering S3 data sources. This path must be unique across all S3 integrations configured in Immuta.
- awsAccessKeyId is the AWS access key ID of the AWS account configuring the integration.
- awsSecretAccessKey is the AWS secret access key of the AWS account configuring the integration.
This request configures the integration using the automatic authentication method, which searches and obtains credentials using the AWS SDK's default credential provider chain. This method requires a configured IAM role for a service account and is only supported if you're using a self-managed deployment of Immuta. Work with your Immuta representative to customize your deployment and set up an IAM role for a service account that can give Immuta the credentials to set up the integration.
curl -X 'POST' \
'https://www.organization.immuta.com/integrations' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: 846e9e43c86a4ct1be14290d95127d13f' \
-d '{
"type": "Native S3",
"autoBootstrap": false,
"config": {
"name": "S3 integration",
"awsAccountId": "123456789",
"awsRegion": "us-east-1",
"awsLocationRole": "arn:aws:iam::123456789:role/access-grants-instance-role",
"awsLocationPath": "s3://",
"authenticationType": "auto"
}
}'
- Copy the request example. The example uses JSON format, but the request also accepts YAML.
- Replace the Immuta URL and API key with your own.
-
Change the config values to your own, where
- name is the name for the integration that is unique across all Amazon S3 integrations configured in Immuta.
- awsAccountId is the ID of your AWS account.
- awsRegion is the account's AWS region (such as
us-east1
). - awsLocationRole is the AWS IAM role ARN assigned to the base access grants location. This is the role the AWS Access Grants service assumes to vend credentials to the grantee.
- awsLocationPath is the base S3 location that Immuta will use for this connection when registering S3 data sources. This path must be unique across all S3 integrations configured in Immuta.
See the config object description for parameter definitions, value types, and additional configuration options.
Response
The response returns the status of the S3 integration configuration connection. See the response schema reference for details about the response schema.
A successful response includes the validation tests statuses.
{
"id": "123456789",
"status": "creating",
"validationResults": {
"status": "passed",
"validationTests": [
{
"name": "There is no existing integration matching this configuration",
"status": "passed"
},
{
"name": "The provided integration name is unique across Immuta S3 integrations",
"status": "passed"
},
{
"name": "The provided access grants location role is a valid ARN format",
"status": "passed"
},
{
"name": "The provided AWS credentials allow fetching the caller's identity via the AWS STS API",
"status": "passed"
},
{
"name": "An AWS Access Grants instance is configured in the provided AWS account and region",
"status": "passed"
},
{
"name": "The provided S3 path exists and Immuta can list prefixes",
"status": "passed"
},
{
"name": "An AWS Access Grants location does not yet exist for the provided path",
"status": "passed"
}
]
}
}
An unsuccessful request returns the status code and an error message. See the HTTP status codes and error messages for a list of statuses, error messages, and troubleshooting guidance.
{
"statusCode": 409,
"error": "Conflict",
"message": "Access Grants location already exists on provided path."
}
Get an integration
curl -X 'GET' \
'https://www.organization.immuta.com/integrations/{id}' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: 846e9e43c86a4ct1be14290d95127d13f'
- Copy the request example.
- Replace the Immuta URL and API key with your own.
- Replace the {id} request parameter with the unique identifier of the integration you want to get.
Alternatively, you can get a list of all integrations and their IDs with the
GET /integrations
endpoint.
Response
The response returns an S3 integration configuration. See the response schema reference for details about the response schema. An unsuccessful response returns the status code and an error message. See the HTTP status codes and error messages for a list of statuses, error messages, and troubleshooting guidance.
{
"id": "123456789",
"status": "enabled",
"validationResults": {
"status": "passed",
"validationTests": [
{
"name": "There is no existing integration matching this configuration",
"status": "passed"
},
{
"name": "The provided integration name is unique across Immuta S3 integrations",
"status": "passed"
},
{
"name": "The provided access grants location role is a valid ARN format",
"status": "passed"
},
{
"name": "The provided AWS credentials allow fetching the caller's identity via the AWS STS API",
"status": "passed"
},
{
"name": "An AWS Access Grants instance is configured in the provided AWS account and region",
"status": "passed"
},
{
"name": "The provided S3 path exists and Immuta can list prefixes",
"status": "passed"
},
{
"name": "An AWS Access Grants location does not yet exist for the provided path",
"status": "passed"
}
]
},
"type": "Native S3",
"autoBootstrap": false,
"config": {
"port": 443,
"name": "S3 integration",
"awsAccountId": "123456789",
"awsRegion": "us-east-1",
"awsLocationRole": "arn:aws:iam::123456789:role/access-grants-instance-role",
"awsLocationPath": "s3://",
"authenticationType": "accessKey",
"awsAccessKeyId": "123456789",
"awsSecretAccessKey": "123456789"
}
}
Get all integrations
curl -X 'GET' \
'https://www.organization.immuta.com/integrations' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: 846e9e43c86a4ct1be14290d95127d13f'
- Copy the request example.
- Replace the Immuta URL and API key with your own.
Response
The response returns the configuration for all integrations. See the response schema reference for details about the response schema. An unsuccessful request returns the status code and an error message. See the HTTP status codes and error messages for a list of statuses, error messages, and troubleshooting guidance.
[
{
"id": "1",
"status": "enabled",
"validationResults": {
"status": "passed",
"validationTests": [
{
"name": "Initial Validation: Basic Connection Test",
"status": "passed"
},
{
"name": "Initial Validation: Default Warehouse Access Test",
"status": "passed",
"result": []
},
{
"name": "Initial Validation: Validate access to Privileged Role",
"status": "passed",
"result": []
},
{
"name": "Validate Automatic: Database Does Not Exist",
"status": "passed"
},
{
"name": "Validate Automatic: Impersonation Role Does Not Exist",
"status": "skipped"
},
{
"name": "Validate Automatic Bootstrap User Grants",
"status": "passed"
}
] },
"type": "Snowflake",
"autoBootstrap": true,
"config": {
"host": "organization.us-east-1.snowflakecomputing.com",
"warehouse": "SAMPLE_WAREHOUSE",
"database": "SNOWFLAKE_SAMPLE_DATA",
"port": 443,
"audit": {
"enabled": false
},
"workspaces": {
"enabled": false
},
"impersonation": {
"enabled": false
},
"lineage": {
"enabled": false
},
"authenticationType": "userPassword",
"username": "<REDACTED>",
"password": "<REDACTED>",
"role": "ACCOUNTADMIN"
}
},
{
"id": "123456789",
"status": "enabled",
"validationResults": {
"status": "passed",
"validationTests": [
{
"name": "There is no existing integration matching this configuration",
"status": "passed"
},
{
"name": "The provided integration name is unique across Immuta S3 integrations",
"status": "passed"
},
{
"name": "The provided access grants location role is a valid ARN format",
"status": "passed"
},
{
"name": "The provided AWS credentials allow fetching the caller's identity via the AWS STS API",
"status": "passed"
},
{
"name": "An AWS Access Grants instance is configured in the provided AWS account and region",
"status": "passed"
},
{
"name": "The provided S3 path exists and Immuta can list prefixes",
"status": "passed"
},
{
"name": "An AWS Access Grants location does not yet exist for the provided path",
"status": "passed"
}
] },
"type": "Native S3",
"autoBootstrap": false,
"config": {
"port": 443,
"name": "S3 integration",
"awsAccountId": "123456789",
"awsRegion": "us-east-1",
"awsLocationRole": "arn:aws:iam::123456789:role/access-grants-instance-role",
"awsLocationPath": "s3://",
"authenticationType": "accessKey",
"awsAccessKeyId": "123456789",
"awsSecretAccessKey": "123456789"
}
}
]
Delete an integration
curl -X 'DELETE' \
'https://www.organization.immuta.com/integrations/{id}' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: 846e9e43c86a4ct1be14290d95127d13f'
- Copy the request example.
- Replace the Immuta URL and API key with your own.
- Replace the {id} request parameter with the unique identifier of the integration you want to delete.
Response
The response returns the status of the S3 integration configuration that has been deleted. See the response schema reference for details about the response schema. An unsuccessful request returns the status code and an error message. See the HTTP status codes and error messages for a list of statuses, error messages, and troubleshooting guidance.
{
"id": "123456789",
"status": "deleting",
"validationResults": {
"status": "passed",
"validationTests": [
{
"name": "The provided access grants location role is a valid ARN format",
"status": "passed"
},
{
"name": "The provided AWS credentials allow fetching the caller's identity via the AWS STS API",
"status": "passed"
},
{
"name": "An AWS Access Grants instance is configured in the provided AWS account and region",
"status": "passed"
},
{
"name": "The provided S3 path exists and Immuta can list prefixes",
"status": "passed"
}
]
}
}
Create a data source
curl -X 'POST' \
'https://www.organization.immuta.com/native-s3/handler' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: 846e9e43c86a4ct1be14290d95127d13f' \
-d '{
"type": "Native S3",
"integrationId": 123456789,
"dataSources": [
{
"dataSourceName": "Research Data",
"prefix": "/research-data"
}
]
}'
- Copy the request example. The example uses JSON format, but the request also accepts YAML.
- Replace the Immuta URL and API key with your own.
- Change the integrationsID to the ID of your S3 integration. This ID can be retrieved with the
GET /integrations
request. -
Change the dataSources values to your own, where
- dataSourceName is the name of your data source.
- prefix creates a data source for the prefix, bucket, or object provided in the path. If the data source prefix ends in a wildcard (), it protects all items starting with that prefix. If the data source prefix ends without a wildcard (), it protects a single object.
See the S3 data source payload description for parameter definitions and value types.
Response
The response returns the ID, name, and prefix of the data source. See the response schema reference for details about the response schema. An unsuccessful response returns the status code and an error message. See the HTTP status codes and error messages for a list of statuses, error messages, and troubleshooting guidance.