SlideShare a Scribd company logo
Easily Deploying and
Optimizing Open
Source Web
Application Firewalls
In 20 minutes or less
What is a WAF
● Assuming you’re here you probably already know
● What it does
○ Sits in front of web applications and filters HTTP based on some
set of criteria
● What it doesn’t do
○ Solve all “OWASP Top 10” issues
● The most common Open Source WAF is ModSecurity
○ Most commonly used with OWASP CRS
Core Rule Set v3.0
● The last major release of CRS was in 2013 (2.2)
● In November 2016 we released 3.0
Features
● 3.0 Additions
○ Paranoia levels
○ Improved rule quality
● 3.1 Adds
○ Rewritten SQL Injection Rules
○ Java Protections
○ More pretuned application support
○ Better testing
Deploying
● Both ModSecurity and Core Rule Set can be installed using package
managers
○ Only really recent versions of ubuntu (18.04) have CRS 3.0.2 and modsec 2.9.2
○ Generally you are better off installing at minimum CRS from source
Apt-get install modsecurity-crs libapache2-modsecurity
Dnf install mod_security mod_security_crs
CI: Docker for ModSecurity
We have Docker images available on GitHub and Dockerhub
https://github.com/CRS-support/modsecurity-docker
https://hub.docker.com/r/owasp/modsecurity/
We use Docker as part of testing so we support a number of different variants
We use a multistage builds which keeps size down
ModSecv2 on Ubuntu with Nginx ModSecv2 on Ubuntu with Apache
ModSecv2 on Alpine with Apache ModSecv3 on Ubuntu with Apache
CI: Ansible
We also have ansible support -
https://github.com/CRS-support/modsecurity-ansible-role
Ansible requires a few prereqs to run obviously.
Install ModSec: ansible-playbook modsecurity.yaml --tags "modsec_install"
Install CRS: ansible-playbook modsecurity.yaml --tags "crs_install"
CI: ModSecurity + Core Rule Set
The Core Rule Set provides a Docker image that builds on the ModSecurity
image.
It is available in the CRS repo (/utils) and on DockerHub
● https://hub.docker.com/r/owasp/modsecurity-crs/
The Ansible playbook also has the capability to provide CRS.
Optimizations
Save Processing
● Biggest gains come from reducing work
○ Restrict processing on content types you don’t care about.
■ SecResponseBodyMimeType
■ X
● Place the WAF where it doesn’t need to recreate the wheel
○ At or after the TLS termination proxy is a good place.
● Remove processors you don’t need or use (JSON/XML)
SecRule REQUEST_BASENAME ".*?(.[a-z0-9]{1,10})?$" "id:123, t:lowercase,
capture.setvar:tx.extension=/%{TX.1}/, chain,nolog, allow"
SecRule TX:EXTENSION "!@within %{tx.static_extensions}" "t:none"
Hide the bodies
● Storing request or response bodies can be arbitrarily expensive.
○ Determine what the max size of request/response bodies on
your site (SecResponseBodyLimit and SecResponseBodyLimitAction)
● Use CTL: to skip to after rules that process request body when we
don’t care.
● Use CTL: to shut off response body access when it’s not needed
SecRule REQUEST_FILENAME "@beginsWith /admin"
"id:2,pass,nolog,ctl:requestBodyAccess=Off"
SecRule REQUEST_FILENAME "@beginsWith /admin"
"id:3,pass,nolog,ctl:responseBodyAccess=Off"
Stop with the noise!
● If you are using audit logs, don’t use error logs (and vice versa)
● Logging is expensive, only log what you need.
○ Serial versus concurrent audit logging.
○ Nolog and noauditlog are critical to this process
○ Also refine which audit parts you want stored
SecRule ARGS "<script>"
"id:3,nolog,block,ctl:auditLogParts=+ABCDFGH"
Using the Correct Rules
● Minimize the amount of rules that are running
● Minimize the types of rules you’re running
○ Booting up the PCRE engine on every rule is hard work for the engine
● Remember the engine itself has some overhead.
○ Allocating memory to store Req/Resp data (blocking)
○ Running comparisons (blocking)
○ Generating logs (non-blocking of the transaction)
Questions

More Related Content

What's hot

