Windows Server web server hardening checklist for IIS 10

A practical Windows Server web server hardening checklist for IIS 10 on Server 2019, 2022 and 2025: headers, TLS, request filtering, least privilege, updates and RDP.

Cover image: Windows Server web server hardening checklist for IIS 10

Key takeaways

  • Remove the Server and X-Powered-By headers, add nosniff and a Referrer-Policy, and turn off directory browsing at the server level.
  • Turn off SSL 3.0, TLS 1.0 and 1.1 and weak ciphers in SCHANNEL, then restart; keep TLS 1.2 and 1.3.
  • Give every site its own application pool identity and grant NTFS rights to that identity only.
  • Never leave RDP open to the whole Internet: restrict it by IP in Windows Firewall and require NLA.

A Windows Server web server hardening checklist comes down to six areas: response headers, TLS settings, request filtering, least privilege for each site, regular updates, and how exposed RDP is. Each item below has a PowerShell command you can run on Windows Server 2019, 2022 or 2025 with IIS 10. Work through them on a test server first, because a few of them (TLS changes in particular) need a restart and can break old clients.

Run every command in PowerShell as Administrator. The IIS commands use the WebAdministration module, which is installed with the IIS management tools.

Import-Module WebAdministration

1. Response headers

By default IIS tells every visitor which server it is (Server: Microsoft-IIS/10.0) and ASP.NET adds X-Powered-By: ASP.NET. Neither helps your visitors, and both help someone looking for known flaws.

$apphost = 'MACHINE/WEBROOT/APPHOST'

# Remove the Server header (IIS 10, version 1709 and later)
Set-WebConfigurationProperty -PSPath $apphost `
  -Filter 'system.webServer/security/requestFiltering' -Name removeServerHeader -Value $true

# Remove X-Powered-By
Remove-WebConfigurationProperty -PSPath $apphost `
  -Filter 'system.webServer/httpProtocol/customHeaders' -Name '.' -AtElement @{name='X-Powered-By'}

# Add two safe headers for every site
Add-WebConfigurationProperty -PSPath $apphost `
  -Filter 'system.webServer/httpProtocol/customHeaders' -Name '.' `
  -Value @{name='X-Content-Type-Options'; value='nosniff'}
Add-WebConfigurationProperty -PSPath $apphost `
  -Filter 'system.webServer/httpProtocol/customHeaders' -Name '.' `
  -Value @{name='Referrer-Policy'; value='strict-origin-when-cross-origin'}

One catch: if a site's own web.config adds the same header, IIS reports a duplicate entry for that site. Check the sites you host before you set headers at the server level.

Headers such as Content-Security-Policy and Strict-Transport-Security depend on each application, so set them per site. IIS 10 has built-in HSTS per site:

$site = "system.applicationHost/sites/site[@name='example.com']/hsts"
Set-WebConfigurationProperty -PSPath $apphost -Filter $site -Name enabled -Value $true
Set-WebConfigurationProperty -PSPath $apphost -Filter $site -Name max-age -Value 31536000

Only turn on HSTS once the site has a working certificate and you know every subdomain you include serves HTTPS.

2. TLS protocols and ciphers

SCHANNEL, not IIS, decides which TLS versions and ciphers the server accepts. Turn off SSL 2.0, SSL 3.0, TLS 1.0 and TLS 1.1 on the server side and keep TLS 1.2 (and TLS 1.3 on Server 2022 and 2025; Server 2019 has no TLS 1.3 in IIS).

$base = 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols'
foreach ($p in 'SSL 2.0','SSL 3.0','TLS 1.0','TLS 1.1') {
  $key = "$base\$p\Server"
  New-Item -Path $key -Force | Out-Null
  New-ItemProperty -Path $key -Name Enabled -Value 0 -PropertyType DWord -Force | Out-Null
  New-ItemProperty -Path $key -Name DisabledByDefault -Value 1 -PropertyType DWord -Force | Out-Null
}

Then look at the cipher suites and remove weak ones (anything with RC4, DES, 3DES or NULL):

Get-TlsCipherSuite | Format-Table Name
Disable-TlsCipherSuite -Name 'TLS_RSA_WITH_3DES_EDE_CBC_SHA'

Restart the server for SCHANNEL changes to take effect, then test from outside with a TLS scanner. Very old clients (Windows 7 without updates, old Android, some payment terminals) will stop connecting, which is usually the point but worth knowing first.

3. Request filtering

Request filtering rejects requests before they reach your application. Start with three settings:

# Turn off directory listings for every site
Set-WebConfigurationProperty -PSPath $apphost -Filter 'system.webServer/directoryBrowse' -Name enabled -Value $false

