OpenAppsec is a powerful web application firewall (WAF) that provides security for web applications by inspecting and filtering HTTP traffic between a web application and the Internet. In this article, we will guide you through the process of installing OpenAppsec WAF free edition for Nginx, one of the most popular web servers.
Step 1: Download and Install OpenAppsec
The first step is to download and install OpenAppsec WAF. Use the following commands in your terminal:
wget https://downloads.openappsec.io/open-appsec-install && chmod +x open-appsec-install
./open-appsec-install --auto --prevent
- The
--auto
flag ensures that the relevant software is downloaded, and OpenAppsec is added to NGINX automatically. - The
--prevent
flag is used for training purposes. Typically, you should start with the defaultdetect-learn
mode.
Step 2: Manage OpenAppsec WAF
After the installation, you can manage OpenAppsec using the following commands:
Check Status
open-appsec-ctl --status
This command provides information about the current status of OpenAppsec.
Stop and Start Agent
open-appsec-ctl --stop-agent
open-appsec-ctl --start-agent
Use these commands to stop and start the OpenAppsec agent.
Manage Policies
open-appsec-ctl --list-policies
open-appsec-ctl --view-policy
open-appsec-ctl --edit-policy
open-appsec-ctl --apply-policy
These commands allow you to list, view, edit, and apply policies to configure OpenAppsec according to your specific requirements.
View Logs
open-appsec-ctl --view-logs
Check the logs to monitor the activities and events detected by OpenAppsec.
Step 3: Restart Nginx
After making changes or applying policies, it’s essential to restart Nginx for the changes to take effect:
service nginx restart
This ensures that the OpenAppsec WAF configurations are properly applied to your Nginx web server.
Congratulations! You have successfully installed and configured OpenAppsec WAF for Nginx. This free and robust security solution will help protect your web applications from various cyber threats.