SlideShare a Scribd company logo
1 of 35
presents
Welcome to the
WAF Workshop
Jose Nazario | Security Research Director
Enrique Hernandez | SOC Manager
Rex Belli | SOC Engineer
A brief intro to the Fastly
WAF
Introduction Chaotic
Capture the
Flag
In some CTF’s we attack,
in Others we defend. In
chaotic ones you do both!
Recent
Vulnerabilities
Review
A walkthrough of recent
vulnerabilities released in
blackhat this year
WAF Workshop
WAF Workshop
Incident patterns leading to breaches
Src: Verizon 2017 Data Breach Investigations Report (DBIR)
Introduction
What is a Fastly WAF
WAF Workshop
WAF Workshop
Fastly App Security In Layers
Fastly Edge cloud
Origin Server
Real-time programmable
security policy refresh
Policy changes are live
worldwide within ms
Client-side Web
Traffic
Secured Traffic
& Origin Protection
Client Devices
& Apps
Fastly VCLFastly Platform and Presence
TLS
Acceleration
Bot
Detection
Content
Validation
DDoS
Protection
Web Application
Firewall
Edge
Authentication
Edge
Access Control
● Low Latency
● Real-Time visibility
● A complete rule set
● Instant Push changes
WAF Workshop
Fastly WAF
WAF Workshop
1.5 to 20 ms overhead
WAF Workshop
Real-time logging Integrations
WAF Workshop
Generic, Application and Critical
WAF Workshop
Semi-Instant Changes
● SQL Injection (SQLi)
● Cross Site Scripting
● Local File Include/Directory Traversal
● Remote File Include
● Object Injection
● Command injection
WAF Workshop
Types of Attacks it Mitigates
# syslog soc_weblogs log
{"syslog 7YCnicdpjTvxxxxxxx soc-weblogs :: "}
{"{"type":"req","service_id":""} req.service_id
{"","request_id":""} req.http.fastly-soc-x-
request-id {"","datacenter":""} server.datacenter
{"","client_ip":""} req.http.Fastly-Client-IP
{"","req_method":""} req.request
{"","req_uri":""} cstr_escape(req.url)
{"","req_h_user_agent":""} {"","waf_logged":""}
waf.logged {"","waf_blocked":""} waf.blocked
{"","waf_failures":""} waf.failures
{"","anomaly_score":""} waf.anomaly_score
{"","resp_status":""} resp.status
{"","resp_bytes":""} resp.bytes_written
{"","resp_header_bytes":""}
resp.header_bytes_written
{"","resp_body_bytes":""} resp.body_bytes_written
{"""} "}";
Crucial Component
Logging of Attack and Request events
WAF Workshop
# syslog soc_weblogs log
{"syslog 7YCnicdpjTvxxxxxxx soc-weblogs :: "}
{"{"type":"req","service_id":""} req.service_id
{"","request_id":""} req.http.fastly-soc-x-
request-id {"","datacenter":""} server.datacenter
{"","client_ip":""} req.http.Fastly-Client-IP
{"","req_method":""} req.request
{"","req_uri":""} cstr_escape(req.url)
{"","req_h_user_agent":""} {"","waf_logged":""}
waf.logged {"","waf_blocked":""} waf.blocked
{"","waf_failures":""} waf.failures
{"","anomaly_score":""} waf.anomaly_score
{"","resp_status":""} resp.status
{"","resp_bytes":""} resp.bytes_written
{"","resp_header_bytes":""}
resp.header_bytes_written
{"","resp_body_bytes":""} resp.body_bytes_written
{"""} "}";
Crucial Component
API
WAF Workshop
SecRule REQUEST_COOKIES|!REQUEST_COOKIES:/__utm/|REQUEST_COOKIES_NAMES|REQUEST_HEADERS:User-
Agent|REQUEST_HEADERS:Referer|ARGS_NAMES|ARGS|XML:/* "@detectSQLi" 
"id:942100,
phase:2,
block,
capture,
t:none,t:utf8toUnicode,t:urlDecodeUni,t:removeNulls,
msg:'SQL Injection Attack Detected via libinjection',
logdata:'Matched Data: %{TX.0} found within %{MATCHED_VAR_NAME}: %{MATCHED_VAR}',
tag:'application-multi',
tag:'language-multi',
tag:'platform-multi',
tag:'attack-sqli',
tag:'OWASP_CRS/WEB_ATTACK/SQL_INJECTION',
tag:'WASCTC/WASC-19',
tag:'OWASP_TOP_10/A1',
tag:'OWASP_AppSensor/CIE1',
tag:'PCI/6.5.2',
ver:'OWASP_CRS/3.1.0',
severity:'CRITICAL',
multiMatch,
setvar:'tx.anomaly_score_pl1=+%{tx.critical_anomaly_score}',
setvar:'tx.sql_injection_score=+%{tx.critical_anomaly_score}',
setvar:'tx.msg=%{rule.msg}',
setvar:'tx.%{rule.id}-OWASP_CRS/WEB_ATTACK/SQL_INJECTION-%{matched_var_name}=%{matched_var}'"
Crucial Component
Rules
WAF Workshop
if (!req.http.fastly-soc-x-request-id)
{
set req.http.fastly-soc-x-request-id = digest.hash_sha256(now
randomstr(64) req.http.host req.url req.http.Fastly-Client-IP
server.identity);
}
Crucial Component
VCL Snippets
WAF Workshop
WAF UI
Sumologic WAF App
WAF Workshop
Interfaces
Preview Rule MGMT UI
Preview of WAF Rules UI
waflyctl .. WAF Control CLI
FTW .. Framework For Testing WAFs
WAF Workshop
Tooling
Capture the Flag
Contest Introduction
WAF Workshop
WAF Workshop
Layout
Configure
Attack/Targets
Crawl
Velites
Warden
Legatus
Team 1
Fastly Service
WAF
Juice shop 1
Team 2
Fastly Service
WAF
Juice shop 2Sumo 1 Sumo 2
Rules
1. Juice shop host needs to be always available
2. Only juice shops are under scope (not Fastly API or
other teams service)
3. No DDoS/DoS
4. No IP Blacklisting
5. Cannot switch all rules to blocking mode blindly
Scoring
1. Lowest score wins
2. Attackers increase score by grabbing flags
3. Defenders decrease score by patching vulnerabilities
4. Points will be removed for mitigating Velites attacks
5. Velites triggers random flag with in each tier at a given time:
a. Tier 1 - 15 mins
b. Tier 2- 30 mins
c. Tier 3 - 45 mins
d. Tier 4 - 1 hour
e. Tier 5 - 1 hour and 15 mins
WAF Workshop
Scoreboard
WAF Workshop
End to End Example
Instructions https://goo.gl/3DavuY
Recommended Tools:
● ZAP
● Burp
● SQLMap
WAF Workshop
Configuration 10m
CTF START
Start of contest
WAF Workshop
WINNERS
Contest winners and
prizes
WAF Workshop
BH/Defcon
Disclosures
What we learned,
what was most difficult to
mitigate and
what you can take away
WAF Workshop
WAF Workshop
We received cooperation from the researchers in these cases, which
enables us to study and mitigate these risks ahead of public disclosure.
We at Fastly greatly appreciate the back and forth with these
independent researchers.
Many Thanks to the Researchers
Practical Web Cache Poisoning, BHUSA 2018, James Kettle
What we learned
Zend (PHP) supports X-Rewrite-URL and X-Forwarded-URL headers
Controls backend response similar to X-Forwarded-Host does
Tons of stuff - like Drupal - inherit Zend
Confusion between caching layer and application layer
Most difficult aspect to mitigate
Can’t apply blanket VCL unset - unintended consequences possible
Exploit author at BHUSA developed a Burp Suite addition to probe for new headers, it’s endless
What you can take away
Understand your dependencies
Unset unexpected headers
Cache on expected headers
WAF Workshop
Cache Poisoning via XFU/XRU
Edge Side Include Injection, BHUSA 2018, Louis Dion Marcil
What we learned
ESI comments get stripped away, revealing underlying script code
This enables the attacker to bypass XSS, SQLi etc checks
Most difficult aspect to mitigate
ESI is complicated: <esi:comment /> for example, or <!-- esi --> , as well as arbitrary ESI field
names.
What you can take away
Mostly affects Apache Traffic Server, Oracle Weblogic
New WAF rules to block ESI
Minimal exposure at Fastly - ESI not enabled by default
We did find (and fix) an ESI bug, however
WAF Workshop
ESI Injection
CVE-5390
What we learned
Long standing bug, exasperated in Linux 4.9 with larger receive queue
Slow send rate by attacker, long (O(N)) reassembly time by server - denial of service
Instrumented kernels (via kprobes) to look for high rate of receive queue pruning
Most difficult aspect to mitigate
Rolling kernels and preserving cache hit rate
Tuning kernel receive buffers depends on a lot of factors
Dropping fragments not always possible
What you can take away
Hard to clean up on the wire, requires kernel change - config or new kernel
WAF Workshop
SegmentSmack
Lost and Found Certificates, Defcon 26, Ian Foster & Dylan Ayrey
What we learned
.Difference in how TLS certificates are renewed and domain names renewed
Transfer of owner of domain name to a new party without expiry of TLS certificate can lead to
security property loss
Most difficult aspect to mitigate
Shared certificates in CDN, cloud - lots of risk, get yourself on a shared cert with a high value
domain name and get it revoked, destroy cert for everyone sharing with you
What you can take away
We rate the risk as minimal
No easy answer, operational safety relies status quo for not revoking immediately on domain
transfer
Invest in a certificate you wholly own for maximum safety
WAF Workshop
BygoneSSL - Certificate
Revocation

More Related Content

What's hot

Multi domain security-management_technical_presentation
Multi domain security-management_technical_presentationMulti domain security-management_technical_presentation
Multi domain security-management_technical_presentation
davebrosnan
 

What's hot (20)

System hardening - OS and Application
System hardening - OS and ApplicationSystem hardening - OS and Application
System hardening - OS and Application
 
Tools for Offensive RTC security. Introducing SIPVicious PRO and the demo ser...
Tools for Offensive RTC security. Introducing SIPVicious PRO and the demo ser...Tools for Offensive RTC security. Introducing SIPVicious PRO and the demo ser...
Tools for Offensive RTC security. Introducing SIPVicious PRO and the demo ser...
 
Platform Security Summit 18: Xen Security Weather Report 2018
Platform Security Summit 18: Xen Security Weather Report 2018Platform Security Summit 18: Xen Security Weather Report 2018
Platform Security Summit 18: Xen Security Weather Report 2018
 
WAF in Scale
WAF in ScaleWAF in Scale
WAF in Scale
 
Securing Apache Web Servers
Securing Apache Web ServersSecuring Apache Web Servers
Securing Apache Web Servers
 
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
 
Multi domain security-management_technical_presentation
Multi domain security-management_technical_presentationMulti domain security-management_technical_presentation
Multi domain security-management_technical_presentation
 
Solaris servers sec
Solaris servers secSolaris servers sec
Solaris servers sec
 
Check Point designing a security
Check Point designing a securityCheck Point designing a security
Check Point designing a security
 
Future Internet Week - IPv6 the way forward: IPv6 and security from a user’s ...
Future Internet Week - IPv6 the way forward: IPv6 and security from a user’s ...Future Internet Week - IPv6 the way forward: IPv6 and security from a user’s ...
Future Internet Week - IPv6 the way forward: IPv6 and security from a user’s ...
 
Better Security Testing: Using the Cloud and Continuous Delivery
Better Security Testing: Using the Cloud and Continuous DeliveryBetter Security Testing: Using the Cloud and Continuous Delivery
Better Security Testing: Using the Cloud and Continuous Delivery
 
BeStorm Introduction
BeStorm IntroductionBeStorm Introduction
BeStorm Introduction
 
OSSA17 - Live patch, VMI, Security Mgmt (50 mins, no embedded demos)
OSSA17 - Live patch, VMI, Security Mgmt (50 mins, no embedded demos)OSSA17 - Live patch, VMI, Security Mgmt (50 mins, no embedded demos)
OSSA17 - Live patch, VMI, Security Mgmt (50 mins, no embedded demos)
 
Windows server hardening 1
Windows server hardening 1Windows server hardening 1
Windows server hardening 1
 
Server Load Balancer Test Methodology
Server Load Balancer Test MethodologyServer Load Balancer Test Methodology
Server Load Balancer Test Methodology
 
Web Application Firewall - Friend of your DevOps Pipeline?
Web Application Firewall - Friend of your DevOps Pipeline?Web Application Firewall - Friend of your DevOps Pipeline?
Web Application Firewall - Friend of your DevOps Pipeline?
 
Pxosys Webinar Amplify your Security
Pxosys Webinar Amplify your SecurityPxosys Webinar Amplify your Security
Pxosys Webinar Amplify your Security
 
Enterprise PowerShell for Remote Security Assessments
Enterprise PowerShell for Remote Security AssessmentsEnterprise PowerShell for Remote Security Assessments
Enterprise PowerShell for Remote Security Assessments
 
A Byte of Software Deployment
A Byte of Software DeploymentA Byte of Software Deployment
A Byte of Software Deployment
 
Web Database Server Best Practices
Web Database Server Best PracticesWeb Database Server Best Practices
Web Database Server Best Practices
 

Similar to Altitude San Francisco 2018: WAF Workshop

Isa2004 Configuration Guide
Isa2004 Configuration GuideIsa2004 Configuration Guide
Isa2004 Configuration Guide
guest60864fc
 
Track 1 Virtualizing Critical Applications with VMWARE VISPHERE by Roshan Shetty
Track 1 Virtualizing Critical Applications with VMWARE VISPHERE by Roshan ShettyTrack 1 Virtualizing Critical Applications with VMWARE VISPHERE by Roshan Shetty
Track 1 Virtualizing Critical Applications with VMWARE VISPHERE by Roshan Shetty
EMC Forum India
 
WAFFLE - A Web Application Firewall that defies rules
WAFFLE - A Web Application Firewall that defies rulesWAFFLE - A Web Application Firewall that defies rules
WAFFLE - A Web Application Firewall that defies rules
Dimitris Gkizanis
 

Similar to Altitude San Francisco 2018: WAF Workshop (20)

VMWare Lab For Training, Testing or Proof of Concept
VMWare Lab For Training, Testing or Proof of ConceptVMWare Lab For Training, Testing or Proof of Concept
VMWare Lab For Training, Testing or Proof of Concept
 
CloudFlare vs Incapsula: Round 2
CloudFlare vs Incapsula: Round 2CloudFlare vs Incapsula: Round 2
CloudFlare vs Incapsula: Round 2
 
Advanced malwareanalysis training session2 botnet analysis part1
Advanced malwareanalysis training session2 botnet analysis part1Advanced malwareanalysis training session2 botnet analysis part1
Advanced malwareanalysis training session2 botnet analysis part1
 
Faster, Higher, Stronger – Accelerating Fault Management to the Next Level
Faster, Higher, Stronger – Accelerating Fault Management to the Next LevelFaster, Higher, Stronger – Accelerating Fault Management to the Next Level
Faster, Higher, Stronger – Accelerating Fault Management to the Next Level
 
Zaccone Carmelo - IPv6 and security from a user’s point of view
Zaccone Carmelo - IPv6 and security from a user’s point of view Zaccone Carmelo - IPv6 and security from a user’s point of view
Zaccone Carmelo - IPv6 and security from a user’s point of view
 
Advanced Malware Analysis Training Session 2 - Botnet Analysis Part 1
Advanced Malware Analysis Training Session 2 - Botnet Analysis Part 1  Advanced Malware Analysis Training Session 2 - Botnet Analysis Part 1
Advanced Malware Analysis Training Session 2 - Botnet Analysis Part 1
 
Purple Teaming With Adversary Emulation.pdf
Purple Teaming With Adversary Emulation.pdfPurple Teaming With Adversary Emulation.pdf
Purple Teaming With Adversary Emulation.pdf
 
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 ...
 
What’s New at Cloudflare: New Product Launches
What’s New at Cloudflare: New Product LaunchesWhat’s New at Cloudflare: New Product Launches
What’s New at Cloudflare: New Product Launches
 
Apache Cloudstack QA Strategy
Apache Cloudstack QA StrategyApache Cloudstack QA Strategy
Apache Cloudstack QA Strategy
 
Locking Down CF Servers
Locking Down CF ServersLocking Down CF Servers
Locking Down CF Servers
 
Foundation Fieldbus - Control in the Field
Foundation Fieldbus - Control in the FieldFoundation Fieldbus - Control in the Field
Foundation Fieldbus - Control in the Field
 
WebSphere Technical University: Top WebSphere Problem Determination Features
WebSphere Technical University: Top WebSphere Problem Determination FeaturesWebSphere Technical University: Top WebSphere Problem Determination Features
WebSphere Technical University: Top WebSphere Problem Determination Features
 
Testing distributed systems in production
Testing distributed systems in productionTesting distributed systems in production
Testing distributed systems in production
 
Network performance test plan_v0.3
Network performance test plan_v0.3Network performance test plan_v0.3
Network performance test plan_v0.3
 
Isa2004 Configuration Guide
Isa2004 Configuration GuideIsa2004 Configuration Guide
Isa2004 Configuration Guide
 
Track 1 Virtualizing Critical Applications with VMWARE VISPHERE by Roshan Shetty
Track 1 Virtualizing Critical Applications with VMWARE VISPHERE by Roshan ShettyTrack 1 Virtualizing Critical Applications with VMWARE VISPHERE by Roshan Shetty
Track 1 Virtualizing Critical Applications with VMWARE VISPHERE by Roshan Shetty
 
When Web Services Go Bad
When Web Services Go BadWhen Web Services Go Bad
When Web Services Go Bad
 
Why Use Oracle VM for Oracle Databases? Revera Presentation
Why Use Oracle VM for Oracle Databases? Revera PresentationWhy Use Oracle VM for Oracle Databases? Revera Presentation
Why Use Oracle VM for Oracle Databases? Revera Presentation
 
WAFFLE - A Web Application Firewall that defies rules
WAFFLE - A Web Application Firewall that defies rulesWAFFLE - A Web Application Firewall that defies rules
WAFFLE - A Web Application Firewall that defies rules
 

More from Fastly

More from Fastly (20)

Revisiting HTTP/2
Revisiting HTTP/2Revisiting HTTP/2
Revisiting HTTP/2
 
Altitude San Francisco 2018: Preparing for Video Streaming Events at Scale
Altitude San Francisco 2018: Preparing for Video Streaming Events at ScaleAltitude San Francisco 2018: Preparing for Video Streaming Events at Scale
Altitude San Francisco 2018: Preparing for Video Streaming Events at Scale
 
Altitude San Francisco 2018: Building the Souther Hemisphere of the Internet
Altitude San Francisco 2018: Building the Souther Hemisphere of the InternetAltitude San Francisco 2018: Building the Souther Hemisphere of the Internet
Altitude San Francisco 2018: Building the Souther Hemisphere of the Internet
 
Altitude San Francisco 2018: The World Cup Stream
Altitude San Francisco 2018: The World Cup StreamAltitude San Francisco 2018: The World Cup Stream
Altitude San Francisco 2018: The World Cup Stream
 
Altitude San Francisco 2018: We Own Our Destiny
Altitude San Francisco 2018: We Own Our DestinyAltitude San Francisco 2018: We Own Our Destiny
Altitude San Francisco 2018: We Own Our Destiny
 
Altitude San Francisco 2018: Scale and Stability at the Edge with 1.4 Billion...
Altitude San Francisco 2018: Scale and Stability at the Edge with 1.4 Billion...Altitude San Francisco 2018: Scale and Stability at the Edge with 1.4 Billion...
Altitude San Francisco 2018: Scale and Stability at the Edge with 1.4 Billion...
 
Altitude San Francisco 2018: Moving Off the Monolith: A Seamless Migration
Altitude San Francisco 2018: Moving Off the Monolith: A Seamless MigrationAltitude San Francisco 2018: Moving Off the Monolith: A Seamless Migration
Altitude San Francisco 2018: Moving Off the Monolith: A Seamless Migration
 
Altitude San Francisco 2018: Bringing TLS to GitHub Pages
Altitude San Francisco 2018: Bringing TLS to GitHub PagesAltitude San Francisco 2018: Bringing TLS to GitHub Pages
Altitude San Francisco 2018: Bringing TLS to GitHub Pages
 
Altitude San Francisco 2018: HTTP Invalidation Workshop
Altitude San Francisco 2018: HTTP Invalidation WorkshopAltitude San Francisco 2018: HTTP Invalidation Workshop
Altitude San Francisco 2018: HTTP Invalidation Workshop
 
Altitude San Francisco 2018: HTTP/2 Tales: Discovery and Woe
Altitude San Francisco 2018: HTTP/2 Tales: Discovery and WoeAltitude San Francisco 2018: HTTP/2 Tales: Discovery and Woe
Altitude San Francisco 2018: HTTP/2 Tales: Discovery and Woe
 
Altitude San Francisco 2018: How Magento moved to the cloud while maintaining...
Altitude San Francisco 2018: How Magento moved to the cloud while maintaining...Altitude San Francisco 2018: How Magento moved to the cloud while maintaining...
Altitude San Francisco 2018: How Magento moved to the cloud while maintaining...
 
Altitude San Francisco 2018: Scaling Ethereum to 10B requests per day
Altitude San Francisco 2018: Scaling Ethereum to 10B requests per dayAltitude San Francisco 2018: Scaling Ethereum to 10B requests per day
Altitude San Francisco 2018: Scaling Ethereum to 10B requests per day
 
Altitude San Francisco 2018: Authentication at the Edge
Altitude San Francisco 2018: Authentication at the EdgeAltitude San Francisco 2018: Authentication at the Edge
Altitude San Francisco 2018: Authentication at the Edge
 
Altitude San Francisco 2018: WebAssembly Tools & Applications
Altitude San Francisco 2018: WebAssembly Tools & ApplicationsAltitude San Francisco 2018: WebAssembly Tools & Applications
Altitude San Francisco 2018: WebAssembly Tools & Applications
 
Altitude San Francisco 2018: Testing with Fastly Workshop
Altitude San Francisco 2018: Testing with Fastly WorkshopAltitude San Francisco 2018: Testing with Fastly Workshop
Altitude San Francisco 2018: Testing with Fastly Workshop
 
Altitude San Francisco 2018: Fastly Purge Control at the USA TODAY NETWORK
Altitude San Francisco 2018: Fastly Purge Control at the USA TODAY NETWORKAltitude San Francisco 2018: Fastly Purge Control at the USA TODAY NETWORK
Altitude San Francisco 2018: Fastly Purge Control at the USA TODAY NETWORK
 
Altitude San Francisco 2018: Logging at the Edge
Altitude San Francisco 2018: Logging at the Edge Altitude San Francisco 2018: Logging at the Edge
Altitude San Francisco 2018: Logging at the Edge
 
Altitude San Francisco 2018: Video Workshop Docs
Altitude San Francisco 2018: Video Workshop DocsAltitude San Francisco 2018: Video Workshop Docs
Altitude San Francisco 2018: Video Workshop Docs
 
Altitude San Francisco 2018: Programming the Edge
Altitude San Francisco 2018: Programming the EdgeAltitude San Francisco 2018: Programming the Edge
Altitude San Francisco 2018: Programming the Edge
 
Enabling lightning fast content delivery for Spotify
Enabling lightning fast content delivery for SpotifyEnabling lightning fast content delivery for Spotify
Enabling lightning fast content delivery for Spotify
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Recently uploaded (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

Altitude San Francisco 2018: WAF Workshop

  • 1. presents Welcome to the WAF Workshop Jose Nazario | Security Research Director Enrique Hernandez | SOC Manager Rex Belli | SOC Engineer
  • 2. A brief intro to the Fastly WAF Introduction Chaotic Capture the Flag In some CTF’s we attack, in Others we defend. In chaotic ones you do both! Recent Vulnerabilities Review A walkthrough of recent vulnerabilities released in blackhat this year WAF Workshop
  • 3. WAF Workshop Incident patterns leading to breaches Src: Verizon 2017 Data Breach Investigations Report (DBIR)
  • 4. Introduction What is a Fastly WAF WAF Workshop
  • 5. WAF Workshop Fastly App Security In Layers Fastly Edge cloud Origin Server Real-time programmable security policy refresh Policy changes are live worldwide within ms Client-side Web Traffic Secured Traffic & Origin Protection Client Devices & Apps Fastly VCLFastly Platform and Presence TLS Acceleration Bot Detection Content Validation DDoS Protection Web Application Firewall Edge Authentication Edge Access Control
  • 6. ● Low Latency ● Real-Time visibility ● A complete rule set ● Instant Push changes WAF Workshop Fastly WAF
  • 7. WAF Workshop 1.5 to 20 ms overhead
  • 11. ● SQL Injection (SQLi) ● Cross Site Scripting ● Local File Include/Directory Traversal ● Remote File Include ● Object Injection ● Command injection WAF Workshop Types of Attacks it Mitigates
  • 12. # syslog soc_weblogs log {"syslog 7YCnicdpjTvxxxxxxx soc-weblogs :: "} {"{"type":"req","service_id":""} req.service_id {"","request_id":""} req.http.fastly-soc-x- request-id {"","datacenter":""} server.datacenter {"","client_ip":""} req.http.Fastly-Client-IP {"","req_method":""} req.request {"","req_uri":""} cstr_escape(req.url) {"","req_h_user_agent":""} {"","waf_logged":""} waf.logged {"","waf_blocked":""} waf.blocked {"","waf_failures":""} waf.failures {"","anomaly_score":""} waf.anomaly_score {"","resp_status":""} resp.status {"","resp_bytes":""} resp.bytes_written {"","resp_header_bytes":""} resp.header_bytes_written {"","resp_body_bytes":""} resp.body_bytes_written {"""} "}"; Crucial Component Logging of Attack and Request events WAF Workshop
  • 13. # syslog soc_weblogs log {"syslog 7YCnicdpjTvxxxxxxx soc-weblogs :: "} {"{"type":"req","service_id":""} req.service_id {"","request_id":""} req.http.fastly-soc-x- request-id {"","datacenter":""} server.datacenter {"","client_ip":""} req.http.Fastly-Client-IP {"","req_method":""} req.request {"","req_uri":""} cstr_escape(req.url) {"","req_h_user_agent":""} {"","waf_logged":""} waf.logged {"","waf_blocked":""} waf.blocked {"","waf_failures":""} waf.failures {"","anomaly_score":""} waf.anomaly_score {"","resp_status":""} resp.status {"","resp_bytes":""} resp.bytes_written {"","resp_header_bytes":""} resp.header_bytes_written {"","resp_body_bytes":""} resp.body_bytes_written {"""} "}"; Crucial Component API WAF Workshop
  • 14. SecRule REQUEST_COOKIES|!REQUEST_COOKIES:/__utm/|REQUEST_COOKIES_NAMES|REQUEST_HEADERS:User- Agent|REQUEST_HEADERS:Referer|ARGS_NAMES|ARGS|XML:/* "@detectSQLi" "id:942100, phase:2, block, capture, t:none,t:utf8toUnicode,t:urlDecodeUni,t:removeNulls, msg:'SQL Injection Attack Detected via libinjection', logdata:'Matched Data: %{TX.0} found within %{MATCHED_VAR_NAME}: %{MATCHED_VAR}', tag:'application-multi', tag:'language-multi', tag:'platform-multi', tag:'attack-sqli', tag:'OWASP_CRS/WEB_ATTACK/SQL_INJECTION', tag:'WASCTC/WASC-19', tag:'OWASP_TOP_10/A1', tag:'OWASP_AppSensor/CIE1', tag:'PCI/6.5.2', ver:'OWASP_CRS/3.1.0', severity:'CRITICAL', multiMatch, setvar:'tx.anomaly_score_pl1=+%{tx.critical_anomaly_score}', setvar:'tx.sql_injection_score=+%{tx.critical_anomaly_score}', setvar:'tx.msg=%{rule.msg}', setvar:'tx.%{rule.id}-OWASP_CRS/WEB_ATTACK/SQL_INJECTION-%{matched_var_name}=%{matched_var}'" Crucial Component Rules WAF Workshop
  • 15. if (!req.http.fastly-soc-x-request-id) { set req.http.fastly-soc-x-request-id = digest.hash_sha256(now randomstr(64) req.http.host req.url req.http.Fastly-Client-IP server.identity); } Crucial Component VCL Snippets WAF Workshop
  • 16. WAF UI Sumologic WAF App WAF Workshop Interfaces
  • 18. Preview of WAF Rules UI
  • 19. waflyctl .. WAF Control CLI FTW .. Framework For Testing WAFs WAF Workshop Tooling
  • 20. Capture the Flag Contest Introduction WAF Workshop
  • 21. WAF Workshop Layout Configure Attack/Targets Crawl Velites Warden Legatus Team 1 Fastly Service WAF Juice shop 1 Team 2 Fastly Service WAF Juice shop 2Sumo 1 Sumo 2
  • 22. Rules 1. Juice shop host needs to be always available 2. Only juice shops are under scope (not Fastly API or other teams service) 3. No DDoS/DoS 4. No IP Blacklisting 5. Cannot switch all rules to blocking mode blindly
  • 23. Scoring 1. Lowest score wins 2. Attackers increase score by grabbing flags 3. Defenders decrease score by patching vulnerabilities 4. Points will be removed for mitigating Velites attacks 5. Velites triggers random flag with in each tier at a given time: a. Tier 1 - 15 mins b. Tier 2- 30 mins c. Tier 3 - 45 mins d. Tier 4 - 1 hour e. Tier 5 - 1 hour and 15 mins
  • 26. End to End Example
  • 27. Instructions https://goo.gl/3DavuY Recommended Tools: ● ZAP ● Burp ● SQLMap WAF Workshop Configuration 10m
  • 28. CTF START Start of contest WAF Workshop
  • 30. BH/Defcon Disclosures What we learned, what was most difficult to mitigate and what you can take away WAF Workshop
  • 31. WAF Workshop We received cooperation from the researchers in these cases, which enables us to study and mitigate these risks ahead of public disclosure. We at Fastly greatly appreciate the back and forth with these independent researchers. Many Thanks to the Researchers
  • 32. Practical Web Cache Poisoning, BHUSA 2018, James Kettle What we learned Zend (PHP) supports X-Rewrite-URL and X-Forwarded-URL headers Controls backend response similar to X-Forwarded-Host does Tons of stuff - like Drupal - inherit Zend Confusion between caching layer and application layer Most difficult aspect to mitigate Can’t apply blanket VCL unset - unintended consequences possible Exploit author at BHUSA developed a Burp Suite addition to probe for new headers, it’s endless What you can take away Understand your dependencies Unset unexpected headers Cache on expected headers WAF Workshop Cache Poisoning via XFU/XRU
  • 33. Edge Side Include Injection, BHUSA 2018, Louis Dion Marcil What we learned ESI comments get stripped away, revealing underlying script code This enables the attacker to bypass XSS, SQLi etc checks Most difficult aspect to mitigate ESI is complicated: <esi:comment /> for example, or <!-- esi --> , as well as arbitrary ESI field names. What you can take away Mostly affects Apache Traffic Server, Oracle Weblogic New WAF rules to block ESI Minimal exposure at Fastly - ESI not enabled by default We did find (and fix) an ESI bug, however WAF Workshop ESI Injection
  • 34. CVE-5390 What we learned Long standing bug, exasperated in Linux 4.9 with larger receive queue Slow send rate by attacker, long (O(N)) reassembly time by server - denial of service Instrumented kernels (via kprobes) to look for high rate of receive queue pruning Most difficult aspect to mitigate Rolling kernels and preserving cache hit rate Tuning kernel receive buffers depends on a lot of factors Dropping fragments not always possible What you can take away Hard to clean up on the wire, requires kernel change - config or new kernel WAF Workshop SegmentSmack
  • 35. Lost and Found Certificates, Defcon 26, Ian Foster & Dylan Ayrey What we learned .Difference in how TLS certificates are renewed and domain names renewed Transfer of owner of domain name to a new party without expiry of TLS certificate can lead to security property loss Most difficult aspect to mitigate Shared certificates in CDN, cloud - lots of risk, get yourself on a shared cert with a high value domain name and get it revoked, destroy cert for everyone sharing with you What you can take away We rate the risk as minimal No easy answer, operational safety relies status quo for not revoking immediately on domain transfer Invest in a certificate you wholly own for maximum safety WAF Workshop BygoneSSL - Certificate Revocation

Editor's Notes

  1. Why should you care, most data breaches stem or start with a web attack as an initialization vector
  2. 15min
  3. Talk about how Fastly approaches security
  4. Talk about how Fastly approaches security
  5. Features of Fastly WAF and what is it Emphasis on speed .. Near time Visibility PCI Compliance
  6. Fastly’s WAF provides global protection without any significant performance impact because it’s fully integrated into our Varnish-based edge cloud platform. Using a set of pre-built rules, we only run WAF detection logic on requests that cannot be served from cache, saving valuable milliseconds in detecting attacks aimed at the origin server. Integration with our edge cloud platform also ensures support for IPv6 and HTTP/2.
  7. Fastly’s cloud-based WAF consumes third-party rules from the OWASP Core Ruleset, commercial sources, and open source, in addition to Fastly-generated rules. Customers are protected from key application-layer attacks, such as injection attacks and malicious inputs, cross site scripting, data exfiltration, HTTP protocol violations, and other OWASP Top 10 threats. Fastly WAF rules are instantly configurable so you can respond to threats as they arise.
  8. Built on our powerful edge cloud platform, Fastly’s WAF gives you access to 100% of your security events and notifications within seconds from the edge. You can quickly identify potential application layer threats and make instant configuration changes to your WAF rules from within our service. Real-time log streaming also gives you immediate visibility into attack mitigation efforts.
  9. How it mitigates it and limitations (no response checking) you can use snippets to fill those gaps
  10. You will be using the Sumo UI today
  11. Shout out
  12. 10min Reverse CTF Each team given a vulnerable website and a WAF to protect it Teams will be able to attack other teams
  13. Tier 6 will be ignored
  14. Green is untriggered challenges - for which you will receive no points Red is triggered challenges - for which you will receive positive points Blue is mitigated challenges - for which you will receive negative points
  15. Tools that will be used (js/scoreboard, sumologic, rule management UI) Sumo has the Fastly pre-installed
  16. Form Teams in this slide
  17. 1h
  18. Where we go to juice shop, then launch attacks then go to sumo analyze, then go to Rule UI and activate rule.
  19. 10 min
  20. 15min
  21. <scr<esi:comment text="the goal of the comment is just to break the script tag"/>ipt>alert(/Chrome%20XSS%20filter%20bypass/);</script> <script>alert(/Chrome%20XSS%20filter%20bypass/);</script>
  22. https://isc.sans.edu/forums/diary/Back+to+the+90s+FragmentSmack/23998/
  23. Code syntax highlighting isn’t natively supported by Google Slides. To apply syntax highlighting to your text box do the following steps in Chrome: Go to https://tohtml.com Paste your code snippet in the box Press the ‘highlight’ button Paste the highlighted code in the text boxes on the slide
  24. If you text isn’t legible against your background (such as in this case), there’s a second layer of type layered directly underneath to create a small outline. Photo is under the MIT license.
  25. Code syntax highlighting isn’t natively supported by Google Slides. To apply syntax highlighting to your text box do the following steps in Chrome: Go to https://tohtml.com Paste your code snippet in the box Press the ‘highlight’ button Paste the highlighted code in the text boxes on the slide
  26. Code syntax highlighting isn’t natively supported by Google Slides. To apply syntax highlighting to your text box do the following steps in Chrome: Go to https://tohtml.com Paste your code snippet in the box Press the ‘highlight’ button Paste the highlighted code in the text boxes on the slide