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
Azure VMs
Update Manager
Monitoring
Gebruik PowerShell-script vm-automatic-updates-enabled.ps1 (functie Invoke-Monitoring) β Controleren.
See vm-os-updates-check control.
Compliance en Auditing
BIO 12.06
ISO 27001:2022 A.8.8
Remediatie
Gebruik PowerShell-script vm-automatic-updates-enabled.ps1 (functie Invoke-Remediation) β Herstellen.
Compliance & Frameworks
BIO: 12.06 - Patch management
ISO 27001:2022: A.8.8 - kwetsbaarheidsbeheer
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 } }
functionTest-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-ComplianceWrite-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-ComplianceWrite-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 = $truetry {
Connect-RequiredServices
if ($Monitoring) {
$r = Test-ComplianceWrite-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-ComplianceWrite-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.