IIS Binding and SAN Monitoring
Section titled “ IIS Binding and SAN Monitoring”Comprehensive IIS monitoring of IIS HTTPS bindings and Subject Alternative Names (SANs) to detect orphaned bindings, hostname mismatches, wildcard certificates, and multi-level wildcard security risks.
New 6.4.x Introduced IIS certificate binding monitoring with wildcard support and SAN parsing, including multi-level wildcard detection.
For the latest configuration and operational behavior, see IIS - Binding.
The Problem: When IIS Bindings and Certificates Go Out of Sync
Section titled “ The Problem: When IIS Bindings and Certificates Go Out of Sync”Scenario: E-Commerce Site Outage After Certificate Renewal
Section titled “Scenario: E-Commerce Site Outage After Certificate Renewal”A financial services company renewed their wildcard SSL certificate for *.payments.example.com covering their payment gateway. The new certificate was successfully installed in the Windows certificate store and validated. However, the IIS binding for the main payment site (secure.payments.example.com:443) was not updated to reference the new certificate thumbprint.
Monday 9:00 AM - Production Outage:
- Old certificate expires at midnight Sunday
- IIS binding still references expired certificate thumbprint
- All payment transactions fail with SSL/TLS handshake errors
- Customers cannot complete purchases or access account information
- Call center flooded with complaints
Business Impact:
- $420,000 in lost revenue (4.5 hours × $93K/hour average transaction volume)
- 1,200+ failed payment attempts during outage window
- 67 customer escalations to executive support
- PCI DSS compliance violation triggered due to expired certificate in production
- Regulatory reporting required to payment card processors
Root Cause: Certificate was renewed in certificate store, but IIS binding was not updated to point to new certificate. IIS continued serving expired certificate, causing complete service outage. Orphaned binding detection would have prevented this by alerting that binding referenced a certificate nearing expiration while a newer valid certificate existed.
Additional Common Scenarios:
- Orphaned Bindings: Certificate deleted from store during cleanup, but IIS binding still references the deleted thumbprint (binding breaks silently until next IIS restart)
- Hostname Mismatches: Wrong certificate assigned to binding (e.g.,
api.example.combinding uses certificate forwww.example.com- works initially but triggers browser warnings) - Multi-Level Wildcard Security Risk: Using
*.*.example.comcertificates that violate CA/Browser Forum requirements and will be rejected during next renewal - Excessive SANs: Certificate with 150+ SAN entries causing TLS handshake performance degradation and management complexity
Monitoring States Summary
Section titled “ Monitoring States Summary”Comprehensive testing scenarios covering all IIS binding and SAN monitoring states:
| # | Test Scenario | Detection Type | State | Test Script |
|---|---|---|---|---|
| 1 | Healthy Binding - Exact Match | Certificate matches hostname exactly | ✅ OK | Test |
| 2 | Healthy Binding - Wildcard Match | Wildcard certificate covers subdomain | ✅ OK | Test |
| 3 | Orphaned Binding | Certificate deleted but binding remains | ❌ ERROR | Test |
| 4 | Hostname Mismatch | Certificate doesn't match binding hostname | ❌ ERROR | Test |
| 5 | Expiring Certificate | Certificate within warning threshold | ⚠️ WARNING | Test |
| 6 | Multi-Level Wildcard | *.*.example.com security risk |
⚠️ WARNING | Test |
| 7 | Excessive SANs | Certificate with 100+ SAN entries | ⚠️ WARNING | Test |
| 8 | SNI Enabled Binding | Multiple certificates on same IP | ✅ OK | Test |
Testing Guide: See FAQ: IIS Binding and SAN Monitoring for comprehensive PowerShell test scenarios for all states.
Overview
Section titled “ Overview”IIS Binding and SAN monitoring provides four critical capabilities:
- IIS Binding Health: Monitors HTTPS bindings for hostname mismatches, orphaned bindings, and expiration
- Subject Alternative Name (SAN) Display: Parses and displays all SAN entries as badges for easy identification
- Wildcard Certificate Detection: Identifies single-level and multi-level wildcard certificates
- Excessive SAN Monitoring: Optional alerts for certificates with unusually high SAN counts
IIS Certificate Bindings
Section titled “ IIS Certificate Bindings”For the certificate category IIS Certificate Bindings, resources are named %Binding-Hostname% - IIS Site: %Site% representing HTTPS bindings in Internet Information Services.
IIS Binding States
Section titled “ IIS Binding States”A binding resource can have one of the following states:
| Icon | State | Status | Description | Actions |
|---|---|---|---|---|
| Unavailable | Service not available |
|
Review Prerequisites | |
| Error | Error state raised |
|
Manage Details |
|
| Warning | Warning state raised |
|
Manage Details |
|
| OK | Online |
|
Manage Details |
IIS Binding State Examples
Section titled “ IIS Binding State Examples”OK State - Exact Match
Section titled “OK State - Exact Match”IIS Site: WebServer|Hostname: www.example.com|Port: 443Certificate Subject: www.example.comExpiration: 2025-12-20 (31 days remaining)Match: ✅ Exact MatchSNI: EnabledState: ✅ OKOK State - Wildcard Match
Section titled “OK State - Wildcard Match”IIS Site: WebServer|Hostname: api.example.com|Port: 443Certificate Subject: *.example.comExpiration: 2025-12-20 (31 days remaining)Match: ✅ Wildcard MatchSNI: EnabledState: ✅ OKWARNING State - Expiring Certificate
Section titled “WARNING State - Expiring Certificate”IIS Site: WebServer|Hostname: www.example.com|Port: 443Certificate Subject: www.example.comExpiration: 2025-11-15 (17 days remaining, warning threshold: 30 days)Match: ✅ Exact MatchSNI: EnabledState: ⚠️ WARNING (Renew certificate)ERROR State - Hostname Mismatch
Section titled “ERROR State - Hostname Mismatch”IIS Site: APIServer|Hostname: api.example.com|Port: 443Certificate Subject: www.example.comExpiration: 2025-12-20 (31 days remaining)Match: ❌ MismatchSNI: EnabledState: ❌ ERROR (Certificate does not match binding hostname)ERROR State - Orphaned Binding
Section titled “ERROR State - Orphaned Binding”IIS Site: LegacyApp|Hostname: old.example.com|Port: 443Certificate Subject: [Certificate Not Found]Certificate Thumbprint: 1A2B3C4D5E6F7G8H9I0J...Match: ❌ Not FoundSNI: UnknownState: ❌ ERROR (Certificate no longer exists in certificate store)ERROR State - Expired Certificate
Section titled “ERROR State - Expired Certificate”IIS Site: WebServer|Hostname: www.example.com|Port: 443Certificate Subject: www.example.comExpiration: 2025-09-15 (Expired 45 days ago)Match: ✅ Exact MatchSNI: EnabledState: ❌ ERROR (Certificate has expired)IIS Binding Monitoring Features
Section titled “ IIS Binding Monitoring Features”IIS Certificate Binding monitoring provides the following capabilities:
- Opt-In Configuration: Disabled by default via
MonitorIISCertificateBindingssetting - no impact if not enabled - Graceful Degradation: Binding data shown only when IIS is available; empty results with no errors if IIS is not installed
- Wildcard Support: Correctly matches binding hostnames against wildcard certificates (e.g.,
*.example.commatchesapi.example.com) - SNI Detection: Identifies Server Name Indication (SNI) enabled bindings for multi-certificate configurations
- Hostname Mismatch Detection: Alerts when binding hostname does not match certificate subject or alternate names
- Single Category Integration: IIS binding resources integrated into existing certificate monitoring workflow without creating separate categories
Subject Alternative Names (SAN) Display
Section titled “ Subject Alternative Names (SAN) Display”All certificates display their Subject Alternative Names in the Details view with comprehensive parsing:
SAN Display Features
Section titled “SAN Display Features”- SAN Count: Total number of SAN entries displayed prominently at the top
- SAN List: All SANs shown as color-coded badges for easy scanning and identification
- Wildcard Detection: Wildcard SANs automatically highlighted with appropriate icons
- ⚠️ Excessive SAN Warning: Optional alert when SAN count exceeds configured threshold (default: 100)
Example SAN Display
Section titled “Example SAN Display”Subject Alternative Names (8)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━[www.example.com] [api.example.com] [mail.example.com] [*.example.com][app.example.com] [portal.example.com] [admin.example.com] [dev.example.com]
✅ Wildcard certificate detected: *.example.com (single-level, secure)Wildcard Certificate Detection
Section titled “ Wildcard Certificate Detection”Certificates containing wildcard domains are automatically identified and classified by security risk level:
Single-Level Wildcard (Recommended)
Section titled “Single-Level Wildcard (Recommended)”Pattern: *.example.com
Matches:
- ✅
www.example.com - ✅
api.example.com - ✅
mail.example.com
Does NOT Match:
- ❌
example.com(base domain - wildcard does not cover apex domain) - ❌
app.dev.example.com(multi-level subdomain - wildcard covers one level only)
Security Assessment: ✅ OK (industry standard best practice)
Use Cases:
- Single organization with multiple subdomains
- Standard HTTPS deployment for web applications
- Cost-effective alternative to multiple single-domain certificates
Multi-Level Wildcard (Security Risk)
Section titled “Multi-Level Wildcard (Security Risk)”Pattern: *.*.example.com
Matches:
- ⚠️
anything.anythingelse.example.com(overly permissive) - ⚠️
api.dev.example.com - ⚠️
www.staging.example.com - ⚠️
app.test.example.com
Security Concerns:
- ❌ Most certificate authorities refuse to issue multi-level wildcards (violates CA/Browser Forum Baseline Requirements)
- ❌ Overly permissive scope creates security audit violations
- ❌ Modern browsers may reject or show warnings for multi-level wildcards
- ❌ Creates ambiguous certificate selection scenarios in multi-certificate environments
- ❌ Difficult to revoke without affecting many services
Security Assessment: ⚠️ WARNING (security/best practice violation)
Alert Message:
⚠️ WARNING: Multi-level wildcard detected (*.*.example.com)
Security Risk: Multi-level wildcards are overly permissive and violate industry best practices.
Recommended Actions:1. Replace with single-level wildcard (*.example.com) for first-level subdomains2. Use specific SAN entries for known multi-level subdomains (e.g., api.dev.example.com)3. Consider separate certificates for different environments (dev, staging, prod)
Impact: Certificate authorities may refuse issuance during next renewalWildcard Best Practices
Section titled “Wildcard Best Practices”- Use Single-Level Wildcards Only:
*.example.comis industry standard and universally accepted - Combine with Specific SANs: Include apex domain
example.comas SAN entry alongside*.example.com - Separate Environments: Use different certificates for dev/staging/production environments
- Monitor Expiration: Wildcard certificates often cover many services - plan renewals carefully
- Document Usage: Maintain inventory of services using wildcard certificates for renewal planning
Excessive SAN Monitoring
Section titled “ Excessive SAN Monitoring”Certificates with unusually high SAN counts trigger optional warnings to identify potential configuration issues:
Configuration
Section titled “Configuration”| Setting | Default | Description |
|---|---|---|
| AlertOnExcessiveSANs | false |
Enable/disable excessive SAN warning (disabled by default - cosmetic warning only) |
| MaximumSANCount | 100 |
Threshold for excessive SAN alert |
Why Monitor Excessive SANs?
Section titled “Why Monitor Excessive SANs?”Excessive SANs (100+ domains) may indicate:
- Configuration Errors: Accidentally added too many domains during certificate request
- Poor Certificate Hygiene: Legacy certificates repeatedly appended to during renewals without cleanup
- Multi-Tenant Issues: Poorly managed multi-tenant certificates with all customer domains
- Performance Impact: TLS handshake performance degradation with very large SAN lists
- Management Complexity: Difficult to audit which services/domains are actually using the certificate
Example Excessive SAN Alert
Section titled “Example Excessive SAN Alert”Subject Alternative Names (127)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━[domain1.com] [domain2.com] [domain3.com] [domain4.com] [domain5.com][domain6.com] [domain7.com] [domain8.com] [domain9.com] [domain10.com]... (117 more SANs not shown)
⚠️ WARNING: Certificate has 127 SANs (threshold: 100)
Potential Issues:• Excessive SAN entries may indicate configuration errors• Large SAN lists can impact TLS handshake performance• Certificate management complexity increases with SAN count
Recommended Actions:1. Review SAN list and remove unused domains2. Consider splitting into multiple certificates by service/environment3. Verify all listed domains are actively in useConfiguration
Section titled “ Configuration”Control IIS binding and SAN monitoring behavior:
| Setting | Default | Description |
|---|---|---|
| MonitorIISCertificateBindings | false |
Enable/disable IIS binding monitoring (opt-in feature) |
| AlertOnMultiLevelWildcard | true |
Warn when multi-level wildcards detected (e.g., *.*.example.com) |
| AlertOnExcessiveSANs | false |
Warn when SAN count exceeds MaximumSANCount |
| MaximumSANCount | 100 |
Threshold for excessive SAN warning |
| ValidateIISBindingHostnames | true |
Check that binding hostnames match certificate subject/SANs |
For detailed configuration, see Certificate Configuration.
Testing IIS Binding and SAN Monitoring
Section titled “ Testing IIS Binding and SAN Monitoring”Test Scenario 1: Create IIS Binding with Matching Certificate
Section titled “Test Scenario 1: Create IIS Binding with Matching Certificate”# Prerequisites: IIS installed with HTTPS binding supportImport-Module WebAdministration
# Create self-signed certificate for testing$cert = New-SelfSignedCertificate ` -Subject "CN=www.test.local" ` -DnsName "www.test.local" ` -CertStoreLocation "Cert:\LocalMachine\My"
# Create IIS site with HTTPS bindingNew-Website -Name "TestSite" -PhysicalPath "C:\inetpub\wwwroot" ` -Port 443 -Ssl -HostHeader "www.test.local"
# Bind certificate to site$binding = Get-WebBinding -Name "TestSite" -Protocol "https"$binding.AddSslCertificate($cert.Thumbprint, "my")
# Expected: OK state - exact match between binding hostname and certificateTest Scenario 2: Create IIS Binding with Wildcard Certificate
Section titled “Test Scenario 2: Create IIS Binding with Wildcard Certificate”# Create wildcard certificate$wildcardCert = New-SelfSignedCertificate ` -Subject "CN=*.test.local" ` -DnsName "*.test.local" ` -CertStoreLocation "Cert:\LocalMachine\My"
# Create IIS site with subdomain bindingNew-Website -Name "APISite" -PhysicalPath "C:\inetpub\wwwroot" ` -Port 443 -Ssl -HostHeader "api.test.local"
# Bind wildcard certificate to site$apiBinding = Get-WebBinding -Name "APISite" -Protocol "https"$apiBinding.AddSslCertificate($wildcardCert.Thumbprint, "my")
# Expected: OK state - wildcard match (*.test.local covers api.test.local)Test Scenario 3: Create Orphaned Binding (ERROR)
Section titled “Test Scenario 3: Create Orphaned Binding (ERROR)”# Create certificate and binding$tempCert = New-SelfSignedCertificate ` -Subject "CN=temp.test.local" ` -DnsName "temp.test.local" ` -CertStoreLocation "Cert:\LocalMachine\My"
New-Website -Name "TempSite" -PhysicalPath "C:\inetpub\wwwroot" ` -Port 443 -Ssl -HostHeader "temp.test.local"
$tempBinding = Get-WebBinding -Name "TempSite" -Protocol "https"$tempBinding.AddSslCertificate($tempCert.Thumbprint, "my")
# Delete certificate while binding remains (simulate orphaned binding)Remove-Item -Path "Cert:\LocalMachine\My\$($tempCert.Thumbprint)" -Force
# Expected: ERROR state - certificate not found (orphaned binding)Test Scenario 4: Certificate with Multi-Level Wildcard (WARNING)
Section titled “Test Scenario 4: Certificate with Multi-Level Wildcard (WARNING)”# Note: Most CAs won't issue multi-level wildcards, so create with OpenSSL# Create OpenSSL config file for multi-level wildcard$opensslConfig = @"[req]distinguished_name = req_distinguished_namereq_extensions = v3_req
[req_distinguished_name]
[v3_req]subjectAltName = @alt_names
[alt_names]DNS.1 = *.*.test.localDNS.2 = test.local"@
Set-Content -Path "multilevel.cnf" -Value $opensslConfig
# Create private keyopenssl genrsa -out multilevel.key 2048
# Create CSR with multi-level wildcardopenssl req -new -key multilevel.key -out multilevel.csr -config multilevel.cnf -subj "/CN=*.*.test.local"
# Self-sign certificateopenssl x509 -req -in multilevel.csr -signkey multilevel.key -out multilevel.crt -days 365 -extensions v3_req -extfile multilevel.cnf
# Convert to PFX and importopenssl pkcs12 -export -out multilevel.pfx -inkey multilevel.key -in multilevel.crt -passout pass:test123
$pwd = ConvertTo-SecureString -String "test123" -Force -AsPlainText$multiLevelCert = Import-PfxCertificate -FilePath "multilevel.pfx" -CertStoreLocation "Cert:\LocalMachine\My" -Password $pwd
# Expected: WARNING state - multi-level wildcard detected (security risk)Test Scenario 5: Certificate with Excessive SANs (WARNING)
Section titled “Test Scenario 5: Certificate with Excessive SANs (WARNING)”# Create certificate with 110 SANs (above default threshold of 100)$sanList = 1..110|ForEach-Object { "domain$_.test.local" }
$excessiveSANCert = New-SelfSignedCertificate ` -Subject "CN=multidomain.test.local" ` -DnsName $sanList ` -CertStoreLocation "Cert:\LocalMachine\My"
# Expected: WARNING state - excessive SANs (110 > 100 threshold)# Note: Requires AlertOnExcessiveSANs=true in configurationFor comprehensive testing scripts and additional scenarios, see FAQ: IIS Binding Test Scripts.
Security Best Practices
Section titled “ Security Best Practices”DO - Recommended Practices
Section titled “ DO - Recommended Practices”| Practice | Why It Matters | Implementation |
|---|---|---|
| Remove orphaned bindings promptly | Prevents silent failures after certificate deletion | Audit IIS bindings monthly and remove entries for deleted certificates |
| Validate hostname matches | Ensures users don't see certificate mismatch warnings | Certificate Subject or SAN must match IIS binding hostname |
| Enable SNI for multi-domain sites | Allows multiple certificates on same IP address | Configure SNI in IIS binding settings for each hostname |
| Use single-level wildcards only | Universally accepted by CAs and browsers | Use *.example.com instead of *.*.example.com |
| Keep SAN counts reasonable | Improves performance and manageability | Limit to 50 SANs per certificate (remove unused domains) |
| Update bindings before expiration | Prevents production outages | Plan IIS binding updates 30 days before certificate expiration |
DON'T - Practices to Avoid
Section titled “ DON'T - Practices to Avoid”| Anti-Pattern | Risk | Correct Approach |
|---|---|---|
| Leave orphaned bindings indefinitely | IIS site fails silently until restart | Remove binding or update certificate reference immediately |
| Assign wrong certificate to binding | Browser warnings and user trust issues | Verify certificate Subject/SAN matches binding hostname |
| Use multi-level wildcards | CAs refuse issuance; security violations | Use single-level wildcard + specific SAN entries |
| Accumulate excessive SANs | TLS handshake degradation; management complexity | Remove unused SANs during renewal; split into multiple certs |
| Skip binding update after renewal | Service outage when old certificate expires | Update IIS bindings immediately after certificate renewal |