Project: KICS (Provisioning / Security & Compliance)
File: 9b09dee1-f09b-4013-91d2-158fa4695f4b.md

title: AKS Logging To Azure Monitoring Is Disabled hide: toc: true navigation: true <style> .highlight .hll { background-color: #ff171742; } .md-content { max-width: 1100px; margin: 0 auto; } </style> Query id: 9b09dee1-f09b-4013-91d2-158fa4695f4b Query name: AKS Logging To Azure Monitoring Is Disabled Platform: AzureResourceManager Severity: <span style="color:#ff7213">Medium</span> Category: Observability URL: Azure Kubernetes Service should have logging to Azure Monitoring enabled.<br> ```json title="Positive test num. 1 - json file" hl_lines="14" { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "resources": [ { "name": "aksCluster1", "type": "Microsoft.ContainerService/managedClusters", "apiVersion": "2020-02-01", "location": "[resourceGroup().location]", "properties": { "kubernetesVersion": "1.15.7", "addonProfiles": { "omsagent": { "enabled": false } }, "dnsPrefix": "dnsprefix", "agentPoolProfiles": [ { "name": "agentpool", "count": 2, "vmSize": "Standard_A1", "osType": "Linux", "storageProfile": "ManagedDisks" } ], "linuxProfile": { "adminUsername": "adminUserName", "ssh": { "publicKeys": [ { "keyData": "keyData" } ] } }, "servicePrincipalProfile": { "clientId": "servicePrincipalAppId", "secret": "servicePrincipalAppPassword" }, "networkProfile": { "networkPolicy": "azure" } } } ] } ``` ```json title="Positive test num. 2 - json file" hl_lines="6" { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "resources": [ { "name": "aksCluster1", "type": "Microsoft.ContainerService/managedClusters", "apiVersion": "2020-02-01", "location": "[resourceGroup().location]", "properties": { "kubernetesVersion": "1.15.7", "dnsPrefix": "dnsprefix", "agentPoolProfiles": [ { "name": "agentpool", "count": 2, "vmSize": "Standard_A1", "osType": "Linux", "storageProfile": "ManagedDisks" } ], "linuxProfile": { "adminUsername": "adminUserName", "ssh": { "publicKeys": [ { "keyData": "keyData" } ] } }, "servicePrincipalProfile": { "clientId": "servicePrincipalAppId", "secret": "servicePrincipalAppPassword" }, "networkProfile": { "networkPolicy": "azure" } } } ] } ``` ```json title="Positive test num. 3 - json file" hl_lines="16" { "properties": { "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "resources": [ { "name": "aksCluster1", "type": "Microsoft.ContainerService/managedClusters", "apiVersion": "2020-02-01", "location": "[resourceGroup().location]", "properties": { "kubernetesVersion":

"addonProfiles": { "omsagent": { "enabled": false } }, "dnsPrefix": "dnsprefix", "agentPoolProfiles": [ { "name": "agentpool", "count": 2, "vmSize": "Standard_A1", "osType": "Linux", "storageProfile": "ManagedDisks" } ], "linuxProfile": { "adminUsername": "adminUserName", "ssh": { "publicKeys": [ { "keyData": "keyData" } ] } }, "servicePrincipalProfile": { "clientId": "servicePrincipalAppId", "secret": "servicePrincipalAppPassword" }, "networkProfile": { "networkPolicy": "azure" } } } ], "outputs": {} }, "parameters": {} }, "kind": "template", "type": "Microsoft.Blueprint/blueprints/artifacts", "name": "myTemplate" } ``` <details><summary>Positive test num. 4 - json file</summary> ```json hl_lines="8" { "properties": { "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "resources": [ { "name": "aksCluster1", "type": "Microsoft.ContainerService/managedClusters", "apiVersion": "2020-02-01", "location": "[resourceGroup().location]", "properties": { "kubernetesVersion": "1.15.7", "dnsPrefix": "dnsprefix", "agentPoolProfiles": [ { "name": "agentpool", "count": 2, "vmSize": "Standard_A1", "osType": "Linux", "storageProfile": "ManagedDisks" } ], "linuxProfile": { "adminUsername": "adminUserName", "ssh": { "publicKeys": [ { "keyData": "keyData" } ] } }, "servicePrincipalProfile": { "clientId": "servicePrincipalAppId", "secret": "servicePrincipalAppPassword" }, "networkProfile": { "networkPolicy": "azure" } } } ], "outputs": {} }, "parameters": {} }, "kind": "template", "type": "Microsoft.Blueprint/blueprints/artifacts", "name": "myTemplate" } ``` </details> ```json title="Negative test num. 1 - json file" { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "resources": [ { "name": "aksCluster1", "type": "Microsoft.ContainerService/managedClusters", "apiVersion": "2020-02-01", "location": "[resourceGroup().location]", "properties": { "kubernetesVersion": "1.15.7", "addonProfiles": { "omsagent": { "enabled": true } }, "dnsPrefix": "dnsprefix", "agentPoolProfiles": [ { "name": "agentpool", "count": 2, "vmSize": "Standard_A1", "osType": "Linux", "storageProfile": "ManagedDisks" } ], "linuxProfile": { "adminUsername": "adminUserName", "ssh": { "publicKeys": [ { "keyData": "keyData" } ] } }, "servicePrincipalProfile": { "clientId": "servicePrincipalAppId", "secret": "servicePrincipalAppPassword" }, "networkProfile": { "networkPolicy": "azure" } } } ] } ``` ```json title="Negative test num. 2 - json file" { "properties": { "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "resources": [ { "name": "aksCluster1", "type": "Microsoft.ContainerService/managedClusters", "apiVersion": "2020-02-01", "location": "[resourceGroup().location]", "properties": { "kubernetesVersion": "1.15.7", "addonProfiles": { "omsagent": { "enabled": true } }, "dnsPrefix": "dnsprefix", "agentPoolProfiles": [ { "name": "agentpool", "count": 2, "vmSize": "Standard_A1", "osType": "Linux", "storageProfile": "ManagedDisks" } ], "linuxProfile": { "adminUsername": "adminUserName", "ssh": { "publicKeys": [ { "keyData": "keyData" } ] } }, "servicePrincipalProfile": { "clientId": "servicePrincipalAppId", "secret": "servicePrincipalAppPassword" }, "networkProfile": { "networkPolicy": "azure" } } } ], "outputs": {} }, "parameters": {} }, "kind": "template", "type": "Microsoft.Blueprint/blueprints/artifacts", "name": "myTemplate" } ```