Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
    • Security
Google Cloud Platform icon
Labs

Configure ModSecurity

The goal for this lab is to configure ModSecurity for the Apache web server. There are a few things you need to keep in mind before you start the lab. Take into consideration that firewalld is up and running and that ports 61613, 80, and 65535 are open. Port 61613 is your SSH port where you will connect. Apache is running on port 80, and the back end is functioning on port 65535. SELinux is in enforcing mode. The objective of the lab is to install ModSecurity from the repositories, load it, and instruct Apache to use it. Lastly, install ModSecurity to use OWASP rules in order to apply them against traffic.

Google Cloud Platform icon
Lab platform
Lab Info
Level
Intermediate
Last updated
Sep 22, 2025
Duration
45m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Install `mod_security`
    1. Install mod_security from the repositories:
      sudo yum install mod_security
      
  2. Challenge

    Configure OWASP Core Rule Set (CRS)
    1. Make a crs directory:

      sudo mkdir /etc/httpd/crs
      
    2. Navigate to the new directory:

      cd /etc/httpd/crs
      
    3. Install Git:

      sudo yum install git
      
    4. Clone a Git repository for OWASP CRS:

      sudo git clone https://github.com/SpiderLabs/owasp-modsecurity-crs.git
      
    5. Configure the new repository:

      sudo cd /etc/httpd/crs/owasp-modsecurity-crs/ 
      
    6. Make a copy of crs-setup.conf.example and rename it to crs-setup.conf:

      sudo cp crs-setup.conf.example crs-setup.conf
      
  3. Challenge

    Inform Apache of the Changes
    1. Open the configuration file:

      sudo vim /etc/httpd/conf/httpd.conf
      
    2. Insert at the bottom of the file:

      <IfModule security2_module>
         Include /etc/httpd/crs/owasp-modsecurity-crs/crs-setup.conf
         Include /etc/httpd/crs/owasp-modsecurity-crs/rules/*.conf
      </IfModule> 
      
    3. Save and close:

      ESC
      :wq
      ENTER
      
  4. Challenge

    Restart Apache and Run a Few Tests to Confirm `mod_security` Is Working Properly
    1. Restart the Apache service:

      sudo systemctl restart httpd
      
    2. Run a test:

      curl -i http://<SERVER_IP_ADDRESS>/index.html -A Nessus 
      
About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight