Skip to content

feat(bedrockagentcore): add bedrockagentcore_runtime_vpc_configured check - #12800

Open
Nithin078 wants to merge 1 commit into
prowler-cloud:masterfrom
Nithin078:feat/bedrockagentcore-runtime-vpc-configured
Open

feat(bedrockagentcore): add bedrockagentcore_runtime_vpc_configured check#12800
Nithin078 wants to merge 1 commit into
prowler-cloud:masterfrom
Nithin078:feat/bedrockagentcore-runtime-vpc-configured

Conversation

@Nithin078

@Nithin078 Nithin078 commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Context

Amazon Bedrock AgentCore runtimes default to public network mode, which lets agent traffic leave a customer VPC. This PR adds a resource-level check for that posture.

Fix #12615

Related initiative: #12597 (AC-01 — Runtime Amazon VPC Configuration)

Description

  • Collector: Adds a BedrockAgentCore service that lists AgentCore runtimes (ListAgentRuntimes) and retains GetAgentRuntime networkConfiguration fields (networkMode, networkModeConfig.subnets, networkModeConfig.securityGroups).
  • Check: bedrockagentcore_runtime_vpc_configured
    • PASS: networkMode is VPC and both subnets and security groups are configured.
    • FAIL: networkMode is PUBLIC/default, or VPC mode is missing required subnets or security groups.
    • MANUAL: Runtime listing failed in a region (for example AccessDenied) or GetAgentRuntime could not retrieve the runtime detail. Unreadable in-scope data is never reported as PASS.
    • No findings: Empty inventory, or the region does not support AgentCore (ValidationException and similar).
  • Permissions: Named read-only actions bedrock-agentcore:ListAgentRuntimes, bedrock-agentcore:GetAgentRuntime, and bedrock-agentcore:ListTagsForResource in permissions/prowler-additions-policy.json and the CloudFormation scan role.
  • Regions: Adds bedrock-agentcore-control to aws_regions_by_service.json (aliased from bedrock-agentcore in util/update_aws_services_regions.py).
  • Tests: 17 unit tests covering PASS, FAIL (public, missing fields, mixed inventory), MANUAL, empty inventory, unsupported region, and API errors.

This check is atomic: it does not inspect public-subnet IGW routes or VPC endpoints (those are separate assertions).

Note: open PRs #12557 (shared AgentCore collector) and #12762 (JWT identity check + runtime collector) also add bedrockagentcore files. This PR is self-contained so it can land independently; it will need a rebase if either of those merges first.

Steps to review

  1. Run the service and check unit tests:
    uv run pytest -v tests/providers/aws/services/bedrockagentcore/
  2. Confirm the check is discovered:
    uv run python prowler-cli.py aws --list-checks | grep bedrockagentcore_runtime_vpc_configured
  3. Review collector error handling: unsupported-region errors must not become MANUAL; AccessDenied on list/get must not become PASS.

Execution Evidence

Unit tests (17 passed) are included. Representative finding messages from those tests:

[PASS] runtime-12345 (us-east-1)
  ARN: arn:aws:bedrock-agentcore:us-east-1:************:runtime/runtime-12345
  Status Extended: Bedrock AgentCore runtime test-runtime is configured with VPC network mode and has subnets and security groups in region us-east-1.

[FAIL] runtime-12345 (us-east-1)
  ARN: arn:aws:bedrock-agentcore:us-east-1:************:runtime/runtime-12345
  Status Extended: Bedrock AgentCore runtime test-runtime is configured with PUBLIC network mode instead of VPC in region us-east-1.

Live AWS PASS/FAIL execution against real AgentCore runtimes was not available in this environment. I can add censored CLI output from a real account as a follow-up if needed for merge.

Checklist

Community Checklist

SDK/CLI

  • Are there new checks included in this PR? Yes
    • Updated permissions in permissions/prowler-additions-policy.json and permissions/templates/cloudformation/prowler-scan-role.yml.

License

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

Summary by CodeRabbit

  • New Features

    • Added AWS Bedrock AgentCore support, including runtime discovery, regional availability, details, and tags.
    • Added a security check verifying that AgentCore runtimes use VPC networking with configured subnets and security groups.
    • Findings now identify compliant, non-compliant, or manually reviewable runtime configurations.
  • Permissions

    • Added read-only permissions required to inspect AgentCore runtimes and resource tags.
  • Documentation

    • Added remediation guidance and documentation for the new AgentCore runtime networking check.

…heck

