TMAegis
Više pravila za iis

TMA-IIS-3.11

Ensure X-Powered-By Header is removed

NiskaNivo 2Automatskaiis

Opis

The x-powered-by headers specify the underlying technology used by the webserver. No X-Powered-By custom header may be configured at server level or for any site. PowerShell 5.1 with the WebAdministration module; run elevated. CIS marks this recommendation Manual; the automated check implements its audit procedure.

Kako se proverava

Metod provere: Komanda ljuske

shell
Import-Module WebAdministration -ErrorAction Stop; $paths = @('MACHINE/WEBROOT/APPHOST') + @(Get-Website | ForEach-Object { "IIS:\Sites\$($_.Name)" }); $bad = @($paths | Where-Object { @(Get-WebConfiguration -Filter 'system.webServer/httpProtocol/customHeaders/add' -PSPath $_ | Where-Object { $_.name -eq 'X-Powered-By' }).Count -gt 0 }); if ($bad.Count -eq 0) { 'compliant' } else { 'noncompliant' }
Očekivani izlaz
compliant

Kako se ispravlja

Metod ispravke: Smernica ili zakrpa infrastrukture

Remove-WebConfigurationProperty -PSPath 'MACHINE/WEBROOT/APPHOST' -Filter system.webServer/httpProtocol/customHeaders -Name . -AtElement @{name='X-Powered-By'}

Svojstva

Operativni sistemi
Bilo koji
Oznake
iisinformation-disclosure
Referenca
CIS Microsoft IIS 10 Benchmark v1.2.1 - 3.11 Ensure X-Powered-By Header is removed

Proverite ovaj računar

Pokrenite ovo na računaru za koji imate dozvolu za proveru. Skeniranje radi u režimu samo za čitanje.

shell
tmaegis scan --target iis --level 2