惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

W
WeLiveSecurity
T
Tenable Blog
Project Zero
Project Zero
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
S
Schneier on Security
Scott Helme
Scott Helme
S
Securelist
Know Your Adversary
Know Your Adversary
Vercel News
Vercel News
IT之家
IT之家
V
V2EX
F
Fortinet All Blogs
Simon Willison's Weblog
Simon Willison's Weblog
K
Kaspersky official blog
博客园_首页
T
Tailwind CSS Blog
The GitHub Blog
The GitHub Blog
Spread Privacy
Spread Privacy
Microsoft Security Blog
Microsoft Security Blog
Cisco Talos Blog
Cisco Talos Blog
The Register - Security
The Register - Security
有赞技术团队
有赞技术团队
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Cyberwarzone
Cyberwarzone
Google DeepMind News
Google DeepMind News
The Hacker News
The Hacker News
L
LINUX DO - 热门话题
Hugging Face - Blog
Hugging Face - Blog
博客园 - 三生石上(FineUI控件)
A
Arctic Wolf
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
CXSECURITY Database RSS Feed - CXSecurity.com
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Threat Research - Cisco Blogs
P
Proofpoint News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Privacy & Cybersecurity Law Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
CERT Recently Published Vulnerability Notes
S
SegmentFault 最新的问题
AWS News Blog
AWS News Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
罗磊的独立博客
Apple Machine Learning Research
Apple Machine Learning Research
P
Proofpoint News Feed
The Cloudflare Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Vulnerabilities – Threatpost

不明のNetWorkOS

使用 GitHub 部署密钥部署代码 Supervisor 的安装与使用 PHP 中的 JIT 配置 IOC 服务容器 在 Nginx 中为 PHP 添加环境变量 Python 使用 virtualenv 部署 flask 项目 Git 基础命令 在 Laravel 中的 Vue 组件无法使用 @apply 的解决方案 [转载] 免费 VPS 大全
Libmodsecurity 的安装与使用
不明 · 2023-06-04 · via 不明のNetWorkOS

Libmodsecurity 是 ModSecurity v3 项目的一个组成部分。该库代码库作为 ModSecurity 连接器的接口,接收 Web 流量并应用传统的 ModSecurity 处理。总体而言,它提供了加载/解释以 ModSecurity SecRules 格式编写的规则并将其应用于通过连接器提供的 HTTP 内容的能力。

Github 连接:ModSecurity

这里展示如何编译安装最新版的 Libmodsecurity 系统使用 Debian 11 。

安装依赖

apt update

apt -y install libyajl-dev libpcre++-dev libxml2-dev libgeoip1 libmaxminddb-dev libfuzzy-dev liblua5.3-dev liblmdb-dev libpcre2-dev liblmdb-dev libcurl4-openssl-dev

这些依赖是博主自己参考官网文档的依赖关系章节总结而来,并且经过验证。

编译安装 Libmodsecurity

用 git 将 Libmodsecurity 下载至你需要的位置(一般来说是 /usr/src)。

cd 到源码目录下安顺序执行:

./build.sh
git submodule init
git submodule update
./configure --with-lmdb --with-pcre2
sudo make && make install

配置 Libmodsecurity

复制源码中的 unicode.mapping 和 modsecurity.conf-recommended 到你所使用的 http 服务器的配置目录中(modsecurity.conf-recommended 要重命名为 modsecurity.conf)

下载 OWASP 规则

Github 连接:OWASP

复制 crs-setup.conf.example 到 crs-setup.conf(可选)编辑此文件以配置正确的 CRS 设置。然后将这些文件置入 modsecurity.conf 中

Include /.../crs-setup.conf
Include /.../rules/*.conf

安装完成 OWASP 后你可以根据你自己的需求对规则进行调整,规则详情可以参考两者的官方文档。