VM Automatische Updates

πŸ’Ό Management Samenvatting

Deze security control is essentieel voor het waarborgen van een veilige cloud omgeving en beschermt tegen ongeautoriseerde toegang en datalekes.

Aanbeveling
IMPLEMENTEER AUTOMATIC UPDATES
Risico zonder
Critical
Risk Score
9/10
Implementatie
5u (tech: 3u)
Van toepassing op:
βœ“ Azure VMs

Zonder deze beveiligingsmaatregel kunnen er significante security risks ontstaan die leiden tot data compromise, compliance overtredingen en reputatieschade voor de organisatie.

PowerShell Modules Vereist
Primary API: Azure API
Connection: Connect-AzAccount
Required Modules: Az.Accounts, Az.Compute

Implementatie

Dit control implementeert security best practices via Azure Policy, ARM templates of Microsoft Intune om cloud resources en endpoints te beschermen volgens actuele compliance frameworks.

Vereisten

  1. Azure VMs
  2. Update Manager

Monitoring

Gebruik PowerShell-script vm-automatic-updates-enabled.ps1 (functie Invoke-Monitoring) – Controleren.

See vm-os-updates-check control.

Compliance en Auditing

  1. BIO 12.06
  2. ISO 27001:2022 A.8.8

Remediatie

Gebruik PowerShell-script vm-automatic-updates-enabled.ps1 (functie Invoke-Remediation) – Herstellen.

Compliance & Frameworks

Automation

Gebruik het onderstaande PowerShell script om deze security control te monitoren en te implementeren. Het script bevat functies voor zowel monitoring (-Monitoring) als remediation (-Remediation).

PowerShell
<# ================================================================================ AZURE POWERSHELL SCRIPT - Nederlandse Baseline voor Veilige Cloud ================================================================================ .SYNOPSIS VM Automatic Updates Enabled .DESCRIPTION CIS Azure Foundations Benchmark - Control 7.2 Controleert of automatische updates zijn ingeschakeld op VMs. .NOTES Filename: vm-automatic-updates-enabled.ps1 Author: Nederlandse Baseline voor Veilige Cloud Version: 1.0 CIS Control: 7.2 #> #Requires -Version 5.1 #Requires -Modules Az.Accounts, Az.Compute [CmdletBinding()] param([Parameter()][switch]$Monitoring) $ErrorActionPreference = 'Stop' $PolicyName = "VM Automatic Updates Enabled" function Connect-RequiredServices { if (-not (Get-AzContext)) { Connect-AzAccount | Out-Null } } function Test-Compliance { $vms = Get-AzVM -ErrorAction SilentlyContinue $result = @{ TotalVMs = $vms.Count; WindowsVMs = 0; AutoUpdateEnabled = 0 } foreach ($vm in $vms) { if ($vm.StorageProfile.OsDisk.OsType -eq 'Windows') { $result.WindowsVMs++ if ($vm.OSProfile.WindowsConfiguration.EnableAutomaticUpdates) { $result.AutoUpdateEnabled++ } } } return $result } try { Connect-RequiredServices if ($Monitoring) { $r = Test-Compliance Write-Host "`n========================================" -ForegroundColor Cyan Write-Host "$PolicyName" -ForegroundColor Cyan Write-Host "========================================" -ForegroundColor Cyan Write-Host "Windows VMs: $($r.WindowsVMs)" -ForegroundColor White Write-Host "Auto-Update Enabled: $($r.AutoUpdateEnabled)" -ForegroundColor $(if ($r.AutoUpdateEnabled -eq $r.WindowsVMs) { 'Green' } else { 'Yellow' }) } else { $r = Test-Compliance Write-Host "`nAuto-Updates: $($r.AutoUpdateEnabled)/$($r.WindowsVMs) Windows VMs" } } catch { Write-Error $_; exit 1 } # ================================================================================ # Standaard Invoke-* Functions (Auto-generated) # ================================================================================ function Invoke-Implementation { <# .SYNOPSIS Implementeert de configuratie #> [CmdletBinding()] param() Invoke-Remediation } function Invoke-Monitoring { <# .SYNOPSIS Controleert de huidige configuratie status #> [CmdletBinding()] param() $Monitoring = $true try { Connect-RequiredServices if ($Monitoring) { $r = Test-Compliance Write-Host "`n========================================" -ForegroundColor Cyan Write-Host "$PolicyName" -ForegroundColor Cyan Write-Host "========================================" -ForegroundColor Cyan Write-Host "Windows VMs: $($r.WindowsVMs)" -ForegroundColor White Write-Host "Auto-Update Enabled: $($r.AutoUpdateEnabled)" -ForegroundColor $(if ($r.AutoUpdateEnabled -eq $r.WindowsVMs) { 'Green' } else { 'Yellow' }) } else { $r = Test-Compliance Write-Host "`nAuto-Updates: $($r.AutoUpdateEnabled)/$($r.WindowsVMs) Windows VMs" } } catch { Write-Error $_; exit 1 } } function Invoke-Remediation { <# .SYNOPSIS Herstelt de configuratie naar de gewenste staat .DESCRIPTION Dit is een monitoring-only control, remediation delegeert naar monitoring #> [CmdletBinding()] param() Write-Host "[INFO] Dit is een monitoring-only control" -ForegroundColor Yellow Write-Host "[INFO] Running monitoring check..." -ForegroundColor Cyan Invoke-Monitoring }

Risico zonder implementatie

Risico zonder implementatie
Critical: Missing patches = exploitation window (WannaCry, BlueKeep, PrintNightmare). 60 procent breaches exploit known vulnerabilities met available patches. Time-to-patch critical. Compliance: CIS 7.2, BIO 9.04, NIS2. Het risico is KRITIEK - patch management.

Management Samenvatting

VM Automatic Updates: Azure Update Manager automatic patching (Windows Update + Linux package managers). Schedule maintenance windows. Critical patches auto-deployed. Activatie: Update Manager β†’ Enable automatic updates. Gratis (Update Manager included). Verplicht CIS 7.2, BIO 9.04, NIS2. Implementatie: 3-5 uur. CRITICAL vulnerability management.