Skip to content

feat(aws): add bedrock_full_access_policy_attached security check#10577

Open
danibarranqueroo wants to merge 3 commits intomasterfrom
feat/prowler-630-bedrock-full-access-policy-attached
Open

feat(aws): add bedrock_full_access_policy_attached security check#10577
danibarranqueroo wants to merge 3 commits intomasterfrom
feat/prowler-630-bedrock-full-access-policy-attached

Conversation

@danibarranqueroo
Copy link
Copy Markdown
Member

Context

The AmazonBedrockFullAccess AWS-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 AmazonBedrockFullAccess managed 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 detach AmazonBedrockFullAccess and replace it with a scoped custom policy granting only the specific Bedrock actions required, supplemented by permissions boundaries and SCPs.

Steps to review

  1. Review the check implementation at prowler/providers/aws/services/bedrock/bedrock_full_access_policy_attached/
  2. Review the metadata file for correct severity, remediation, and compliance mappings
  3. Review compliance framework mappings in prowler/compliance/aws/ to ensure the check is correctly mapped to relevant requirements
  4. Run the check tests: poetry run pytest tests/providers/aws/services/bedrock/bedrock_full_access_policy_attached/ -v
  5. Run the check against a real environment (if possible):
    prowler aws --check bedrock_full_access_policy_attached

Related Issues

https://prowlerpro.atlassian.net/browse/PROWLER-630

Checklist

Community Checklist
  • This feature/issue is listed in here or roadmap.prowler.com
  • Is it assigned to me, if not, request it via the issue/feature in here or Prowler Community Slack

SDK/CLI

  • Are there new checks included in this PR? Yes
    • If so, do we need to update permissions for the provider? Please review this carefully.

License

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

Add new security check bedrock_full_access_policy_attached for aws provider.
Includes check implementation, metadata, and unit tests.
@github-actions github-actions bot added provider/aws Issues/PRs related with the AWS provider compliance Issues/PRs related with the Compliance Frameworks metadata-review labels Apr 6, 2026
@danibarranqueroo danibarranqueroo force-pushed the feat/prowler-630-bedrock-full-access-policy-attached branch from aab49b3 to 7972d61 Compare April 6, 2026 11:07
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

Conflict Markers Resolved

All conflict markers have been successfully resolved in this pull request.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

✅ All necessary CHANGELOG.md files have been updated.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

Compliance Mapping Review

This PR adds new checks. Please verify that they have been mapped to the relevant compliance framework requirements.

New checks already mapped in this PR

  • bedrock_full_access_policy_attached (aws): aws_well_architected_framework_security_pillar_aws, c5_aws, iso27001_2022_aws, kisa_isms_p_2023_aws, kisa_isms_p_2023_korean_aws, nist_csf_2.0_aws, secnumcloud_3.2_aws, soc2_aws

Use the no-compliance-check label to skip this check.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 6.53%. Comparing base (961f9c8) to head (2e3b99f).
⚠️ Report is 3 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (961f9c8) and HEAD (2e3b99f). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (961f9c8) HEAD (2e3b99f)
api 1 0
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     
Flag Coverage Δ
api ?
prowler-py3.10-aws 6.53% <100.00%> (?)
prowler-py3.11-aws 6.53% <100.00%> (?)
prowler-py3.12-aws 6.53% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
prowler 6.53% <100.00%> (∅)
api ∅ <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

🔒 Container Security Scan

Image: prowler:f39a03b
Last scan: 2026-04-06 15:59:46 UTC

📊 Vulnerability Summary

Severity Count
🔴 Critical 4
Total 4

4 package(s) affected

⚠️ Action Required

Critical severity vulnerabilities detected. These should be addressed before merging:

  • Review the detailed scan results
  • Update affected packages to patched versions
  • Consider using a different base image if updates are unavailable

📋 Resources:

@danibarranqueroo danibarranqueroo marked this pull request as ready for review April 6, 2026 15:51
@danibarranqueroo danibarranqueroo requested review from a team as code owners April 6, 2026 15:51
Copy link
Copy Markdown
Member

@HugoPBrito HugoPBrito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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":
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compliance Issues/PRs related with the Compliance Frameworks metadata-review provider/aws Issues/PRs related with the AWS provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants