SlideShare a Scribd company logo
1 of 62
Download to read offline
1
Preventing Data Breaches
A Tour on Tightening Your Security Stance
Becca Petrin
She/Her
Software Engineer
Github: tyrannosaurus-becks
2
• Overview of Data Breaches
• Hands-On
• Getting data through….
• Common approaches
• A platform-specific secrets manager
• A cross-platform secrets manager
• A dynamic secrets manager
• Password-less authentication
3
Today’s Topics
• Imagining a Security Incident
• Preventing Insider Breaches
• Questions
4
Today’s Topics
Overview of Data Breaches
5
A History
The Breach
• 2013: Edward Snowden
• 2014: Home Depot
• 2017: Equifax
• 2018: Facebook
• 2019: Capital One
6
The Root Cause
• An insider
• Malware
• Hackers
• Hackers
• Insider at AWS
Data Exfiltration
7
$150M per breach
8
$242 per record
9
Employee Fraud & Abuse
Costs 5% per Year
10
• Make passwords hard to get
• Then make passwords die
• Then make passwords impossible to get
• Then figure it out if there’s a data breach happening anyways
12
Let’s Prevent Some Breaches
15
16
17
18
Common Approaches
Pros
• Easy
• Cheap up front
• Instant access to passwords
19
Cons
• Too easy
• If breached, cost savings will be lost
• No tracking who’s viewed things
• Service must be offlined for password
rotation
• Password leak means many instances
and services offlined for password
rotation
Hands-On:
Platform-Specific
Secrets Manager
20
• Cloudwatch - woo!
• But what if the password was leaked?
21
Observability
A Platform-Specific Secrets Manager
Pros
• Easy-ish
• Can use built-in identity
• Some automated password rotation
• More auditable
• Pay-as-you-go
22
Cons
• Another company has your secrets
• Password rotation isn’t easy
• Pay-as-you-go
Hands-On:
A Cross-Platform
Secrets Manager
23
import requests
import json
from psycopg2 import connect
vault = 'ec2-54-197-74-45.compute-1.amazonaws.com'
as_json = json.dumps({"password": "v7vf-swbiUYqB7MVzzMQ"})
response = requests.post("http://" + vault + ":8080/v1/auth/userpass/login/student", data=as_json)
resp_json = json.loads(response.content)
token = resp_json[‘auth']['client_token']
response = requests.get("http://" + vault + “:8080/v1/datadogdash/postgres_creds", headers={'X-Vault-Token': token})
resp_json = json.loads(response.content)
password = resp_json['data']['password']
conn = connect('host=ec2-3-89-155-20.compute-1.amazonaws.com port=5432 dbname=dash user=student password=‘ + password)
cur = conn.cursor()
cur.execute("SELECT name FROM users WHERE ID=8364;")
cur.fetchone()
24
Updating Our Code
• Application logs
• Audit logs
• >100 performance-oriented metrics
25
Observability
A Cross-Platform Secrets Manager
Pros
• Cross-platform
• Can still use built-in identity
• Secrets only inside your company
• Encryption-as-a-service
26
Cons
• Self deploy
• Can be more complex
• Opaque pricing
Hands-On:
A Dynamic
Secrets Manager
27
28
The Enigma Machine
eydwYXNzd29yZCc6ICJhcHBsZXMifQ==Vault
29
Ellen
Bob
30
Web Worker 1
foo-username
bar-password
Web Worker 2
fizz-username
buzz-password
Web Worker 3
boom-username
hiss-password
import requests
import json
from psycopg2 import connect
vault = 'ec2-54-197-47-181.compute-1.amazonaws.com'
as_json = json.dumps({"password": "personalpassword"})
response = requests.post("http://" + vault + ":8080/v1/auth/userpass/login/student", data=as_json)
resp_json = json.loads(response.content)
token = resp_json[‘auth']['client_token']
response = requests.get("http://" + vault + “:8080/v1/database/creds/my-role", headers={'X-Vault-Token': token})
resp_json = json.loads(response.content)
username = resp_json['data']['username']
password = resp_json[‘data']['password']
print ‘username: ’ + username + “, password: ” + password # this changes every time you call the my-role endpoint! run this script twice!
conn_str = 'host=ec2-34-229-136-247.compute-1.amazonaws.com port=8080 dbname=dash user=‘ + username + ' password=' + password
conn = connect(conn_str)
cur = conn.cursor()
cur.execute("SELECT name FROM users WHERE ID=8364;")
cur.fetchone()
31
Updating Our Code
• Application logs
• Audit logs
• >100 performance-oriented metrics
• Identity system helps with attribution
32
Observability
Cross-Platform + Secret Rotation
Pros
• Easy automated password rotation
• The main approach is ephemeral
usernames and passwords
33
Cons
• Attribution can be difficult
• Modern logging frameworks log
faster than a username and password
can disappear
Hands-On
Passwordless Authentication
34
35
Can I get some
data please?
36
Sure, if you can take
the string “abcd”,
hash it with your
password, and tell
me the correct result.
37
Hm, “abcd” and
“mypassword” hashed
are
“806839236b1e9ddb”.
38
Nailed it!
You’re in!
But With Approzium….
39
40
Can I get some
data please?
41
Sure, if you can take
the string “abcd”,
hash it with your
password, and tell
me the correct result.
42
Yo, the database
said to hash the pass
with “abcd”, what’s
the challenge
response?
43
Looks like it’s
“806839236b1e9ddb”!
44
The challenge
response is
“806839236b1e9ddb”!
45
Kazaam!
You’re in!
from approzium import AuthClient
from approzium.psycopg2 import connect
auth = AuthClient('54.160.35.66:8080', disable_tls=True)
conn = connect('host=52.5.163.43 port=8080 dbname=dash user=student', authenticator=auth)
cur = conn.cursor()
cur.execute("SELECT name FROM users WHERE ID=8364;")
cur.fetchone()
46
Updating Our Code
• Explicitly security-oriented logs
• Identity logged at INFO level
• Suspicious activity logged at WARN level
• Explicitly security-oriented metrics
• DOS
• Fuzzing
• Impersonation
• Replay attacks
• Sniffing
47
Observability
Password-less Authentication
Pros
• Can use built-in identity
• Pick your secrets manager
• The main approach is unleakable
passwords
• Security-oriented observability at the
forefront
• SDK
• Free extra layer to add
48
Cons
• Self deploy
• Can be more complex
• Dynamic secrets not yet supported
49
Imagining a Security Incident
51
A History
The Breach
• 2013: Edward Snowden
• 2014: Home Depot
• 2017: Equifax
• 2018: Facebook
• 2019: Capital One
52
The Root Cause
• An insider
• Malware
• Hackers
• Hackers
• Insider at AWS
Scenario: Hackers
• Your company has a portal that people log into.
• You run it using a framework like Apache Struts, the Spring framework, Django, React,
etc.
• A serious vulnerability is announced.
• An unauthenticated remote attacker begins exploiting the vulnerability by executing
malicious code on effected instances (or containers).
• One of their first actions is planting a script on every instance (or container) that is
executed every hour by a cron job, and all it does is call out to somewhere to get
arbitrary code, and it executes it.
• You install a patch or update to resolve the vulnerability.
53
Scenario: Hackers
The hacker snoops around on your instance and finds a configuration file like this:
APPROZIUM_URL=ec2-100-26-168-97.compute-1.amazonaws.com
APPROZIUM_PORT=8080
PG_URL=ec2-34-229-136-247.compute-1.amazonaws.com
PG_PORT=8080
PG_DB_NAME=dash
PG_USER_NAME=student
54
55
Hey, they’re using
Approzium!
from approzium import AuthClient
from approzium.psycopg2 import connect
auth = AuthClient('54.160.35.66:8080', disable_tls=True)
conn = connect('host=52.5.163.43 port=8080 dbname=dash user=student', authenticator=auth)
cur = conn.cursor()
cur.execute("SELECT * FROM pg_catalog.pg_tables WHERE schemaname != 'pg_catalog' AND schemaname !=
‘information_schema';")
cur.execute("SELECT * FROM users;")
cur.fetchone()
56
They Make Code Just Like Yours!!!
57
Yo, the database
said to hash the pass
with “efgh”, what’s
the challenge
response?
Yo, the database
said to hash the pass
with “ijkl”, what’s
the challenge
response?
INFO: verified arn:aws:sts::733164497221:assumed-role/RoleForEC2Instances/
i-04810e8b639073295
INFO: verified arn:aws:sts::733164497221:assumed-role/RoleForEC2Instances/
i-04810e8b639073295
58
59
Preventing Insider Breaches
60
Preventing Insider Breaches
Strategies
You Should
• Provide a way for employees to share secret information securely
• Consider giving short-lived passwords
• Give the minimum access needed to perform a job
• Set minimum password complexity levels
• Include your whole organization
• Encrypt data at rest
61
62
Summary
63
There is no silver bullet.
Defense in Depth
Defense in depth is a concept used in Information security in
which multiple layers of security controls (defense) are placed
throughout an information technology (IT) system. Its intent is to
provide redundancy in the event a security control fails or a
vulnerability is exploited.
64
65
Questions?

More Related Content

What's hot

Webinar slides: How to Secure MongoDB with ClusterControl
Webinar slides: How to Secure MongoDB with ClusterControlWebinar slides: How to Secure MongoDB with ClusterControl
Webinar slides: How to Secure MongoDB with ClusterControl
Severalnines
 
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
CODE BLUE
 
Open source security
Open source securityOpen source security
Open source security
lrigknat
 

What's hot (20)

SSL/TLS for Mortals (GOTO Berlin)
SSL/TLS for Mortals (GOTO Berlin)SSL/TLS for Mortals (GOTO Berlin)
SSL/TLS for Mortals (GOTO Berlin)
 
BlueHat v18 || Malicious user profiling using a deep neural net
BlueHat v18 || Malicious user profiling using a deep neural netBlueHat v18 || Malicious user profiling using a deep neural net
BlueHat v18 || Malicious user profiling using a deep neural net
 
SSL/TLS for Mortals (JavaZone)
SSL/TLS for Mortals (JavaZone)SSL/TLS for Mortals (JavaZone)
SSL/TLS for Mortals (JavaZone)
 
Think Like a Hacker - Database Attack Vectors
Think Like a Hacker - Database Attack VectorsThink Like a Hacker - Database Attack Vectors
Think Like a Hacker - Database Attack Vectors
 
BlueHat v17 || Detecting Compromise on Windows Endpoints with Osquery
BlueHat v17 || Detecting Compromise on Windows Endpoints with Osquery BlueHat v17 || Detecting Compromise on Windows Endpoints with Osquery
BlueHat v17 || Detecting Compromise on Windows Endpoints with Osquery
 
HTTP For the Good or the Bad
HTTP For the Good or the BadHTTP For the Good or the Bad
HTTP For the Good or the Bad
 
Persistant Cookies and LDAP Injection
Persistant Cookies and LDAP InjectionPersistant Cookies and LDAP Injection
Persistant Cookies and LDAP Injection
 
Webinar slides: How to Secure MongoDB with ClusterControl
Webinar slides: How to Secure MongoDB with ClusterControlWebinar slides: How to Secure MongoDB with ClusterControl
Webinar slides: How to Secure MongoDB with ClusterControl
 
BlueHat v18 || Badly behaving scripts - meet amsi script behavior instrumenta...
BlueHat v18 || Badly behaving scripts - meet amsi script behavior instrumenta...BlueHat v18 || Badly behaving scripts - meet amsi script behavior instrumenta...
BlueHat v18 || Badly behaving scripts - meet amsi script behavior instrumenta...
 
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
 
I hunt sys admins 2.0
I hunt sys admins 2.0I hunt sys admins 2.0
I hunt sys admins 2.0
 
Open source security
Open source securityOpen source security
Open source security
 
BlueHat v18 || May i see your credentials, please
BlueHat v18 || May i see your credentials, pleaseBlueHat v18 || May i see your credentials, please
BlueHat v18 || May i see your credentials, please
 
BlueHat v17 || Go Hunt: An Automated Approach for Security Alert Validation
BlueHat v17 || Go Hunt: An Automated Approach for Security Alert Validation BlueHat v17 || Go Hunt: An Automated Approach for Security Alert Validation
BlueHat v17 || Go Hunt: An Automated Approach for Security Alert Validation
 
Onward15
Onward15Onward15
Onward15
 
In The Middle of Printers - The (In)Security of Pull Printing solutions - Hac...
In The Middle of Printers - The (In)Security of Pull Printing solutions - Hac...In The Middle of Printers - The (In)Security of Pull Printing solutions - Hac...
In The Middle of Printers - The (In)Security of Pull Printing solutions - Hac...
 
Hack ASP.NET website
Hack ASP.NET websiteHack ASP.NET website
Hack ASP.NET website
 
ChromeからMacBookのTouchIDでWebAuthenticationする ~Idance vol1~
ChromeからMacBookのTouchIDでWebAuthenticationする ~Idance vol1~ChromeからMacBookのTouchIDでWebAuthenticationする ~Idance vol1~
ChromeからMacBookのTouchIDでWebAuthenticationする ~Idance vol1~
 
Geth important commands
Geth important commandsGeth important commands
Geth important commands
 
Hollywood mode off: security testing at scale
Hollywood mode off: security testing at scaleHollywood mode off: security testing at scale
Hollywood mode off: security testing at scale
 

Similar to Preventing Data Breaches: How to Tighten Your Security Stance

Eight simple rules to writing secure PHP programs
Eight simple rules to writing secure PHP programsEight simple rules to writing secure PHP programs
Eight simple rules to writing secure PHP programs
Aleksandr Yampolskiy
 

Similar to Preventing Data Breaches: How to Tighten Your Security Stance (20)

hackcon2013-Dirty Little Secrets They Didn't Teach You In Pentesting Class v2
hackcon2013-Dirty Little Secrets They Didn't Teach You In Pentesting Class v2hackcon2013-Dirty Little Secrets They Didn't Teach You In Pentesting Class v2
hackcon2013-Dirty Little Secrets They Didn't Teach You In Pentesting Class v2
 
Applications secure by default
Applications secure by defaultApplications secure by default
Applications secure by default
 
Applications secure by default
Applications secure by defaultApplications secure by default
Applications secure by default
 
Dynamic Database Credentials: Security Contingency Planning
Dynamic Database Credentials: Security Contingency PlanningDynamic Database Credentials: Security Contingency Planning
Dynamic Database Credentials: Security Contingency Planning
 
DevBeat 2013 - Developer-first Security
DevBeat 2013 - Developer-first SecurityDevBeat 2013 - Developer-first Security
DevBeat 2013 - Developer-first Security
 
Whatever it takes - Fixing SQLIA and XSS in the process
Whatever it takes - Fixing SQLIA and XSS in the processWhatever it takes - Fixing SQLIA and XSS in the process
Whatever it takes - Fixing SQLIA and XSS in the process
 
How to discover 1352 Wordpress plugin 0days in one hour (not really)
How to discover 1352 Wordpress plugin 0days in one hour (not really)How to discover 1352 Wordpress plugin 0days in one hour (not really)
How to discover 1352 Wordpress plugin 0days in one hour (not really)
 
Secure Software: Action, Comedy or Drama? (2017 edition)
Secure Software: Action, Comedy or Drama? (2017 edition)Secure Software: Action, Comedy or Drama? (2017 edition)
Secure Software: Action, Comedy or Drama? (2017 edition)
 
Demystifying Apple 'Pie' & TouchID
Demystifying Apple 'Pie' & TouchIDDemystifying Apple 'Pie' & TouchID
Demystifying Apple 'Pie' & TouchID
 
SE2016 Android Denis Zhuchinski "Ways of enhancing application security"
SE2016 Android Denis Zhuchinski "Ways of enhancing application security"SE2016 Android Denis Zhuchinski "Ways of enhancing application security"
SE2016 Android Denis Zhuchinski "Ways of enhancing application security"
 
CQURE_BHAsia19_Paula_Januszkiewicz_slides
CQURE_BHAsia19_Paula_Januszkiewicz_slidesCQURE_BHAsia19_Paula_Januszkiewicz_slides
CQURE_BHAsia19_Paula_Januszkiewicz_slides
 
My app is secure... I think
My app is secure... I thinkMy app is secure... I think
My app is secure... I think
 
Codetainer: a Docker-based browser code 'sandbox'
Codetainer: a Docker-based browser code 'sandbox'Codetainer: a Docker-based browser code 'sandbox'
Codetainer: a Docker-based browser code 'sandbox'
 
Eight simple rules to writing secure PHP programs
Eight simple rules to writing secure PHP programsEight simple rules to writing secure PHP programs
Eight simple rules to writing secure PHP programs
 
My app is secure... I think
My app is secure... I thinkMy app is secure... I think
My app is secure... I think
 
Attack Chaining: Advanced Maneuvers for Hack Fu
Attack Chaining: Advanced Maneuvers for Hack FuAttack Chaining: Advanced Maneuvers for Hack Fu
Attack Chaining: Advanced Maneuvers for Hack Fu
 
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik
 
Protect Your Payloads: Modern Keying Techniques
Protect Your Payloads: Modern Keying TechniquesProtect Your Payloads: Modern Keying Techniques
Protect Your Payloads: Modern Keying Techniques
 
IstSec'14 - İbrahim BALİÇ - Automated Malware Analysis
IstSec'14 - İbrahim BALİÇ -  Automated Malware AnalysisIstSec'14 - İbrahim BALİÇ -  Automated Malware Analysis
IstSec'14 - İbrahim BALİÇ - Automated Malware Analysis
 
IDSECCONF2013 CTF online Write Up
IDSECCONF2013 CTF online Write Up IDSECCONF2013 CTF online Write Up
IDSECCONF2013 CTF online Write Up
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

Preventing Data Breaches: How to Tighten Your Security Stance

  • 1. 1 Preventing Data Breaches A Tour on Tightening Your Security Stance
  • 3. • Overview of Data Breaches • Hands-On • Getting data through…. • Common approaches • A platform-specific secrets manager • A cross-platform secrets manager • A dynamic secrets manager • Password-less authentication 3 Today’s Topics
  • 4. • Imagining a Security Incident • Preventing Insider Breaches • Questions 4 Today’s Topics
  • 5. Overview of Data Breaches 5
  • 6. A History The Breach • 2013: Edward Snowden • 2014: Home Depot • 2017: Equifax • 2018: Facebook • 2019: Capital One 6 The Root Cause • An insider • Malware • Hackers • Hackers • Insider at AWS
  • 10. Employee Fraud & Abuse Costs 5% per Year 10
  • 11.
  • 12. • Make passwords hard to get • Then make passwords die • Then make passwords impossible to get • Then figure it out if there’s a data breach happening anyways 12 Let’s Prevent Some Breaches
  • 13. 15
  • 14. 16
  • 15. 17
  • 16. 18
  • 17. Common Approaches Pros • Easy • Cheap up front • Instant access to passwords 19 Cons • Too easy • If breached, cost savings will be lost • No tracking who’s viewed things • Service must be offlined for password rotation • Password leak means many instances and services offlined for password rotation
  • 19. • Cloudwatch - woo! • But what if the password was leaked? 21 Observability
  • 20. A Platform-Specific Secrets Manager Pros • Easy-ish • Can use built-in identity • Some automated password rotation • More auditable • Pay-as-you-go 22 Cons • Another company has your secrets • Password rotation isn’t easy • Pay-as-you-go
  • 22. import requests import json from psycopg2 import connect vault = 'ec2-54-197-74-45.compute-1.amazonaws.com' as_json = json.dumps({"password": "v7vf-swbiUYqB7MVzzMQ"}) response = requests.post("http://" + vault + ":8080/v1/auth/userpass/login/student", data=as_json) resp_json = json.loads(response.content) token = resp_json[‘auth']['client_token'] response = requests.get("http://" + vault + “:8080/v1/datadogdash/postgres_creds", headers={'X-Vault-Token': token}) resp_json = json.loads(response.content) password = resp_json['data']['password'] conn = connect('host=ec2-3-89-155-20.compute-1.amazonaws.com port=5432 dbname=dash user=student password=‘ + password) cur = conn.cursor() cur.execute("SELECT name FROM users WHERE ID=8364;") cur.fetchone() 24 Updating Our Code
  • 23. • Application logs • Audit logs • >100 performance-oriented metrics 25 Observability
  • 24. A Cross-Platform Secrets Manager Pros • Cross-platform • Can still use built-in identity • Secrets only inside your company • Encryption-as-a-service 26 Cons • Self deploy • Can be more complex • Opaque pricing
  • 28. 30 Web Worker 1 foo-username bar-password Web Worker 2 fizz-username buzz-password Web Worker 3 boom-username hiss-password
  • 29. import requests import json from psycopg2 import connect vault = 'ec2-54-197-47-181.compute-1.amazonaws.com' as_json = json.dumps({"password": "personalpassword"}) response = requests.post("http://" + vault + ":8080/v1/auth/userpass/login/student", data=as_json) resp_json = json.loads(response.content) token = resp_json[‘auth']['client_token'] response = requests.get("http://" + vault + “:8080/v1/database/creds/my-role", headers={'X-Vault-Token': token}) resp_json = json.loads(response.content) username = resp_json['data']['username'] password = resp_json[‘data']['password'] print ‘username: ’ + username + “, password: ” + password # this changes every time you call the my-role endpoint! run this script twice! conn_str = 'host=ec2-34-229-136-247.compute-1.amazonaws.com port=8080 dbname=dash user=‘ + username + ' password=' + password conn = connect(conn_str) cur = conn.cursor() cur.execute("SELECT name FROM users WHERE ID=8364;") cur.fetchone() 31 Updating Our Code
  • 30. • Application logs • Audit logs • >100 performance-oriented metrics • Identity system helps with attribution 32 Observability
  • 31. Cross-Platform + Secret Rotation Pros • Easy automated password rotation • The main approach is ephemeral usernames and passwords 33 Cons • Attribution can be difficult • Modern logging frameworks log faster than a username and password can disappear
  • 33. 35 Can I get some data please?
  • 34. 36 Sure, if you can take the string “abcd”, hash it with your password, and tell me the correct result.
  • 35. 37 Hm, “abcd” and “mypassword” hashed are “806839236b1e9ddb”.
  • 38. 40 Can I get some data please?
  • 39. 41 Sure, if you can take the string “abcd”, hash it with your password, and tell me the correct result.
  • 40. 42 Yo, the database said to hash the pass with “abcd”, what’s the challenge response?
  • 44. from approzium import AuthClient from approzium.psycopg2 import connect auth = AuthClient('54.160.35.66:8080', disable_tls=True) conn = connect('host=52.5.163.43 port=8080 dbname=dash user=student', authenticator=auth) cur = conn.cursor() cur.execute("SELECT name FROM users WHERE ID=8364;") cur.fetchone() 46 Updating Our Code
  • 45. • Explicitly security-oriented logs • Identity logged at INFO level • Suspicious activity logged at WARN level • Explicitly security-oriented metrics • DOS • Fuzzing • Impersonation • Replay attacks • Sniffing 47 Observability
  • 46. Password-less Authentication Pros • Can use built-in identity • Pick your secrets manager • The main approach is unleakable passwords • Security-oriented observability at the forefront • SDK • Free extra layer to add 48 Cons • Self deploy • Can be more complex • Dynamic secrets not yet supported
  • 47. 49
  • 48. Imagining a Security Incident 51
  • 49. A History The Breach • 2013: Edward Snowden • 2014: Home Depot • 2017: Equifax • 2018: Facebook • 2019: Capital One 52 The Root Cause • An insider • Malware • Hackers • Hackers • Insider at AWS
  • 50. Scenario: Hackers • Your company has a portal that people log into. • You run it using a framework like Apache Struts, the Spring framework, Django, React, etc. • A serious vulnerability is announced. • An unauthenticated remote attacker begins exploiting the vulnerability by executing malicious code on effected instances (or containers). • One of their first actions is planting a script on every instance (or container) that is executed every hour by a cron job, and all it does is call out to somewhere to get arbitrary code, and it executes it. • You install a patch or update to resolve the vulnerability. 53
  • 51. Scenario: Hackers The hacker snoops around on your instance and finds a configuration file like this: APPROZIUM_URL=ec2-100-26-168-97.compute-1.amazonaws.com APPROZIUM_PORT=8080 PG_URL=ec2-34-229-136-247.compute-1.amazonaws.com PG_PORT=8080 PG_DB_NAME=dash PG_USER_NAME=student 54
  • 53. from approzium import AuthClient from approzium.psycopg2 import connect auth = AuthClient('54.160.35.66:8080', disable_tls=True) conn = connect('host=52.5.163.43 port=8080 dbname=dash user=student', authenticator=auth) cur = conn.cursor() cur.execute("SELECT * FROM pg_catalog.pg_tables WHERE schemaname != 'pg_catalog' AND schemaname != ‘information_schema';") cur.execute("SELECT * FROM users;") cur.fetchone() 56 They Make Code Just Like Yours!!!
  • 54. 57 Yo, the database said to hash the pass with “efgh”, what’s the challenge response? Yo, the database said to hash the pass with “ijkl”, what’s the challenge response?
  • 55. INFO: verified arn:aws:sts::733164497221:assumed-role/RoleForEC2Instances/ i-04810e8b639073295 INFO: verified arn:aws:sts::733164497221:assumed-role/RoleForEC2Instances/ i-04810e8b639073295 58
  • 56. 59
  • 58. Strategies You Should • Provide a way for employees to share secret information securely • Consider giving short-lived passwords • Give the minimum access needed to perform a job • Set minimum password complexity levels • Include your whole organization • Encrypt data at rest 61
  • 60. 63 There is no silver bullet.
  • 61. Defense in Depth Defense in depth is a concept used in Information security in which multiple layers of security controls (defense) are placed throughout an information technology (IT) system. Its intent is to provide redundancy in the event a security control fails or a vulnerability is exploited. 64