SlideShare a Scribd company logo
1 of 72
Download to read offline
DO YOU LOSE SLEEP AT NIGHT?
Introductions
Nathan Van Gheem

Director of Solutions Engineering at Wildcard Corp

@vangheezy

vangheem@gmail.com

nathanvangheem.com
Wildcard Corp
wildcardcorp.com

secure web solutions
More about what I do
• Plone(CMS)
• Python
• JavaScript
• NoSQL
• Linux
Purpose
• Learn more about common security issues
• Change attitude and culture toward security
• You, the site owner, can sleep at night
• We, the site developers/system administrators, can sleep
at night
Why you should care about security
• Responsibility
• Reputation
• Legal implications
• $$$
Zero Days
CMS focus
• Exposure
• Complexity
• Users
• Features
• Add-ons
Covering the basics
• firewall
• open ports
• vulnerability patches
• mailing lists
• server configuration
• unprivileged user running server process
What won’t be covered
• DNS, DNSSEC
• Physical security
• Social engineering
• Not in depth on OS Security
Top 5 Security Vulnerabilities/Risks
Top 5
• No particular order
• Call em as I see em
• We can quibble on what makes the top 5 and the order
• From my experience
• https://www.owasp.org/index.php/
Category:OWASP_Top_Ten_Project
1) SQLi - SQL Injection
“A SQL injection attack consists of
insertion or "injection" of a SQL
query via the input data from the
client to the application.” - OWASP
SQLi Risk Level: HIGH
• Full data compromise
• Access compromise
• Availability compromise
• Possible to issue commands to operating system
SQLi: How it works
SQLi: How it works
• Input from URL
• Or input from form data
Source: http://hackaday.com/2014/04/04/sql-injection-fools-speed-traps-and-clears-your-record/
Source: https://xkcd.com/327/
1) SQLi Prevention/Solutions
• If you can, do not write SQL yourself, EVER(ORD)
• Use parameterized statements
• Stored procedures
• Escape all input
• WAF(Web Application Firewall)
• Do not use a SQL database
2) (D)DOS - Denial of Service
“The Denial of Service (DoS) attack is
focused on making a resource (site,
application, server) unavailable for the
purpose it was designed.” - OWASP
(D)DOS Risk Level: MEDIUM
• Availability compromise
• No sensitive data compromised
• Easiest attack to perform
(D)DOS: How it works
• Known slow resources
• Overload server
• Bypass caching
• Example: Script that when run, will make many
simultaneous requests to a server in an attempt to
overwhelm it
DDOS: Distributed Denial of Service
• Distributed to many machines
• Zombie machines for hire
• Botnets
DDOS: LOIC: Low Orbit Ion Cannon
• Hosted service DDOS
• Powered by JavaScript
• Socially driven attack
• Generate random urls to bypass cache and overload
target
2) (D)DOS Solutions
• WAF(Web Application Firewall)
• CDN(Content Delivery Network)
• Caching, Load balancing
• Keep cache warm
• Serve stale content
• Backup static copy of site
2) (D)DOS Solutions continued…
• Profile code
• Monitor traffic, use regular expressions to block request
types
• Rate limiting
• LOIC: watch and block from known bad referrer header
3) XSS - Cross site scripting
“Cross-Site Scripting (XSS) attacks are a type of
injection, in which malicious scripts are injected
into otherwise benign and trusted web sites. XSS
attacks occur when an attacker uses a web
application to send malicious code, generally in the
form of a browser side script, to a different end
user.” - OWASP
XSS Risk Level: HIGH
• Full data compromise
• Access compromise
XSS: Continued
• Injects JavaScript into target web application
• Input/output not validated(server side)
• Targets already logged in users to cause malicious
actions
• Persistent: attack stored in application and rendered
directly from application
• Reflexive: attack is part of URL
XSS: Reflexive example
Source: http://www.codeproject.com/KB/web-security/617043/ReflectedXSS2.jpg
XSS: How it’s exploited
• Malicious user has ability to add attack to site
• Social engineering gets logged in user to click exploited
URL
• JavaScript renders html that it assumes is safe
3) XSS Solutions
• WAF(Web Application Firewall)
• Validated user input
• Escaped output
• Use JavaScript libraries that are safe by default(ReactJS)
4) CSRF - Cross-Site Request Forgery
“Cross-Site Request Forgery (CSRF) is an attack
that forces an end user to execute unwanted
actions on a web application in which they're
currently authenticated.” - OWASP
CSRF Risk Level: MEDIUM
• Data compromise
• Availability compromise
CSRF: How it works
• Target website needs privileged user logged in
• Draw targeted user to view page with exploited URLs
• Or click exploited URLs
CSRF: Example
• Malicious user makes a comment
• Then logged in user reviews comment and executes that
URL
4) CSRF Solutions
• Force every operation to require unique authentication
token to the logged in user
• Authentication token protection implemented at the
database layer
• Well thought out frameworks require use of CSRF tokens
for database changes are allowed
5) Access control
• Broken, misconfigured access control
• Information disclosure
• misconfigured workflows
• file uploads containing metadata
• pre-package REST APIs giving out too much data
5) Access control solutions
• Assume users will be lazy
• Private by default
• Scrub files
• exiftool(linux)
• Block any potential problem areas with web server rules
Going Deeper
Source: http://wallpapercow.com/wp-content/uploads/2014/06/Deep-Iceberg-HD-Desktop-Wallpaper.jpg
Caching
• Sits in front of web application
• Caches content for a configured duration so the user does
not hit the backend
• Varnish**
• Nginx(proxy_cache), Apache(mod_cache) do simple caching
okay
• Apache Traffic Server
• Know your content, how to tune your cache
Caching: server diagram
CDN - Content Delivery Network
• Geographically dispersed caching servers
• WAF(Web Application Firewall)
• Serve stale content
• Keep cache warm
• Cloudflare
• Prepared for a stampede
CDN network diagram
WAF - Web Application Firewall
• CDN(Content Delivery Network)s often provide WAF
• Cloudflare
• Modsecurity(Apache)
• Naxsi(nginx)
WAF diagram
Load balancing
• Provide multiple application servers to handle requests from users
• Better, more resilient performance
• HAProxy**
• Nginx
• Apache
• Varnish
• CDN
Load balancing diagram
Database Selection
• NOSQL
• CouchDB/Couchbase
• ZODB(Python/Plone)
• RDMS: Support for replication
Replication
• All database engines provide some sort of solution for
replication
• Multiple servers can then server web application: better
performance
• Different networks if possible
• Geographically dispersed
Replication diagram
Read-only / Read-write
• Can your web application be readonly?
• What parts of your solution require writes? Can they be done differently?
• For example: Disqus for commenting
• Different backend/frontend URLs
• Are there tools for your platform to do pseudo read-only mode?
• wildcard.readonly(Plone)
• https://github.com/collective/wildcard.readonly
• wildcard.lockdown(Plone)
• https://github.com/collective/wildcard.lockdown
Performance and security
• Caching, CDN provide better performance
• Warm caches provide improved performance
• Keeps backends healthy to serve requests fast
• Replicated database provides added performance
• Geographically dispersed servers can provide lower
latency
Web server techniques
• Understand your application/deployment
• Minimize exposure
• Robust, fail resistant configurations
• Failover to back up replicated server, to static copy, etc
• Can you block certain types of requests?
• Rate limiting
• Careful not to on IP
Two Factor Authentication
• Additional security for users
• Does your 2-factor solution work as a wrapper around
your web application or is it just another token passed
into the login form?
• https://github.com/wildcardcorp/factored
• Proxy
• Or Python WSGI filter
Monitoring
• Know what is going on your systems
• Know traffic patterns
• CDN/Proxy reporting
• Log stash(https://www.elastic.co/products/logstash)
• Pingdom(https://www.pingdom.com/)
• Zabbix/Nagios/Munin/etc
• New relic, Sentry
• Cloud monitoring tools
• ossec(http://ossec.github.io/)
Vulnerability Scanning Tools
• Will test web application against known exploit types
• Acunetix, Netsparker, etc
• https://www.owasp.org/index.php/
Category:Vulnerability_Scanning_Tools
• Or google “vulnerability scanners”
• Some open source
• Some cloud solutions
Add-ons and customizations
Source: http://cheezburger.com/5158827264
Add-ons
• Assume ownership of every add-on you integrate
• You are responsible for security
• Audit code
• Do NOT just install any add-on you find
• Consider if you really need add-ons you install
Add-ons and customizations
• How do you install?
• How do you update?
• What kind of access do they have?
• Are they allowed to execute arbitrary SQL queries?
• Do they run in a sandboxed mode?
• Reproducible builds?
PHP
The most popular open source CMS systems are written in PHP; which has a
suspect security track record.
PHP: Problems
• Register globals: off
• Remote file inclusion: off
• Safe mode
• Works by executing scripts on filesystem
• Common to install/update add-ons through the web
• Common to patch it’s own code
What Plone does well
• Permissions checked *before* view code is executed
• CSRF protection at the database layer
• Input and output filtering on everything
• Add-ons must be installed by system administrators,
process restart
• Through the web customizations run in sandboxed mode
• Monkey patching
Final thoughts
• A small investment in security, resiliency = big payoff
• Understand web vulnerabilities
• Understand risks
• Be comfortable with your risks, exposure and technology
• Secure sites can be beautiful. The security of a site has
nothing to do with it’s design
Questions/Comments
Nathan Van Gheem

@vangheezy

vangheem@gmail.com

nathanvangheem.com

wildcardcorp.com

More Related Content

What's hot

NoSQL - No Security? - The BSides Edition
NoSQL - No Security? - The BSides EditionNoSQL - No Security? - The BSides Edition
NoSQL - No Security? - The BSides Edition
Gavin Holt
 

What's hot (20)

Secure360 - Extracting Password from Windows
Secure360 - Extracting Password from WindowsSecure360 - Extracting Password from Windows
Secure360 - Extracting Password from Windows
 
ColdFusion for Penetration Testers
ColdFusion for Penetration TestersColdFusion for Penetration Testers
ColdFusion for Penetration Testers
 
NoSQL - No Security? - The BSides Edition
NoSQL - No Security? - The BSides EditionNoSQL - No Security? - The BSides Edition
NoSQL - No Security? - The BSides Edition
 
Securing Your MongoDB Deployment
Securing Your MongoDB DeploymentSecuring Your MongoDB Deployment
Securing Your MongoDB Deployment
 
1000 to 0
1000 to 01000 to 0
1000 to 0
 
Prowler: BlackHat Europe Arsenal 2018
Prowler: BlackHat Europe Arsenal 2018Prowler: BlackHat Europe Arsenal 2018
Prowler: BlackHat Europe Arsenal 2018
 
Forging Trusts for Deception in Active Directory
Forging Trusts for Deception in Active DirectoryForging Trusts for Deception in Active Directory
Forging Trusts for Deception in Active Directory
 
Exploiting NoSQL Like Never Before
Exploiting NoSQL Like Never BeforeExploiting NoSQL Like Never Before
Exploiting NoSQL Like Never Before
 
Security Testing using ZAP in SFDC
Security Testing using ZAP in SFDCSecurity Testing using ZAP in SFDC
Security Testing using ZAP in SFDC
 
Red Team Tactics for Cracking the GSuite Perimeter
Red Team Tactics for Cracking the GSuite PerimeterRed Team Tactics for Cracking the GSuite Perimeter
Red Team Tactics for Cracking the GSuite Perimeter
 
The OWASP Zed Attack Proxy
The OWASP Zed Attack ProxyThe OWASP Zed Attack Proxy
The OWASP Zed Attack Proxy
 
Covert Attack Mystery Box: A few novel techniques for exploiting Microsoft “f...
Covert Attack Mystery Box: A few novel techniques for exploiting Microsoft “f...Covert Attack Mystery Box: A few novel techniques for exploiting Microsoft “f...
Covert Attack Mystery Box: A few novel techniques for exploiting Microsoft “f...
 
Injection flaw teaser
Injection flaw teaserInjection flaw teaser
Injection flaw teaser
 
Html5 hacking
Html5 hackingHtml5 hacking
Html5 hacking
 
WMI for Penetration Testers - Arcticcon 2017
WMI for Penetration Testers - Arcticcon 2017WMI for Penetration Testers - Arcticcon 2017
WMI for Penetration Testers - Arcticcon 2017
 
BlueHat Seattle 2019 || I'm in your cloud: A year of hacking Azure AD
BlueHat Seattle 2019 || I'm in your cloud: A year of hacking Azure ADBlueHat Seattle 2019 || I'm in your cloud: A year of hacking Azure AD
BlueHat Seattle 2019 || I'm in your cloud: A year of hacking Azure AD
 
CNIT 128 3. Attacking iOS Applications (Part 2)
CNIT 128 3. Attacking iOS Applications (Part 2)CNIT 128 3. Attacking iOS Applications (Part 2)
CNIT 128 3. Attacking iOS Applications (Part 2)
 
Lateral Movement with PowerShell
Lateral Movement with PowerShellLateral Movement with PowerShell
Lateral Movement with PowerShell
 
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
 
Appsec DC - wXf -2010
Appsec DC - wXf  -2010Appsec DC - wXf  -2010
Appsec DC - wXf -2010
 

Viewers also liked

TOROS: Python Framework for Recommender System
TOROS: Python Framework for Recommender SystemTOROS: Python Framework for Recommender System
TOROS: Python Framework for Recommender System
Kwangseob Kim
 

Viewers also liked (12)

Pitch 1
Pitch 1Pitch 1
Pitch 1
 
Codal analysis a2
Codal analysis   a2Codal analysis   a2
Codal analysis a2
 
Film trailer questionnaire
Film trailer questionnaireFilm trailer questionnaire
Film trailer questionnaire
 
НМЦ ПТО у Рівненській області у 2015 році
НМЦ ПТО у Рівненській області у 2015 роціНМЦ ПТО у Рівненській області у 2015 році
НМЦ ПТО у Рівненській області у 2015 році
 
3000 Word Essay
3000 Word Essay3000 Word Essay
3000 Word Essay
 
TOROS: Python Framework for Recommender System
TOROS: Python Framework for Recommender SystemTOROS: Python Framework for Recommender System
TOROS: Python Framework for Recommender System
 
Звіт директора НМЦ ПТО у Рівненській області Бондарчук В.М.
Звіт директора НМЦ ПТО у Рівненській області Бондарчук В.М.Звіт директора НМЦ ПТО у Рівненській області Бондарчук В.М.
Звіт директора НМЦ ПТО у Рівненській області Бондарчук В.М.
 
Filter Bubbles - the discovery of tacit knowledge
Filter Bubbles - the discovery of tacit knowledgeFilter Bubbles - the discovery of tacit knowledge
Filter Bubbles - the discovery of tacit knowledge
 
小さなジェスチャーセンサーを使ってみました
小さなジェスチャーセンサーを使ってみました小さなジェスチャーセンサーを使ってみました
小さなジェスチャーセンサーを使ってみました
 
SK Tim Kegiatan Diklat Barjas 2015
SK Tim Kegiatan Diklat Barjas 2015SK Tim Kegiatan Diklat Barjas 2015
SK Tim Kegiatan Diklat Barjas 2015
 
So, How Do You Make Agile Successful?
So, How Do You Make Agile Successful? So, How Do You Make Agile Successful?
So, How Do You Make Agile Successful?
 
[2A1]Line은 어떻게 글로벌 메신저 플랫폼이 되었는가
[2A1]Line은 어떻게 글로벌 메신저 플랫폼이 되었는가[2A1]Line은 어떻게 글로벌 메신저 플랫폼이 되었는가
[2A1]Line은 어떻게 글로벌 메신저 플랫폼이 되었는가
 

Similar to Do you lose sleep at night?

Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
Denim Group
 
Cloud and Windows Azure
Cloud and Windows AzureCloud and Windows Azure
Cloud and Windows Azure
Radu Vunvulea
 
Web development tips and tricks
Web development tips and tricksWeb development tips and tricks
Web development tips and tricks
maxo_64
 
Java scriptwidgetdevelopmentjstanbul2012
Java scriptwidgetdevelopmentjstanbul2012Java scriptwidgetdevelopmentjstanbul2012
Java scriptwidgetdevelopmentjstanbul2012
Volkan Özçelik
 

Similar to Do you lose sleep at night? (20)

Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
 
Cloud and Windows Azure
Cloud and Windows AzureCloud and Windows Azure
Cloud and Windows Azure
 
Be faster then rabbits
Be faster then rabbitsBe faster then rabbits
Be faster then rabbits
 
External JavaScript Widget Development Best Practices (updated) (v.1.1)
External JavaScript Widget Development Best Practices (updated) (v.1.1) External JavaScript Widget Development Best Practices (updated) (v.1.1)
External JavaScript Widget Development Best Practices (updated) (v.1.1)
 
Road to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoopsRoad to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoops
 
321 codeincontainer brewbox
321 codeincontainer brewbox321 codeincontainer brewbox
321 codeincontainer brewbox
 
Web development tips and tricks
Web development tips and tricksWeb development tips and tricks
Web development tips and tricks
 
Security for devs
Security for devsSecurity for devs
Security for devs
 
External JavaScript Widget Development Best Practices
External JavaScript Widget Development Best PracticesExternal JavaScript Widget Development Best Practices
External JavaScript Widget Development Best Practices
 
Head in the clouds
Head in the cloudsHead in the clouds
Head in the clouds
 
Android lessons you won't learn in school
Android lessons you won't learn in schoolAndroid lessons you won't learn in school
Android lessons you won't learn in school
 
Java scriptwidgetdevelopmentjstanbul2012
Java scriptwidgetdevelopmentjstanbul2012Java scriptwidgetdevelopmentjstanbul2012
Java scriptwidgetdevelopmentjstanbul2012
 
Protecting Against Web App Attacks
Protecting Against Web App AttacksProtecting Against Web App Attacks
Protecting Against Web App Attacks
 
Cloud patterns
Cloud patternsCloud patterns
Cloud patterns
 
Crypto Miners in the Cloud
Crypto Miners in the CloudCrypto Miners in the Cloud
Crypto Miners in the Cloud
 
After the LAMP, it's time to get MEAN
After the LAMP, it's time to get MEANAfter the LAMP, it's time to get MEAN
After the LAMP, it's time to get MEAN
 
Web App Security Presentation by Ryan Holland - 05-31-2017
Web App Security Presentation by Ryan Holland - 05-31-2017Web App Security Presentation by Ryan Holland - 05-31-2017
Web App Security Presentation by Ryan Holland - 05-31-2017
 
Spa Secure Coding Guide
Spa Secure Coding GuideSpa Secure Coding Guide
Spa Secure Coding Guide
 
Application Streaming is dead. A smart way to choose an alternative
Application Streaming is dead. A smart way to choose an alternativeApplication Streaming is dead. A smart way to choose an alternative
Application Streaming is dead. A smart way to choose an alternative
 
20120306 dublin js
20120306 dublin js20120306 dublin js
20120306 dublin js
 

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@
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 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)

ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
+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...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
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...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
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
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
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...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
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 ...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
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
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

Do you lose sleep at night?

  • 1. DO YOU LOSE SLEEP AT NIGHT?
  • 2. Introductions Nathan Van Gheem Director of Solutions Engineering at Wildcard Corp @vangheezy vangheem@gmail.com nathanvangheem.com
  • 4. More about what I do • Plone(CMS) • Python • JavaScript • NoSQL • Linux
  • 5. Purpose • Learn more about common security issues • Change attitude and culture toward security • You, the site owner, can sleep at night • We, the site developers/system administrators, can sleep at night
  • 6. Why you should care about security • Responsibility • Reputation • Legal implications • $$$
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 14. CMS focus • Exposure • Complexity • Users • Features • Add-ons
  • 15. Covering the basics • firewall • open ports • vulnerability patches • mailing lists • server configuration • unprivileged user running server process
  • 16. What won’t be covered • DNS, DNSSEC • Physical security • Social engineering • Not in depth on OS Security
  • 17. Top 5 Security Vulnerabilities/Risks
  • 18. Top 5 • No particular order • Call em as I see em • We can quibble on what makes the top 5 and the order • From my experience • https://www.owasp.org/index.php/ Category:OWASP_Top_Ten_Project
  • 19. 1) SQLi - SQL Injection “A SQL injection attack consists of insertion or "injection" of a SQL query via the input data from the client to the application.” - OWASP
  • 20. SQLi Risk Level: HIGH • Full data compromise • Access compromise • Availability compromise • Possible to issue commands to operating system
  • 21. SQLi: How it works
  • 22. SQLi: How it works • Input from URL • Or input from form data
  • 25. 1) SQLi Prevention/Solutions • If you can, do not write SQL yourself, EVER(ORD) • Use parameterized statements • Stored procedures • Escape all input • WAF(Web Application Firewall) • Do not use a SQL database
  • 26. 2) (D)DOS - Denial of Service “The Denial of Service (DoS) attack is focused on making a resource (site, application, server) unavailable for the purpose it was designed.” - OWASP
  • 27. (D)DOS Risk Level: MEDIUM • Availability compromise • No sensitive data compromised • Easiest attack to perform
  • 28. (D)DOS: How it works • Known slow resources • Overload server • Bypass caching • Example: Script that when run, will make many simultaneous requests to a server in an attempt to overwhelm it
  • 29. DDOS: Distributed Denial of Service • Distributed to many machines • Zombie machines for hire • Botnets
  • 30. DDOS: LOIC: Low Orbit Ion Cannon • Hosted service DDOS • Powered by JavaScript • Socially driven attack • Generate random urls to bypass cache and overload target
  • 31. 2) (D)DOS Solutions • WAF(Web Application Firewall) • CDN(Content Delivery Network) • Caching, Load balancing • Keep cache warm • Serve stale content • Backup static copy of site
  • 32. 2) (D)DOS Solutions continued… • Profile code • Monitor traffic, use regular expressions to block request types • Rate limiting • LOIC: watch and block from known bad referrer header
  • 33. 3) XSS - Cross site scripting “Cross-Site Scripting (XSS) attacks are a type of injection, in which malicious scripts are injected into otherwise benign and trusted web sites. XSS attacks occur when an attacker uses a web application to send malicious code, generally in the form of a browser side script, to a different end user.” - OWASP
  • 34. XSS Risk Level: HIGH • Full data compromise • Access compromise
  • 35. XSS: Continued • Injects JavaScript into target web application • Input/output not validated(server side) • Targets already logged in users to cause malicious actions • Persistent: attack stored in application and rendered directly from application • Reflexive: attack is part of URL
  • 36. XSS: Reflexive example Source: http://www.codeproject.com/KB/web-security/617043/ReflectedXSS2.jpg
  • 37. XSS: How it’s exploited • Malicious user has ability to add attack to site • Social engineering gets logged in user to click exploited URL • JavaScript renders html that it assumes is safe
  • 38. 3) XSS Solutions • WAF(Web Application Firewall) • Validated user input • Escaped output • Use JavaScript libraries that are safe by default(ReactJS)
  • 39. 4) CSRF - Cross-Site Request Forgery “Cross-Site Request Forgery (CSRF) is an attack that forces an end user to execute unwanted actions on a web application in which they're currently authenticated.” - OWASP
  • 40. CSRF Risk Level: MEDIUM • Data compromise • Availability compromise
  • 41. CSRF: How it works • Target website needs privileged user logged in • Draw targeted user to view page with exploited URLs • Or click exploited URLs
  • 42. CSRF: Example • Malicious user makes a comment • Then logged in user reviews comment and executes that URL
  • 43. 4) CSRF Solutions • Force every operation to require unique authentication token to the logged in user • Authentication token protection implemented at the database layer • Well thought out frameworks require use of CSRF tokens for database changes are allowed
  • 44. 5) Access control • Broken, misconfigured access control • Information disclosure • misconfigured workflows • file uploads containing metadata • pre-package REST APIs giving out too much data
  • 45. 5) Access control solutions • Assume users will be lazy • Private by default • Scrub files • exiftool(linux) • Block any potential problem areas with web server rules
  • 47. Caching • Sits in front of web application • Caches content for a configured duration so the user does not hit the backend • Varnish** • Nginx(proxy_cache), Apache(mod_cache) do simple caching okay • Apache Traffic Server • Know your content, how to tune your cache
  • 49. CDN - Content Delivery Network • Geographically dispersed caching servers • WAF(Web Application Firewall) • Serve stale content • Keep cache warm • Cloudflare • Prepared for a stampede
  • 51. WAF - Web Application Firewall • CDN(Content Delivery Network)s often provide WAF • Cloudflare • Modsecurity(Apache) • Naxsi(nginx)
  • 53. Load balancing • Provide multiple application servers to handle requests from users • Better, more resilient performance • HAProxy** • Nginx • Apache • Varnish • CDN
  • 55. Database Selection • NOSQL • CouchDB/Couchbase • ZODB(Python/Plone) • RDMS: Support for replication
  • 56. Replication • All database engines provide some sort of solution for replication • Multiple servers can then server web application: better performance • Different networks if possible • Geographically dispersed
  • 58. Read-only / Read-write • Can your web application be readonly? • What parts of your solution require writes? Can they be done differently? • For example: Disqus for commenting • Different backend/frontend URLs • Are there tools for your platform to do pseudo read-only mode? • wildcard.readonly(Plone) • https://github.com/collective/wildcard.readonly • wildcard.lockdown(Plone) • https://github.com/collective/wildcard.lockdown
  • 59. Performance and security • Caching, CDN provide better performance • Warm caches provide improved performance • Keeps backends healthy to serve requests fast • Replicated database provides added performance • Geographically dispersed servers can provide lower latency
  • 60. Web server techniques • Understand your application/deployment • Minimize exposure • Robust, fail resistant configurations • Failover to back up replicated server, to static copy, etc • Can you block certain types of requests? • Rate limiting • Careful not to on IP
  • 61. Two Factor Authentication • Additional security for users • Does your 2-factor solution work as a wrapper around your web application or is it just another token passed into the login form? • https://github.com/wildcardcorp/factored • Proxy • Or Python WSGI filter
  • 62. Monitoring • Know what is going on your systems • Know traffic patterns • CDN/Proxy reporting • Log stash(https://www.elastic.co/products/logstash) • Pingdom(https://www.pingdom.com/) • Zabbix/Nagios/Munin/etc • New relic, Sentry • Cloud monitoring tools • ossec(http://ossec.github.io/)
  • 63. Vulnerability Scanning Tools • Will test web application against known exploit types • Acunetix, Netsparker, etc • https://www.owasp.org/index.php/ Category:Vulnerability_Scanning_Tools • Or google “vulnerability scanners” • Some open source • Some cloud solutions
  • 64. Add-ons and customizations Source: http://cheezburger.com/5158827264
  • 65. Add-ons • Assume ownership of every add-on you integrate • You are responsible for security • Audit code • Do NOT just install any add-on you find • Consider if you really need add-ons you install
  • 66. Add-ons and customizations • How do you install? • How do you update? • What kind of access do they have? • Are they allowed to execute arbitrary SQL queries? • Do they run in a sandboxed mode? • Reproducible builds?
  • 67. PHP The most popular open source CMS systems are written in PHP; which has a suspect security track record.
  • 68. PHP: Problems • Register globals: off • Remote file inclusion: off • Safe mode • Works by executing scripts on filesystem • Common to install/update add-ons through the web • Common to patch it’s own code
  • 69.
  • 70. What Plone does well • Permissions checked *before* view code is executed • CSRF protection at the database layer • Input and output filtering on everything • Add-ons must be installed by system administrators, process restart • Through the web customizations run in sandboxed mode • Monkey patching
  • 71. Final thoughts • A small investment in security, resiliency = big payoff • Understand web vulnerabilities • Understand risks • Be comfortable with your risks, exposure and technology • Secure sites can be beautiful. The security of a site has nothing to do with it’s design