Skip to content

Commit

Permalink
feat: Policy Refresh Q1 FY25 (#806)
Browse files Browse the repository at this point in the history
* Update Policy Library (automated)

* Update Policy Library (automated)

* Change monitor policy names to avoid confusion

* Update Policy Library (automated)

* feat: Update Policy Library (automated)

* feat: Update Policy Library (automated)

* Updated json values for custompolicydefinitions

* Remove duplicate AKS Assignment and create subnet private assignment

* Added param and logic for category of resource logs

* Generate Parameter Markdowns [oZakari/c375e413]

* feat: Update Policy Library (automated)

---------

Co-authored-by: github-actions <action@github.com>
Co-authored-by: Zach Trocinski <ztrocinski@outlook.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
4 people authored Oct 24, 2024
1 parent c375e41 commit 3f3d38f
Show file tree
Hide file tree
Showing 48 changed files with 1,794 additions and 833 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ parLandingZoneChildrenMgAlzDefaultsEnable | No | Assign policies to Corp &
parLandingZoneMgConfidentialEnable | No | Assign policies to Confidential Corp and Online groups under Landing Zones.
parLogAnalyticsWorkSpaceAndAutomationAccountLocation | No | Location of Log Analytics Workspace & Automation Account.
parLogAnalyticsWorkspaceResourceId | No | Resource ID of Log Analytics Workspace.
parLogAnalyticsWorkspaceResourceCategory | No | Category of logs for supported resource logging for Log Analytics Workspace.
parDataCollectionRuleVMInsightsResourceId | No | Resource ID for VM Insights Data Collection Rule.
parDataCollectionRuleChangeTrackingResourceId | No | Resource ID for Change Tracking Data Collection Rule.
parDataCollectionRuleMDFCSQLResourceId | No | Resource ID for MDFC SQL Data Collection Rule.
Expand Down Expand Up @@ -101,6 +102,14 @@ Location of Log Analytics Workspace & Automation Account.

Resource ID of Log Analytics Workspace.

### parLogAnalyticsWorkspaceResourceCategory

![Parameter Setting](https://img.shields.io/badge/parameter-optional-green?style=flat-square)

Category of logs for supported resource logging for Log Analytics Workspace.

- Default value: `allLogs`

### parDataCollectionRuleVMInsightsResourceId

![Parameter Setting](https://img.shields.io/badge/parameter-optional-green?style=flat-square)
Expand Down Expand Up @@ -265,6 +274,9 @@ Opt out of deployment telemetry.
"parLogAnalyticsWorkspaceResourceId": {
"value": ""
},
"parLogAnalyticsWorkspaceResourceCategory": {
"value": "allLogs"
},
"parDataCollectionRuleVMInsightsResourceId": {
"value": ""
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ var varModuleDeploymentNames = {
modPolicyAssignmentLZsDeployVMBackup: take('${varDeploymentNameWrappers.basePrefix}-polAssi-deployVMBackup-lz-${varDeploymentNameWrappers.baseSuffixTenantAndManagementGroup}', 64)
modPolicyAssignmentLZsEnableDDoSVNET: take('${varDeploymentNameWrappers.basePrefix}-polAssi-enableDDoSVNET-lz-${varDeploymentNameWrappers.baseSuffixTenantAndManagementGroup}', 64)
modPolicyAssignmentLZsDenyStorageHttp: take('${varDeploymentNameWrappers.basePrefix}-polAssi-denyStorageHttp-lz-${varDeploymentNameWrappers.baseSuffixTenantAndManagementGroup}', 64)
modPolicyAssignmentLZsDeployAKSPolicy: take('${varDeploymentNameWrappers.basePrefix}-polAssi-deployAKSPolicy-lz-${varDeploymentNameWrappers.baseSuffixTenantAndManagementGroup}', 64)
modPolicyAssignmentLZsDenyPrivEscalationAKS: take('${varDeploymentNameWrappers.basePrefix}-polAssi-denyPrivEscAKS-lz-${varDeploymentNameWrappers.baseSuffixTenantAndManagementGroup}', 64)
modPolicyAssignmentLZsDenyPrivContainersAKS: take('${varDeploymentNameWrappers.basePrefix}-polAssi-denyPrivConAKS-lz-${varDeploymentNameWrappers.baseSuffixTenantAndManagementGroup}', 64)
modPolicyAssignmentLZsEnforceAKSHTTPS: take('${varDeploymentNameWrappers.basePrefix}-polAssi-enforceAKSHTTPS-lz-${varDeploymentNameWrappers.baseSuffixTenantAndManagementGroup}', 64)
Expand Down Expand Up @@ -129,11 +128,6 @@ var varPolicyAssignmentDenySubnetWithoutNsg = {
libDefinition: loadJsonContent(('../../../policy/assignments/lib/china/policy_assignments/policy_assignment_es_deny_subnet_without_nsg.tmpl.json'))
}

var varPolicyAssignmentDeployAKSPolicy = {
definitionId: '/providers/Microsoft.Authorization/policyDefinitions/a8eff44f-8c92-45c3-a3fb-9880802d67a7'
libDefinition: loadJsonContent(('../../../policy/assignments/lib/china/policy_assignments/policy_assignment_es_deploy_aks_policy.tmpl.json'))
}

var varPolicyAssignmentDeployASCMonitoring = {
definitionId: '/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8'
libDefinition: loadJsonContent(('../../../policy/assignments/lib/china/policy_assignments/policy_assignment_es_deploy_asc_monitoring.tmpl.json'))
Expand Down Expand Up @@ -585,25 +579,6 @@ module modPolicyAssignmentLZsDenyStorageHttp '../../../policy/assignments/policy
}
}

// Module - Policy Assignment - Deploy-AKS-Policy
module modPolicyAssignmentLZsDeployAKSPolicy '../../../policy/assignments/policyAssignmentManagementGroup.bicep' = {
scope: managementGroup(varManagementGroupIDs.landingZones)
name: varModuleDeploymentNames.modPolicyAssignmentLZsDeployAKSPolicy
params: {
parPolicyAssignmentDefinitionId: varPolicyAssignmentDeployAKSPolicy.definitionId
parPolicyAssignmentName: varPolicyAssignmentDeployAKSPolicy.libDefinition.name
parPolicyAssignmentDisplayName: varPolicyAssignmentDeployAKSPolicy.libDefinition.properties.displayName
parPolicyAssignmentDescription: varPolicyAssignmentDeployAKSPolicy.libDefinition.properties.description
parPolicyAssignmentParameters: varPolicyAssignmentDeployAKSPolicy.libDefinition.properties.parameters
parPolicyAssignmentIdentityType: varPolicyAssignmentDeployAKSPolicy.libDefinition.identity.type
parPolicyAssignmentEnforcementMode: parDisableAlzDefaultPolicies ? 'DoNotEnforce' : varPolicyAssignmentDeployAKSPolicy.libDefinition.properties.enforcementMode
parPolicyAssignmentIdentityRoleDefinitionIds: [
varRBACRoleDefinitionIDs.aksContributor
]
parTelemetryOptOut: parTelemetryOptOut
}
}

// Module - Policy Assignment - Deny-Priv-Escalation-AKS
module modPolicyAssignmentLZsDenyPrivEscalationAKS '../../../policy/assignments/policyAssignmentManagementGroup.bicep' = {
scope: managementGroup(varManagementGroupIDs.landingZones)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
"parLogAnalyticsWorkspaceLogRetentionInDays": {
"value": "365"
},
"parLogAnalyticsWorkspaceResourceCategory": {
"value": "allLogs"
},
"parDataCollectionRuleVMInsightsResourceId": {
"value": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/alz-logging/providers/Microsoft.Insights/dataCollectionRules/alz-ama-vmi-dcr"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ var varPolicyAssignmentDenySubnetWithoutUdr = {
libDefinition: loadJsonContent('../../policy/assignments/lib/china/policy_assignments/policy_assignment_es_deny_subnet_without_udr.tmpl.json')
}

var varPolicyAssignmentDeployAKSPolicy = {
definitionId: '/providers/Microsoft.Authorization/policyDefinitions/a8eff44f-8c92-45c3-a3fb-9880802d67a7'
libDefinition: loadJsonContent('../../policy/assignments/lib/china/policy_assignments/policy_assignment_es_deploy_aks_policy.tmpl.json')
}

var varPolicyAssignmentDeployASCMonitoring = {
definitionId: '/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8'
libDefinition: loadJsonContent('../../policy/assignments/lib/china/policy_assignments/policy_assignment_es_deploy_asc_monitoring.tmpl.json')
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,6 @@ var varPolicyAssignmentDenyUnmanagedDisk = {
libDefinition: loadJsonContent('../../../policy/assignments/lib/policy_assignments/policy_assignment_es_deny_unmanageddisk.tmpl.json')
}

var varPolicyAssignmentDeployAKSPolicy = {
definitionId: '/providers/Microsoft.Authorization/policyDefinitions/a8eff44f-8c92-45c3-a3fb-9880802d67a7'
libDefinition: loadJsonContent('../../../policy/assignments/lib/policy_assignments/policy_assignment_es_deploy_aks_policy.tmpl.json')
}

var varPolicyAssignmentDeployASCMonitoring = {
definitionId: '/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8'
libDefinition: loadJsonContent('../../../policy/assignments/lib/policy_assignments/policy_assignment_es_deploy_asc_monitoring.tmpl.json')
Expand Down Expand Up @@ -253,7 +248,7 @@ var varPolicyAssignmentDeployVMChangeTrack = {
libDefinition: loadJsonContent('../../../policy/assignments/lib/policy_assignments/policy_assignment_es_deploy_vm_changetrack.tmpl.json')
}

var varPolicyAssignmentDeployVMMonitoring = {
var varPolicyAssignmentDeployVMMonitor24 = {
definitionId: '/providers/Microsoft.Authorization/policySetDefinitions/924bfe3a-762f-40e7-86dd-5c8b95eb09e6'
libDefinition: loadJsonContent('../../../policy/assignments/lib/policy_assignments/policy_assignment_es_deploy_vm_monitor.tmpl.json')
}
Expand All @@ -263,7 +258,7 @@ var varPolicyAssignmentDeployVMSSChangeTrack = {
libDefinition: loadJsonContent('../../../policy/assignments/lib/policy_assignments/policy_assignment_es_deploy_vmss_changetrack.tmpl.json')
}

var varPolicyAssignmentDeployVMSSMonitoring = {
var varPolicyAssignmentDeployVMSSMonitor24 = {
definitionId: '/providers/Microsoft.Authorization/policySetDefinitions/f5bf694c-cca7-4033-b883-3a23327d5485'
libDefinition: loadJsonContent('../../../policy/assignments/lib/policy_assignments/policy_assignment_es_deploy_vmss_monitor.tmpl.json')
}
Expand Down Expand Up @@ -318,6 +313,11 @@ var varPolicyAssignmentEnforceSovereignGlobal = {
libDefinition: loadJsonContent('../../../policy/assignments/lib/policy_assignments/policy_assignment_es_enforce_sovereignty_baseline_global.tmpl.json')
}

var varPolicyAssignmentEnforceSubnetPrivate = {
definitionId: '/providers/Microsoft.Authorization/policyDefinitions/7bca8353-aa3b-429b-904a-9229c4385837'
libDefinition: loadJsonContent('../../../policy/assignments/lib/policy_assignments/policy_assignment_es_enforce_subnet_private.tmpl.json')
}

var varPolicyAssignmentEnforceTLSSSLH224 = {
definitionId: '${varTopLevelManagementGroupResourceId}/providers/Microsoft.Authorization/policySetDefinitions/Enforce-EncryptTransit_20240509'
libDefinition: loadJsonContent('../../../policy/assignments/lib/policy_assignments/policy_assignment_es_enforce_tls_ssl.tmpl.json')
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Deploy-VM-Monitoring",
"name": "Deploy-VM-Monitor-24",
"type": "Microsoft.Authorization/policyAssignments",
"apiVersion": "2024-04-01",
"properties": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Deploy-VMSS-Monitoring",
"name": "Deploy-VMSS-Monitor-24",
"type": "Microsoft.Authorization/policyAssignments",
"apiVersion": "2024-04-01",
"properties": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "Enforce-Subnet-Private",
"type": "Microsoft.Authorization/policyAssignments",
"apiVersion": "2024-04-01",
"properties": {
"description": "Ensure your subnets are secure by default by preventing default outbound access. For more information go to https://aka.ms/defaultoutboundaccessretirement",
"displayName": "Subnets should be private",
"notScopes": [],
"parameters": {},
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7bca8353-aa3b-429b-904a-9229c4385837",
"scope": null,
"enforcementMode": "Default"
},
"location": null,
"identity": {
"type": "None"
}
}
Loading

0 comments on commit 3f3d38f

Please sign in to comment.