Azure / azure-policy

Repository for Azure Resource Policy built-in definitions and samples
MIT License
1.5k stars 1.09k forks source link

AzureSecurityCenter.json - Missing effects from list of allowedValues in assignment parameters for multiple definitions #1257

Open Dekor86 opened 10 months ago

Dekor86 commented 10 months ago

Details of the scenario you tried and the problem that is occurring

The following policies included in this initiative support "Deny" effects, however can't be used in the Microsoft Cloud Security Benchmark as the assignment parameters only support "Audit" and "Disabled".

Verbose logs showing the problem

The value 'Deny' | is not allowed for policy parameter | 'firewallShouldBeEnabledOnKeyVaultMonitoringEffect' in policy definition | '1f3afdf9-d0c9-4c3d-847f-89da613e70a8'. The allowed values are 'Audit, | Disabled'.

New-AzManagementGroupDeployment: /home/vsts/work/1/s/pipeline-scripts/Deploy-ALZPolicyAssignments.ps1:29 Line | 29 | New-AzManagementGroupDeployment @inputObject | ~~~~~~~~~~~~ | 11:11:23 - The deployment | 'alz-PolicyAssignmentsDeployment-20231207T1112568206Z' failed with | error(s). Showing 2 out of 2 error(s). Status Message: The value 'Deny' | is not allowed for policy parameter | 'containerRegistriesShouldNotAllowUnrestrictedNetworkAccessMonitoringEffect' in policy definition '1f3afdf9-d0c9-4c3d-847f-89da613e70a8'. The allowed values are 'Audit, Disabled'. (Code:PolicyParameterValueNotAllowed) Status Message: At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details. (Code: DeploymentFailed) - The value 'Deny' is not allowed for policy parameter 'containerRegistriesShouldNotAllowUnrestrictedNetworkAccessMonitoringEffect' in policy definition '1f3afdf9-d0c9-4c3d-847f-89da613e70a8'. The allowed values are 'Audit, Disabled'. (Code:PolicyParameterValueNotAllowed) CorrelationId: ca910fe7-1b99-4e90-9700-c2ee10f5d266

[error]PowerShell exited with code '1'.

New-AzManagementGroupDeployment: /home/vsts/work/1/s/pipeline-scripts/Deploy-ALZPolicyAssignments.ps1:29 Line | 29 | New-AzManagementGroupDeployment @inputObject | ~~~~~~~~~~~~ | 13:26:20 - The deployment | 'alz-PolicyAssignmentsDeployment-20231207T1312599552Z' failed with | error(s). Showing 2 out of 2 error(s). Status Message: The value 'Deny' | is not allowed for policy parameter | 'publicNetworkAccessShouldBeDisabledForMySqlServersMonitoringEffect' in | policy definition '1f3afdf9-d0c9-4c3d-847f-89da613e70a8'. The allowed | values are 'Audit, Disabled'. (Code:PolicyParameterValueNotAllowed) | Status Message: At least one resource deployment operation failed. | Please list deployment operations for details. Please see | https://aka.ms/arm-deployment-operations for usage details. (Code: | DeploymentFailed) - The value 'Deny' is not allowed for policy | parameter | 'publicNetworkAccessShouldBeDisabledForMySqlServersMonitoringEffect' in | policy definition '1f3afdf9-d0c9-4c3d-847f-89da613e70a8'. The allowed | values are 'Audit, Disabled'. (Code:PolicyParameterValueNotAllowed) | CorrelationId: c079c8d6-6899-4119-90bd-064b765ed42c

New-AzManagementGroupDeployment: /home/vsts/work/1/s/pipeline-scripts/Deploy-ALZPolicyAssignments.ps1:29 Line | 29 | New-AzManagementGroupDeployment @inputObject | ~~~~~~~~~~~~ | 13:08:31 - The deployment | 'alz-PolicyAssignmentsDeployment-20231207T1312092717Z' failed with | error(s). Showing 2 out of 2 error(s). Status Message: The value 'Deny' | is not allowed for policy parameter | 'publicNetworkAccessShouldBeDisabledForMariaDbServersMonitoringEffect' | in policy definition '1f3afdf9-d0c9-4c3d-847f-89da613e70a8'. The allowed | values are 'Audit, Disabled'. (Code:PolicyParameterValueNotAllowed) | Status Message: At least one resource deployment operation failed. | Please list deployment operations for details. Please see | https://aka.ms/arm-deployment-operations for usage details. (Code: | DeploymentFailed) - The value 'Deny' is not allowed for policy | parameter | 'publicNetworkAccessShouldBeDisabledForMariaDbServersMonitoringEffect' | in policy definition '1f3afdf9-d0c9-4c3d-847f-89da613e70a8'. The allowed | values are 'Audit, Disabled'. (Code:PolicyParameterValueNotAllowed) | CorrelationId: 9e16204a-ad06-4aae-bba8-c6c13e6d719a

New-AzManagementGroupDeployment: /home/vsts/work/1/s/pipeline-scripts/Deploy-ALZPolicyAssignments.ps1:29 Line | 29 | New-AzManagementGroupDeployment @inputObject | ~~~~~~~~~~~~ | 15:04:19 - The deployment | 'alz-PolicyAssignmentsDeployment-20231207T1512540731Z' failed with | error(s). Showing 2 out of 2 error(s). Status Message: The value 'Deny' | is not allowed for policy parameter | 'publicNetworkAccessShouldBeDisabledForPostgreSqlServersMonitoringEffect' in policy definition '1f3afdf9-d0c9-4c3d-847f-89da613e70a8'. The allowed values are 'Audit, Disabled'. (Code:PolicyParameterValueNotAllowed) Status Message: At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details. (Code: DeploymentFailed) - The value 'Deny' is not allowed for policy parameter 'publicNetworkAccessShouldBeDisabledForPostgreSqlServersMonitoringEffect' in policy definition '1f3afdf9-d0c9-4c3d-847f-89da613e70a8'. The allowed values are 'Audit, Disabled'. (Code:PolicyParameterValueNotAllowed) CorrelationId: 6a5ac4fc-dae3-415b-a14b-cdd5b0b10858

Suggested solution to the issue

Update list of "allowedValues" in policy initiative parameters for these policies to include "deny"

Alternatively, review PR:

https://github.com/Azure/azure-policy/pull/1252

If policy is Guest Configuration - details about target node

N/A

RT235 commented 2 months ago

Is there an update available on this please? No response since December 2023.