feat(aws): add bedrock_full_access_policy_attached security check#10577
feat(aws): add bedrock_full_access_policy_attached security check#10577danibarranqueroo wants to merge 3 commits intomasterfrom
Conversation
Add new security check bedrock_full_access_policy_attached for aws provider. Includes check implementation, metadata, and unit tests.
aab49b3 to
7972d61
Compare
|
✅ Conflict Markers Resolved All conflict markers have been successfully resolved in this pull request. |
|
✅ All necessary |
Compliance Mapping ReviewThis PR adds new checks. Please verify that they have been mapped to the relevant compliance framework requirements. New checks already mapped in this PR
Use the |
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## master #10577 +/- ##
===========================================
- Coverage 93.55% 6.53% -87.03%
===========================================
Files 225 841 +616
Lines 31645 23940 -7705
===========================================
- Hits 29607 1564 -28043
- Misses 2038 22376 +20338
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
🔒 Container Security ScanImage: 📊 Vulnerability Summary
4 package(s) affected
|
HugoPBrito
left a comment
There was a problem hiding this comment.
The check should match the AWS-managed policy by ARN, not only by name.
| report.status = "PASS" | ||
| report.status_extended = f"IAM Role {role.name} does not have AmazonBedrockFullAccess policy attached." | ||
| for policy in role.attached_policies: | ||
| if policy["PolicyName"] == "AmazonBedrockFullAccess": |
There was a problem hiding this comment.
This check is supposed to detect the AWS-managed AmazonBedrockFullAccess policy, but the current implementation only matches on PolicyName. That can lead to false positives if a customer-managed policy exists with the same name. Matching on PolicyArn makes the check precise and ensures it only flags the AWS-managed policy described in the metadata and remediation.
| if policy["PolicyName"] == "AmazonBedrockFullAccess": | |
| for policy in role.attached_policies: | |
| if policy["PolicyArn"] == "arn:aws:iam::aws:policy/AmazonBedrockFullAccess": | |
| report.status = "FAIL" | |
| report.status_extended = f"IAM Role {role.name} has AmazonBedrockFullAccess policy attached." | |
| break |
Context
The
AmazonBedrockFullAccessAWS-managed policy grants unrestricted access to all Amazon Bedrock actions and resources. If an IAM role with this policy is compromised, an attacker could invoke any model to exfiltrate data or generate harmful content, modify guardrails, logging, and security configurations, or incur significant costs through unrestricted model invocations. Organizations using Bedrock should follow least privilege and avoid attaching this overly broad policy to non-service roles.Description
This check evaluates all IAM roles (excluding service roles) for attachment of the
AmazonBedrockFullAccessmanaged policy. A role passes if the policy is not attached; it fails if the policy is found among the role's attached policies. The recommended remediation is to detachAmazonBedrockFullAccessand replace it with a scoped custom policy granting only the specific Bedrock actions required, supplemented by permissions boundaries and SCPs.Steps to review
prowler/providers/aws/services/bedrock/bedrock_full_access_policy_attached/prowler/compliance/aws/to ensure the check is correctly mapped to relevant requirementspoetry run pytest tests/providers/aws/services/bedrock/bedrock_full_access_policy_attached/ -vRelated Issues
https://prowlerpro.atlassian.net/browse/PROWLER-630
Checklist
Community Checklist
SDK/CLI
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.