- Collect AgentCore runtime network configuration
- Fail public or incomplete VPC settings
- Report MANUAL when runtime details cannot be read
@Nithin078
Nithin078 requested a review from a team as a code owner September 12, 2026 16:05
@github-actions github-actions Bot added provider/aws Issues/PRs related with the AWS provider metadata-review community Opened by the Community labels Sep 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

No Conflicts

No conflict markers, and the branch merges cleanly into its base.

@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: b1c75f9a-3056-4257-8562-9071a83b792b

📥 Commits

Reviewing files that changed from the base of the PR and between 282fe5b and d794040.

📒 Files selected for processing (13)
  • permissions/prowler-additions-policy.json
  • permissions/templates/cloudformation/prowler-scan-role.yml
  • prowler/changelog.d/bedrockagentcore-runtime-vpc-configured.added.md
  • prowler/providers/aws/aws_regions_by_service.json
  • prowler/providers/aws/services/bedrockagentcore/__init__.py
  • prowler/providers/aws/services/bedrockagentcore/bedrockagentcore_client.py
  • prowler/providers/aws/services/bedrockagentcore/bedrockagentcore_runtime_vpc_configured/__init__.py
  • prowler/providers/aws/services/bedrockagentcore/bedrockagentcore_runtime_vpc_configured/bedrockagentcore_runtime_vpc_configured.metadata.json
  • prowler/providers/aws/services/bedrockagentcore/bedrockagentcore_runtime_vpc_configured/bedrockagentcore_runtime_vpc_configured.py
  • prowler/providers/aws/services/bedrockagentcore/bedrockagentcore_service.py
  • tests/providers/aws/services/bedrockagentcore/bedrockagentcore_runtime_vpc_configured/bedrockagentcore_runtime_vpc_configured_test.py
  • tests/providers/aws/services/bedrockagentcore/bedrockagentcore_service_test.py
  • util/update_aws_services_regions.py

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Adds Bedrock AgentCore runtime collection and a new AWS check that validates VPC network mode, subnets, and security groups. It also adds regional service wiring, read-only IAM permissions, metadata, changelog content, and unit tests.

Changes

AgentCore VPC runtime check

