Skip to content

Coding Agents#1445

Merged
evandrofranco merged 4 commits into
awslabs:mainfrom
evandrofranco:main
May 7, 2026
Merged

Coding Agents#1445
evandrofranco merged 4 commits into
awslabs:mainfrom
evandrofranco:main

Conversation

@evandrofranco
Copy link
Copy Markdown
Contributor

Amazon Bedrock AgentCore Samples Pull Request

Important

  1. We strictly follow a issue-first approach, please first open an issue relating to this Pull Request.
  2. Once this Pull Request is ready for review please attach review ready label to it. Only PRs with review ready will be reviewed.

Issue number:

Concise description of the PR

Changes to ..., because ...

User experience

Please share what the user experience looks like before and after this change

Checklist

If your change doesn't seem to apply, please leave them unchecked.

  • I have reviewed the contributing guidelines
  • Add your name to CONTRIBUTORS.md
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Are you uploading a dataset?
  • Have you documented Introduction, Architecture Diagram, Prerequisites, Usage, Sample Prompts, and Clean Up steps in your example README?
  • I agree to resolve any issues created for this example in the future.
  • I have performed a self-review of this change
  • Changes have been tested
  • Changes are documented

Acknowledgment

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

@github-actions github-actions Bot added 01-tutorials 01-tutorials 01-AgentCore-runtime 01-tutorials/01-AgentCore-runtime labels May 6, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

Latest scan for commit: b86c8fe | Updated: 2026-05-06 23:34:04 UTC

Security Scan Results

Scan Metadata

  • Project: ASH
  • Scan executed: 2026-05-06T23:33:45+00:00
  • ASH version: 3.0.0

Summary

Scanner Results

The table below shows findings by scanner, with status based on severity thresholds and dependencies:

Column Explanations:

Severity Levels (S/C/H/M/L/I):

  • Suppressed (S): Security findings that have been explicitly suppressed/ignored and don't affect the scanner's pass/fail status
  • Critical (C): The most severe security vulnerabilities requiring immediate remediation (e.g., SQL injection, remote code execution)
  • High (H): Serious security vulnerabilities that should be addressed promptly (e.g., authentication bypasses, privilege escalation)
  • Medium (M): Moderate security risks that should be addressed in normal development cycles (e.g., weak encryption, input validation issues)
  • Low (L): Minor security concerns with limited impact (e.g., information disclosure, weak recommendations)
  • Info (I): Informational findings for awareness with minimal security risk (e.g., code quality suggestions, best practice recommendations)

Other Columns:

  • Time: Duration taken by each scanner to complete its analysis
  • Action: Total number of actionable findings at or above the configured severity threshold that require attention

Scanner Results:

  • PASSED: Scanner found no security issues at or above the configured severity threshold - code is clean for this scanner
  • FAILED: Scanner found security vulnerabilities at or above the threshold that require attention and remediation
  • MISSING: Scanner could not run because required dependencies/tools are not installed or available
  • SKIPPED: Scanner was intentionally disabled or excluded from this scan
  • ERROR: Scanner encountered an execution error and could not complete successfully

Severity Thresholds (Thresh Column):

  • CRITICAL: Only Critical severity findings cause scanner to fail
  • HIGH: High and Critical severity findings cause scanner to fail
  • MEDIUM (MED): Medium, High, and Critical severity findings cause scanner to fail
  • LOW: Low, Medium, High, and Critical severity findings cause scanner to fail
  • ALL: Any finding of any severity level causes scanner to fail

Threshold Source: Values in parentheses indicate where the threshold is configured:

  • (g) = global: Set in the global_settings section of ASH configuration
  • (c) = config: Set in the individual scanner configuration section
  • (s) = scanner: Default threshold built into the scanner itself

Statistics calculation:

  • All statistics are calculated from the final aggregated SARIF report
  • Suppressed findings are counted separately and do not contribute to actionable findings
  • Scanner status is determined by comparing actionable findings to the threshold
Scanner S C H M L I Time Action Result Thresh
bandit 0 0 0 0 0 0 747ms 0 PASSED MED (g)
cdk-nag 0 10 0 0 0 6 31.0s 10 FAILED MED (g)
cfn-nag 0 0 0 13 0 0 1.7s 13 FAILED MED (g)
checkov 0 0 0 0 0 0 5.8s 0 PASSED MED (g)
detect-secre… 0 0 0 0 0 0 906ms 0 PASSED MED (g)
grype 0 0 0 0 0 0 41.6s 0 PASSED MED (g)
npm-audit 0 0 0 0 0 0 200ms 0 PASSED MED (g)
opengrep 0 0 0 0 0 0 <1ms 0 SKIPPED MED (g)
semgrep 0 0 0 0 0 0 <1ms 0 MISSING MED (g)
syft 0 0 0 0 0 0 2.8s 0 PASSED MED (g)

