Threat Modeling
Threat Modeling
Networks
Networks
Jesper M. Johansson
Jesper M. Johansson
Senior Security Strategist
Senior Security Strategist
Microsoft Corporation
Microsoft Corporation
[email protected]
[email protected]
http://
http://
blogs.technet.com/jesper_johansson
blogs.technet.com/jesper_johansson
© 2004, Microsoft Corporation, All Rights Reserved
Fundamental Tradeoff
Fundamental Tradeoff
Secure
Usable
Cheap
You get to pick any two!
You get to pick any two!
© 2004, Microsoft Corporation, All Rights Reserved
Perimeters Are Weak
Perimeters Are Weak
© 2004, Microsoft Corporation, All Rights Reserved
Defense in Depth
Defense in Depth
Threat Modeling is one part of a Defense in Depth strategy
Threat Modeling is one part of a Defense in Depth strategy
Supplement it with other measures
Supplement it with other measures
People, Policies, & Process
OS hardening, patch management,
authentication, HIDS
Firewalls, VPN quarantine
Guards, locks, tracking devices
Network segments, IPSec, NIDS
Application hardening, antivirus
ACL, encryption
User education
Physical Security
Perimeter
Internal Network
Host
Application
Data
© 2004, Microsoft Corporation, All Rights Reserved
Lessons Learned From Experience
Lessons Learned From Experience
Most security tweaks do not improve
Most security tweaks do not improve
security
security
Security changes without a threat model do
Security changes without a threat model do
not improve security
not improve security
Focus is often on the wrong thing
Focus is often on the wrong thing
Analysis of target environment is essential
Analysis of target environment is essential
Threat model must correlate with security
Threat model must correlate with security
policy
policy
Group policy is a bonus
Group policy is a bonus
Careful smoke
Careful smoke
-
-
testing needed
testing needed
© 2004, Microsoft Corporation, All Rights Reserved
Applying the lessons
Applying the lessons
-
-
DSR
DSR
Document
Document
Model applications and services
Model applications and services
Environment dependent
Environment dependent
Segment
Segment
Applications
Applications
Security requirements
Security requirements
Restrict
Restrict
Disable services
Disable services
Close ports
Close ports
Use IPSec or RRAS filters
Use IPSec or RRAS filters
Use different passwords
© 2004, Microsoft Corporation, All Rights Reserved
Document
Document
© 2004, Microsoft Corporation, All Rights Reserved
Modeling Systems with DFDs
Modeling Systems with DFDs
Graphic representation showing
Graphic representation showing
communication between objects
communication between objects
Describes activities that process data
Describes activities that process data
Shows how data flows through a system
Shows how data flows through a system
Shows logical sequence of associations and
Shows logical sequence of associations and
activities
activities
Sometimes known as a process model
Sometimes known as a process model
We are appropriating and modifying this
We are appropriating and modifying this
method
method
© 2004, Microsoft Corporation, All Rights Reserved
Modified Data Flow Diagram
Modified Data Flow Diagram
Conventions
Conventions
Data Flow
© 2004, Microsoft Corporation, All Rights Reserved
Model The Network
Model The Network
Internet
Domain Controller Client
Corporate Domain Controller Corporate Clients
Client
Web Farm 2 SQL Cluster Web Farm 1 SQL Cluster VPN Server
Corp Servers
© 2004, Microsoft Corporation, All Rights Reserved
Superimpose a DFD
Superimpose a DFD
Internet
Domain Controller Client
Corporate Domain Controller Corporate Clients
Client Web Farm 2 Web Farm 1 SQL Cluster
VPN Server SQL Cluster
Corp Servers
© 2004, Microsoft Corporation, All Rights Reserved
Component Segmentation
© 2004, Microsoft Corporation, All Rights Reserved
Network Segmentation
Network Segmentation
Segment systems by application and
Segment systems by application and
security requirements
security requirements
Should you trust systems that are not part
Should you trust systems that are not part
of your application?
of your application?
Which systems do they trust?
Which systems do they trust?
What are their security requirements?
What are their security requirements?
Less sensitive systems may depend on
Less sensitive systems may depend on
more sensitive systems
more sensitive systems
More sensitive systems
More sensitive systems
MUST NEVER
MUST NEVER
depend on less sensitive systems
depend on less sensitive systems
© 2004, Microsoft Corporation, All Rights Reserved
End Goal
End Goal
© 2004, Microsoft Corporation, All Rights Reserved
Documenting Segments
Documenting Segments
Domain Controller
Corp Servers Corp Clients Corp DCs Internet Client
W
e
b
F
a
rm
1
S
Q
L
C
lu
s
te
r
1
W
e
b
F
a
r
m
2
S
Q
L
C
lu
s
te
r
2 VPN
Domain Controller 1433
DC Traffic DC Traffic
DC traffic 80, 443
443
1433 3389 3389 3389
Term Serv Term Serv 3389
3389
1723 1433
DC traffic DC traffic DC traffic DC traffic
DC traffic DC traffic 3389 DC Traffic
© 2004, Microsoft Corporation, All Rights Reserved
Trust Boundaries
Trust Boundaries
Systems and entities you trust are included
Systems and entities you trust are included
within your trust boundary
within your trust boundary
Never share administration and accounts
Never share administration and accounts
across boundaries
across boundaries
Should your trust boundary include
Should your trust boundary include
databases?
databases?
It depends
It depends
…
…
© 2004, Microsoft Corporation, All Rights Reserved
Trust Boundaries
Trust Boundaries
Internet Client
W
e
b
F
ar
m
1
SQL 1
Domain Controller 1433
DC Traffic DC Traffic 80, 443 Trust Boundary
Staging Server 445
1433
© 2004, Microsoft Corporation, All Rights Reserved
Threat Analysis
© 2004, Microsoft Corporation, All Rights Reserved
Fault Trees
Fault Trees
Demonstrate logical paths through a
Demonstrate logical paths through a
system
system
Used to highlight faults in a system
Used to highlight faults in a system
Points out relationships between faults
Points out relationships between faults
Allow us to estimate the interactions
Allow us to estimate the interactions
between faults
between faults
© 2004, Microsoft Corporation, All Rights Reserved
Port 80 open
in firewall
Port 1433 open
in firewall
Write access
to web app
1434 open in
firewall
DLL Loading
Trojan
0.7 0 .8 0.5Vroots with
Execute
Dump LSA
Secrets
Shared svc accts
with admin privs
Exploit Blank
SA Password
0.3 0.9 0.7 1 .0 0 .51434 BO on
SQL
Root SQL
0.0Blank SA
password
0.0 1 .0Goal: Root the SQL Server
Goal: Root the SQL Server
OR condition
-Probability:
MAX[(0.9*0.7), 0.3] = 0 . 6 3
Probability:
0.5Aggregate
Probability:
MAX[MIN(0.7,0.0), MIN(0.5,0.0), 1 . 0 * 0 . 5 0 4 ] = 0.504Pre requisite
-Probability:
0.8*0.63 = 0.504OR condition
– Probability:
MAX[1.0*0.5, 0.7] = 0.7© 2004, Microsoft Corporation, All Rights Reserved
Port 80 open
in firewall
Port 1433 open
in firewall
Write access
to web app
1434 open in
firewall
DLL Loading
Trojan
0.7 0 .8 0.5Vroots with
Execute
Dump LSA
Secrets
Shared svc accts
with admin privs
Exploit Blank
SA Password
0.3 0.9 0.7 1 .0 0 .51434 BO on
SQL
Root SQL
0.0
Blank SA
password
0.0 1 .0
Preventative Measures
Preventative Measures
Break here by
restricting
outgoing traffic
from servers
Break here by
removing
security
dependencies
Break here with
IIS lockdown
Break here
with best
practices
Break here
with SQL
hardening
© 2004, Microsoft Corporation, All Rights Reserved
Restrict
Restrict
© 2004, Microsoft Corporation, All Rights Reserved
Restrict
Restrict
Policies allow nothing but
Policies allow nothing but
…
…
Disable unnecessary services
Disable unnecessary services
Remove users
Remove users
Restrict privileges
Restrict privileges
Turn on security tweaks
Turn on security tweaks
Remove permissions
Remove permissions
Set very strong passwords
Set very strong passwords
Restrict communications
Restrict communications
IPSec
IPSec
RRAS filters
RRAS filters
© 2004, Microsoft Corporation, All Rights Reserved
Manage Administrative
Manage Administrative
Dependencies
Dependencies
An administrator on any given machine can
An administrator on any given machine can
run code as any user logging on to that
run code as any user logging on to that
machine
machine
What other machines do your
What other machines do your
admins
admins
log on to?
log on to?
Who administers those machines
Who administers those machines
Administrative dependencies
Administrative dependencies
balloon
balloon
–
–
fast!
fast!
Enumerating actual administrators
Enumerating actual administrators
is hard
© 2004, Microsoft Corporation, All Rights Reserved
How Many
How Many
Admins
Admins
Do
Do
You Have?
You Have?
© 2004, Microsoft Corporation, All Rights Reserved
Limit Service Account Trust
Limit Service Account Trust
Environment
Environment
Any admin can retrieve service account
Any admin can retrieve service account
credentials
credentials
Service accounts frequently have
Service accounts frequently have
Administrative privileges
Administrative privileges
…
…
…
…
on several machines
on several machines
Implements the
Implements the
“
“
least common security
least common security
denominator
denominator
”
”
Consider security needs
Consider security needs
NetworkService
NetworkService
and
and
LocalService
LocalService
are
are
useful, to a point
useful, to a point
© 2004, Microsoft Corporation, All Rights Reserved
Dependency Chain Example
Dependency Chain Example
Attacker
Attacker
1. Hacks Test-Host, gets account “Cedric”
2. Uses Cedric’s account to compromise
SQL Server
SQL Server gives up account “Bob”
3. Bob is an Admin on the Web Server
Web server has service account _Svc
4. _Svc is a domain admin!
0wn3d!
0wn3d!
© 2004, Microsoft Corporation, All Rights Reserved
Conclusion
Conclusion
Hardening networks requires understanding
Hardening networks requires understanding
the environment
the environment
Optimal hardening requires deep
Optimal hardening requires deep
understanding
understanding
There is a fundamental tradeoff between
There is a fundamental tradeoff between
security and usability
security and usability
Three
Three
-
-
phase approach to network
phase approach to network
hardening
hardening
Document
Document
Segment
Segment
Restrict
Restrict
© 2004, Microsoft Corporation, All Rights Reserved
For more information
For more information
See Chapters 8 and 9
See Chapters 8 and 9
Order online:
Order online:
http://www.awprofessio
http://www.awprofessio
nal.com/title/032133643
nal.com/title/032133643
7
7
Use promo code
Use promo code
JJSR6437
JJSR6437
[email protected]
[email protected]
© 2004, Microsoft Corporation, All Rights Reserved
Resources
Resources
Tools
Tools
Registry Monitor, File Monitor, Process
Registry Monitor, File Monitor, Process
Explorer, et. al.
Explorer, et. al.
http://www.sysinternals.com
http://www.sysinternals.com
My Email:
My Email:
[email protected]
[email protected]
Technical information
Technical information
Security Guidance Center
Security Guidance Center
http://www.microsoft.com/security/guidance/ http://www.microsoft.com/security/guidance/ MBSA MBSA http://www.microsoft.com/technet/security/tools/mb http://www.microsoft.com/technet/security/tools/mb sahome.mspx sahome.mspx
Open Hack IV Hardening
Open Hack IV Hardening
http://msdn.microsoft.com/library/en
http://msdn.microsoft.com/library/en-
-us/dnnetsec/html/openhack.asp
us/dnnetsec/html/openhack.asp
Jesper
Jesper’’s Security Columnss Security Columns
http://go.microsoft.com/fwlink/?LinkId=28592
http://go.microsoft.com/fwlink/?LinkId=28592
Threats and Countermeasures
Threats and Countermeasures
http://go.microsoft.com/fwlink/?LinkId=15159
http://go.microsoft.com/fwlink/?LinkId=15159
Security news
Security news
Security Bulletin Notification
Security Bulletin Notification
http://go.microsoft.com/fwlink/?LinkId=21163
http://go.microsoft.com/fwlink/?LinkId=21163
Security Bulletins
Security Bulletins
http://www.microsoft.com/
http://www.microsoft.com/technet/security/currenttechnet/security/current
.aspx
.aspx
Security guidance and training
Security guidance and training
Windows 2000 Security Hardening Guide
Windows 2000 Security Hardening Guide
http://go.microsoft.com/fwlink/?LinkId=28591
http://go.microsoft.com/fwlink/?LinkId=28591
Windows Server 2003 Security Guide
Windows Server 2003 Security Guide
http://go.microsoft.com/fwlink/?LinkId=14846
http://go.microsoft.com/fwlink/?LinkId=14846
Windows XP Security Guide
Windows XP Security Guide
http://go.microsoft.com/fwlink/?LinkId=14839
http://go.microsoft.com/fwlink/?LinkId=14839
Exchange Server 2003 Security Hardening Guide
Exchange Server 2003 Security Hardening Guide
http://go.microsoft.com/fwlink/?LinkId=25210
http://go.microsoft.com/fwlink/?LinkId=25210
Microsoft Guide to Security
Microsoft Guide to Security
Patch Management
Patch Management
http://go.microsoft.com/fwlink/?LinkId=16284
Jesper M. Johansson
Jesper M. Johansson
[email protected]
[email protected]
© 2004-2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.