# Refuse common leftovers by extension
foreach ($ext in '.bak','.sql','.log','.old') {
  Add-WebConfigurationProperty -PSPath $apphost `
    -Filter 'system.webServer/security/requestFiltering/fileExtensions' -Name '.' `
    -Value @{fileExtension=$ext; allowed=$false}
}

# Hide folders that should never be served
Add-WebConfigurationProperty -PSPath $apphost `
  -Filter 'system.webServer/security/requestFiltering/hiddenSegments' -Name '.' -Value @{segment='.git'}

The default maximum request body is about 30 MB (maxAllowedContentLength = 30000000 bytes). Lower it for sites that never take uploads and raise it only on the sites that need it, in their own web.config.

Request filtering is not a web application firewall. It blocks by extension, path, verb and size, not by attack pattern.

4. Least privilege for every site

The most important hardening step on a shared web server is that one compromised site cannot read another. In IIS that means:

  • One application pool per site, running as its own ApplicationPoolIdentity.
  • NTFS rights on the site folder for that identity only, read-only unless the application must write.
  • No site folders readable by Users, Everyone or IIS_IUSRS broadly.
New-WebAppPool -Name 'example.com'
Set-ItemProperty IIS:\AppPools\example.com -Name processModel.identityType -Value ApplicationPoolIdentity

icacls 'D:\sites\example.com' /inheritance:r /grant:r 'Administrators:(OI)(CI)F' 'SYSTEM:(OI)(CI)F' 'IIS AppPool\example.com:(OI)(CI)RX'
icacls 'D:\sites\example.com\uploads' /grant 'IIS AppPool\example.com:(OI)(CI)M'

Databases should listen on loopback unless a customer really needs remote access, and each database should have its own login. Services you do not use (SMBv1, Print Spooler on a web server, the Guest account) should be off:

Disable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol -NoRestart
Get-LocalUser Guest | Disable-LocalUser

5. Updates

Unpatched software is still the most common way in. Install the monthly cumulative update, and keep PHP, .NET, URL Rewrite and your applications (WordPress and its plugins especially) current. Check when the server was last patched:

Get-HotFix | Sort-Object InstalledOn -Descending | Select-Object -First 5 HotFixID, InstalledOn

Patching a web server without surprising your customers is its own topic; see Windows updates on web servers without downtime.

6. RDP exposure

RDP open to the whole Internet gets password guesses within minutes. In order of value:

  1. Restrict RDP in Windows Firewall to your office or VPN addresses.
  2. Require Network Level Authentication.
  3. Set an account lockout policy.
  4. Use long, unique passwords and avoid obvious account names.
Get-NetFirewallRule -DisplayGroup 'Remote Desktop' | Set-NetFirewallRule -RemoteAddress 203.0.113.10, 198.51.100.0/24
Set-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -Name UserAuthentication -Value 1
net accounts /lockoutthreshold:10 /lockoutwindow:15 /lockoutduration:15

The display group name is in English on English installs. Make sure you still have a way in (your VPS provider's console) before you narrow the firewall rule. More on this in how to protect Windows Server from brute force attacks.

The Windows Server web server hardening checklist in one place

  • Server and X-Powered-By headers removed; nosniff and Referrer-Policy added.
  • HSTS per site once HTTPS works.
  • SSL 2.0/3.0 and TLS 1.0/1.1 off on the server side; weak ciphers removed; restarted.
  • Directory browsing off; risky extensions and .git refused.
  • One application pool and one identity per site; NTFS rights for that identity only.
  • Databases on loopback, one login each; SMBv1 and Guest off.
  • Monthly updates installed; runtimes and applications current.
  • RDP limited by IP, NLA on, account lockout set.

FAQ

Do I need a restart after changing TLS settings?

Yes. SCHANNEL reads its protocol and cipher settings at boot, so restart the server after changing them.

Is removing the Server header real security?

It is a small step. It does not fix any flaw, but it stops your server from advertising its version to automated scanners.

Does request filtering replace a WAF?

No. It blocks by extension, path, verb and size. A WAF looks at request content for attack patterns, such as SQL injection.

Can I apply these settings per site instead of server-wide?

Most of them, yes, in the site's web.config. TLS protocols and ciphers are server-wide only.

How Zopanel handles it

Zopanel for Windows has a Security Center that scores each server and offers one-click fixes with a preview and an undo: Windows Firewall (it keeps RDP, SSH and the panel port open), SMBv1, legacy TLS and weak ciphers, the Guest account, account lockout and the IIS headers above. It does not turn off Microsoft Defender. Every site gets its own application pool identity with folder rights for that identity only. A per-site WAF (Coraza with the OWASP Core Rule Set) is available with limited status. See the security documentation and the security feature page. The Free plan covers 1 server and 10 websites; download the signed MSI to try it.