Detailed Findings

Show 23 actionable findings

Finding 1: CFN_NAG_W33

  • Severity: MEDIUM
  • Scanner: cfn-nag
  • Rule ID: CFN_NAG_W33
  • Location: 01-tutorials/01-AgentCore-runtime/12-coding-agents/01-claude-code-with-s3-files/cfn-vpc.yaml:90

Description:
EC2 Subnet should not have MapPublicIpOnLaunch set to true


Finding 2: CFN_NAG_W33

  • Severity: MEDIUM
  • Scanner: cfn-nag
  • Rule ID: CFN_NAG_W33
  • Location: 01-tutorials/01-AgentCore-runtime/12-coding-agents/01-claude-code-with-s3-files/cfn-vpc.yaml:101

Description:
EC2 Subnet should not have MapPublicIpOnLaunch set to true


Finding 3: CFN_NAG_W28

  • Severity: MEDIUM
  • Scanner: cfn-nag
  • Rule ID: CFN_NAG_W28
  • Location: 01-tutorials/01-AgentCore-runtime/12-coding-agents/01-claude-code-with-s3-files/cfn-vpc.yaml:232

Description:
Resource found with an explicit name, this disallows updates that require replacement of this resource


Finding 4: CFN_NAG_W40

  • Severity: MEDIUM
  • Scanner: cfn-nag
  • Rule ID: CFN_NAG_W40
  • Location: 01-tutorials/01-AgentCore-runtime/12-coding-agents/01-claude-code-with-s3-files/cfn-vpc.yaml:211

Description:
Security Groups egress with an IpProtocol of -1 found


Finding 5: CFN_NAG_W5

  • Severity: MEDIUM
  • Scanner: cfn-nag
  • Rule ID: CFN_NAG_W5
  • Location: 01-tutorials/01-AgentCore-runtime/12-coding-agents/01-claude-code-with-s3-files/cfn-vpc.yaml:211

Description:
Security Groups found with cidr open to world on egress


Finding 6: CFN_NAG_W9

  • Severity: MEDIUM
  • Scanner: cfn-nag
  • Rule ID: CFN_NAG_W9
  • Location: 01-tutorials/01-AgentCore-runtime/12-coding-agents/01-claude-code-with-s3-files/cfn-vpc.yaml:211

Description:
Security Groups found with ingress cidr that is not /32


Finding 7: CFN_NAG_W60

  • Severity: MEDIUM
  • Scanner: cfn-nag
  • Rule ID: CFN_NAG_W60
  • Location: 01-tutorials/01-AgentCore-runtime/12-coding-agents/01-claude-code-with-s3-files/cfn-vpc.yaml:65

Description:
VPC should have a flow log attached


Finding 8: CFN_NAG_W33

  • Severity: MEDIUM
  • Scanner: cfn-nag
  • Rule ID: CFN_NAG_W33
  • Location: 01-tutorials/01-AgentCore-runtime/12-coding-agents/02-claude-code-with-efs/cfn-vpc.yaml:84

Description:
EC2 Subnet should not have MapPublicIpOnLaunch set to true


Finding 9: CFN_NAG_W33

  • Severity: MEDIUM
  • Scanner: cfn-nag
  • Rule ID: CFN_NAG_W33
  • Location: 01-tutorials/01-AgentCore-runtime/12-coding-agents/02-claude-code-with-efs/cfn-vpc.yaml:95

Description:
EC2 Subnet should not have MapPublicIpOnLaunch set to true


Finding 10: CFN_NAG_W40

  • Severity: MEDIUM
  • Scanner: cfn-nag
  • Rule ID: CFN_NAG_W40
  • Location: 01-tutorials/01-AgentCore-runtime/12-coding-agents/02-claude-code-with-efs/cfn-vpc.yaml:205

Description:
Security Groups egress with an IpProtocol of -1 found


Finding 11: CFN_NAG_W5

  • Severity: MEDIUM
  • Scanner: cfn-nag
  • Rule ID: CFN_NAG_W5
  • Location: 01-tutorials/01-AgentCore-runtime/12-coding-agents/02-claude-code-with-efs/cfn-vpc.yaml:205

Description:
Security Groups found with cidr open to world on egress


Finding 12: CFN_NAG_W9

  • Severity: MEDIUM
  • Scanner: cfn-nag
  • Rule ID: CFN_NAG_W9
  • Location: 01-tutorials/01-AgentCore-runtime/12-coding-agents/02-claude-code-with-efs/cfn-vpc.yaml:205

