# 1.22 Restrict Access to AWSCloudShellFullAccess (Manual)

- Source: https://support.icompaas.com/support/solutions/articles/62000233099-1-22-restrict-access-to-awscloudshellfullaccess-manual-
- Section: [Solutions](https://support.icompaas.com/support/solutions) › [AWS CIS V.4 Level 1 Benchmarks](https://support.icompaas.com/support/solutions/62000112671) › [CIS Control 1](https://support.icompaas.com/support/solutions/folders/62000169194)
- Last updated: 2026-05-29
- Publisher: iCompaas, Inc. (https://www.icompaas.com)

### Profile Applicability:

Level 1

## Description:

AWS CloudShell provides a pre-authenticated command-line interface (CLI) for interacting with AWS services.

-   The AWSCloudShellFullAccess IAM policy grants full access to CloudShell, allowing users to upload/download files and run commands with sudo privileges.
    
-   Users with this policy can install data exfiltration tools or transfer sensitive data to external systems.
    

## Rationale:

-   AWSCloudShellFullAccess allows unrestricted sudo access, meaning malicious actors can install unauthorized tools.
    
-   Potential data exfiltration risk – users can upload and download files between AWS CloudShell and their local system.
    
-   Excessive access violates the principle of least privilege and increases security risk.
    

## Impact:

-   If AWSCloudShellFullAccess is removed from all users, CloudShell will be unavailable.
    
-   Existing workflows that rely on CloudShell access may break unless alternative permissions are provided.
    
-   Restricting AWSCloudShellFullAccess may require users to switch to the AWS CLI on their local machine.
    

## Default Value:

By default:

-   AWSCloudShellFullAccess is not attached to any users or roles.
    
-   Users must be explicitly granted this policy to use CloudShell with full privileges.
    

## Pre-Requisites:

1.  IAM Administrator Access
    
    -   Permissions: iam:ListPolicies, iam:ListEntitiesForPolicy, iam:DetachUserPolicy
        
2.  AWS CLI Installed (for automation)
    
3.  Identify users, roles, and groups assigned AWSCloudShellFullAccess
    
4.  Create a more restrictive policy for AWS CloudShell users
    

## Remediation:

### Test Plan:

## Using AWS Console

1.  Login to AWS Console as an IAM Administrator.
    
2.  Open IAM Console → Click Policies.
    

                        ![](https://support.icompaas.com/assets/kb/28992c1a09429c9c.png)

3.  Search for AWSCloudShellFullAccess.
    
4.  Click on Entities Attached.
    

           ![](https://support.icompaas.com/assets/kb/3ac03418ccfef7dd.png)

5.  Ensure no IAM users, roles, or groups are attached to this policy.
    

## Using AWS CLI

Step 1: List IAM Policies and Find AWSCloudShellFullAccess

aws iam list-policies --query "Policies\[?PolicyName=='AWSCloudShellFullAccess'\]"

-   This command checks if the policy exists in your AWS account.
    

Step 2: Check Who Has AWSCloudShellFullAccess Attached

aws iam list-entities-for-policy --policy-arn arn:aws:iam::aws:policy/AWSCloudShellFullAccess

-   If PolicyRoles, PolicyUsers, or PolicyGroups contain entities, those entities have access to CloudShell.

Example Output (Non-Compliant):  

{
  "PolicyRoles": \["AdminRole"\],
  "PolicyUsers": \["JohnDoe"\],
  "PolicyGroups": \[\]
}

-   AdminRole and JohnDoe have full CloudShell access and must be remediated.

Step 3: Verify If Other Policies Grant CloudShell Access

aws iam list-policies --query "Policies\[?contains(PolicyName, 'CloudShell')\]"

-   If other custom policies provide CloudShell access, they should be reviewed. 

##   
Implementation Steps:

Step 1: Detach AWSCloudShellFullAccess from Users, Roles, and Groups

## Using AWS Console

1.  Login to AWS Console as an IAM Administrator.
    
2.  Open IAM Console → Click Policies.
    

                     ![](https://support.icompaas.com/assets/kb/425bf34441ce2c74.png)

3.  Search for AWSCloudShellFullAccess and select it.                   ![](https://support.icompaas.com/assets/kb/ab49fe36a46d06e5.png)                   
    
4.  Click Entities Attached → For each user, role, or group, check the box and click Detach.
    

                  ![](https://support.icompaas.com/assets/kb/18584d2775739890.png)

    ![](https://support.icompaas.com/assets/kb/798d439d0fd70fa5.png)

## Using AWS CLI

Detach the policy from IAM users:

aws iam detach-user-policy --user-name <UserName> --policy-arn arn:aws:iam::aws:policy/AWSCloudShellFullAccess

Detach the policy from IAM groups:

aws iam detach-group-policy --group-name <GroupName> --policy-arn arn:aws:iam::aws:policy/AWSCloudShellFullAccess

Detach the policy from IAM roles:

aws iam detach-role-policy --role-name <RoleName> --policy-arn arn:aws:iam::aws:policy/AWSCloudShellFullAccess

Step 2: Restrict CloudShell Access with a Custom IAM Policy

-   Instead of removing CloudShell entirely, create a restricted policy:

{
    "Version": "2012-10-17",
    "Statement": \[
        {
            "Effect": "Allow",
            "Action": \[
                "cloudshell:CreateEnvironment",
                "cloudshell:GetEnvironmentStatus",
                "cloudshell:StartEnvironment"
            \],
            "Resource": "\*"
        },
        {
            "Effect": "Deny",
            "Action": \[
                "cloudshell:PutFile",
                "cloudshell:GetFile"
            \],
            "Resource": "\*"
        }
    \]
}

-   Save the JSON policy file as RestrictedCloudShellAccess.json.

1.  Create a new IAM policy using AWS CLI:

aws iam create-policy --policy-name RestrictedCloudShellAccess --policy-document file://RestrictedCloudShellAccess.json

-   Attach this policy to specific IAM users or groups:

aws iam attach-user-policy --user-name <UserName> --policy-arn arn:aws:iam::aws:policy/RestrictedCloudShellAccess

## Backout Plan:

If users require CloudShell access, follow these steps:

-   Re-attach AWSCloudShellFullAccess to specific users/groups:

aws iam attach-user-policy --user-name <UserName> --policy-arn arn:aws:iam::aws:policy/AWSCloudShellFullAccess

-   Modify the restricted policy to allow specific actions.

## References:

-   AWS CloudShell Overview: [AWS Docs](https://docs.aws.amazon.com/cloudshell/latest/userguide/sec-auth-with-identities.html)
    
-   IAM Best Practices: [AWS Security Best Practices](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html)

## Related compliance guidance

- [SOC 2 compliance: a practical implementation guide for cloud-native SaaS teams](https://support.icompaas.com/compliance/soc-2-trust-services-criteria): Configuration checks like this one are the technical half of a SOC 2 / ISO 27001 programme — the guide shows where they fit, what else an auditor expects, and how to evidence them.
- [ISO/IEC 27001:2022 compliance: a practical implementation guide](https://support.icompaas.com/compliance/iso-27001-2022): ISO 27001 Annex A.8 (technological controls) is where cloud hardening evidence lands; the guide shows how to run the ISMS around it.
