security vulnerabilities for grown ups - gotocon 2012

49
Security vulnerabilities for grown-ups Vitaly Osipov Atlassian

Upload: vitaly-osipov

Post on 07-Jul-2015

300 views

Category:

Technology


2 download

DESCRIPTION

Dealing with product security vulnerabilities in startups. Talk at GOTOcon Aarhus May 2012

TRANSCRIPT

Page 1: Security vulnerabilities for grown ups - GOTOcon 2012

Security vulnerabilities for grown-ups

Vitaly OsipovAtlassian

Page 2: Security vulnerabilities for grown ups - GOTOcon 2012

Or: 7 product security lessons I learned @Atlassian

Page 3: Security vulnerabilities for grown ups - GOTOcon 2012

Disclaimer

All good parts of this talk

Are learned from my colleagues

Any errors

Are all mine

Page 4: Security vulnerabilities for grown ups - GOTOcon 2012

Lesson 1Sea of vulnerabilities

Page 5: Security vulnerabilities for grown ups - GOTOcon 2012

Security vulnerability?

Not a security feature - e.g. login

Security of other features

Bug in your code that can lead to unauthorised

view / change of information

downtime

Page 6: Security vulnerabilities for grown ups - GOTOcon 2012

Typical product

Web(-ish) applications

>100 kloc

Dozen third party libraries

A couple of Web frameworks

Enterprise customers

Page 7: Security vulnerabilities for grown ups - GOTOcon 2012

If you’re a mid-size software vendor

You will learn your code has vulnerabilities

This year...

More than once…

Remember, only 50% products can be “above average”

The current industry average is far from good

Learned:

Page 8: Security vulnerabilities for grown ups - GOTOcon 2012

Levels of “oops”

You find the vulnerability yourself

Customer reports their findings

“Security researcher” contacts you

You are compromised

Customer is compromised

Page 9: Security vulnerabilities for grown ups - GOTOcon 2012

Clouds and silver lining

Someone gives a damn, hurray!

A culture shift - “loss of innocence”

Growing up

Stages of grief

Page 10: Security vulnerabilities for grown ups - GOTOcon 2012

5 stages of grief

Denial: “This cannot be happening”

Anger: “Why me? It is not fair!”

Bargaining: “Perhaps it is not as bad as it seems?”

Depression: “Man, nobody will ever buy from us again!”

Acceptance: “We can fix this!”

Page 11: Security vulnerabilities for grown ups - GOTOcon 2012

Lesson 2Small bugs, big incidents

Page 12: Security vulnerabilities for grown ups - GOTOcon 2012

Debian OpenSSL

Page 13: Security vulnerabilities for grown ups - GOTOcon 2012

Apache / JIRA 2010

“ive got this error while browsing some projects in jira http://tinyurl.com/XXXXXXXXX”

Change attachment path

Install JSP shell and password interceptor...

https://blogs.apache.org/infra/entry/apache_org_04_09_2010

Page 14: Security vulnerabilities for grown ups - GOTOcon 2012

Learned:

Often one vulnerability is all it takes

Several “non-critcial” issues combine into one big trouble

Page 15: Security vulnerabilities for grown ups - GOTOcon 2012

Lesson 3But this is not my code!

Page 16: Security vulnerabilities for grown ups - GOTOcon 2012

Is this sufficient?

Page 17: Security vulnerabilities for grown ups - GOTOcon 2012

XML BombKnown since 2002, yet you probably have this

10^9 lols

Page 18: Security vulnerabilities for grown ups - GOTOcon 2012

XXE Local Entities

Page 19: Security vulnerabilities for grown ups - GOTOcon 2012

XXE

Other recent examples:https://issues.jboss.org/browse/RESTEASY-637

Page 20: Security vulnerabilities for grown ups - GOTOcon 2012

Aside: where to start with XXE in Java

DocumentBuilderFactory

SAXParserFactory

XMLInputFactory

nu.xom.Builder 

SAXBuilder

Page 21: Security vulnerabilities for grown ups - GOTOcon 2012

OGNL - Struts

See Struts advisories

Page 22: Security vulnerabilities for grown ups - GOTOcon 2012

More OGNL

Page 23: Security vulnerabilities for grown ups - GOTOcon 2012

Ruby

/triggerpath?search[instance_eval]=%60touch%20%2ftmp%2fcommand_exec%60

touch /tmp/command_exec

