nosql - no security? - the bsides edition

46
NoSQL – No Security? A way to lose even more stuff Gavin Holt (@GavinHolt)

Upload: gavin-holt

Post on 22-Nov-2014

542 views

Category:

Documents


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: NoSQL - No Security? - The BSides Edition

NoSQL – No Security?A way to lose even more stuffGavin Holt (@GavinHolt)

Page 2: NoSQL - No Security? - The BSides Edition

What we will cover today What is Big Data? What is NoSQL? Why NoSQL Security is an issue NoSQL Vulnerabilities Securing NoSQL Installations

Page 3: NoSQL - No Security? - The BSides Edition

What is Big Data?Datasets that are so large or complex that they are difficult to process using traditional database processing applications

Page 4: NoSQL - No Security? - The BSides Edition

2.5 quintillion bytes(1 followed by 18 zeros)

Data being generated every day (IBM)

Page 5: NoSQL - No Security? - The BSides Edition

2.5 Petabytes(1048576 Gigabytes)

The total size of Walmarts transaction database (

The Economist)

Page 6: NoSQL - No Security? - The BSides Edition

40 Terabytes per secondData generated by

experiments on the LHC at CERN

(The Economist)

Page 7: NoSQL - No Security? - The BSides Edition

72 Hours per MinuteVideo uploaded to YouTube

(Google Inc.)

Page 8: NoSQL - No Security? - The BSides Edition

That is a lot of data!Try running any of them in

MS Access

Page 9: NoSQL - No Security? - The BSides Edition

What is NoSQL?“Not Only SQL”

Page 10: NoSQL - No Security? - The BSides Edition

Umbrella TermType of System – Not a

Product

Page 11: NoSQL - No Security? - The BSides Edition

Not the Traditional Relational Model

Page 12: NoSQL - No Security? - The BSides Edition

Generally don’t use tables

Page 13: NoSQL - No Security? - The BSides Edition

Optimised for appends and retrieves

Do very little other than record storage

Page 14: NoSQL - No Security? - The BSides Edition

Highly Scalable & Very QuickThis is all about speed and

size

Page 15: NoSQL - No Security? - The BSides Edition

Why use NoSQL?Why the Big Data/NoSQL Hype?

Page 16: NoSQL - No Security? - The BSides Edition

Eventual ConsistencyDelays in writing across nodes slow down your

application

Page 17: NoSQL - No Security? - The BSides Edition

User Updates Social Network

Click icon to add picture

Social Network uses a load balancer

Page 18: NoSQL - No Security? - The BSides Edition

Writes don’t propagate immediately

Click icon to add picture

Data is now inconsistent

Page 19: NoSQL - No Security? - The BSides Edition

Reading Stale Data

Click icon to add picture

Users now being served old data from nodes that haven’t been updated

Page 20: NoSQL - No Security? - The BSides Edition

A more serious example

Click icon to add picture

Data needs to be propagated quickly – NoSQL allows for thatDiagram from Adobe Security Labs

Page 21: NoSQL - No Security? - The BSides Edition

NoSQL VulnerabilitiesHow do these compare to traditional databases?

21

Page 22: NoSQL - No Security? - The BSides Edition

The DeveloperBy Laziness or Ignorance

Page 23: NoSQL - No Security? - The BSides Edition

Little to no Authentication“Trusted Environments”

Page 24: NoSQL - No Security? - The BSides Edition

NoSQL Injection

Page 25: NoSQL - No Security? - The BSides Edition

Helpful isn’t always usefulFlattening associative

arrays

Page 26: NoSQL - No Security? - The BSides Edition

MongoDB Example http://example.com/login.php?username=admin&passwd=mysuperpassword

26

Page 27: NoSQL - No Security? - The BSides Edition

MongoDB Example http://example.com/login.php?username=admin&passwd[$ne]=1

Page 28: NoSQL - No Security? - The BSides Edition

MongoDB Example http://example.com/login.php?username=admin&passwd[$ne]=1

Page 29: NoSQL - No Security? - The BSides Edition

MongoDB ExampleMYSQL NOSQL

Page 30: NoSQL - No Security? - The BSides Edition

MongoDB ExampleMYSQL NOSQL

Page 31: NoSQL - No Security? - The BSides Edition

Server Side Javascript Injection

Page 32: NoSQL - No Security? - The BSides Edition

Server Side Javascript Injection

Page 33: NoSQL - No Security? - The BSides Edition

Server Side Javascript Injection

Page 34: NoSQL - No Security? - The BSides Edition

Server Side Javascript Injection

Page 35: NoSQL - No Security? - The BSides Edition

Server Side Javascript Injection

Page 36: NoSQL - No Security? - The BSides Edition

Server Side Javascript Injection

Page 37: NoSQL - No Security? - The BSides Edition

Example of an Attack

Page 38: NoSQL - No Security? - The BSides Edition

CSFR can be used to bypass firewalls

Click icon to add picture

Diagram from Adobe Security Labs

Page 39: NoSQL - No Security? - The BSides Edition

POST is all an Attacker needs Inserting Data

Inserting Script Data

Execute any REST command from inside the firewall

Page 40: NoSQL - No Security? - The BSides Edition

Securing NoSQLOne does not simply secure NoSQL </meme>

Page 41: NoSQL - No Security? - The BSides Edition

Sanitize InputsDon’t trust users (or other

systems!)

Page 42: NoSQL - No Security? - The BSides Edition

Be in control of your query building

Don’t simply concatenate user input

Page 43: NoSQL - No Security? - The BSides Edition

Check how your solution worksRead the manual

Page 44: NoSQL - No Security? - The BSides Edition

All other SQL Best PracticeThese aren’t different

attack vectors – just new

Page 45: NoSQL - No Security? - The BSides Edition

Questions?Twitter: @GavinHoltLinkedIn: http://uk.linkedin.com/in/gavinholt/Email: [email protected] all day – Grab me for a chat.

Page 46: NoSQL - No Security? - The BSides Edition

NoSQL – No Security?A way to lose even more stuffGavin Holt (@GavinHolt)