Azure / Azure/template-analyzer
[BUG] Built in rule TA-000001 false-positive on site config object
- Dominant language
- C#
- Stars
- 143
- Forks
- 47
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the bug
The builtin rule TA-000001 has the following rule:
```json
"anyOf": [
{
"resourceType": "Microsoft.Web/sites/config",
"allOf": [
{
"path": "properties.detailedErrorLoggingEnabled",
"equals": true
},
{
"path": "properties.httpLoggingEnabled",
"equals": true
},
{
"path": "properties.requestTracingEnabled",
"equals": true
}
]
},
```
But, whilst those are the property names for `properties.siteConfig` in the `Web/Sites` app, they are _not_ for the `Microsoft.Web/sites/config` resource.
This is a valid site config, but the rule is still triggering on this template--
```bicep
resource configLogs 'Microsoft.Web/sites/config@2022-03-01' = {
name: 'logs'
parent: appService
properties: {
applicationLogs: { fileSystem: { level: 'Verbose' } }
detailedErrorMessages: { enabled: true }
failedRequestsTracing: { enabled: true }
httpLogs: { fileSystem: { enabled: true, retentionInDays: 1, retentionInMb: 35 } }
}
dependsOn: [configAppSettings]
}
```
This means the rule will always trigger on a `Web/sites/config` object, because `properties.detailedErrorLoggingEnabled` doesn't exist.
Contributor guide
Assessment
This issue has not been assessed yet.