πΌ Management Samenvatting
retentiebeleid voor SharePoint sites ensures documents retained per legal requirements.
Aanbeveling
IMPLEMENT
Risico zonder
Medium
Risk Score
5/10
Implementatie
4u (tech: 2u)
Van toepassing op:
β M365
β SharePoint
β SharePoint
Zonder retention: documents deleted prematurely, compliance schendingen, e-discovery gaps.
PowerShell Modules Vereist
Primary API: Security & Compliance PowerShell
Connection:
Required Modules: ExchangeOnlineManagement
Connection:
Connect-IPPSSessionRequired Modules: ExchangeOnlineManagement
Implementatie
retentiebeleid: SharePoint sites, 7 years retention. voorkomt premature deletion.
- Security.microsoft.com β retentiebeleid
- Maak aan policy: SharePoint sites + OneDrive
- Retention: 7 years
- Apply to alle sites
Vereisten
M365 E3/E5
Implementatie
- Security.microsoft.com β retentiebeleid
- Maak aan policy: SharePoint sites + OneDrive
- Retention: 7 years
- Apply to alle sites
Compliance en Auditing
- BIO 18.01
- ISO 27001 A.18.1.3
- AVG Artikel 5
Monitoring
Gebruik PowerShell-script retention-sharepoint.ps1 (functie Invoke-Monitoring) β Controleren.
Remediatie
Gebruik PowerShell-script retention-sharepoint.ps1 (functie Invoke-Remediation) β Herstellen.
Compliance & Frameworks
- BIO: 18.01 - Records retention
- ISO 27001:2022: A.18.1.3 - bescherming of records
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
Retention Policy SharePoint 7 Jaar
.NOTES
Author: Nederlandse Baseline voor Veilige Cloud
Version: 2.0
#>
#Requires -Version 5.1
#Requires -Modules ExchangeOnlineManagement
[CmdletBinding()]
param([Parameter()][switch]$Monitoring, [Parameter()][switch]$Remediation, [Parameter()][switch]$Revert,
[switch]$WhatIf)
$ErrorActionPreference = 'Stop'
Write-Host "`n========================================`nRetention Policy SharePoint 7 Jaar`n========================================`n" -ForegroundColor Cyan
$script:RetentionDays = 2555; $script:RetentionYears = 7
function Invoke-Monitoring {
try {
Write-Host "Monitoring:" -ForegroundColor Yellow
Connect-IPPSSession -ShowBanner:$false -ErrorAction Stop
$policies = Get-RetentionCompliancePolicy -ErrorAction Stop | Where-Object { $_.SharePointLocation -ne $null -and $_.SharePointLocation.Count -gt 0 }
$result = @{isCompliant = $false; totalPolicies = $policies.Count; compliantPolicies = 0 }
if ($policies.Count -eq 0) { Write-Host " No SharePoint policies" -ForegroundColor Red }
else { foreach ($policy in $policies) { $rules = Get-RetentionComplianceRule -Policy $policy.Name -ErrorAction SilentlyContinue; $maxDays = 0; foreach ($rule in $rules) { if ($rule.RetentionDuration) { $days = [int]$rule.RetentionDuration; if ($days -gt $maxDays) { $maxDays = $days }; if ($days -ge $script:RetentionDays -and $policy.Enabled) { $result.compliantPolicies++; $result.isCompliant = $true } } }; Write-Host " $($policy.Name): $maxDays days" -ForegroundColor $(if ($maxDays -ge $script:RetentionDays) { "Green" }else { "Yellow" }) } }
Write-Host "`n Total: $($result.totalPolicies) | Compliant: $($result.compliantPolicies)" -ForegroundColor Cyan
if ($result.isCompliant) { Write-Host "`nCOMPLIANT" -ForegroundColor Green; exit 0 }else { Write-Host "`nNON-COMPLIANT" -ForegroundColor Red; exit 1 }
}
catch { Write-Host "ERROR: $_" -ForegroundColor Red; exit 2 }
}
function Invoke-Remediation {
try {
Connect-IPPSSession -ShowBanner:$false -ErrorAction Stop
$policyName = "SharePoint $script:RetentionYears Year Retention"
$policy = New-RetentionCompliancePolicy -Name $policyName -Comment "NL Baseline - $script:RetentionYears year SharePoint retention" -SharePointLocation All -Enabled $true -ErrorAction Stop
$rule = New-RetentionComplianceRule -Name "$policyName - Rule" -Policy $policyName -RetentionDuration $script:RetentionDays -RetentionComplianceAction Keep -ErrorAction Stop
Write-Host "Policy created" -ForegroundColor Green; exit 0
}
catch { Write-Host "ERROR: $_" -ForegroundColor Red; exit 2 }
}
function Invoke-Revert {
try { Connect-IPPSSession -ShowBanner:$false -ErrorAction Stop; $policyName = "SharePoint $script:RetentionYears Year Retention"; $policy = Get-RetentionCompliancePolicy -Identity $policyName -ErrorAction SilentlyContinue; if ($policy) { Remove-RetentionCompliancePolicy -Identity $policyName -Confirm:$false -ErrorAction Stop; Write-Host "Policy removed" -ForegroundColor Yellow }; exit 0 }catch { Write-Host "ERROR: $_" -ForegroundColor Red; exit 2 }
}
try { if ($Revert) { Invoke-Revert }elseif ($Monitoring) { Invoke-Monitoring }elseif ($Remediation) { Invoke-Remediation }else { Write-Host "Use: -Monitoring | -Remediation | -Revert" -ForegroundColor Yellow } }catch { throw }finally { Write-Host "`n========================================`n" -ForegroundColor Cyan }
Risico zonder implementatie
Risico zonder implementatie
Medium: Medium - SharePoint documents deleted prematurely. compliance schendingen.
Management Samenvatting
retentiebeleid: SharePoint 7 years. Voldoet aan BIO 18.01, AVG 5. Setup: 2u.
- Implementatietijd: 4 uur
- FTE required: 0.03 FTE