Skip to content

Add multi-region assessment support and Financial Services GenAI risk reporting#41

Merged
vivekmittal514 merged 32 commits into
aws-samples:mainfrom
agasthik:multiregion-support
Jun 24, 2026
Merged

Add multi-region assessment support and Financial Services GenAI risk reporting#41
vivekmittal514 merged 32 commits into
aws-samples:mainfrom
agasthik:multiregion-support

Conversation

@agasthik

@agasthik agasthik commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Description

  • This PR adds multi-region scanning support for the AI/ML Security Assessment framework and expands the optional Financial Services GenAI risk assessment/reporting experience.
  • The changes update the Step Functions workflow, deployment templates, CodeBuild orchestration, report generation, and documentation so assessments can run across resolved target regions while avoiding duplicate global findings and false failures in regions with no applicable resources.

Key Changes

  • Added TargetRegions support with region resolution and per-region Step Functions fan-out.
  • Added regional filtering, region columns, and “Risk by Region” views to single-account and multi-account HTML reports.
  • Deduplicated global findings and gated regional Bedrock, SageMaker, AgentCore, and FinServ findings based on resource footprint.
  • Added optional Financial Services GenAI Risk reporting under a dedicated “By Industry” section.
  • Updated FinServ report references to the AWS Responsible AI governance, risk, and compliance guidance.
  • Improved CloudFormation parameter descriptions, validation rules, and CodeBuild timeout handling.
  • Consolidated FinServ documentation into a single SECURITY_CHECKS_FINSERV.md reference.
  • Updated sample reports and screenshots, with sample account IDs anonymized.
  • Removed stale docs, stale sample CSV/report artifacts

Deployment Notes

  • Existing deployments should update the CloudFormation stack to pick up the new/updated parameters, IAM permissions, CodeBuild environment variables, and Step Functions changes.
  • EnableFinServAssessment remains opt-in.
  • TargetRegions controls the regions scanned; empty/default behavior remains deployment-region scoped unless configured otherwise.

Review Focus

  • CloudFormation parameter validation and backward compatibility.
  • Step Functions region fan-out and global finding deduplication.
  • Report UI behavior for region, service, and industry sections.
  • FinServ behavior in regions with no applicable resources.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

agasthik added 21 commits June 6, 2026 09:38
Enable security assessments to scan multiple AWS regions in parallel
using a Step Functions Map state. Each region gets its own Lambda
invocation for Bedrock, SageMaker, and AgentCore assessments,
providing linear performance scaling regardless of region count.

Configuration:
- Add TargetRegions CloudFormation parameter to all deployment templates
  (empty = single region, comma-separated list, or 'all')
- Add ResolveRegions Lambda to resolve target regions for Map state
- Use ItemSelector on Map state to inject region into each iteration

Assessment changes:
- Add Region field to all finding schemas and CSV reports
- Refactor all assessment Lambdas to accept region from event payload
  and create boto3 clients with explicit region_name
- Add graceful service-unavailability handling (N/A finding when
  a service is not available in a region)
- Include region in S3 report filenames for per-region CSV outputs

Report changes:
- Add Region column, filter dropdown, and Risk by Region section
  to HTML report template
- Update consolidate_html_reports.py to pass region data through

Infrastructure:
- Restructure Step Functions state machine with Map state
- Fail CodeBuild when Step Function execution fails (previously
  only logged a warning)

Documentation:
- Streamline README (603 → 208 lines) by moving cleanup and
  troubleshooting content to dedicated docs
- Add docs/CLEANUP.md with step-by-step removal instructions
- Add upgrade guide and stack identification to Troubleshooting
- Update Developer Guide with region-aware patterns
- Correct check count from 52 to 51 (13 Bedrock + 25 SageMaker + 13 AgentCore)
…egion scans

Refine multi-region scanning so global/IAM-only checks (e.g. AC-02/AC-03,
BR-01/BR-03) run once on the primary region and are tagged with a "Global"
region label, avoiding duplicate findings across scanned regions. Regional
assessments now probe availability and skip opt-in/disabled regions and
APIs unsupported in a region, tagging remaining findings with their region.

