Integrating AWS S3
Capabilities
DataGrail's AWS S3 Integration provides the following capabilities:
Product | Capability | ||
---|---|---|---|
Request Manager |
|
Before You Start
To successfully configure this integration, please ensure you have sufficient privileges:
- DataGrail User Role: Super Admin, Connections Manager
- AWS S3 User Role: Admin
Setup Cloud Storage
DataGrail uses two buckets to support your privacy request storage, one for the data retrieved during privacy requests, and another for logging.
Create The Bucket
- Log in to AWS, and navigate to S3.
- Select Create Bucket.
- Enter a Bucket Name. We recommend using:
yourcompanyname-datagrail-reports
- Enter an AWS Region. There are no restrictions on region.
- Take note of the bucket name and region. You will need this for later.
Configure The Bucket
The following are highly recommended configuration options. They ensure that you're both logging access to any objects produced during an access or deletion request and ensures that data is also encrypted at rest.
- Confirm that the Block All Public Access is checked.
- Under Default Encryption, select either:
- Server-side encryption with Amazon S3 managed keys (SSE-S3)
- Server-side encryption with AWS Key Management Service keys (SSE-KMS)
Configuring the KMS Key
- Select or create a KMS key that works for your security posture. However, per Amazon's recommendation, use symmetric encryption on the KMS Key.
- Add the following permissions in the Key Policy:
kms:GenerateDataKey
,kms:Encrypt
andkms:Decrypt
- The Key Policy should look like the following. The
Principal
should be set toarn:aws:iam::338780525468:user/dg_app
for Access Key Connections. For AssumeRole Connections, thePrincipal
should be the ARN of the role.
{
"Sid": "Allow use of the key",
"Effect": "Allow",
"Principal": {
"AWS": [
"<SUBSTITUTEME>"
]
},
"Action": [
"kms:Encrypt",
"kms:Decrypt",
"kms:GenerateDataKey"
],
"Resource": "<The ARN of the KMS Key>"
}It's important that the Resource is properly set to restrict access to only the AWS KMS Key.
- Select Create Bucket.
Create a Bucket For Logging
- Follow the steps in Create The Bucket and Configure The Bucket to create another bucket named
yourcompanyname-datagrail-logs
. This bucket will be used to store server access logs for your bucket. - Select the original bucket (
yourcompanyname-datagrail-reports
) and click Properties from the top menu. - Select Edit under Server Access Logging.
- Enable Server Access Logging and select the
yourcompanyname-datagrail-logs
bucket you created earlier as the Target Bucket. - Select Save Changes.
- Scroll down to AWS CloudTrail data events and select Configure in CloudTrail.
- After being redirected, select Create Trail and enter a trail name. We suggest:
datagrail-reports-events
- Take note of the name of the new bucket that will be created under Trail log bucket and folder.
- Enter an AWS KMS alias. We suggest:
datagrail-reports-key
- Select Next at the bottom of the page.
- Deselect Management events and select Data events.
- Select Switch to basic event selectors.
- Set Data event type to S3. Uncheck the Read and Write options under All current and future buckets.
- Under Individual bucket selection, enter the name of the original bucket (
yourcompanyname-datagrail-reports
). Ensure Read and Write are checked. - Click Next, Review, and then select Create Trail.
Create The IAM Bucket Policy
- Navigate to IAM within AWS and select Policies from the left menu.
- Select Create Policy.
- Switch to the JSON policy editor.
- Enter the Recommended IAM Policy.
Recommended IAM Policy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowListBucketIfSpecificPrefixIsIncludedInRequest",
"Action": [
"s3:ListBucket"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::SUBSTITUTEME"
]
},
{
"Sid": "AllowUserToReadWriteObjectDataInFolder",
"Action": [
"s3:GetObject",
"s3:DeleteObject",
"s3:PutObject"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::SUBSTITUTEME/*"
]
}
]
}
Ensure you substitute the ARN of your bucket for SUBSTITUTEME
.
Connect to DataGrail
DataGrail provides two methods for securely connecting AWS S3:
One of the main security benefits of using AssumeRole is the lack of key rotation requirements. Read more about IAM Users and Roles here.
Connect With AssumeRole (Recommended)
Create The IAM Role
- Navigate to IAM within AWS and select Roles from the left menu.
- Select Create Role.
- Choose Custom trust policy.
- Enter the Recommended JSON Policy, ensuring you create and substitute an External ID.
Recommended JSON Policy
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::338780525468:user/dg_app"
},
"Action": "sts:AssumeRole",
"Condition": {
"StringEquals": {
"sts:ExternalId": "SUBSTITUTEME"
}
}
}
]
}
Ensure you create and substitute an External ID for SUBSTITUTEME
.
The External ID is, in effect, a password. Keep it secure. We recommend using a secure password generator with a long length (32+ alphanumeric characters, no symbols). Save the External ID for later; it will be used to set up the DataGrail connection to this role.
- Select Next and choose the policy created in Creating The IAM Bucket Policy.
- Select Next and enter a Role name.
- Select Create role and then ensure that this IAM Role ARN is populated on the JSON KMS Key Policy you created in Configure The Bucket.
Please send the ARN of the newly created role to support@datagrail.io. Our support team will work with you to assume the necessary permissions on this role.
Connect to DataGrail
- Navigate back to DataGrail.
- Under Bucket, enter the name of the original bucket (
yourcompanyname-datagrail-reports
). - Under Region, enter the name of the AWS region of the original bucket (i.e.
us-west-2
). - Select AWS Assume Role under Authentication Type.
- Under AssumeRole ARN, enter the ARN of the IAM Role you just created.
- Under AssumeRole External ID, enter the External ID used in the IAM Role you just created.
- Select Configure Integration.
Connect With an Access Key
Create The IAM User
- Navigate to IAM within AWS and select Users from the left menu.
- Select Create User.
- Enter a User name and ensure Provide user access to the AWS Management Console is unchecked.
- Select Next and then Attach policies directly.
- Select the policy created in Creating The IAM Bucket Policy.
- Select Next and then Create user.
- Save the Access Key ID and Secret Access Key in a secure, temporary location, then select Close.
- Ensure the IAM User ARN is populated on the JSON KMS Key Policy you created in Configure The Bucket.
Connect to DataGrail
- Navigate back to DataGrail.
- Under Bucket, enter the name of the original bucket (
yourcompanyname-datagrail-reports
). - Under Region, enter the name of the AWS region of the original bucket (i.e.
us-west-2
). - Select AWS Access Key under Authentication Type.
- Under Access Key ID, enter the Access Key ID from the IAM User you just created.
- Under Secret Access Key, enter the Secret Access Key from the IAM User you just created.
- Select Configure Integration.
Next Steps
Now that you've successfully connected the integration, check out the following resources:
Troubleshooting
If you are unable to successfully connect the integration, review these common troubleshooting steps:
Ensure you have sent the IAM Role ARN to DataGrail Support.
For AssumeRole connections, the DataGrail Support Team needs the ARN of the IAM role you created to assume the necessary permissions.
Please send the ARN of the newly created role to support@datagrail.io.
Ensure all placeholder values in JSON policies are populated.
All JSON policies in this documentation contain multiple placeholders for credentials you have created during the setup process. Please review the JSON policies for the KMS Key and any IAM Users, Roles, or Resources.
Ensure Required Permissions Are Granted on API Keys/Resources
DataGrail checks required permissions and scopes on API keys/resources used by each integration. If all necessary permissions are not granted, new connections will fail.
Review Required Account Types and User Roles
If users do not have the necessary permissions or the minimum required user role in the connecting system, the connection to DataGrail will fail. Additionally, connections will fail if your account type does not match the one required by the integration.
See Before You Start to review these requirements.
Disclaimer: The information contained in this message does not constitute as legal advice. We would advise seeking professional counsel before acting on or interpreting any material.