Layer / File(s) Summary
AgentCore service integration
prowler/providers/aws/aws_regions_by_service.json, util/update_aws_services_regions.py, prowler/providers/aws/services/bedrockagentcore/bedrockagentcore_client.py, permissions/*
Registers the bedrock-agentcore-control service and client, preserves its regions during refreshes, and adds read-only runtime permissions to both IAM policy templates.
Runtime collection and enrichment
prowler/providers/aws/services/bedrockagentcore/bedrockagentcore_service.py, tests/providers/aws/services/bedrockagentcore/bedrockagentcore_service_test.py
Lists runtimes with pagination, retrieves runtime details and tags, builds typed models, filters resources, and records supported scan errors. Tests cover successful collection, denied access, and unsupported regions.
VPC configuration check
prowler/providers/aws/services/bedrockagentcore/bedrockagentcore_runtime_vpc_configured/*, tests/providers/aws/services/bedrockagentcore/bedrockagentcore_runtime_vpc_configured/*, prowler/changelog.d/bedrockagentcore-runtime-vpc-configured.added.md
Adds the check metadata and implementation. The check reports PASS for complete VPC settings, FAIL for incomplete or non-VPC settings, and MANUAL when required data is unavailable. Tests cover the result states and edge cases.

Priority: ⬆️ High

Estimated code review effort: 4 (Complex) | ~45 minutes

Severity of issue fixed: High

Sequence Diagram(s)

sequenceDiagram
  participant Prowler
  participant BedrockAgentCore
  participant AWSControlPlane
  Prowler->>BedrockAgentCore: Initialize service
  BedrockAgentCore->>AWSControlPlane: ListAgentRuntimes
  AWSControlPlane-->>BedrockAgentCore: Runtime summaries
  BedrockAgentCore->>AWSControlPlane: GetAgentRuntime and ListTagsForResource
  AWSControlPlane-->>BedrockAgentCore: Runtime details and tags
  Prowler->>BedrockAgentCore: Run VPC configuration check
  BedrockAgentCore-->>Prowler: PASS, FAIL, or MANUAL findings
Loading

Merge Risk: ⚪ Minimal · up to d7940

No actionable merge-blocking risk remains in the reviewed change.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 22.86% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 35 functions across 6 files. (5 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the new Bedrock AgentCore VPC configuration check, which is the primary change.
Description check ✅ Passed The description includes context, issue references, implementation details, review steps, test evidence, permissions, regions, checklist status, and license confirmation. It is sufficiently complete d…
Linked Issues check ✅ Passed Issue #12615 coding requirements are implemented. BedrockAgentCore lists runtimes, retrieves network configuration, and retains region and resource data. The check emits one runtime finding with PAS…
Out of Scope Changes check ✅ Passed The changes stay within Issue #12615. The client, regional service map, IAM permissions, CloudFormation permissions, collector tags, metadata, changelog, and tests support collecting and evaluating Ag…
Full details: Docstring Coverage

Explanation

Docstring coverage is 22.86% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 35 functions across 6 files. (5 skipped: 5 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Sep 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.33333% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.99%. Comparing base (282fe5b) to head (d794040).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12800      +/-   ##
==========================================
+ Coverage   90.75%   92.99%   +2.24%     
==========================================
  Files        2420     1203    -1217     
  Lines      118134    72441   -45693     
==========================================
- Hits       107210    67369   -39841     
+ Misses      10924     5072    -5852     
Flag Coverage Δ
prowler-py3.10-aws 90.58% <93.33%> (+<0.01%) ⬆️
prowler-py3.10-azure ?
prowler-py3.10-config ?
prowler-py3.10-e2enetworks ?
prowler-py3.10-external ?
prowler-py3.10-gcp ?
prowler-py3.10-github ?
prowler-py3.10-googleworkspace ?
prowler-py3.10-iac ?
prowler-py3.10-kubernetes ?
prowler-py3.10-lib ?
prowler-py3.10-linode ?
prowler-py3.10-m365 ?
prowler-py3.10-mongodbatlas ?
prowler-py3.10-nhn ?
prowler-py3.10-okta ?
prowler-py3.10-openstack ?
prowler-py3.10-oraclecloud ?
prowler-py3.10-scaleway ?
prowler-py3.10-stackit ?
prowler-py3.10-vercel ?
prowler-py3.11-aws 90.58% <93.33%> (+<0.01%) ⬆️
prowler-py3.11-azure ?
prowler-py3.11-config ?
prowler-py3.11-e2enetworks ?
prowler-py3.11-external ?
prowler-py3.11-gcp ?
prowler-py3.11-github ?
prowler-py3.11-googleworkspace ?
prowler-py3.11-iac ?
prowler-py3.11-kubernetes ?
prowler-py3.11-lib ?
prowler-py3.11-linode ?
prowler-py3.11-m365 ?
prowler-py3.11-mongodbatlas ?
prowler-py3.11-nhn ?
prowler-py3.11-okta ?
prowler-py3.11-openstack ?
prowler-py3.11-oraclecloud ?
prowler-py3.11-scaleway ?
prowler-py3.11-stackit ?
prowler-py3.11-vercel ?
prowler-py3.12-aws 90.56% <93.33%> (+<0.01%) ⬆️
prowler-py3.12-azure ?
prowler-py3.12-config ?
prowler-py3.12-e2enetworks ?
prowler-py3.12-external ?
prowler-py3.12-gcp ?
prowler-py3.12-github ?
prowler-py3.12-googleworkspace ?
prowler-py3.12-iac ?
prowler-py3.12-kubernetes ?
prowler-py3.12-lib ?
prowler-py3.12-linode ?
prowler-py3.12-m365 ?
prowler-py3.12-mongodbatlas ?
prowler-py3.12-nhn ?
prowler-py3.12-okta ?
prowler-py3.12-openstack ?
prowler-py3.12-oraclecloud ?
prowler-py3.12-scaleway ?
prowler-py3.12-stackit ?
prowler-py3.12-vercel ?
prowler-py3.13-aws 90.56% <93.33%> (+<0.01%) ⬆️
prowler-py3.13-azure ?
prowler-py3.13-config ?
prowler-py3.13-e2enetworks ?
prowler-py3.13-external ?
prowler-py3.13-gcp ?
prowler-py3.13-github ?
prowler-py3.13-googleworkspace ?
prowler-py3.13-iac ?
prowler-py3.13-kubernetes ?
prowler-py3.13-lib ?
prowler-py3.13-linode ?
prowler-py3.13-m365 ?
prowler-py3.13-mongodbatlas ?
prowler-py3.13-nhn ?
prowler-py3.13-okta ?
prowler-py3.13-openstack ?
prowler-py3.13-oraclecloud ?
prowler-py3.13-scaleway ?
prowler-py3.13-stackit ?
prowler-py3.13-vercel ?

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

Components Coverage Δ
prowler 90.58% <93.33%> (+2.03%) ⬆️
api 94.71% <ø> (ø)
mcp_server ∅ <ø> (∅)
🚀 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.

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

Labels

community Opened by the Community metadata-review provider/aws Issues/PRs related with the AWS provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[New Check]: AgentCore runtimes use VPC network mode

1 participant