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

推荐订阅源

罗磊的独立博客
SecWiki News
SecWiki News
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
量子位
M
MIT News - Artificial intelligence
GbyAI
GbyAI
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
TaoSecurity Blog
TaoSecurity Blog
博客园 - 【当耐特】
H
Heimdal Security Blog
腾讯CDC
The Last Watchdog
The Last Watchdog
Security Archives - TechRepublic
Security Archives - TechRepublic
Hacker News: Ask HN
Hacker News: Ask HN
S
Schneier on Security
Microsoft Security Blog
Microsoft Security Blog
WordPress大学
WordPress大学
博客园 - 司徒正美
Recent Commits to openclaw:main
Recent Commits to openclaw:main
C
Cybersecurity and Infrastructure Security Agency CISA
S
SegmentFault 最新的问题
大猫的无限游戏
大猫的无限游戏
Application and Cybersecurity Blog
Application and Cybersecurity Blog
F
Full Disclosure
有赞技术团队
有赞技术团队
T
Tailwind CSS Blog
Engineering at Meta
Engineering at Meta
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Threatpost
月光博客
月光博客
A
Arctic Wolf
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
雷峰网
雷峰网
T
Troy Hunt's Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The Cloudflare Blog
D
DataBreaches.Net
O
OpenAI News
L
LINUX DO - 最新话题
宝玉的分享
宝玉的分享
小众软件
小众软件
V
Vulnerabilities – Threatpost
A
About on SuperTechFans
人人都是产品经理
人人都是产品经理
T
The Exploit Database - CXSecurity.com
Martin Fowler
Martin Fowler
美团技术团队
P
Privacy International News Feed

不明の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 后你可以根据你自己的需求对规则进行调整,规则详情可以参考两者的官方文档。