Skip to content

Commit

Permalink
Denyactionpr (#1406)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
4pplied and github-actions[bot] authored Sep 18, 2023
1 parent bc067a2 commit bc80050
Show file tree
Hide file tree
Showing 7 changed files with 203 additions and 78 deletions.
3 changes: 3 additions & 0 deletions docs/wiki/Whats-new.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ Here's what's changed in Enterprise Scale/Azure Landing Zones:
- Updated to the new [Configure Microsoft Defender for Storage to be enabled](https://www.azadvertizer.com/azpolicyadvertizer/cfdc5972-75b3-4418-8ae1-7f5c36839390.html) built-in policy to the `Deploy-MDFC-Config` initiative and assignment.
- Read more about the new Microsoft Defender for Storage here: [aka.ms//DefenderForStorage](https://aka.ms//DefenderForStorage).
- NOTE: there are additional cost considerations associated with this feature - [more info](https://learn.microsoft.com/azure/defender-for-cloud/defender-for-storage-introduction#malware-scanning-powered-by-microsoft-defender-antivirus).
- Added two new definitions with Deny Action feature:
- `DenyAction-ActivityLogSettings.json`
- `DenyAction-DiagnosticSettings.json`

### July 2023

Expand Down
158 changes: 82 additions & 76 deletions eslzArm/managementGroupTemplates/policyDefinitions/policies.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.20.4.51522",
"templateHash": "11768655431175792812"
"version": "0.21.1.54444",
"templateHash": "7093918517635612324"
}
},
"variables": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "DenyAction-ActivityLogs",
"type": "Microsoft.Authorization/policyDefinitions",
"apiVersion": "2021-06-01",
"scope": null,
"properties": {
"policyType": "Custom",
"mode": "Indexed",
"displayName": "DenyAction implementation on Activity Logs",
"description": "This is a DenyAction implementation policy on Activity Logs.",
"metadata": {
"deprecated": false,
"version": "1.0.0",
"category": "Monitoring",
"source": "https://github.com/Azure/Enterprise-Scale/",
"alzCloudEnvironments": [
"AzureCloud",
"AzureChinaCloud",
"AzureUSGovernment"
]
},
"parameters": {},
"policyRule": {
"if": {
"field": "type",
"equals": "Microsoft.Resources/subscriptions/providers/diagnosticSettings"
},
"then": {
"effect": "denyAction",
"details": {
"actionNames": [
"delete"
]
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "DenyAction-DiagnosticLogs",
"type": "Microsoft.Authorization/policyDefinitions",
"apiVersion": "2021-06-01",
"scope": null,
"properties": {
"policyType": "Custom",
"mode": "Indexed",
"displayName": "DenyAction implementation on Diagnostic Logs.",
"description": "DenyAction implementation on Diagnostic Logs.",
"metadata": {
"deprecated": false,
"version": "1.0.0",
"category": "Monitoring",
"source": "https://github.com/Azure/Enterprise-Scale/",
"alzCloudEnvironments": [
"AzureCloud",
"AzureChinaCloud",
"AzureUSGovernment"
]
},
"parameters": {},
"policyRule": {
"if": {
"field": "type",
"equals": "Microsoft.Insights/diagnosticSettings"
},
"then": {
"effect": "denyAction",
"details": {
"actionNames": [
"delete"
]
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "DenyAction-DeleteProtection",
"type": "Microsoft.Authorization/policySetDefinitions",
"apiVersion": "2021-06-01",
"scope": null,
"properties": {
"policyType": "Custom",
"displayName": "DenyAction Delete - Activity Log Settings and Diagnostic Settings",
"description": "Enforces DenyAction - Delete on Activity Log Settings and Diagnostic Settings.",
"metadata": {
"version": "1.0.0",
"category": "Monitoring",
"source": "https://github.com/Azure/Enterprise-Scale/",
"alzCloudEnvironments": [
"AzureCloud",
"AzureChinaCloud",
"AzureUSGovernment"
]
},
"parameters": {},
"policyDefinitions": [
{
"policyDefinitionReferenceId": "DenyActionDelete-DiagnosticSettings",
"policyDefinitionId": "/providers/Microsoft.Management/managementGroups/contoso/providers/Microsoft.Authorization/policyDefinitions/DenyAction-DiagnosticSettings",
"parameters": {},
"groupNames": []
},
{
"policyDefinitionReferenceId": "DenyActionDelete-ActivityLogSettings",
"policyDefinitionId": "/providers/Microsoft.Management/managementGroups/contoso/providers/Microsoft.Authorization/policyDefinitions/DenyAction-ActivityLogSettings",
"parameters": {},
"groupNames": []
}
],
"policyDefinitionGroups": null
}
}
3 changes: 3 additions & 0 deletions src/templates/policies.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ var loadPolicyDefinitions = {
loadTextContent('../resources/Microsoft.Authorization/policyDefinitions/Deploy-Windows-DomainJoin.json')
loadTextContent('../resources/Microsoft.Authorization/policyDefinitions/Deploy-Diagnostics-VWanS2SVPNGW.json')
loadTextContent('../resources/Microsoft.Authorization/policyDefinitions/Audit-PrivateLinkPrivateDnsZones.json')
loadTextContent('../resources/Microsoft.Authorization/policyDefinitions/DenyAction-DiagnosticSettings.json')
loadTextContent('../resources/Microsoft.Authorization/policyDefinitions/DenyAction-ActivityLogSettings.json')
]
AzureCloud: [
loadTextContent('../resources/Microsoft.Authorization/policyDefinitions/Audit-MachineLearning-PrivateEndpointId.json') // Needs validating in AzureChinaCloud and AzureUSGovernment
Expand Down Expand Up @@ -224,6 +226,7 @@ var loadPolicySetDefinitions = {
loadTextContent('../resources/Microsoft.Authorization/policySetDefinitions/Enforce-Guardrails-KeyVault.json')
loadTextContent('../resources/Microsoft.Authorization/policySetDefinitions/Enforce-ALZ-Decomm.json')
loadTextContent('../resources/Microsoft.Authorization/policySetDefinitions/Enforce-ALZ-Sandbox.json')
loadTextContent('../resources/Microsoft.Authorization/policySetDefinitions/DenyAction-DeleteProtection.json')
]
AzureCloud: [
loadTextContent('../resources/Microsoft.Authorization/policySetDefinitions/Deny-PublicPaaSEndpoints.json') // See AzureChinaCloud and AzureUSGovernment comments below for reasoning
Expand Down

0 comments on commit bc80050

Please sign in to comment.