Iis 6.0 Security Architecture
Iis 6.0 Security Architecture
Iis 6.0 Security Architecture
0 SECURITY ARCHITECTURE
Its a Whole New World
Michael Muckin
Security Architect
Microsoft Consulting Services
Agenda
Setting the Stage
IIS 6.0 Security design
ASP.NET Security Config
Scanning & Tools
Hardening IIS 6.0
Demos throughout
Vulnerability Trends
Application
Increasing
V
e
r
t
i
c
a
l
Decreasin
g
Leveling
out
OS
Network
Physical
Horizon
tal
Data
BROWSER
Always up-to-date
Make it practical to keep systems up-to-date
with the latest software patches
Product Quality
Security stand-down
Development practices
/GS
Prefix/Prefast runs
Single String Class
QFE and IIS core
team merged
Code review for
every change
External reviews
keep us honest
Removed legacy code
Security design review
for every feature
Extensive test
infrastructure
External tools
Internal tools
IIS tools
Buffer overflow scanner
Cross-site scripting
Fault injection in
regular test runs
enabled
enabled
ASP
enabled
disabled
Server-side includes
enabled
disabled
enabled
disabled
WebDAV
enabled
disabled
enabled
disabled
enabled
disabled
CGI
enabled
disabled
Frontpage Server
Extensions
enabled
disabled
Password Change
Functionality
enabled
disabled
SMTP
enabled
disabled
FTP
enabled
disabled
Vulnerability Distribution
Web-Server only
Server-side includes
(SSINC.DLL)
Internet Data Connector
(HTTPODBC.DLL)
WebDAV (HTTPEXT.DLL)
Index Server ISAPI
(WEBHITS.DLL, QUERY.DLL,
IDQ.DLL
Internet Printing ISAPI
(MSW3PRT.DLL
Frontpage Server Extensions
(div.)
Password Change
Severity
Defense In Depth
Buffer overflows
New Low Privilege accts: Network Service
(default) and Local Service
Default Privileges:
SeAssignPrimaryTokenPrivilege
SeSecurityPrivilege
SeSystemtimePrivilege
SeAuditPrivilege
SeChangeNotifyPrivilege
SeUndockPrivilege
Defense In Depth
Canonicalization issues
Denial-of-service attacks
Fault-tolerant infrastructure
Limits
Site defacements
Secure By Default
Secure Defaults I
No executable VDirs
/SCRIPTS and /MSADC
X
X
XX
XX
Known extensions
Check if file exists
Secure By Default
Secure Defaults II
Strong ACLs on
Logfiles
Custom error directory
On cache directories
ASP
ASPEnableParentPath = FALSE
Hang detection
4MB response buffer limit
Internal health detection
Secure By Default
NTFS canonicalization
\\?\
Streams outlawed
Security Conscious
Architecture
Compartmentalization
Rearchitecting IIS
A review of IIS5
INETINFO.EXE
ISAPI Filters and
Extensions
Metabase
user
DLLHost.E
XE
DLLHost.EX
ISAPI
E
Extensions
DLLHost.EX
ISAPI
E Extensions
ISAPI
Extensions
WinSock 2.0
kernel
TCP/IP
Application Pools
WWW Service
XML
Metabase
Administration
Administration
&
&
Monitoring
Monitoring
SMTP
SMTP
User mode
Kernel mode
Queue
IIS 6.0
Cache
HTTP
Request
Response
Rearchitecting IIS
A New Architecture for IIS6
GOAL: prevent apps
from affecting system
health
Web service in
INETINFO split out to
do this:
Multiple W3 Cores
W3 Core
web
app
kernel
WAS
HTTP.SYS
Rearchitecting IIS
HTTP.SYS
What is it?
Kernel-mode HTTP stack/listener
Always running
Reliability Features
Process routing based on URL
Request queues: kernel-mode
queuing
Performance Features
Kernel-mode response cache
Text-based and binary logging
Rearchitecting IIS
HTTP.SYS
Namespace Mapper
Req. Queue
Listener
Req. Queue
HTTP.SYS
Req. Queue
HTTP.SYS API
Send Response
HTTP Engine
HTTP Parser
Response Cache
TCP/IP
REQUEST
Rearchitecting IIS
Configuration Manager
Configures HTTP.SYS
No application code
Ensures reliability
Easier to identify problems
Hosted in SVCHOST.exe
Rearchitecting IIS
W3 Core
What is it?
Main web processing DLL responsible
for processing web requests
Mini-web server
Contains all web request processing
functionality
Loads ISAPIs filters and extensions
Application Pools
Application Pooling
Recycling
Recycling
Overlapping Recycle
New
Worker
Process
Old
Worker
Process
Web Proc.
Core DLL
Web Proc.
Core DLL
user
kernel
HTTP.SYS
Request
Ready for
Shut down
Recycle
WAS
startup
ready
Countering DoS
Health Detection
Crash Detection & Rapid Fail
Protection
WAS detects process
crash/AVs
On failure
ASP.NET
Web Service Extensions
Authorization by Role and URL
File access by ASP mapped extensions
ASP.NET Accounts
When ASP.NET is enabled a new account
is created: ASPNET and a new Group
IIS_WPG
Configurable in IIS Service Manager MMC
For multiple Pools requiring complete
isolation:
Create low-priv accounts for each Pool
Add to IIS_WPG group
Config each Pool with appropriate Identity
Both ASPNET and the IUSR_xxxx accounts need
Read and Execute (ntfs) access to ASP.NET files
(.aspx, .asmx, etc.)
Careful of code-behind files that are being
accessed set ACLs appropriately (aspx.cs,
</authorization>
----------------------------------<authorization>
<allow verbs=HEAD, GET, POST
roles="Administrators"/>
<allow verbs=HEAD, GET, POST
roles="Users"/>
<deny users=?/>
</authorization>
ASP.NET Server-side
Validation
<%@ Page Language="C#" %>
ASP.NET Server-side
Validation
<form runat="server">
<h3>My CustomValidator Example</h3>
Summary
Completely new Architecture
Kernel mode request handling
Complete Application Isolation
Secure Defaults
At the Code Level
Deployment Default IIS box is only a static
web server Admin must turn on what is
needed
Questions ???