Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS::IAM::ManagedPolicy Condition syntax error not detected #3751

Closed
gbudge opened this issue Oct 16, 2024 · 0 comments · Fixed by #3767
Closed

AWS::IAM::ManagedPolicy Condition syntax error not detected #3751

gbudge opened this issue Oct 16, 2024 · 0 comments · Fixed by #3767
Labels
enhancement New feature or request

Comments

@gbudge
Copy link

gbudge commented Oct 16, 2024

CloudFormation Lint Version

cfn-lint 1.16.1

What operating system are you using?

Linux

Describe the bug

cfn-lint is not detecting missing Condition operator.

$ cfn-lint --format json --include-checks I -t ./demo-template.yaml
[]

$ 

CloudFormation throws the following syntax error:

Resource handler returned message: "Syntax errors in policy. (Service: Iam, Status Code: 400, Request ID: <redacted>)" (RequestToken: <redacted>, HandlerErrorCode: InvalidRequest)

Expected behavior

The missing operator should be detected.

Reproduction template

---
AWSTemplateFormatVersion: '2010-09-09'
Description: Example IAM policy syntax error not detected.

Resources:
  IAMPolicy:
    Type: AWS::IAM::ManagedPolicy
    Properties:
      Roles:
        - DemoRole
      PolicyDocument:
        Version: '2012-10-17'
        Statement:
          - Effect: Allow
            Action:
              - servicecatalog:*
            Resource: '*'
            Condition:
                servicecatalog:accountLevel: self
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants