SharePoint & OneDrive: Download Van Geïnfecteerde Bestanden Blokkeren

💼 Management Samenvatting

Het blokkeren van geïnfecteerde bestanden in SharePoint Online en OneDrive for Business voorkomt dat gebruikers malware kunnen downloaden die door Microsoft Defender for Office 365 is gedetecteerd. Deze maatregel stopt malware-verspreiding via file sharing en beschermt gebruikers tegen malicious file downloads.

Aanbeveling
IMPLEMENT
Risico zonder
High
Risk Score
7/10
Implementatie
1u (tech: 0.5u)
Van toepassing op:
M365
SharePoint
OneDrive

SharePoint Online en OneDrive for Business worden frequent gebruikt voor het delen van bestanden tussen medewerkers, met externe partners, en voor collaboration. Malware kan op verschillende manieren in deze platforms terechtkomen: gebruikers uploaden per ongeluk geïnfecteerde bestanden vanaf hun eigen apparaten, external partners sturen malicious attachments via SharePoint sharing, phishing-aanvallen waarbij aanvallers malware uploaden naar gecompromitteerde accounts, en supply chain attacks waarbij trusted third-party leveranciers gecompromitteerde bestanden delen. Zonder download-blocking kunnen geïnfecteerde bestanden vrij worden gedownload door gebruikers, wat leidt tot malware-infecties op hun apparaten, lateral spreading van malware binnen de organisatie via file sharing, ransomware-deployment waarbij één geïnfecteerde download kan escaleren naar organization-wide ransomware encryption, en data exfiltratie waarbij malware credentials steelt of gevoelige bestanden uploadt naar attacker-controlled servers. Microsoft Defender for Office 365 Safe Attachments for SharePoint, OneDrive and Teams scant automatisch alle uploaded files op malware via real-time malware detection engines, maar zonder download-blocking kunnen gebruikers geïnfecteerde files nog steeds downloaden nadat ze zijn gedetecteerd. Het blokkeren van infected file downloads voorkomt dat malware zich verspreidt door download-functionaliteit volledig uit te schakelen voor files die als malicious zijn geclassificeerd, gebruikers te waarschuwen dat het bestand malware bevat en niet kan worden gedownload, en file owners te notificeren dat hun uploaded file malware bevat zodat ze het kunnen verwijderen of vervangen door een clean version. Dit is essentieel voor compliance met ISO 27001 controle A.8.7 voor malware protection en BIO richtlijn 12.02 voor bescherming tegen malware.

PowerShell Modules Vereist
Primary API: SharePoint Online PowerShell
Connection: Connect-SPOService
Required Modules: Microsoft.Online.SharePoint.PowerShell

Implementatie

Deze maatregel configureert de SharePoint Online tenant-setting DisallowInfectedFileDownload op true, waardoor download van geïnfecteerde bestanden volledig wordt geblokkeerd. De implementatie vereist dat Microsoft Defender for Office 365 Plan 1 of Plan 2 is geactiveerd en dat Safe Attachments for SharePoint, OneDrive and Teams is ingeschakeld (deze feature scant automatisch alle uploads op malware). De configuratie gebeurt via SharePoint Online PowerShell met het Set-SPOTenant -DisallowInfectedFileDownload $true commando, gevolgd door verificatie met Get-SPOTenant | Select DisallowInfectedFileDownload om te bevestigen dat de setting op True staat. Na activering wordt elk bestand dat door Defender for Office 365 als malware wordt gedetecteerd automatisch voorzien van een download-block: gebruikers die het bestand proberen te downloaden krijgen een error message dat het bestand potentieel gevaarlijk is en niet kan worden gedownload, het bestand blijft zichtbaar in SharePoint/OneDrive maar download-functionaliteit is disabled, en de file owner krijgt een notification dat hun bestand als malware is gedetecteerd met instructies om het te verwijderen. Deze blocking voorkomt effectief malware-spreading via file sharing binnen de organisatie. De implementatie is extreem eenvoudig en kost slechts 30 minuten technisch werk, vereist geen user training omdat de feature transparant werkt, en heeft geen negatieve impact op legitimate file operations (alleen daadwerkelijk infected files worden geblokkeerd). De kosten zijn inclusief in Defender for Office 365 licensing zonder additional charges. Deze maatregel is een must-have voor alle M365-tenants met Defender for Office 365 en voldoet aan CIS Microsoft 365 Foundations control 3.1.4 Level 1 en ISO 27001 controle A.8.7 voor protection tegen malware.

Vereisten

  1. Defender voor Office 365 P1/P2
  2. SharePoint Administrator

Implementatie

  1. Set-SPOTenant -DisallowInfectedFileDownload $true
  2. Verify: Get-SPOTenant | Select DisallowInfectedFileDownload
  3. Safe Attachments voor SharePoint moet be ingeschakeld

Compliance en Auditing

  1. CIS M365 - control 3.1.4
  2. BIO 12.02
  3. ISO 27001 A.8.7

Monitoring

Gebruik PowerShell-script infected-files-download-blocked.ps1 (functie Invoke-Monitoring) – Controleren.

Remediatie

Gebruik PowerShell-script infected-files-download-blocked.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
<# .SYNOPSIS Infected Files Download Blocked .DESCRIPTION Blocks download of files detected as infected by antivirus .NOTES NL Baseline v2.0 #> #Requires -Version 5.1 #Requires -Modules Microsoft.Graph [CmdletBinding()] param([switch]$Monitoring) $ErrorActionPreference = 'Stop' Write-Host "`n========================================" -ForegroundColor Cyan Write-Host "Infected Files Download Blocked" -ForegroundColor Cyan Write-Host "========================================`n" -ForegroundColor Cyan function Invoke-Monitoring { try { Connect-MgGraph -Scopes "Domain.Read.All" -NoWelcome -ErrorAction Stop $domain = (Get-MgDomain | Where-Object { $_.IsDefault }).Id $tenantName = $domain.Split('.')[0] Connect-SPOService -Url "https://$tenantName-admin.sharepoint.com" -ErrorAction Stop $tenant = Get-SPOTenant $result = @{ isCompliant = $tenant.DisallowInfectedFileDownload blocked = $tenant.DisallowInfectedFileDownload } Write-Host " Infected File Download: $(if($result.blocked){'BLOCKED'}else{'ALLOWED'})" -ForegroundColor $( if ($result.blocked) { 'Green' }else { 'Red' } ) Write-Host "`n Security Benefits:" -ForegroundColor Cyan Write-Host " • Prevents malware distribution" -ForegroundColor Gray Write-Host " • Protects against infected files" -ForegroundColor Gray Write-Host " • Reduces security risks" -ForegroundColor Gray Write-Host " • Maintains data integrity" -ForegroundColor Gray if ($result.isCompliant) { Write-Host "`n[OK] COMPLIANT - Infected file download blocked" -ForegroundColor Green exit 0 } else { Write-Host "`n[FAIL] NON-COMPLIANT - Infected file download allowed!" -ForegroundColor Red exit 1 } } catch { Write-Host "ERROR: $_" -ForegroundColor Red exit 2 } } try { if ($Monitoring) { Invoke-Monitoring } else { Write-Host "Use: -Monitoring" -ForegroundColor Yellow } } catch { throw } finally { Write-Host "`n========================================`n" -ForegroundColor Cyan } 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
High: High - Malware in SharePoint kan zijn downloaded/spread.

Management Samenvatting

Blokkeer infected file downloads. vereist Defender voor Office 365. Voldoet aan CIS 3.1.4 L1. Setup: 30 min.