跳到正文
Skillpedia
安全35k · #8139

implementing-web-application-logging-with-modsecurity

它能做什么

这个功能帮你设置一个名为 ModSecurity 的安全系统,用来记录网页应用上的活动。它就像互联网流量的“交警”,记录谁试图访问什么内容,以及是否存在可疑行为。

适用场景

  • ✓当你为网站安装新的安全系统时。
  • ✓当你需要调查针对网站的攻击尝试时。
  • ✓当你需要微调安全规则,避免不必要的拦截时。

技能链接

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

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-web-application-logging-with-modsecurity/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“设置 ModSecurity,记录针对我网站的 SQL Injection 攻击尝试。”

每周 5 个新技能,1 分钟读完。

工作原理

ModSecurity 会监控发送到你网站的请求。它使用一套规则(OWASP CRS)来识别恶意活动,并把这些尝试记录到日志文件中,供之后分析。

技术内容(原始 SKILL.md)

作者在 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"]
常见问题

什么是 ModSecurity?

ModSecurity 是一个充当 Web 应用防火墙(WAF)的程序,可以保护你的网站免受常见攻击。

什么是 OWASP CRS?

OWASP CRS 是一套预定义的安全规则,ModSecurity 用它来检测和拦截 SQL 注入、XSS 等威胁。

什么是“误报”?

误报是指安全系统把正常操作误认为是攻击而将其拦截。调整规则有助于避免这种情况。

详情

作者的原始描述

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

热度

GitHub 星标
35k
排名
#8139
许可证
Apache-2.0
更新时间
2026/8/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能