Redis fundamental
Redis fundamentalRedis fundamental
Redis fundamental
Yuhao Zhang
 
15th Athens Big Data Meetup - 1st Talk - Running Spark On Mesos
15th Athens Big Data Meetup - 1st Talk - Running Spark On Mesos15th Athens Big Data Meetup - 1st Talk - Running Spark On Mesos
15th Athens Big Data Meetup - 1st Talk - Running Spark On Mesos
Athens Big Data
 
Don't Build "Death Star" Security - O'Reilly Software Architecture Conference...
Don't Build "Death Star" Security - O'Reilly Software Architecture Conference...Don't Build "Death Star" Security - O'Reilly Software Architecture Conference...
Don't Build "Death Star" Security - O'Reilly Software Architecture Conference...
David Timothy Strauss
 
Meteor Meets Mallory
Meteor Meets MalloryMeteor Meets Mallory
Meteor Meets Mallory
Emily Stark
 
Vault w/ config injection kubernetes canada
Vault w/ config injection   kubernetes canadaVault w/ config injection   kubernetes canada
Vault w/ config injection kubernetes canada
Jean-Philippe Bélanger
 
Metasploit: Pwnage and Ponies
Metasploit: Pwnage and PoniesMetasploit: Pwnage and Ponies
Metasploit: Pwnage and Ponies
Trowalts
 
Mobile Programming - 3 UDP
Mobile Programming - 3 UDPMobile Programming - 3 UDP
Mobile Programming - 3 UDP
Riza Fahmi
 
Nginx cheat sheet
Nginx cheat sheetNginx cheat sheet
Nginx cheat sheet
Lam Hoang
 
Azure ServiceBus Queues and Topics
Azure ServiceBus Queues and TopicsAzure ServiceBus Queues and Topics
Azure ServiceBus Queues and Topics
Igor Moochnick
 
JSConfBR - Securing Node.js App, by the community and for the community
JSConfBR - Securing Node.js App, by the community and for the community JSConfBR - Securing Node.js App, by the community and for the community
JSConfBR - Securing Node.js App, by the community and for the community
David Dias
 
Mobile Programming - Network Universitas Budi Luhur
Mobile Programming - Network Universitas Budi LuhurMobile Programming - Network Universitas Budi Luhur
Mobile Programming - Network Universitas Budi Luhur
Riza Fahmi
 
Using IPS for Web Protection
Using IPS for Web ProtectionUsing IPS for Web Protection
Using IPS for Web ProtectionConferencias FIST
 
Nginx
NginxNginx
Insecurity-In-Security version.1 (2010)
Insecurity-In-Security version.1 (2010)Insecurity-In-Security version.1 (2010)
Insecurity-In-Security version.1 (2010)
Abhishek Kumar
 
KSDG-iSlide App 開發心得分享
KSDG-iSlide App 開發心得分享KSDG-iSlide App 開發心得分享
KSDG-iSlide App 開發心得分享
Chia Wei Tsai
 
Insecurity-In-Security version.2 (2011)
Insecurity-In-Security version.2 (2011)Insecurity-In-Security version.2 (2011)
Insecurity-In-Security version.2 (2011)
Abhishek Kumar
 
Sophos XG FIREWALL SSL VPN Configuration
Sophos XG FIREWALL SSL VPN ConfigurationSophos XG FIREWALL SSL VPN Configuration
Sophos XG FIREWALL SSL VPN Configuration
Naseem Khoodoruth
 
Mise en place d'un client VPN l2tp IPsec sous docker
Mise en place d'un client VPN l2tp IPsec sous dockerMise en place d'un client VPN l2tp IPsec sous docker
Mise en place d'un client VPN l2tp IPsec sous docker
Nicolas Trauwaen
 
using Virtualbox NAT and shared folder
using Virtualbox NAT and shared folderusing Virtualbox NAT and shared folder
using Virtualbox NAT and shared folder
Yingshiuan Pan
 
Squid Server
Squid ServerSquid Server
Squid Server
Sumant Garg
 

What's hot (20)

Redis fundamental
Redis fundamentalRedis fundamental
Redis fundamental
 
