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

[Enhancement] Support for CloudFormation Pseudo Parameters #480

Open
varun656 opened this issue Mar 12, 2024 · 1 comment
Open

[Enhancement] Support for CloudFormation Pseudo Parameters #480

varun656 opened this issue Mar 12, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@varun656
Copy link

varun656 commented Mar 12, 2024

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

@joshfried-aws
Copy link
Contributor

Hey @varun656 would like to hear more about how users would want to use this. Would it be best to set these values via a configuration file vs hooking into the aws sdk and attempting to resolve them via the defaults?

I'm also wondering whether users would rather work with a command that spits out a new template with these values resolved, which they can then feed to the guard engine.

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

No branches or pull requests

2 participants