|
| 1 | +# AKS cluster without disk encryption |
| 2 | + |
| 3 | +Azure Kubernetes Service (AKS) clusters should utilize disk encryption to protect sensitive data at rest. Without disk encryption, data stored on node disks could be vulnerable to unauthorized access if the storage is compromised. |
| 4 | + |
| 5 | +## Problem statement |
| 6 | + |
| 7 | +When an AKS cluster is configured without disk encryption: |
| 8 | + |
| 9 | +1. Node VM disks including OS disks and data disks could store data in an unencrypted format |
| 10 | +2. In case of physical theft, hardware decommissioning, or improper disk handling, sensitive data might be exposed |
| 11 | +3. Security and compliance requirements (like HIPAA, PCI DSS, or GDPR) may be violated |
| 12 | +4. If a node is compromised, an attacker may be able to access data directly from the disk |
| 13 | + |
| 14 | +## Recommendation |
| 15 | + |
| 16 | +Configure disk encryption for your AKS cluster by setting a disk encryption set ID: |
| 17 | + |
| 18 | +```bicep |
| 19 | +resource diskEncryptionSet 'Microsoft.Compute/diskEncryptionSets@2022-07-02' = { |
| 20 | + name: 'myDiskEncryptionSet' |
| 21 | + location: location |
| 22 | + identity: { |
| 23 | + type: 'SystemAssigned' |
| 24 | + } |
| 25 | + properties: { |
| 26 | + activeKey: { |
| 27 | + keyUrl: keyVault.getSecret('encryptionKey').id |
| 28 | + } |
| 29 | + } |
| 30 | +} |
| 31 | +
|
| 32 | +resource aksCluster 'Microsoft.ContainerService/managedClusters@2023-02-02-preview' = { |
| 33 | + name: 'secureAksCluster' |
| 34 | + location: location |
| 35 | + properties: { |
| 36 | + // Other properties... |
| 37 | + diskEncryptionSetID: diskEncryptionSet.id |
| 38 | + // Other properties... |
| 39 | + } |
| 40 | +} |
| 41 | +``` |
| 42 | + |
| 43 | +## Example |
| 44 | + |
| 45 | +### Insecure configuration (No disk encryption) |
| 46 | + |
| 47 | +```bicep |
| 48 | +resource aksClusterInsecure 'Microsoft.ContainerService/managedClusters@2023-02-02-preview' = { |
| 49 | + name: 'aksClusterInsecure' |
| 50 | + location: location |
| 51 | + properties: { |
| 52 | + kubernetesVersion: '1.24.9' |
| 53 | + dnsPrefix: 'aksdns' |
| 54 | + // Missing diskEncryptionSetID |
| 55 | + // Other properties... |
| 56 | + } |
| 57 | +} |
| 58 | +``` |
| 59 | + |
| 60 | +### Secure configuration (With disk encryption) |
| 61 | + |
| 62 | +```bicep |
| 63 | +resource aksClusterSecure 'Microsoft.ContainerService/managedClusters@2023-02-02-preview' = { |
| 64 | + name: 'aksClusterSecure' |
| 65 | + location: location |
| 66 | + properties: { |
| 67 | + kubernetesVersion: '1.24.9' |
| 68 | + dnsPrefix: 'aksdns' |
| 69 | + diskEncryptionSetID: diskEncryptionSet.id // Secure: Using disk encryption |
| 70 | + // Other properties... |
| 71 | + } |
| 72 | +} |
| 73 | +``` |
| 74 | + |
| 75 | +## References |
| 76 | + |
| 77 | +* [Azure Disk Encryption for AKS clusters](https://learn.microsoft.com/en-us/azure/aks/azure-disk-customer-managed-keys) |
| 78 | +* [Data encryption in AKS](https://learn.microsoft.com/en-us/azure/aks/concepts-data-encryption) |
0 commit comments