15th Athens Big Data Meetup - 1st Talk - Running Spark On Mesos
15th Athens Big Data Meetup - 1st Talk - Running Spark On Mesos15th Athens Big Data Meetup - 1st Talk - Running Spark On Mesos
15th Athens Big Data Meetup - 1st Talk - Running Spark On Mesos
 
Don't Build "Death Star" Security - O'Reilly Software Architecture Conference...
Don't Build "Death Star" Security - O'Reilly Software Architecture Conference...Don't Build "Death Star" Security - O'Reilly Software Architecture Conference...
Don't Build "Death Star" Security - O'Reilly Software Architecture Conference...
 
Meteor Meets Mallory
Meteor Meets MalloryMeteor Meets Mallory
Meteor Meets Mallory
 
Vault w/ config injection kubernetes canada
Vault w/ config injection   kubernetes canadaVault w/ config injection   kubernetes canada
Vault w/ config injection kubernetes canada
 
Metasploit: Pwnage and Ponies
Metasploit: Pwnage and PoniesMetasploit: Pwnage and Ponies
Metasploit: Pwnage and Ponies
 
Mobile Programming - 3 UDP
Mobile Programming - 3 UDPMobile Programming - 3 UDP
Mobile Programming - 3 UDP
 
Nginx cheat sheet
Nginx cheat sheetNginx cheat sheet
Nginx cheat sheet
 
Azure ServiceBus Queues and Topics
Azure ServiceBus Queues and TopicsAzure ServiceBus Queues and Topics
Azure ServiceBus Queues and Topics
 
JSConfBR - Securing Node.js App, by the community and for the community
JSConfBR - Securing Node.js App, by the community and for the community JSConfBR - Securing Node.js App, by the community and for the community
JSConfBR - Securing Node.js App, by the community and for the community
 
Mobile Programming - Network Universitas Budi Luhur
Mobile Programming - Network Universitas Budi LuhurMobile Programming - Network Universitas Budi Luhur
Mobile Programming - Network Universitas Budi Luhur
 
Using IPS for Web Protection
Using IPS for Web ProtectionUsing IPS for Web Protection
Using IPS for Web Protection
 
Nginx
NginxNginx
Nginx
 
Insecurity-In-Security version.1 (2010)
Insecurity-In-Security version.1 (2010)Insecurity-In-Security version.1 (2010)
Insecurity-In-Security version.1 (2010)
 
KSDG-iSlide App 開發心得分享
KSDG-iSlide App 開發心得分享KSDG-iSlide App 開發心得分享
KSDG-iSlide App 開發心得分享
 
Insecurity-In-Security version.2 (2011)
Insecurity-In-Security version.2 (2011)Insecurity-In-Security version.2 (2011)
Insecurity-In-Security version.2 (2011)
 
Sophos XG FIREWALL SSL VPN Configuration
Sophos XG FIREWALL SSL VPN ConfigurationSophos XG FIREWALL SSL VPN Configuration
Sophos XG FIREWALL SSL VPN Configuration
 
Mise en place d'un client VPN l2tp IPsec sous docker
Mise en place d'un client VPN l2tp IPsec sous dockerMise en place d'un client VPN l2tp IPsec sous docker
Mise en place d'un client VPN l2tp IPsec sous docker
 
using Virtualbox NAT and shared folder
using Virtualbox NAT and shared folderusing Virtualbox NAT and shared folder
using Virtualbox NAT and shared folder
 
Squid Server
Squid ServerSquid Server
Squid Server
 

Similar to BSides Rochester 2018: Chaim Sanders: Easily Deploying and Optimizing Open Source Web Application Firewalls

Python And The MySQL X DevAPI - PyCaribbean 2019
Python And The MySQL X DevAPI - PyCaribbean 2019Python And The MySQL X DevAPI - PyCaribbean 2019
Python And The MySQL X DevAPI - PyCaribbean 2019
Dave Stokes
 
Hawkular overview
Hawkular overviewHawkular overview
Hawkular overview
Ted Won
 
Hawkular overview
Hawkular overviewHawkular overview
Hawkular overview
jbugkorea
 
Hands-on Lab - Combaring Redis with Relational
Hands-on Lab - Combaring Redis with RelationalHands-on Lab - Combaring Redis with Relational
Hands-on Lab - Combaring Redis with Relational
Amazon Web Services
 