Add test coverage for the consolidated report, report filenames, SageMaker
template permissions, and the per-service multi-region check behavior.
Update .gitignore to exclude .codex/ and .pytest_cache/.
The post-build poll loop used a hardcoded 600s (10 min) wait for the
Step Function, which is too short for all-region scans and caused false
build failures when the assessment outlived the poll window. Derive the
poll timeout from the CodeBuild timeout (passed through as the
CODEBUILD_TIMEOUT_MINUTES env var) minus a buffer for build/deploy and
report processing, with a floor guard and an SF_POLL_TIMEOUT override.
Clear all 25 ruff findings (F401 unused imports, F811 duplicate import,
F541 extraneous f-string prefix) across the Python sources.
Global/IAM findings (Region == "Global") appear in the report tables but
were absent from the Region filter dropdowns because "Global" is
intentionally excluded from the region count/tiles. Surface a "Global"
filter option when such findings exist, and show the dropdown whenever
there is more than one distinct filterable value (regions + Global),
without inflating the region count.
Probe regional Bedrock list APIs (guardrails, prompts, agents, knowledge
bases, flows, custom models) and AgentCore runtimes before emitting
findings. When no resources exist in a region, report BR-02, BR-05, and
AC-08 as N/A/Informational instead of WARN/Failed, avoiding false
positives in regions with no AI/ML footprint.
The CodeBuild env var TARGET_REGIONS allowed spaces after commas (e.g.
"us-east-1, us-east-2"). 'sam deploy --parameter-overrides' re-splits its
argument on spaces, so only the first chunk ("us-east-1,") reached the
stack and every other region was silently dropped — the cause of build
aws-samples#14 scanning a single region.

- buildspec.yml: strip all whitespace from TARGET_REGIONS before deploy
  and validate the result, failing fast on invalid characters.
- Add AllowedPattern/ConstraintDescription to the TargetRegions parameter
  in all four templates as defense-in-depth at the CloudFormation layer.
Gate model invocation logging (BR-04) and Bedrock CloudTrail coverage
(BR-06) on the regional Bedrock footprint, reporting N/A when no
resources exist instead of Failed. Return False from
detect_bedrock_regional_footprint when any probe succeeds with no
resources, so a single accessible empty API is enough to conclude the
region is empty. For BR-09, treat Knowledge Base API errors (including
AccessDenied) as N/A rather than a High/Failed finding.
CodeBuild reserves the CODEBUILD_ prefix for its own built-in environment
variables and rejects user-defined variables that use it, causing
UpdateProject to fail with InvalidInputException and the stack to enter
UPDATE_FAILED. Rename the variable to BUILD_TIMEOUT_MINUTES in both
CodeBuild project templates and update the consuming buildspec logic.
# Conflicts:
#	README.md
#	aiml-security-assessment/functions/security/generate_consolidated_report/app.py
#	aiml-security-assessment/functions/security/generate_consolidated_report/report_template.py
#	aiml-security-assessment/statemachine/assessments.asl.json
#	deployment/2-aiml-security-codebuild.yaml
#	deployment/aiml-security-single-account.yaml
#	docs/SECURITY_CHECKS.md
agasthik added 4 commits June 22, 2026 19:23
# Conflicts:
#	aiml-security-assessment/functions/security/agentcore_assessments/schema.py
#	aiml-security-assessment/functions/security/bedrock_assessments/app.py
#	aiml-security-assessment/functions/security/bedrock_assessments/schema.py
#	aiml-security-assessment/functions/security/generate_consolidated_report/schema.py
#	aiml-security-assessment/functions/security/sagemaker_assessments/schema.py
#	aiml-security-assessment/template-multi-account.yaml
#	aiml-security-assessment/template.yaml
#	tests/conftest.py
#	tests/test_bedrock_checks.py
@vivekmittal514

Copy link
Copy Markdown
Contributor

/kiro review

@vivekmittal514 vivekmittal514 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks Agasthi. Reviewed the PR and did regression test for single and multi account. Looks good.

@vivekmittal514 vivekmittal514 merged commit 33ed190 into aws-samples:main Jun 24, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Add multi-region scanning support

2 participants