“Ruby on Rails from a code auditor's perspective”, Hackito Ergo Sum 2011 by @joernchen

Page 25: Security vulnerabilities for grown ups - GOTOcon 2012

Learned

Past decisions will bite you

...and decisions of other people will bite you too

When you least expect it

Page 26: Security vulnerabilities for grown ups - GOTOcon 2012

Lesson 4Why all this matters

Page 27: Security vulnerabilities for grown ups - GOTOcon 2012

Here to stay

Page 28: Security vulnerabilities for grown ups - GOTOcon 2012

Do you like…

Coding features?

Fixing bugs?

...bugs that are not triggered by normal use?

...rare bugs reported by people who are intentionally using your software not to the specs?

Also known as security vulnerabilities

Page 29: Security vulnerabilities for grown ups - GOTOcon 2012

“Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?”

Brian Kernigan

Security is difficult

Page 30: Security vulnerabilities for grown ups - GOTOcon 2012

“Please make it go away and let me create exciting new features for my customers!”

(not an actual quote)

Normal dev reaction

Page 31: Security vulnerabilities for grown ups - GOTOcon 2012

Learned:

Security is counterintuitive

Most companies do not think security (or, say, architecture) until a while into the project

“Fixing” security becomes much harder as the product grows

Page 32: Security vulnerabilities for grown ups - GOTOcon 2012

Lesson 5What can we do?

Page 33: Security vulnerabilities for grown ups - GOTOcon 2012

Three things

1.Product security response

2.Priority fixing

3.“Prevention”

Page 34: Security vulnerabilities for grown ups - GOTOcon 2012

Lesson 6Response and Validation

Page 35: Security vulnerabilities for grown ups - GOTOcon 2012

1. Response

a.k.a. PSIRT

Small effort that goes a long way

Sanity in a crisis

[email protected]

Page 36: Security vulnerabilities for grown ups - GOTOcon 2012

Learned:

Research is exciting for developers

Fixing is less so

Especially when patches are involved

And you do not do patches as a rule

Page 37: Security vulnerabilities for grown ups - GOTOcon 2012

Learned:

Advisory / security alert?

External dependencies

Products

Services

Infrastructure

Checking, double-checking, triple-checking

Page 38: Security vulnerabilities for grown ups - GOTOcon 2012

Lesson 7Fixing

Page 39: Security vulnerabilities for grown ups - GOTOcon 2012

2. Fixing

Page 40: Security vulnerabilities for grown ups - GOTOcon 2012

Learned:

Find vuln reports proactively

Fix fast and keep the reporter in the loop

Even if the issue does not look serious

“Where else does this appear?”

Be very nice

“Responsible disclosure” debate

Page 41: Security vulnerabilities for grown ups - GOTOcon 2012

3. “Preventing”

Difficult and endless battle

Especially in Agile shops

Microsoft has some papers about Agile SDL

Ask me next year

Page 42: Security vulnerabilities for grown ups - GOTOcon 2012

Ideas

Use framework features if you can (auto-encoding for XSS)

Stripped-down Java Security Manager (code execution, file reads)

Reduce complexity of inputs (no OGNL!)

Page 43: Security vulnerabilities for grown ups - GOTOcon 2012

Ideas

Train QA in security

Training a security pro in QA is harder

Developers will learn from them

Depends on how QA/Dev is set up

“Blind spots” - missing classes of vulnerabilities

Page 44: Security vulnerabilities for grown ups - GOTOcon 2012

Ideas

Testing tools

Burp Suite

Only a help, not a magic scanner

Many false positives and false negatives from all automated scanners - source code or web

Page 45: Security vulnerabilities for grown ups - GOTOcon 2012

Watch out

“Each of these endeavours resulted in a significant and brief improvement, which was quickly overcome by the entropy of unstructured coding.”

Somewhere in PragProg mag

Page 46: Security vulnerabilities for grown ups - GOTOcon 2012

Do I have to?

Response and fixing are the basics

Bad PR and stolen data are worse than any short term savings

Emergency fixing is very expensive

“Past results do not guarantee future success”

Page 47: Security vulnerabilities for grown ups - GOTOcon 2012

But it cannot happen to me!

Page 48: Security vulnerabilities for grown ups - GOTOcon 2012

TODO

Make someone accountable for response

Set up and monitor security@

Train QA in security

Prioritise fixing security issues

Think about prevention / risk management...