Repository navigation
Replies: 1 comment 1 reply
|
Hi, thanks for the detailed list.
When a property is missing from the template, the adapter should use the current Azure default. It would be good to link the docs for each default in the PR and note in the code since which API version it applies, like the comment for For PRs, grouping the changes by service works better than one PR per setting. One PR in trivy adds the model fields and the ARM and Terraform adapters for a service. One PR in trivy-checks adds the checks for that service after the trivy PR is merged. The |
Uh oh!
There was an error while loading. Please reload this page.
Description
Scanning Azure ARM and Bicep templates with planted misconfigurations, several common risky settings get no finding in any format (ARM, Bicep or Terraform), because neither the Azure model nor trivy-checks covers them. This is separate from #11655, which is about adapters that drop inputs for existing checks.
Settings with no model field and no check (checked against
pkg/iac/providers/azureon main and trivy-checks main):Microsoft.ContainerRegistry/registriesadminUserEnabledazurerm_container_registry.admin_enabledanonymousPullEnabledanonymous_pull_enabledsiteConfig.remoteDebuggingEnabledsite_config.remote_debugging_enabled*siteConfig.cors.allowedOriginssite_config.cors.allowed_originsallowBlobPublicAccessallow_nested_items_to_be_publicallowSharedKeyAccessshared_access_key_enabledsecurityProfile.encryptionAtHostencryption_at_host_enabledenableRbacAuthorizationrbac_authorization_enabled(enable_rbac_authorizationbefore azurerm 4.x)accessPolicies[].permissionsaccess_policydisableLocalAccountslocal_account_disabledThere's no container registry service in the Azure model at all.
In the model, but no check reads it:
authorization.RoleAssignments. An Owner role assignment (roleDefinitionIdending in8e3af657-a8ff-443c-a75c-2fe8c4bcb635) at subscription or resource-group scope goes unreported. AVD-AZU-0030 only covers custom role definitions with*actions.Dropped before checks run: ARM template
parametersandoutputsaren't in the model, so these aren't detectable:string(notsecurestring) parameter named like a secret, with a default value;listKeys(...)or a secret parameter.Bicep has linter rules for both (
secure-parameter-default,outputs-should-not-contain-secrets), but plain ARM templates and Terraform outputs (sensitive = false) have nothing.Related adapter gap (existing check): AVD-AZU-0037 reads
CustomData, which the model documents as not base64 encoded. The Terraform adapter decodes it (adapters/terraform/azure/compute/adapt.go), but the ARM adapter passesosProfile.customDatathrough as written. ARM requires it base64 encoded, so a secret in ARM customData never fires. Happy to fold this into one of the #11655 PRs or send it separately.Proposal. I can contribute these, one PR per setting: the model field, the ARM and Terraform adapters, and the check in trivy-checks. Before starting, it would help to know:
Target
Filesystem
Scanner
Misconfiguration
All reactions