Lab Manual Combaring Redis with Relational
Lab Manual Combaring Redis with RelationalLab Manual Combaring Redis with Relational
Lab Manual Combaring Redis with Relational
Amazon Web Services
 
Crikeycon 2019 Velociraptor Workshop
Crikeycon 2019 Velociraptor WorkshopCrikeycon 2019 Velociraptor Workshop
Crikeycon 2019 Velociraptor Workshop
Velocidex Enterprises
 
Deploying OpenStack with Ansible
Deploying OpenStack with AnsibleDeploying OpenStack with Ansible
Deploying OpenStack with Ansible
Kevin Carter
 
Scaling symfony apps
Scaling symfony appsScaling symfony apps
Scaling symfony apps
Matteo Moretti
 
Reusable, composable, battle-tested Terraform modules
Reusable, composable, battle-tested Terraform modulesReusable, composable, battle-tested Terraform modules
Reusable, composable, battle-tested Terraform modules
Yevgeniy Brikman
 
Best Practices for Developing & Deploying Java Applications with Docker
Best Practices for Developing & Deploying Java Applications with DockerBest Practices for Developing & Deploying Java Applications with Docker
Best Practices for Developing & Deploying Java Applications with Docker
Eric Smalling
 
Prometheus and Docker (Docker Galway, November 2015)
Prometheus and Docker (Docker Galway, November 2015)Prometheus and Docker (Docker Galway, November 2015)
Prometheus and Docker (Docker Galway, November 2015)
Brian Brazil
 
VMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld 2016: vSphere 6.x Host Resource Deep DiveVMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld
 
2nodesoracle12craconyourlaptopvirtualboxstepbystepguide1 0-130627143310-phpapp02
2nodesoracle12craconyourlaptopvirtualboxstepbystepguide1 0-130627143310-phpapp022nodesoracle12craconyourlaptopvirtualboxstepbystepguide1 0-130627143310-phpapp02
2nodesoracle12craconyourlaptopvirtualboxstepbystepguide1 0-130627143310-phpapp02shaikyunus1980
 
RAC 12c
RAC 12cRAC 12c
Nodejs vatsal shah
Nodejs vatsal shahNodejs vatsal shah
Nodejs vatsal shah
Vatsal N Shah
 
Ippevent : openshift Introduction
Ippevent : openshift IntroductionIppevent : openshift Introduction
Ippevent : openshift Introduction
kanedafromparis
 
MongoDB – Sharded cluster tutorial - Percona Europe 2017
MongoDB – Sharded cluster tutorial - Percona Europe 2017MongoDB – Sharded cluster tutorial - Percona Europe 2017
MongoDB – Sharded cluster tutorial - Percona Europe 2017
Antonios Giannopoulos
 
Sharded cluster tutorial
Sharded cluster tutorialSharded cluster tutorial
Sharded cluster tutorial
Antonios Giannopoulos
 
MongoDB - Sharded Cluster Tutorial
MongoDB - Sharded Cluster TutorialMongoDB - Sharded Cluster Tutorial
MongoDB - Sharded Cluster Tutorial
Jason Terpko
 
Docker Swarm secrets for creating great FIWARE platforms
Docker Swarm secrets for creating great FIWARE platformsDocker Swarm secrets for creating great FIWARE platforms
Docker Swarm secrets for creating great FIWARE platforms
Federico Michele Facca
 

Similar to BSides Rochester 2018: Chaim Sanders: Easily Deploying and Optimizing Open Source Web Application Firewalls (20)

Python And The MySQL X DevAPI - PyCaribbean 2019
Python And The MySQL X DevAPI - PyCaribbean 2019Python And The MySQL X DevAPI - PyCaribbean 2019
Python And The MySQL X DevAPI - PyCaribbean 2019
 
Hawkular overview
Hawkular overviewHawkular overview
Hawkular overview
 
Hawkular overview
Hawkular overviewHawkular overview
Hawkular overview
 
Hands-on Lab - Combaring Redis with Relational
Hands-on Lab - Combaring Redis with RelationalHands-on Lab - Combaring Redis with Relational
Hands-on Lab - Combaring Redis with Relational
 
Lab Manual Combaring Redis with Relational
Lab Manual Combaring Redis with RelationalLab Manual Combaring Redis with Relational
Lab Manual Combaring Redis with Relational
 
Crikeycon 2019 Velociraptor Workshop
Crikeycon 2019 Velociraptor WorkshopCrikeycon 2019 Velociraptor Workshop
Crikeycon 2019 Velociraptor Workshop
 
Deploying OpenStack with Ansible
Deploying OpenStack with AnsibleDeploying OpenStack with Ansible
Deploying OpenStack with Ansible
 
Scaling symfony apps
Scaling symfony appsScaling symfony apps
Scaling symfony apps
 
Reusable, composable, battle-tested Terraform modules
Reusable, composable, battle-tested Terraform modulesReusable, composable, battle-tested Terraform modules
Reusable, composable, battle-tested Terraform modules
 
Best Practices for Developing & Deploying Java Applications with Docker
Best Practices for Developing & Deploying Java Applications with DockerBest Practices for Developing & Deploying Java Applications with Docker
Best Practices for Developing & Deploying Java Applications with Docker
 
Prometheus and Docker (Docker Galway, November 2015)
Prometheus and Docker (Docker Galway, November 2015)Prometheus and Docker (Docker Galway, November 2015)
Prometheus and Docker (Docker Galway, November 2015)
 
VMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld 2016: vSphere 6.x Host Resource Deep DiveVMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld 2016: vSphere 6.x Host Resource Deep Dive
 
2nodesoracle12craconyourlaptopvirtualboxstepbystepguide1 0-130627143310-phpapp02
2nodesoracle12craconyourlaptopvirtualboxstepbystepguide1 0-130627143310-phpapp022nodesoracle12craconyourlaptopvirtualboxstepbystepguide1 0-130627143310-phpapp02
2nodesoracle12craconyourlaptopvirtualboxstepbystepguide1 0-130627143310-phpapp02
 
RAC 12c
RAC 12cRAC 12c
RAC 12c
 
Nodejs vatsal shah
Nodejs vatsal shahNodejs vatsal shah
Nodejs vatsal shah
 
Ippevent : openshift Introduction
Ippevent : openshift IntroductionIppevent : openshift Introduction
Ippevent : openshift Introduction
 
MongoDB – Sharded cluster tutorial - Percona Europe 2017
MongoDB – Sharded cluster tutorial - Percona Europe 2017MongoDB – Sharded cluster tutorial - Percona Europe 2017
MongoDB – Sharded cluster tutorial - Percona Europe 2017
 
Sharded cluster tutorial
Sharded cluster tutorialSharded cluster tutorial
Sharded cluster tutorial
 
MongoDB - Sharded Cluster Tutorial
MongoDB - Sharded Cluster TutorialMongoDB - Sharded Cluster Tutorial
MongoDB - Sharded Cluster Tutorial
 
Docker Swarm secrets for creating great FIWARE platforms
Docker Swarm secrets for creating great FIWARE platformsDocker Swarm secrets for creating great FIWARE platforms
Docker Swarm secrets for creating great FIWARE platforms
 

More from JosephTesta9

BSides Rochester 2018: Chaim Sanders: How the Cookie Crumbles: Modern HTTP St...
BSides Rochester 2018: Chaim Sanders: How the Cookie Crumbles: Modern HTTP St...BSides Rochester 2018: Chaim Sanders: How the Cookie Crumbles: Modern HTTP St...
BSides Rochester 2018: Chaim Sanders: How the Cookie Crumbles: Modern HTTP St...
JosephTesta9
 
BSides Rochester 2018: Justin Moore: Automated HTTP Request Repeating With Bu...
BSides Rochester 2018: Justin Moore: Automated HTTP Request Repeating With Bu...BSides Rochester 2018: Justin Moore: Automated HTTP Request Repeating With Bu...
BSides Rochester 2018: Justin Moore: Automated HTTP Request Repeating With Bu...
JosephTesta9
 
BSides Rochester 2018: Dave Kukfa: BinDbg: Easy Windows Debugging for Binary ...
BSides Rochester 2018: Dave Kukfa: BinDbg: Easy Windows Debugging for Binary ...BSides Rochester 2018: Dave Kukfa: BinDbg: Easy Windows Debugging for Binary ...
BSides Rochester 2018: Dave Kukfa: BinDbg: Easy Windows Debugging for Binary ...
JosephTesta9
 