Description:
Security Groups found with ingress cidr that is not /32


Finding 13: CFN_NAG_W60

  • Severity: MEDIUM
  • Scanner: cfn-nag
  • Rule ID: CFN_NAG_W60
  • Location: 01-tutorials/01-AgentCore-runtime/12-coding-agents/02-claude-code-with-efs/cfn-vpc.yaml:59

Description:
VPC should have a flow log attached


Finding 14: AwsSolutions-VPC7

  • Severity: HIGH
  • Scanner: cdk-nag
  • Rule ID: AwsSolutions-VPC7
  • Location: 01-tutorials/01-AgentCore-runtime/12-coding-agents/01-claude-code-with-s3-files/cfn-vpc.yaml:1

Description:
The VPC does not have an associated Flow Log.

Exception Reason: N/A

Code Snippet:

Resources:
  VPC:
    Properties:
      CidrBlock:
        Ref: VpcCidr
      EnableDnsHostnames: true
      EnableDnsSupport: true
      Tags:
        - Key: Name
          Value: agentcore-vpc
    Type: AWS::EC2::VPC

Finding 15: AwsSolutions-IAM5

  • Severity: HIGH
  • Scanner: cdk-nag
  • Rule ID: AwsSolutions-IAM5
  • Location: 01-tutorials/01-AgentCore-runtime/12-coding-agents/01-claude-code-with-s3-files/cfn-vpc.yaml:230

Description:
The IAM entity contains wildcard permissions and does not have a cdk-nag rule suppression with evidence for those permission.

Exception Reason: N/A

Code Snippet:

