TMAegis
Thêm quy tắc cho iis

TMA-IIS-4.7

Ensure Unlisted File Extensions are not allowed

Trung bìnhCấp 1Tự độngiis

Mô tả

The FileExtensions Request Filter allows administrators to define specific extensions their web server(s) will allow and disallow. The property allowUnlisted will cover all other file extensions not explicitly allowed or denied. Often times, extensions such as .config, .bat, .exe, to name a few, should never be served. The AllowExtensions and DenyExtensions options are the UrlScan equivalents. requestFiltering fileExtensions allowUnlisted must be false at server level (then allow only required extensions). PowerShell 5.1 with the WebAdministration module; run elevated.

Cách kiểm tra

Phương pháp kiểm tra: Lệnh shell

shell
Import-Module WebAdministration -ErrorAction Stop; $c = Get-WebConfiguration -Filter 'system.webServer/security/requestFiltering/fileExtensions' -PSPath 'MACHINE/WEBROOT/APPHOST'; if ($c.allowUnlisted -eq $false) { 'compliant' } else { 'noncompliant' }
Đầu ra mong đợi
compliant

Cách khắc phục

Phương pháp khắc phục: Hướng dẫn hoặc bản vá hạ tầng

Set-WebConfigurationProperty -PSPath 'MACHINE/WEBROOT/APPHOST' -Filter system.webServer/security/requestFiltering/fileExtensions -Name allowUnlisted -Value False (after adding <add fileExtension='.aspx' allowed='true'/> etc. for required types)

Thuộc tính

Hệ điều hành
Bất kỳ
Thẻ
iisrequest-filtering
Tham chiếu
CIS Microsoft IIS 10 Benchmark v1.2.1 - 4.7 Ensure Unlisted File Extensions are not allowed

Kiểm tra máy này

Chạy lệnh này trên máy bạn được phép kiểm tra. Lần quét chỉ ở chế độ đọc.

shell
tmaegis scan --target iis