beyond patch and pray: security by design

36
Beyond Patch and Pray: Security by Design Adam Shostack Presented to the Security Leadership Conference Series Arlington, TX Oct 19 2004

Upload: heller

Post on 10-Feb-2016

20 views

Category:

Documents


0 download

DESCRIPTION

Beyond Patch and Pray: Security by Design. Adam Shostack Presented to the Security Leadership Conference Series Arlington, TX Oct 19 2004. Goal. Much of today’s security seems to cycle through: Penetrate or otherwise find vulnerabilities in deployed systems Fix the issues - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Beyond Patch and Pray: Security by Design

Beyond Patch and Pray:Security by Design

Adam ShostackPresented to the Security Leadership Conference Series

Arlington, TXOct 19 2004

Page 2: Beyond Patch and Pray: Security by Design

Goal

Much of today’s security seems to cycle through:

Penetrate or otherwise find vulnerabilities in deployed systemsFix the issuesPray that you do it before the bad guys or the worms

Page 3: Beyond Patch and Pray: Security by Design

So?

This is very expensive

Fixing deployed systems risks downtime

Could deploy “patch management” sw

Or we could look to fix problem from root causes

Page 4: Beyond Patch and Pray: Security by Design

Bug (and software) Development

Page 5: Beyond Patch and Pray: Security by Design

How To Move?

It’s actually worse than that

That’s a graph for a single program

You deploy lots of programs

Page 6: Beyond Patch and Pray: Security by Design
Page 7: Beyond Patch and Pray: Security by Design
Page 8: Beyond Patch and Pray: Security by Design

How To Get There

Better software tools

Internal, external

Better Deployment tools

Security

Operations

Page 9: Beyond Patch and Pray: Security by Design

Where The Tools Fit

Page 10: Beyond Patch and Pray: Security by Design

Software Improvement

Static checkers

Dynamic Checkers

Languages

Limits of software improvement

Page 11: Beyond Patch and Pray: Security by Design

Static Checkers

Work with source code

Lots of different languages

Results generally easier to fix

They’re associated with lines of code

High false positive rates

Find “sins of commission” like strcat()

Fast

Page 12: Beyond Patch and Pray: Security by Design

Free Static checkers

RATS

ITS4

Flawfinder

Page 13: Beyond Patch and Pray: Security by Design

Static Checkers: Slicers

Compiler-like technology to see what variable could be touched where

Perl’s taint mode

Clever techniques to deal with pointers

Can be perfect on small code (20kloc)

Much research

Page 14: Beyond Patch and Pray: Security by Design

Static Checkers: Parsers

Analyze variables and typing because C doesn’t

Can deal with integer issues well

Slower

SPLINT is a free example

Page 15: Beyond Patch and Pray: Security by Design

Static Checkers: Compilers

Compile code, and analyze on the way

Code is not always compiled to your processor

Target a VM that has security features

MOPS

Dawson Engler’s group @ Stanford

GCC -Wall is not complete

Page 16: Beyond Patch and Pray: Security by Design

Dynamic Checkers

Work on binary code

Never wonder if the optimizer was too clever

Find “Sins of Omission” like SQL injection

Slow! (Can be hours or days)

Page 17: Beyond Patch and Pray: Security by Design

Dynamic Tools: Fuzzers

Fuzz, Spike, libwhisker

Mangleme http fuzzer (added after talk)http://lcamtuf.coredump.cx/soft/mangleme.tgz

Feed noise to the target see if it breaks

And you’re surprised this is slow?

Page 18: Beyond Patch and Pray: Security by Design

Dynamic: Attack Simulation

“Second Gen fuzzers”

Attack tool libraries

CORE Impact, Metasploit

Require skilled driver

Nikto

Less powerful, easy to use

Page 19: Beyond Patch and Pray: Security by Design

Dynamic Tools: Decompilers

Turn byte code/machine code into something resembling C

Useful for closed source apps you need

Need to analyze the decompiled source

Page 20: Beyond Patch and Pray: Security by Design

Dynamic: Binary Differs

Not a dynamic tool as much as a static tool for machine code

Best for finding why a patch happened

Attack/exploit creation

Vendor verification:

Is this patch effective?

Are they being upfront about what’s in it?

Page 21: Beyond Patch and Pray: Security by Design

Language Selection

Some languages seem to be more prone to security flaws

C, PHP

We may not have found the classes of flaws in Java, C#

New classes keep showing up (integer underflows, etc)

Page 22: Beyond Patch and Pray: Security by Design

Things Hard to Measure

Security design goodness

Attack surface

nmap not enough

port 25 seems to have a large surface

port 137 does too.

Page 23: Beyond Patch and Pray: Security by Design

Adding Resilience to Code

How to

deploy

operate

Buggy code more securely

Page 24: Beyond Patch and Pray: Security by Design

Free UNIX techniques

chroot/jail

Unprivileged daemon accounts

Painful if you need fast code on port 80

Free security enhanced OSes:

OpenBSD, SELinux

Page 25: Beyond Patch and Pray: Security by Design

Techniques

Harden the system:

Control Attack surface

Limit effect of an attack

Can entail high operational cost for questionable benefit

Need to evaluate what happens

Page 26: Beyond Patch and Pray: Security by Design

More advanced tools

OS hardening tools

Immunix subdomain

Sana kernel enhancements

Application hardening

Stackguard & company

(Recompile vs kernel modules)

Page 27: Beyond Patch and Pray: Security by Design

Issues with Hardening Tools

How to measure their effectiveness

Configuration effort

Costs (percieved and real)

Cash up front

Speed

Supportability + Vendor finger pointing

Page 28: Beyond Patch and Pray: Security by Design

Network Intrusion Prevention

Throwing Ducks at Baloons

Paper by Ptacek and Newsham, 1998

Showed how to evade IDSs, IPSs

The Covert Channel problem

Page 29: Beyond Patch and Pray: Security by Design

Firewalls Move (back) Up

Application Firewalls vs packet filters

Inspection

Snort Inline

Page 30: Beyond Patch and Pray: Security by Design

Process Resilience Tools

How to fail gracefully

detect, respond, improve

Measuring your process

Architecture and Forensics

An ounce of prevention

Page 31: Beyond Patch and Pray: Security by Design

Selling Your Boss

Or, Security folks are from Mars, businesspeople are from Wheaton

Page 32: Beyond Patch and Pray: Security by Design

How You Buy Software

Functionality, supportability, price

Can you get security in there?

Probably requires being able to get lots of complexity into a 1-5 score (or somesuch)

The above can be used for that

Page 33: Beyond Patch and Pray: Security by Design

Sample Scoring

0-1 point for a good language

0-1 point for documented use of tools to check code

0-1 point for unprivileged, chroot install

0-1 point for logging

0-1 point for local analysis

Page 34: Beyond Patch and Pray: Security by Design

Deployment Budgets

Cash for wires, hubs, power, air

Where does security fit?

What’s the real cost of a failure?

(Hint, its not $1m, unless you’re a large bank)

Page 35: Beyond Patch and Pray: Security by Design

Deployment Business Cases

Cost of operations with and without tool X

Cost of special events:

Patching

Breakins

Worms

Frequency of special events

Page 36: Beyond Patch and Pray: Security by Design

Conclusions

Way back to patching

Learned how to cut # of patches

Better SW

Better operations

Better sales to management