Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(iam): add new check iam_policy_cloudshell_admin_not_attached #5437

Conversation

MarioRgzLpz
Copy link
Member

Context

Add a new check to ensure IAM identities (users, roles, or groups) don't have the AWS managed policy AWSCloudShellFullAccess attached. The control fails if this policy is present.

AWSCloudShellFullAccess provides full access to AWS CloudShell, including file upload/download capabilities and sudo permissions, which can pose security risks. Adhere to the principle of least privilege and avoid attaching this broad policy.

Description

Added new check iam_cloudshell_admin_policy_not_attached with respective unit tests. Added new attribute entities_attached_to_cloudshell_policy with method _list_entities_for_policy and a test for the method.

Checklist

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@MarioRgzLpz MarioRgzLpz requested review from a team as code owners October 16, 2024 17:00
@github-actions github-actions bot added the provider/aws Issues/PRs related with the AWS provider label Oct 16, 2024
Copy link

codecov bot commented Oct 16, 2024

Codecov Report

Attention: Patch coverage is 90.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 89.57%. Comparing base (45c32ab) to head (d288376).
Report is 38 commits behind head on master.

Files with missing lines Patch % Lines
prowler/providers/aws/services/iam/iam_service.py 80.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5437      +/-   ##
==========================================
+ Coverage   89.21%   89.57%   +0.36%     
==========================================
  Files        1044     1067      +23     
  Lines       32225    33080     +855     
==========================================
+ Hits        28750    29633     +883     
+ Misses       3475     3447      -28     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sergargar sergargar changed the title feat(iam): add new check iam_cloudshell_admin_policy_not_attached feat(iam): add new check iam_policy_cloudshell_admin_not_attached Oct 17, 2024
@sergargar sergargar self-requested a review October 21, 2024 14:26
@sergargar sergargar merged commit 415c319 into master Oct 21, 2024
11 checks passed
@sergargar sergargar deleted the PRWLR-4537-iam-identities-should-not-have-the-aws-cloud-shell-full-access-policy-attached branch October 21, 2024 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
provider/aws Issues/PRs related with the AWS provider
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants