Skip to content
Skillpedia
Security35k · #8139

implementing-web-application-logging-with-modsecurity

What it does

This feature helps set up a security system called ModSecurity to log activities on web applications. It acts like an internet traffic cop, noting who tries to access what and if there's any suspicious activity.

When to use it

  • ✓When installing a new security system for your website.
  • ✓When you need to investigate attack attempts on your website.
  • ✓To fine-tune security rules and avoid unnecessary blocks.

Skill link

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-web-application-logging-with-modsecurity/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-web-application-logging-with-modsecurity/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Set up ModSecurity to log SQL Injection attack attempts on my website.”

5 new skills a week. 1 minute to read.

How it works

ModSecurity monitors the requests coming to your website. It uses a set of rules (OWASP CRS) to identify malicious activities and logs these attempts in log files for later analysis.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Implementing Web Application Logging with ModSecurity

Overview

ModSecurity is an open-source WAF engine that works with Apache, Nginx, and IIS. The OWASP Core Rule Set (CRS) provides generic attack detection rules covering SQL injection, XSS, RCE, LFI, and other OWASP Top 10 attacks. ModSecurity logs full request/response data in audit logs for forensic analysis and generates alerts that feed into SIEM platforms.

When to Use

  • When deploying or configuring implementing web application logging with modsecurity capabilities in your environment
  • When establishing security controls aligned to compliance requirements
  • When building or improving security architecture for this domain
  • When conducting security assessments that require this implementation

Prerequisites

  • Web server (Apache 2.4+ or Nginx) with ModSecurity v3 module
  • OWASP CRS v4.x installed
  • Log aggregation infrastructure (ELK, Splunk, or Wazuh)

Steps

  1. Install ModSecurity and configure SecRuleEngine in DetectionOnly mode
  2. Deploy OWASP CRS v4 and set paranoia level (PL1-PL4)
  3. Configure SecAuditEngine for relevant-only logging
  4. Tune false positives with SecRuleRemoveById and rule exclusions
  5. Switch to blocking mode (SecRuleEngine On) after tuning period
  6. Forward audit logs to SIEM for correlation and alerting

Expected Output

ModSecurity: Warning. Pattern match "(?:union\s+select)" [file "/etc/modsecurity/crs/rules/REQUEST-942-APPLICATION-ATTACK-SQLI.conf"] [line "45"] [id "942100"] [msg "SQL Injection Attack Detected via libinjection"] [severity "CRITICAL"]
FAQ

What is ModSecurity?

ModSecurity is a program that acts as a Web Application Firewall (WAF), protecting your website from common attacks.

What is OWASP CRS?

OWASP CRS is a set of pre-defined security rules that ModSecurity uses to detect and block threats like SQL injection and XSS.

What are 'false positives'?

False positives occur when the security system blocks a legitimate action, thinking it's an attack. Adjusting the rules helps prevent this.

Details

Original description by the author

Configure ModSecurity WAF with the OWASP Core Rule Set (CRS) for web application audit logging, tuning SecRuleEngine, SecAuditEngine, and CRS paranoia levels to reduce false positives, and writing custom SecRules for application-specific threats. Use when deploying or tuning a ModSecurity WAF, analyzing audit logs for attack detection, or reducing CRS false positives.

repo: mukul975/Anthropic-Cybersecurity-Skills

Popularity

GitHub stars
35k
Ranking position
#8139
License
Apache-2.0
Updated
8/31/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills