Real Time Sync Setup
With Opal Real Time Sync, admins will be able to see access changes to an application's Resources and Groups in near real-time and on an event-driven basis. Instead of waiting for Opal's scheduled syncs, each time an access change event occurs in the remote system (e.g. User added to a Group), Opal will automatically sync and reflect that change.
For our AWS integration, you can expect to see changes in Opal as quickly as 3 minutes once you set up this feature.
Prerequisites
- A cross-organizational CloudTrail that stores events in an S3 bucket.
- AWS Administrator access
Deployment types
S3 bucket notifications
This method relies on "all object create event" notifications sent from your S3 logging bucket. Note that only one topic can be set up to receive these notifications per bucket. If you are already using "all object create event" notifications from your S3 buckets you must either use CloudTrail notifications instead (see below), or use the existing SNS topic.
CloudTrail notifications
CloudTrail notifications rely on notifications sent directly from your CloudTrail. Unlike S3 bucket notifications, multiple topics can subscribe these notifications.
AWS Setup
We provide Terraform and CloudFormation templates for easy setup.
CloudFormation
- Download the CloudFormation template file.
- In the AWS Console, navigate to CloudFormation > Stacks.
- Navigate to Create Stack > With new resources
- Under Specify template, choose Upload a template file and upload the template from above.
- Continue under S3 Notifications or CloudTrail notifications below depending on your choice of deployment type.
- Fill out the form's fields depending on whether you prefer to use S3 notifications or CloudTrail notifications:
- S3 notifications:
- NotificationType: Select "s3"
- OpalIngesterRole: Enter your OpalIngester role ARN
- CloudTrailBucketArn: Enter the ARN of your S3 bucket that stores CloudTrail logs.
- ExistingTopicArn: If using an existing SNS topic, enter its ARN here, otherwise leave this empty. Ensure that your topic is already preconfigured to receive "All object create event" notifications from the S3 bucket.
- CloudTrailArn: Leave empty.
- CloudTrail notifications:
- NotificationType: Select "cloudtrail"
- OpalIngesterRole: Enter your OpalIngester role ARN
- CloudTrailBucketArn: Enter the ARN of your S3 bucket that stores CloudTrail logs.
- ExistingTopicArn: If using an existing SNS topic, enter its ARN here, otherwise leave this empty. Ensure that your topic is already preconfigured to receive "All object create event" notifications from the S3 bucket.
- CloudTrailArn: Enter the ARN of your cross-organizational CloudTrail.
- S3 notifications:
- Click Next
- Tick the I acknowledge that AWS CloudFormation might create IAM resources checkbox at the bottom of the page and click Next
- Review your configuration and click Submit once you are ready to spin up the resources.
- (CloudTrail notifications ONLY):
- In the AWS console, navigate to CloudTrail > Trails. Open your cross-organizational trail. Click Edit.
- Under SNS Notification Delivery, check Enabled.
- Under SNS Topic, select Existing, and choose the newly created SNS topic.
Terraform
Follow the instructions below for S3 or CloudTrail notifications depending on your preference.
S3 Notifications
- Create a new
.tf
file and paste the following:
provider "aws" {}
module "opal_aws_events" {
source = "https://downloads.opal.dev/eds-templates/aws/terraform/tf-v1.zip"
notification_type = "s3"
opal_ingester_role_arn = "arn:aws:iam::123456789012:role/OpalIngester"
cloudtrail_bucket_arn = "arn:aws:s3:::aws-cloudtrail-logs-123456789012-a2531774"
existing_sns_topic_arn = "" // optional for s3 notifications
cloudtrail_arn = "" // not required for s3 notifications
}
- Replace
opal_ingester_role_arn
andcloudtrail_bucket_arn
with your OpalIngester role ARN and your CloudTrail S3 bucket respectively. - If using an existing SNS topic, ensure that it is already preconfigured to receive "All object create event" notifications. Enter your topic's ARN on the
existing_sns_topic_arn
field. - Save the file and deploy the Terraform schema.
CloudTrail Notifications
- Create a new
.tf
file and paste the following:
provider "aws" {}
module "opal_aws_events" {
source = "https://downloads.opal.dev/eds-templates/aws/terraform/tf-v1.zip"
notification_type = "cloudtrail"
opal_ingester_role_arn = "arn:aws:iam::123456789012:role/OpalIngester"
cloudtrail_bucket_arn = "arn:aws:s3:::aws-cloudtrail-logs-123456789012-a2531774"
existing_sns_topic_arn = "" // not required for cloudtrail notifications
cloudtrail_arn = "arn:aws:cloudtrail:us-east-2:123456789012:trail/management-events"
}
- Replace
opal_ingester_role_arn
,cloudtrail_bucket_arn
, andcloudtrail_arn
with your OpalIngester role ARN, your CloudTrail S3 bucket ARN, and your CloudTrail ARN respectively. - Save the file and deploy the Terraform schema.
- In the AWS console, navigate to CloudTrail > Trails. Open your cross-organizational trail. Click Edit.
- Under SNS Notification Delivery, check Enabled.
- Under SNS Topic, select Existing, and choose the newly created SNS topic.
Opal Setup
The AWS setup above should have yielded a new SQS queue with a name formatted like opal-cloudtrail-queue-1234abcd
. Note down its URL.
In Opal, navigate to the Setup tab within your AWS connector. Paste the SQS Queue URL into the CloudTrail Events SQS Queue URL field. Click Save.
You should now be all set up!
Updated 11 days ago