Skip to content

[Enhancement] Support for CloudFormation Pseudo Parameters  #480

Open
@varun656

Description

@varun656

Is your feature request related to a problem? Please describe.
Validating Policies like :

      - Effect: Deny
        Principal: 
          AWS: "*"
        Action:
          - "s3:*"
        Resource:
          - Fn::Sub: "arn:${AWS::Partition}:s3:::local-${AWS::AccountId}-logs-${AWS::Region}/*"

Validation Output :

"Clause": {
  "Binary": {
      "context": " Resource[*] EQUALS  \"*\"",
      "messages": {
        "custom_message": "",
        "error_message": "Check was not compliant as property value [Path=/Resources/rLocalLogAggregregationBucketPolicy/Properties/PolicyDocument/Statement/0/Resource/0[L:337,C:16] Value={\"Fn::Sub\":\"arn:${AWS::Partition}:s3:::local-${AWS::AccountId}-logs-${AWS::Region}/*\"}] not equal to value [Path=[L:0,C:0] Value=\"*\"]. Error = [PathAwareValues are not comparable map, String]"
      },
      "check": {
        "Resolved": {
            "from": {
              "path": "/Resources/rLocalLogAggregregationBucketPolicy/Properties/PolicyDocument/Statement/0/Resource/0",
              "value": {
                  "Fn::Sub": "arn:${AWS::Partition}:s3:::local-${AWS::AccountId}-logs-${AWS::Region}/*"
              }
            },

Describe the solution you'd like

Support for CloudFormation Pseudo Parameters like ${AWS::Partition} to validate CloudFormation templates using cfn-guard

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions