Description
AWS CloudShell is a convenient way to run CLI commands against AWS services. The AWSCloudShellFullAccess managed IAM policy provides full access to CloudShell, which allows file upload and download capability between a user's local system and the CloudShell environment. Within the CloudShell environment, a user has sudo permissions and can access the internet. This makes it feasible to install file transfer software (for example) and move data from CloudShell to external internet servers.
Rationaleโ
Access to this policy should be restricted, as it presents a potential channel for data exfiltration by malicious cloud admins who are given full permissions to the service. AWS documentation describes how to create a more restrictive IAM policy that denies file transfer permissions.
Auditโ
From Consoleโ
- Open the IAM console at https://console.aws.amazon.com/iam/.
- In the left pane, select
Policies. - Search for and select
AWSCloudShellFullAccess. - On the
Entitiesattached tab, ensure that there are no entities using this policy.
From Command Lineโ
-
List IAM policies, filter for the
AWSCloudShellFullAccessmanaged policy, and note theArnelement value:aws iam list-policies --query "Policies[?PolicyName == 'AWSCloudShellFullAccess']" -
Check if the
AWSCloudShellFullAccesspolicy is attached to any role:aws iam list-entities-for-policy --policy-arn arn:aws:iam::aws:policy/AWSCloudShellFullAccess -
In the output, ensure
PolicyRolesreturns empty.Example:
PolicyRoles: [ ]
Note: Keep in mind that other policies may grant access.