TMA-IIS-4.8
Ensure Handler is not granted Write and Script/Execute
Description
Handler mappings can be configured to give permissions to Read, Write, Script, or Execute depending on what the use is for - reading static content, uploading files, executing scripts, etc. It is recommended to grant a handler either Execute/Script or Write permissions, but not both. The server-level handlers accessPolicy must not contain Write together with Script or Execute. PowerShell 5.1 with the WebAdministration module; run elevated. CIS marks this recommendation Manual; the automated check implements its audit procedure.
Méthode de vérification
Méthode d'audit: Commande shell
Import-Module WebAdministration -ErrorAction Stop; $p = [string](Get-WebConfiguration -Filter 'system.webServer/handlers' -PSPath 'MACHINE/WEBROOT/APPHOST').accessPolicy; if ($p -match 'Write' -and $p -match 'Script|Execute') { 'noncompliant' } else { 'compliant' }- Sortie attendue
compliant
Méthode de correction
Méthode de correction: Recommandation ou correctif d'infrastructure
Set-WebConfigurationProperty -PSPath 'MACHINE/WEBROOT/APPHOST' -Filter system.webServer/handlers -Name accessPolicy -Value 'Read,Script'
Propriétés
- Systèmes d'exploitation
- Tous
- Étiquettes
- iisrequest-filtering
- Référence
- CIS Microsoft IIS 10 Benchmark v1.2.1 - 4.8 Ensure Handler is not granted Write and Script/Execute
Vérifier cet hôte
Exécutez cette commande sur une machine que vous êtes autorisé à auditer. L'analyse est en lecture seule.
tmaegis scan --target iis