AWS LPA Setup

Prior to getting started with the Principal Activity capability, users will be required to complete configuration to enable the system to properly import and display the associated data.

These settings are displayed as LPA Configuration within Cloud Security as the Principal Activity capability is the first component of our future LPA feature.

These requirements consist of the following:

  • Creating/Validating the appropriate IAM Roles and Permissions
  • Creating CloudTrails (this step is optional if you have an existing CloudTrail you plan to use with Principal Activity/LPA)
  • Updating Data Settings & Configuration within Cloud Security

If you have any questions or issues with Principal Activity reach out through any of the options outlined on the Getting Support page.

IAM Roles and Permissions

Permissions

Principal Activity (LPA) requires multiple services and different roles to work correctly. The permissions from the following AWS services are required:

  • Athena: Main Query Executor
  • Glue: Used for retrieving the schema information
  • S3: CloudTrail source inputs, and Working bucket outputs

Policy

New Onboarding

As of Cloud Security version 23.4.11, the new onboarding experience for AWS accounts uses CloudFormation templates to automatically provision relevant accounts with the necessary policies and roles. This means it is easiest to perform LPA configuration while onboarding an account/organization. Review AWS Cloud - Onboarding for more information.

The Egress LPA Auto Provisioning Policy (https://s3.amazonaws.com/get.divvycloud.com/policies/v2/AWS-rapid7-egress-lpa-auto-provisioning-policy.json ) grants the Rapid7 IAM Role permission to access CloudTrail, to create the necessary AWS Glue tables, and to create/execute Athena queries with an S3 bucket for results.

This links to a generic policy and there are fields you will need to update to reflect your specific environment.

Creating a CloudTrail

Before getting started with Principal Activity you will need to have CloudTrail configured to enable Principal Activity (LPA). Most users typically have a CloudTrail configured; in this instance, skip to the setup within Cloud Security and use your existing CloudTrail setup information.

New CloudTrail

If you do not already have a CloudTrail configured or would rather create a new, separate CloudTrail, refer to the AWS documentation on how to create a new CloudTrail  and note the following recommendations:
  • Create a new S3 bucket to go with the CloudTrail
  • Enable log file SSE-KMS encryption (with a new KMS key)
  • Choose to log Management events (both Read and Write)
  • Choose to log Data events and Insights events, but note that this will incur additional CloudTrail costs

Attaching Policy to CloudTrail Bucket

If possible, you should grant bucket access to the harvesting IAM Role within the same AWS Account as the CloudTrail bucket. This way you only need to grant permissions in one place and any security checks about cross-account bucket access won’t be raised. To add a policy to the new CloudTrail bucket:

  1. Navigate to the S3 service in the AWS Console for the same account you created the CloudTrail.
  2. Find the new CloudTrail bucket you just created in the previous section and click its name to open it.
  3. Click the Permissions tab.
  4. In the Bucket policy section, click Edit.
  5. Append the following statement to the bucket policy, ensuring you replace the placeholder values:
    {
        "Sid": "AllowS3ObjectAccessToRapid7EgressRole",
        "Effect": "Allow",
        "Action": ["s3:GetObject", "s3:ListBucket"],
        "Principal": {"AWS": "arn:{partition}:iam::{account_id}:role{role_name}"},
        "Resource": ["arn:{partition}:s3:::{target_bucket}", "arn:aws:s3:::{target_bucket}/*"]
    }
  6. Click Save Changes.

Troubleshooting

Settings & Configuration

These steps assume you have all of the appropriate configuration details on hand to complete the Principal Activity (LPA) configuration within Cloud Security.

Notes on LPA CloudTrail Sources

Cloud Security supports multiple sources of CloudTrail data, if desired. Before you add a source, ensure you have:
  • A unique name for identification purposes
  • An S3 URI that points at the CloudTrail source. Note: This directory MUST POINT TO A DIRECTORY OF ACCOUNT IDS. Thus, the prefix specified, when viewed in the S3 management console, must show a list of directories representing account IDs.
  • Credentials with s3:GetObject and s3:ListBucket access to the CloudTrail S3 URI, write access to the LPA S3 working bucket, and Athena query read/execute permissions.
Our LPA system does not filter CloudTrail events, so please configure the CloudTrail source appropriately to log all of the events (read and/or write) that you want to see inside Cloud Security. We recommend that both read and write management events be enabled for the CloudTrail source; otherwise, the full list of used permissions will not be displayed in the LPA analysis.
Authentication Role

If Authentication Type Assume role is selected, a trust needs to be allowed for the harvest role you created, not the Cloud Security install role.
  1. Go to Administration > IAM Settings > AWS LPA Working Directory.
  2. Complete the form/fields as follows:

Working Directory Location

  • S3 URI: Update with the S3 bucket details associated with the bucket where your LPA (Principal Activity) will be stored. We recommend that:
    • You create an S3 bucket that is dedicated to storage of the LPA (Principal Activity) data
    • This dedicated bucket resides in the same location as your Cloud Security installation
Deleting Settings

Once settings have been tested and validated, you can delete them at any point to prevent unwanted LPA costs. Just return to this page and click Delete Settings.