BSides Rochester 2018: Timothy Duffy: Civic and Humanitarian Open Source
BSides Rochester 2018: Timothy Duffy: Civic and Humanitarian Open SourceBSides Rochester 2018: Timothy Duffy: Civic and Humanitarian Open Source
BSides Rochester 2018: Timothy Duffy: Civic and Humanitarian Open Source
JosephTesta9
 
BSides Rochester 2018: Michael West: Sentry, Or: How I Learned To Stop Worryi...
BSides Rochester 2018: Michael West: Sentry, Or: How I Learned To Stop Worryi...BSides Rochester 2018: Michael West: Sentry, Or: How I Learned To Stop Worryi...
BSides Rochester 2018: Michael West: Sentry, Or: How I Learned To Stop Worryi...
JosephTesta9
 
BSides Rochester 2018: Lee Kagan: Red and Blue Ping Pong
BSides Rochester 2018: Lee Kagan: Red and Blue Ping PongBSides Rochester 2018: Lee Kagan: Red and Blue Ping Pong
BSides Rochester 2018: Lee Kagan: Red and Blue Ping Pong
JosephTesta9
 
BSides Rochester 2018: Jonathan Myers: IoT Malware Detection with Machine Lea...
BSides Rochester 2018: Jonathan Myers: IoT Malware Detection with Machine Lea...BSides Rochester 2018: Jonathan Myers: IoT Malware Detection with Machine Lea...
BSides Rochester 2018: Jonathan Myers: IoT Malware Detection with Machine Lea...
JosephTesta9
 
