Dit regelen Configureerert block bij first sight via Microsoft Intune apparaat configuratie beleid of compliance policies om Windows endpoints te beveiligen volgens security best practices.
Vereisten
Microsoft Intune via device configuratiebeleidsregels
Implementeeratie
Gebruik PowerShell-script block-at-first-sight.ps1 (functie Invoke-Monitoring) β Monitoren.
monitoring
Gebruik PowerShell-script block-at-first-sight.ps1 (functie Invoke-Monitoring) β Controleren.
Remediatie
Gebruik PowerShell-script block-at-first-sight.ps1 (functie Invoke-Remediation) β Herstellen.
Compliance en Auditing
Beleid documentatie
Compliance & Frameworks
CIS M365: Control 18.9.19.2 (L1) - CIS Security Benchmark aanbevelingen
BIO: 16.01 - BIO Baseline Informatiebeveiliging Overheid - 16.01 - Gebeurtenissen logging en audittrails
ISO 27001:2022: A.12.4.1 - ISO 27001:2022 - Gebeurtenissen logging en audittrails
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
<#
.SYNOPSIS
Intune Windows Defender: Block At First Sight
.DESCRIPTION
CIS - Block at first sight voor zero-day protection.
.NOTES
Filename: defender-block-first-sight.ps1|Author: Nederlandse Baseline voor Veilige Cloud|Setting: DisableBlockAtFirstSeen|Expected: False
#>#Requires -Version 5.1#Requires -RunAsAdministrator
[CmdletBinding()]param([switch]$WhatIf, [switch]$Monitoring, [switch]$Remediation, [switch]$Revert)
$ErrorActionPreference = 'Stop'
function Connect-RequiredServices { $p = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent()); return$p.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) }
functionTest-Compliance {
$r = [PSCustomObject]@{ScriptName = "defender-block-first-sight.ps1"; PolicyName = "Defender Block First Sight"; IsCompliant = $false; CurrentValue = $null; Details = @() }; function Invoke-Revert { Set-MpPreference -DisableBlockAtFirstSeen $true }
try { $pref = Get-MpPreference; if ($pref.DisableBlockAtFirstSeen -eq $false) { $r.IsCompliant = $true; $r.Details += "Block at first sight enabled" }else { $r.Details += "Block at first sight disabled" } }catch { $r.Details += "Error: $($_.Exception.Message)" }; return$r
}
function Invoke-Remediation { Set-MpPreference -DisableBlockAtFirstSeen $false; Write-Host "Block at first sight enabled" -ForegroundColor Green }
function Invoke-Monitoring { $r = Test-Compliance; Write-Host "`n$($r.PolicyName): $(if($r.IsCompliant){'COMPLIANT'}else{'NON-COMPLIANT'})" -ForegroundColor $(if ($r.IsCompliant) { 'Green' }else { 'Red' }); return$r }
function Invoke-Revert { Set-MpPreference -DisableBlockAtFirstSeen $true }
try { if (-not(Connect-RequiredServices)) { exit 1 }; if ($Monitoring) { $r = Invoke-Monitoring; exit $(if ($r.IsCompliant) { 0 }else { 1 }) }elseif ($Remediation) { if (-not $WhatIf) { Invoke-Remediation } }elseif ($Revert) { Invoke-Revert }else { $r = Test-Compliance; exit $(if ($r.IsCompliant) { 0 }else { 1 }) } }catch { Write-Error$_; exit 1 }