bridgecrewio / checkov

Prevent cloud misconfigurations and find vulnerabilities during build-time in infrastructure as code, container images and open source packages with Checkov by Bridgecrew.
https://www.checkov.io/
Apache License 2.0
6.72k stars 1.08k forks source link

Failing to parse bicep for loops with new formating #6351

Open tomaxsas opened 1 month ago

tomaxsas commented 1 month ago

Recently bicep changed its for loops formating. I always run az bicep format -f main.bicep

Previous formating which parses

resource vaultSecrets 'Microsoft.KeyVault/vaults/secrets@2022-07-01' = [for entry in keyVaultEntriesArray: {
  name: entry.name
  parent: keyVault
  properties: {
    attributes: {
      enabled: true
      // expires in 2024-11-24
      exp: 1732433200
    }
    contentType: 'Credentials'
    value: entry.secret
  }
}]

new formating which checkov fails to parse

resource vaultSecrets 'Microsoft.KeyVault/vaults/secrets@2022-07-01' = [
  for entry in keyVaultEntriesArray: {
    name: entry.name
    parent: keyVault
    properties: {
      attributes: {
        enabled: true
        // expires in 2024-11-24
        exp: 1732433200
      }
      contentType: 'Credentials'
      value: entry.secret
    }
  }
]