BSides Rochester 2018: Issa Hafiri & Christian Halbert: IOT Devices (And Why ...
BSides Rochester 2018: Issa Hafiri & Christian Halbert: IOT Devices (And Why ...BSides Rochester 2018: Issa Hafiri & Christian Halbert: IOT Devices (And Why ...
BSides Rochester 2018: Issa Hafiri & Christian Halbert: IOT Devices (And Why ...
JosephTesta9
 
BSides Rochester 2018: Esteban Rodriguez: Ducky In The Middle: Injecting keys...
BSides Rochester 2018: Esteban Rodriguez: Ducky In The Middle: Injecting keys...BSides Rochester 2018: Esteban Rodriguez: Ducky In The Middle: Injecting keys...
BSides Rochester 2018: Esteban Rodriguez: Ducky In The Middle: Injecting keys...
JosephTesta9
 
BSides Rochester 2018: Drew Kirkpatrick: Open Source SAST and DAST Tools for ...
BSides Rochester 2018: Drew Kirkpatrick: Open Source SAST and DAST Tools for ...BSides Rochester 2018: Drew Kirkpatrick: Open Source SAST and DAST Tools for ...
BSides Rochester 2018: Drew Kirkpatrick: Open Source SAST and DAST Tools for ...
JosephTesta9
 
BSides Rochester 2018: Chris Partridge: Turning Domain Data Into Domain Intel...
BSides Rochester 2018: Chris Partridge: Turning Domain Data Into Domain Intel...BSides Rochester 2018: Chris Partridge: Turning Domain Data Into Domain Intel...
BSides Rochester 2018: Chris Partridge: Turning Domain Data Into Domain Intel...
JosephTesta9
 
BSides Rochester 2018: Anthony DiDonato: Virtualization Based Security
BSides Rochester 2018: Anthony DiDonato: Virtualization Based SecurityBSides Rochester 2018: Anthony DiDonato: Virtualization Based Security
BSides Rochester 2018: Anthony DiDonato: Virtualization Based Security
JosephTesta9
 

More from JosephTesta9 (12)

BSides Rochester 2018: Chaim Sanders: How the Cookie Crumbles: Modern HTTP St...
BSides Rochester 2018: Chaim Sanders: How the Cookie Crumbles: Modern HTTP St...BSides Rochester 2018: Chaim Sanders: How the Cookie Crumbles: Modern HTTP St...
BSides Rochester 2018: Chaim Sanders: How the Cookie Crumbles: Modern HTTP St...
 
BSides Rochester 2018: Justin Moore: Automated HTTP Request Repeating With Bu...
BSides Rochester 2018: Justin Moore: Automated HTTP Request Repeating With Bu...BSides Rochester 2018: Justin Moore: Automated HTTP Request Repeating With Bu...
BSides Rochester 2018: Justin Moore: Automated HTTP Request Repeating With Bu...
 
BSides Rochester 2018: Dave Kukfa: BinDbg: Easy Windows Debugging for Binary ...
BSides Rochester 2018: Dave Kukfa: BinDbg: Easy Windows Debugging for Binary ...BSides Rochester 2018: Dave Kukfa: BinDbg: Easy Windows Debugging for Binary ...
BSides Rochester 2018: Dave Kukfa: BinDbg: Easy Windows Debugging for Binary ...
 
BSides Rochester 2018: Timothy Duffy: Civic and Humanitarian Open Source
BSides Rochester 2018: Timothy Duffy: Civic and Humanitarian Open SourceBSides Rochester 2018: Timothy Duffy: Civic and Humanitarian Open Source
BSides Rochester 2018: Timothy Duffy: Civic and Humanitarian Open Source
 
BSides Rochester 2018: Michael West: Sentry, Or: How I Learned To Stop Worryi...
BSides Rochester 2018: Michael West: Sentry, Or: How I Learned To Stop Worryi...BSides Rochester 2018: Michael West: Sentry, Or: How I Learned To Stop Worryi...
BSides Rochester 2018: Michael West: Sentry, Or: How I Learned To Stop Worryi...
 
BSides Rochester 2018: Lee Kagan: Red and Blue Ping Pong
BSides Rochester 2018: Lee Kagan: Red and Blue Ping PongBSides Rochester 2018: Lee Kagan: Red and Blue Ping Pong
BSides Rochester 2018: Lee Kagan: Red and Blue Ping Pong
 
BSides Rochester 2018: Jonathan Myers: IoT Malware Detection with Machine Lea...
BSides Rochester 2018: Jonathan Myers: IoT Malware Detection with Machine Lea...BSides Rochester 2018: Jonathan Myers: IoT Malware Detection with Machine Lea...
BSides Rochester 2018: Jonathan Myers: IoT Malware Detection with Machine Lea...
 
BSides Rochester 2018: Issa Hafiri & Christian Halbert: IOT Devices (And Why ...
BSides Rochester 2018: Issa Hafiri & Christian Halbert: IOT Devices (And Why ...BSides Rochester 2018: Issa Hafiri & Christian Halbert: IOT Devices (And Why ...
BSides Rochester 2018: Issa Hafiri & Christian Halbert: IOT Devices (And Why ...
 
BSides Rochester 2018: Esteban Rodriguez: Ducky In The Middle: Injecting keys...
BSides Rochester 2018: Esteban Rodriguez: Ducky In The Middle: Injecting keys...BSides Rochester 2018: Esteban Rodriguez: Ducky In The Middle: Injecting keys...
BSides Rochester 2018: Esteban Rodriguez: Ducky In The Middle: Injecting keys...
 
BSides Rochester 2018: Drew Kirkpatrick: Open Source SAST and DAST Tools for ...
BSides Rochester 2018: Drew Kirkpatrick: Open Source SAST and DAST Tools for ...BSides Rochester 2018: Drew Kirkpatrick: Open Source SAST and DAST Tools for ...
BSides Rochester 2018: Drew Kirkpatrick: Open Source SAST and DAST Tools for ...
 
BSides Rochester 2018: Chris Partridge: Turning Domain Data Into Domain Intel...
BSides Rochester 2018: Chris Partridge: Turning Domain Data Into Domain Intel...BSides Rochester 2018: Chris Partridge: Turning Domain Data Into Domain Intel...
BSides Rochester 2018: Chris Partridge: Turning Domain Data Into Domain Intel...
 
BSides Rochester 2018: Anthony DiDonato: Virtualization Based Security
BSides Rochester 2018: Anthony DiDonato: Virtualization Based SecurityBSides Rochester 2018: Anthony DiDonato: Virtualization Based Security
BSides Rochester 2018: Anthony DiDonato: Virtualization Based Security
 

Recently uploaded

UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 

Recently uploaded (20)

UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 

BSides Rochester 2018: Chaim Sanders: Easily Deploying and Optimizing Open Source Web Application Firewalls

  • 1. Easily Deploying and Optimizing Open Source Web Application Firewalls In 20 minutes or less
  • 2. What is a WAF ● Assuming you’re here you probably already know ● What it does ○ Sits in front of web applications and filters HTTP based on some set of criteria ● What it doesn’t do ○ Solve all “OWASP Top 10” issues ● The most common Open Source WAF is ModSecurity ○ Most commonly used with OWASP CRS
  • 3. Core Rule Set v3.0 ● The last major release of CRS was in 2013 (2.2) ● In November 2016 we released 3.0 Features ● 3.0 Additions ○ Paranoia levels ○ Improved rule quality ● 3.1 Adds ○ Rewritten SQL Injection Rules ○ Java Protections ○ More pretuned application support ○ Better testing
  • 4. Deploying ● Both ModSecurity and Core Rule Set can be installed using package managers ○ Only really recent versions of ubuntu (18.04) have CRS 3.0.2 and modsec 2.9.2 ○ Generally you are better off installing at minimum CRS from source Apt-get install modsecurity-crs libapache2-modsecurity Dnf install mod_security mod_security_crs
  • 5. CI: Docker for ModSecurity We have Docker images available on GitHub and Dockerhub https://github.com/CRS-support/modsecurity-docker https://hub.docker.com/r/owasp/modsecurity/ We use Docker as part of testing so we support a number of different variants We use a multistage builds which keeps size down ModSecv2 on Ubuntu with Nginx ModSecv2 on Ubuntu with Apache ModSecv2 on Alpine with Apache ModSecv3 on Ubuntu with Apache
  • 6. CI: Ansible We also have ansible support - https://github.com/CRS-support/modsecurity-ansible-role Ansible requires a few prereqs to run obviously. Install ModSec: ansible-playbook modsecurity.yaml --tags "modsec_install" Install CRS: ansible-playbook modsecurity.yaml --tags "crs_install"
  • 7. CI: ModSecurity + Core Rule Set The Core Rule Set provides a Docker image that builds on the ModSecurity image. It is available in the CRS repo (/utils) and on DockerHub ● https://hub.docker.com/r/owasp/modsecurity-crs/ The Ansible playbook also has the capability to provide CRS.
  • 9. Save Processing ● Biggest gains come from reducing work ○ Restrict processing on content types you don’t care about. ■ SecResponseBodyMimeType ■ X ● Place the WAF where it doesn’t need to recreate the wheel ○ At or after the TLS termination proxy is a good place. ● Remove processors you don’t need or use (JSON/XML) SecRule REQUEST_BASENAME ".*?(.[a-z0-9]{1,10})?$" "id:123, t:lowercase, capture.setvar:tx.extension=/%{TX.1}/, chain,nolog, allow" SecRule TX:EXTENSION "!@within %{tx.static_extensions}" "t:none"
  • 10. Hide the bodies ● Storing request or response bodies can be arbitrarily expensive. ○ Determine what the max size of request/response bodies on your site (SecResponseBodyLimit and SecResponseBodyLimitAction) ● Use CTL: to skip to after rules that process request body when we don’t care. ● Use CTL: to shut off response body access when it’s not needed SecRule REQUEST_FILENAME "@beginsWith /admin" "id:2,pass,nolog,ctl:requestBodyAccess=Off" SecRule REQUEST_FILENAME "@beginsWith /admin" "id:3,pass,nolog,ctl:responseBodyAccess=Off"
  • 11. Stop with the noise! ● If you are using audit logs, don’t use error logs (and vice versa) ● Logging is expensive, only log what you need. ○ Serial versus concurrent audit logging. ○ Nolog and noauditlog are critical to this process ○ Also refine which audit parts you want stored SecRule ARGS "<script>" "id:3,nolog,block,ctl:auditLogParts=+ABCDFGH"
  • 12. Using the Correct Rules ● Minimize the amount of rules that are running ● Minimize the types of rules you’re running ○ Booting up the PCRE engine on every rule is hard work for the engine ● Remember the engine itself has some overhead. ○ Allocating memory to store Req/Resp data (blocking) ○ Running comparisons (blocking) ○ Generating logs (non-blocking of the transaction)