Resources:
  S3FilesRole:
    Properties:
      AssumeRolePolicyDocument:
        Statement:
          - Action: sts:AssumeRole
            Effect: Allow
            Principal:
              Service: elasticfilesystem.amazonaws.com
        Version: '2012-10-17'
      Policies:
        - PolicyDocument:
            Statement:
              - Action:
                  - s3:GetObject
                  - s3:PutObject
                  - s3:DeleteObject
                  - s3:ListBucket
                  - s3:GetBucketLocation
                  - s3:AbortMultipartUpload
                  - s3:DeleteObject*
                  - s3:GetObject*
                  - s3:List*
                  - s3:PutObject*
                  - s3:ListBucketVersions
                Effect: Allow
                Resource:
                  - Fn::Sub: arn:aws:s3:::${BucketName}
                  - Fn::Sub: arn:aws:s3:::${BucketName}/*
              - Action:
                  - s3:AbortMultipartUpload
                  - s3:DeleteObject*
                  - s3:GetObject*
                  - s3:List*
                  - s3:PutObject*
                Effect: Allow
                Resource:
                  Fn::Sub: arn:aws:s3:::${BucketName}/*
                Sid: S3ObjectPermissions
              - Action:
                  - kms:GenerateDataKey
                  - kms:Encrypt
                  - kms:Decrypt
                  - kms:ReEncryptFrom
                  - kms:ReEncryptTo
                Condition:
                  StringLike:
                    kms:EncryptionContext:aws:s3:arn:
                      - Fn::Sub: arn:aws:s3:::${BucketName}
                      - Fn::Sub: arn:aws:s3:::${BucketName}/*
                    kms:ViaService:
                      Fn::Sub: s3.${AWS::Region}.amazonaws.com
                Effect: Allow
                Resource:
                  Fn::Sub: arn:aws:kms:${AWS::Region}:${AWS::AccountId}:*
                Sid: UseKmsKeyWithS3Files
              - Action:
                  - events:DeleteRule
                  - events:DisableRule
                  - events:EnableRule
                  - events:PutRule
                  - events:PutTargets
                  - events:RemoveTargets
                Condition:
                  StringEquals:
                    events:ManagedBy: elasticfilesystem.amazonaws.com
                Effect: Allow
                Resource:
                  - arn:aws:events:*:*:rule/DO-NOT-DELETE-S3-Files*
                Sid: EventBridgeManage
              - Action:
                  - events:DescribeRule
                  - events:ListRuleNamesByTarget
                  - events:ListRules
                  - events:ListTargetsByRule
                Effect: Allow
                Resource:
                  - arn:aws:events:*:*:rule/*
                Sid: EventBridgeRead
            Version: '2012-10-17'
          PolicyName: s3files-bucket-access
      RoleName:
        Fn::Sub: s3files-${BucketName}-role
    Type: AWS::IAM::Role

Finding 16: AwsSolutions-IAM5

  • Severity: HIGH
  • Scanner: cdk-nag
  • Rule ID: AwsSolutions-IAM5
  • Location: 01-tutorials/01-AgentCore-runtime/12-coding-agents/01-claude-code-with-s3-files/cfn-vpc.yaml:230

Description:
The IAM entity contains wildcard permissions and does not have a cdk-nag rule suppression with evidence for those permission.

Exception Reason: N/A

Code Snippet:

Resources:
  S3FilesRole:
    Properties:
      AssumeRolePolicyDocument:
        Statement:
          - Action: sts:AssumeRole
            Effect: Allow
            Principal:
              Service: elasticfilesystem.amazonaws.com
        Version: '2012-10-17'
      Policies:
        - PolicyDocument:
            Statement:
              - Action:
                  - s3:GetObject
                  - s3:PutObject
                  - s3:DeleteObject
                  - s3:ListBucket
                  - s3:GetBucketLocation
                  - s3:AbortMultipartUpload
                  - s3:DeleteObject*
                  - s3:GetObject*
                  - s3:List*
                  - s3:PutObject*
                  - s3:ListBucketVersions
                Effect: Allow
                Resource:
                  - Fn::Sub: arn:aws:s3:::${BucketName}
                  - Fn::Sub: arn:aws:s3:::${BucketName}/*
              - Action:
                  - s3:AbortMultipartUpload
                  - s3:DeleteObject*
                  - s3:GetObject*
                  - s3:List*
                  - s3:PutObject*
                Effect: Allow
                Resource:
                  Fn::Sub: arn:aws:s3:::${BucketName}/*
                Sid: S3ObjectPermissions
              - Action:
                  - kms:GenerateDataKey
                  - kms:Encrypt
                  - kms:Decrypt
                  - kms:ReEncryptFrom
                  - kms:ReEncryptTo
                Condition:
                  StringLike:
                    kms:EncryptionContext:aws:s3:arn:
                      - Fn::Sub: arn:aws:s3:::${BucketName}
                      - Fn::Sub: arn:aws:s3:::${BucketName}/*
                    kms:ViaService:
                      Fn::Sub: s3.${AWS::Region}.amazonaws.com
                Effect: Allow
                Resource:
                  Fn::Sub: arn:aws:kms:${AWS::Region}:${AWS::AccountId}:*
                Sid: UseKmsKeyWithS3Files
              - Action:
                  - events:DeleteRule
                  - events:DisableRule
                  - events:EnableRule
                  - events:PutRule
                  - events:PutTargets
                  - events:RemoveTargets
                Condition:
                  StringEquals:
                    events:ManagedBy: elasticfilesystem.amazonaws.com
                Effect: Allow
                Resource:
                  - arn:aws:events:*:*:rule/DO-NOT-DELETE-S3-Files*
                Sid: EventBridgeManage
              - Action:
                  - events:DescribeRule
                  - events:ListRuleNamesByTarget
                  - events:ListRules
                  - events:ListTargetsByRule
                Effect: Allow
                Resource:
                  - arn:aws:events:*:*:rule/*
                Sid: EventBridgeRead
            Version: '2012-10-17'
          PolicyName: s3files-bucket-access
      RoleName:
        Fn::Sub: s3files-${BucketName}-role
    Type: AWS::IAM::Role

Finding 17: AwsSolutions-IAM5

  • Severity: HIGH
  • Scanner: cdk-nag
  • Rule ID: AwsSolutions-IAM5
  • Location: 01-tutorials/01-AgentCore-runtime/12-coding-agents/01-claude-code-with-s3-files/cfn-vpc.yaml:230

Description:
The IAM entity contains wildcard permissions and does not have a cdk-nag rule suppression with evidence for those permission.

Exception Reason: N/A

Code Snippet:

Resources:
  S3FilesRole:
    Properties:
      AssumeRolePolicyDocument:
        Statement:
          - Action: sts:AssumeRole
            Effect: Allow
            Principal:
              Service: elasticfilesystem.amazonaws.com
        Version: '2012-10-17'
      Policies:
        - PolicyDocument:
            Statement:
              - Action:
                  - s3:GetObject
                  - s3:PutObject
                  - s3:DeleteObject
                  - s3:ListBucket
                  - s3:GetBucketLocation
                  - s3:AbortMultipartUpload
                  - s3:DeleteObject*
                  - s3:GetObject*
                  - s3:List*
                  - s3:PutObject*
                  - s3:ListBucketVersions
                Effect: Allow
                Resource:
                  - Fn::Sub: arn:aws:s3:::${BucketName}
                  - Fn::Sub: arn:aws:s3:::${BucketName}/*
              - Action:
                  - s3:AbortMultipartUpload
                  - s3:DeleteObject*
                  - s3:GetObject*
                  - s3:List*
                  - s3:PutObject*
                Effect: Allow
                Resource:
                  Fn::Sub: arn:aws:s3:::${BucketName}/*
                Sid: S3ObjectPermissions
              - Action:
                  - kms:GenerateDataKey
                  - kms:Encrypt
                  - kms:Decrypt
                  - kms:ReEncryptFrom
                  - kms:ReEncryptTo
                Condition:
                  StringLike:
                    kms:EncryptionContext:aws:s3:arn:
                      - Fn::Sub: arn:aws:s3:::${BucketName}
                      - Fn::Sub: arn:aws:s3:::${BucketName}/*
                    kms:ViaService:
                      Fn::Sub: s3.${AWS::Region}.amazonaws.com
                Effect: Allow
                Resource:
                  Fn::Sub: arn:aws:kms:${AWS::Region}:${AWS::AccountId}:*
                Sid: UseKmsKeyWithS3Files
              - Action:
                  - events:DeleteRule
                  - events:DisableRule
                  - events:EnableRule
                  - events:PutRule
                  - events:PutTargets
                  - events:RemoveTargets
                Condition:
                  StringEquals:
                    events:ManagedBy: elasticfilesystem.amazonaws.com
                Effect: Allow
                Resource:
                  - arn:aws:events:*:*:rule/DO-NOT-DELETE-S3-Files*
                Sid: EventBridgeManage
              - Action:
                  - events:DescribeRule
                  - events:ListRuleNamesByTarget
                  - events:ListRules
                  - events:ListTargetsByRule
                Effect: Allow
                Resource:
                  - arn:aws:events:*:*:rule/*
                Sid: EventBridgeRead
            Version: '2012-10-17'
          PolicyName: s3files-bucket-access
      RoleName:
        Fn::Sub: s3files-${BucketName}-role
    Type: AWS::IAM::Role

Finding 18: AwsSolutions-IAM5

  • Severity: HIGH
  • Scanner: cdk-nag
  • Rule ID: AwsSolutions-IAM5
  • Location: 01-tutorials/01-AgentCore-runtime/12-coding-agents/01-claude-code-with-s3-files/cfn-vpc.yaml:230

Description:
The IAM entity contains wildcard permissions and does not have a cdk-nag rule suppression with evidence for those permission.

Exception Reason: N/A

Code Snippet:

Resources:
  S3FilesRole:
    Properties:
      AssumeRolePolicyDocument:
        Statement:
          - Action: sts:AssumeRole
            Effect: Allow
            Principal:
              Service: elasticfilesystem.amazonaws.com
        Version: '2012-10-17'
      Policies:
        - PolicyDocument:
            Statement:
              - Action:
                  - s3:GetObject
                  - s3:PutObject
                  - s3:DeleteObject
                  - s3:ListBucket
                  - s3:GetBucketLocation
                  - s3:AbortMultipartUpload
                  - s3:DeleteObject*
                  - s3:GetObject*
                  - s3:List*
                  - s3:PutObject*
                  - s3:ListBucketVersions
                Effect: Allow
                Resource:
                  - Fn::Sub: arn:aws:s3:::${BucketName}
                  - Fn::Sub: arn:aws:s3:::${BucketName}/*
              - Action:
                  - s3:AbortMultipartUpload
                  - s3:DeleteObject*
                  - s3:GetObject*
                  - s3:List*
                  - s3:PutObject*
                Effect: Allow
                Resource:
                  Fn::Sub: arn:aws:s3:::${BucketName}/*
                Sid: S3ObjectPermissions
              - Action:
                  - kms:GenerateDataKey
                  - kms:Encrypt
                  - kms:Decrypt
                  - kms:ReEncryptFrom
                  - kms:ReEncryptTo
                Condition:
                  StringLike:
                    kms:EncryptionContext:aws:s3:arn:
                      - Fn::Sub: arn:aws:s3:::${BucketName}
                      - Fn::Sub: arn:aws:s3:::${BucketName}/*
                    kms:ViaService:
                      Fn::Sub: s3.${AWS::Region}.amazonaws.com
                Effect: Allow
                Resource:
                  Fn::Sub: arn:aws:kms:${AWS::Region}:${AWS::AccountId}:*
                Sid: UseKmsKeyWithS3Files
              - Action:
                  - events:DeleteRule
                  - events:DisableRule
                  - events:EnableRule
                  - events:PutRule
                  - events:PutTargets
                  - events:RemoveTargets
                Condition:
                  StringEquals:
                    events:ManagedBy: elasticfilesystem.amazonaws.com
                Effect: Allow
                Resource:
                  - arn:aws:events:*:*:rule/DO-NOT-DELETE-S3-Files*
                Sid: EventBridgeManage
              - Action:
                  - events:DescribeRule
                  - events:ListRuleNamesByTarget
                  - events:ListRules
                  - events:ListTargetsByRule
                Effect: Allow
                Resource:
                  - arn:aws:events:*:*:rule/*
                Sid: EventBridgeRead
            Version: '2012-10-17'
          PolicyName: s3files-bucket-access
      RoleName:
        Fn::Sub: s3files-${BucketName}-role
    Type: AWS::IAM::Role

Finding 19: AwsSolutions-IAM5

  • Severity: HIGH
  • Scanner: cdk-nag
  • Rule ID: AwsSolutions-IAM5
  • Location: 01-tutorials/01-AgentCore-runtime/12-coding-agents/01-claude-code-with-s3-files/cfn-vpc.yaml:230

Description:
The IAM entity contains wildcard permissions and does not have a cdk-nag rule suppression with evidence for those permission.

Exception Reason: N/A

Code Snippet:

Resources:
  S3FilesRole:
    Properties:
      AssumeRolePolicyDocument:
        Statement:
          - Action: sts:AssumeRole
            Effect: Allow
            Principal:
              Service: elasticfilesystem.amazonaws.com
        Version: '2012-10-17'
      Policies:
        - PolicyDocument:
            Statement:
              - Action:
                  - s3:GetObject
                  - s3:PutObject
                  - s3:DeleteObject
                  - s3:ListBucket
                  - s3:GetBucketLocation
                  - s3:AbortMultipartUpload
                  - s3:DeleteObject*
                  - s3:GetObject*
                  - s3:List*
                  - s3:PutObject*
                  - s3:ListBucketVersions
                Effect: Allow
                Resource:
                  - Fn::Sub: arn:aws:s3:::${BucketName}
                  - Fn::Sub: arn:aws:s3:::${BucketName}/*
              - Action:
                  - s3:AbortMultipartUpload
                  - s3:DeleteObject*
                  - s3:GetObject*
                  - s3:List*
                  - s3:PutObject*
                Effect: Allow
                Resource:
                  Fn::Sub: arn:aws:s3:::${BucketName}/*
                Sid: S3ObjectPermissions
              - Action:
                  - kms:GenerateDataKey
                  - kms:Encrypt
                  - kms:Decrypt
                  - kms:ReEncryptFrom
                  - kms:ReEncryptTo
                Condition:
                  StringLike:
                    kms:EncryptionContext:aws:s3:arn:
                      - Fn::Sub: arn:aws:s3:::${BucketName}
                      - Fn::Sub: arn:aws:s3:::${BucketName}/*
                    kms:ViaService:
                      Fn::Sub: s3.${AWS::Region}.amazonaws.com
                Effect: Allow
                Resource:
                  Fn::Sub: arn:aws:kms:${AWS::Region}:${AWS::AccountId}:*
                Sid: UseKmsKeyWithS3Files
              - Action:
                  - events:DeleteRule
                  - events:DisableRule
                  - events:EnableRule
                  - events:PutRule
                  - events:PutTargets
                  - events:RemoveTargets
                Condition:
                  StringEquals:
                    events:ManagedBy: elasticfilesystem.amazonaws.com
                Effect: Allow
                Resource:
                  - arn:aws:events:*:*:rule/DO-NOT-DELETE-S3-Files*
                Sid: EventBridgeManage
              - Action:
                  - events:DescribeRule
                  - events:ListRuleNamesByTarget
                  - events:ListRules
                  - events:ListTargetsByRule
                Effect: Allow
                Resource:
                  - arn:aws:events:*:*:rule/*
                Sid: EventBridgeRead
            Version: '2012-10-17'
          PolicyName: s3files-bucket-access
      RoleName:
        Fn::Sub: s3files-${BucketName}-role
    Type: AWS::IAM::Role

Finding 20: AwsSolutions-IAM5

  • Severity: HIGH
  • Scanner: cdk-nag
  • Rule ID: AwsSolutions-IAM5
  • Location: 01-tutorials/01-AgentCore-runtime/12-coding-agents/01-claude-code-with-s3-files/cfn-vpc.yaml:230

Description:
The IAM entity contains wildcard permissions and does not have a cdk-nag rule suppression with evidence for those permission.

Exception Reason: N/A

Code Snippet:

Resources:
  S3FilesRole:
    Properties:
      AssumeRolePolicyDocument:
        Statement:
          - Action: sts:AssumeRole
            Effect: Allow
            Principal:
              Service: elasticfilesystem.amazonaws.com
        Version: '2012-10-17'
      Policies:
        - PolicyDocument:
            Statement:
              - Action:
                  - s3:GetObject
                  - s3:PutObject
                  - s3:DeleteObject
                  - s3:ListBucket
                  - s3:GetBucketLocation
                  - s3:AbortMultipartUpload
                  - s3:DeleteObject*
                  - s3:GetObject*
                  - s3:List*
                  - s3:PutObject*
                  - s3:ListBucketVersions
                Effect: Allow
                Resource:
                  - Fn::Sub: arn:aws:s3:::${BucketName}
                  - Fn::Sub: arn:aws:s3:::${BucketName}/*
              - Action:
                  - s3:AbortMultipartUpload
                  - s3:DeleteObject*
                  - s3:GetObject*
                  - s3:List*
                  - s3:PutObject*
                Effect: Allow
                Resource:
                  Fn::Sub: arn:aws:s3:::${BucketName}/*
                Sid: S3ObjectPermissions
              - Action:
                  - kms:GenerateDataKey
                  - kms:Encrypt
                  - kms:Decrypt
                  - kms:ReEncryptFrom
                  - kms:ReEncryptTo
                Condition:
                  StringLike:
                    kms:EncryptionContext:aws:s3:arn:
                      - Fn::Sub: arn:aws:s3:::${BucketName}
                      - Fn::Sub: arn:aws:s3:::${BucketName}/*
                    kms:ViaService:
                      Fn::Sub: s3.${AWS::Region}.amazonaws.com
                Effect: Allow
                Resource:
                  Fn::Sub: arn:aws:kms:${AWS::Region}:${AWS::AccountId}:*
                Sid: UseKmsKeyWithS3Files
              - Action:
                  - events:DeleteRule
                  - events:DisableRule
                  - events:EnableRule
                  - events:PutRule
                  - events:PutTargets
                  - events:RemoveTargets
                Condition:
                  StringEquals:
                    events:ManagedBy: elasticfilesystem.amazonaws.com
                Effect: Allow
                Resource:
                  - arn:aws:events:*:*:rule/DO-NOT-DELETE-S3-Files*
                Sid: EventBridgeManage
              - Action:
                  - events:DescribeRule
                  - events:ListRuleNamesByTarget
                  - events:ListRules
                  - events:ListTargetsByRule
                Effect: Allow
                Resource:
                  - arn:aws:events:*:*:rule/*
                Sid: EventBridgeRead
            Version: '2012-10-17'
          PolicyName: s3files-bucket-access
      RoleName:
        Fn::Sub: s3files-${BucketName}-role
    Type: AWS::IAM::Role

Finding 21: AwsSolutions-IAM5

  • Severity: HIGH
  • Scanner: cdk-nag
  • Rule ID: AwsSolutions-IAM5
  • Location: 01-tutorials/01-AgentCore-runtime/12-coding-agents/01-claude-code-with-s3-files/cfn-vpc.yaml:230

Description:
The IAM entity contains wildcard permissions and does not have a cdk-nag rule suppression with evidence for those permission.

Exception Reason: N/A

Code Snippet:

Resources:
  S3FilesRole:
    Properties:
      AssumeRolePolicyDocument:
        Statement:
          - Action: sts:AssumeRole
            Effect: Allow
            Principal:
              Service: elasticfilesystem.amazonaws.com
        Version: '2012-10-17'
      Policies:
        - PolicyDocument:
            Statement:
              - Action:
                  - s3:GetObject
                  - s3:PutObject
                  - s3:DeleteObject
                  - s3:ListBucket
                  - s3:GetBucketLocation
                  - s3:AbortMultipartUpload
                  - s3:DeleteObject*
                  - s3:GetObject*
                  - s3:List*
                  - s3:PutObject*
                  - s3:ListBucketVersions
                Effect: Allow
                Resource:
                  - Fn::Sub: arn:aws:s3:::${BucketName}
                  - Fn::Sub: arn:aws:s3:::${BucketName}/*
              - Action:
                  - s3:AbortMultipartUpload
                  - s3:DeleteObject*
                  - s3:GetObject*
                  - s3:List*
                  - s3:PutObject*
                Effect: Allow
                Resource:
                  Fn::Sub: arn:aws:s3:::${BucketName}/*
                Sid: S3ObjectPermissions
              - Action:
                  - kms:GenerateDataKey
                  - kms:Encrypt
                  - kms:Decrypt
                  - kms:ReEncryptFrom
                  - kms:ReEncryptTo
                Condition:
                  StringLike:
                    kms:EncryptionContext:aws:s3:arn:
                      - Fn::Sub: arn:aws:s3:::${BucketName}
                      - Fn::Sub: arn:aws:s3:::${BucketName}/*
                    kms:ViaService:
                      Fn::Sub: s3.${AWS::Region}.amazonaws.com
                Effect: Allow
                Resource:
                  Fn::Sub: arn:aws:kms:${AWS::Region}:${AWS::AccountId}:*
                Sid: UseKmsKeyWithS3Files
              - Action:
                  - events:DeleteRule
                  - events:DisableRule
                  - events:EnableRule
                  - events:PutRule
                  - events:PutTargets
                  - events:RemoveTargets
                Condition:
                  StringEquals:
                    events:ManagedBy: elasticfilesystem.amazonaws.com
                Effect: Allow
                Resource:
                  - arn:aws:events:*:*:rule/DO-NOT-DELETE-S3-Files*
                Sid: EventBridgeManage
              - Action:
                  - events:DescribeRule
                  - events:ListRuleNamesByTarget
                  - events:ListRules
                  - events:ListTargetsByRule
                Effect: Allow
                Resource:
                  - arn:aws:events:*:*:rule/*
                Sid: EventBridgeRead
            Version: '2012-10-17'
          PolicyName: s3files-bucket-access
      RoleName:
        Fn::Sub: s3files-${BucketName}-role
    Type: AWS::IAM::Role

Finding 22: AwsSolutions-IAM5

  • Severity: HIGH
  • Scanner: cdk-nag
  • Rule ID: AwsSolutions-IAM5
  • Location: 01-tutorials/01-AgentCore-runtime/12-coding-agents/01-claude-code-with-s3-files/cfn-vpc.yaml:230

Description:
The IAM entity contains wildcard permissions and does not have a cdk-nag rule suppression with evidence for those permission.

Exception Reason: N/A

Code Snippet:

Resources:
  S3FilesRole:
    Properties:
      AssumeRolePolicyDocument:
        Statement:
          - Action: sts:AssumeRole
            Effect: Allow
            Principal:
              Service: elasticfilesystem.amazonaws.com
        Version: '2012-10-17'
      Policies:
        - PolicyDocument:
            Statement:
              - Action:
                  - s3:GetObject
                  - s3:PutObject
                  - s3:DeleteObject
                  - s3:ListBucket
                  - s3:GetBucketLocation
                  - s3:AbortMultipartUpload
                  - s3:DeleteObject*
                  - s3:GetObject*
                  - s3:List*
                  - s3:PutObject*
                  - s3:ListBucketVersions
                Effect: Allow
                Resource:
                  - Fn::Sub: arn:aws:s3:::${BucketName}
                  - Fn::Sub: arn:aws:s3:::${BucketName}/*
              - Action:
                  - s3:AbortMultipartUpload
                  - s3:DeleteObject*
                  - s3:GetObject*
                  - s3:List*
                  - s3:PutObject*
                Effect: Allow
                Resource:
                  Fn::Sub: arn:aws:s3:::${BucketName}/*
                Sid: S3ObjectPermissions
              - Action:
                  - kms:GenerateDataKey
                  - kms:Encrypt
                  - kms:Decrypt
                  - kms:ReEncryptFrom
                  - kms:ReEncryptTo
                Condition:
                  StringLike:
                    kms:EncryptionContext:aws:s3:arn:
                      - Fn::Sub: arn:aws:s3:::${BucketName}
                      - Fn::Sub: arn:aws:s3:::${BucketName}/*
                    kms:ViaService:
                      Fn::Sub: s3.${AWS::Region}.amazonaws.com
                Effect: Allow
                Resource:
                  Fn::Sub: arn:aws:kms:${AWS::Region}:${AWS::AccountId}:*
                Sid: UseKmsKeyWithS3Files
              - Action:
                  - events:DeleteRule
                  - events:DisableRule
                  - events:EnableRule
                  - events:PutRule
                  - events:PutTargets
                  - events:RemoveTargets
                Condition:
                  StringEquals:
                    events:ManagedBy: elasticfilesystem.amazonaws.com
                Effect: Allow
                Resource:
                  - arn:aws:events:*:*:rule/DO-NOT-DELETE-S3-Files*
                Sid: EventBridgeManage
              - Action:
                  - events:DescribeRule
                  - events:ListRuleNamesByTarget
                  - events:ListRules
                  - events:ListTargetsByRule
                Effect: Allow
                Resource:
                  - arn:aws:events:*:*:rule/*
                Sid: EventBridgeRead
            Version: '2012-10-17'
          PolicyName: s3files-bucket-access
      RoleName:
        Fn::Sub: s3files-${BucketName}-role


<!-- ASH-SECURITY-SCAN-COMMENT -->

@evandrofranco evandrofranco merged commit 3100733 into awslabs:main May 7, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

01-AgentCore-runtime 01-tutorials/01-AgentCore-runtime 01-tutorials 01-tutorials

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants