This page explains how to minimize Cloud Monitorings access to your AWS account.
When you use the standard instructions for adding an AWS account to one of your Workspaces, you grant Monitoring read-only access to all your AWS resources. This is done by creating a role in AWS IAM with read-only access to all services. You store in your Workspace a key (the Role ARN) that lets Monitoring use that role.
Monitoring's level of access is controlled by the AWS IAM role you choose. To minimize access, create an AWS IAM role with read-only access to only some of your AWS resources, rather than to all of them. For example, your role might permit access to only CloudWatch and SNS.
An AWS role used to authorize Monitoring can be used in only one Workspace. Each role contains an External ID that is specific to a single Workspace.
The following AWS permission policies are the minimal set required by Monitoring. Your AWS role must contain at least these permissions:
AmazonDynamoDBReadOnlyAccess AmazonEC2ReadOnlyAccess AmazonElastiCacheReadOnlyAccess AmazonESReadOnlyAccess AmazonKinesisReadOnlyAccess AmazonRedshiftReadOnlyAccess AmazonRDSReadOnlyAccess AmazonS3ReadOnlyAccess AmazonSESReadOnlyAccess AmazonSNSReadOnlyAccess AmazonSQSReadOnlyAccess AmazonVPCReadOnlyAccess AutoScalingReadOnlyAccess AWSLambdaReadOnlyAccess CloudFrontReadOnlyAccess CloudWatchReadOnlyAccess CloudWatchEventsReadOnlyAccess
This list could grow as new AWS services are added to Monitoring. You can add additional permissions to balance Monitoring functionality with your desire to keep access limited.
Modifying an AWS role
If you have already added your AWS account to a Workspace, then you can limit Monitoring access by changing the permissions in the AWS role you are already using:
- Login to your AWS account.
- Go to Services > IAM > Roles to get to the AWS IAM console.
At the bottom of the page, click the role name you are using to authorize Stackdriver. In the Permissions tab, you see the list of permissions for that role:
- To remove an existing permission, click the X to the right of the permission.
- To add additional permissions, click Attach policy:
- Use the filter to find the policy you want.
- Select one of the policies ending in ReadOnlyAccess or ReadOnly.
- Click Attach Policy.
- Repeat to add more policies.
Adding an AWS account with limited access
Refer to the standard instructions at Adding a project or account to a Workspace. The instructions for creating your AWS Role are not in the Stackdriver user documentation, but instead are listed inside the Cloud Monitoring page in the Google Cloud Console, when you add an AWS account. Following is a screenshot of those instructions.
Here is how to modify those instructions:
Find step 7, "Select ReadOnlyAccess from the policy list and click Next: Review."
Replace that step with the following:
- Use the filter to locate a permissions policy you want to use. Select a ReadOnly variant of the policy because that is all you need.
- Repeat as necessary to select more permissions.
- When finished, click Next: Review. You see something like the following:
Continue with the standard instructions.