Title here
Summary here
下载存储库
| |
安装完成后,CrowdSec 会自动:
重新载入配置:
| |
使用修复组件阻止攻击(安装防火墙组件)
CrowdSec 默认不会拦截流量,必须安装 Bouncer 才会封禁 IP
请选择与你系统一致的防火墙(推荐 nftables)
安装完成后,bouncer 会:
重启服务
| |
连接 CrowdSec 控制台(可选)
打开 CrowdSec Engines如何安装 页面 ,在 3 Connect with the Console 中复制命令执行,例:
| |
在终端中输入注册成功后: 您可以在 引擎 页面找到您的引擎,等待审核。
检查是否获取社区封禁(CAPI)
| |
root@LA:~# cscli metrics | grep -i capi
| generic:scan | CAPI | ban | 2023 |
| ssh:bruteforce | CAPI | ban | 12970 |
| ssh:exploit | CAPI | ban | 7 |检查 bouncer 是否正常
| |
root@LA:~# cscli bouncers list
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Name IP Address Valid Last API pull Type Version Auth Type
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
firewall-bouncer 127.0.0.1 ✔️ 2026-04-07T05:22:51Z crowdsec-firewall-bouncer v0.0.34-debian-pragmatic-amd64-12345678900987654321ee64253dfd90bbc1f698 api-key
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────查看防火墙拦截统计
| |
root@LA:~#
cscli metrics show bouncers
╭────────────────────────────────────────────────────────────────────────────────────╮
│ Bouncer Metrics (firewall-bouncer) since 2026-04-07 05:16:51 +0000 UTC │
├────────────────────────────┬──────────────────┬──────────────────┬─────────────────┤
│ Origin │ active_decisions │ dropped │ processed │
│ │ IPs │ bytes │ packets │ bytes │ packets │
├────────────────────────────┼──────────────────┼────────┼─────────┼───────┼─────────┤
│ CAPI (community blocklist) │ 15.00k │ 5.38k │ 98 │ - │ - │
│ lists:firehol_greensnow │ - │ 7.16k │ 179 │ - │ - │
├────────────────────────────┼──────────────────┼────────┼─────────┼───────┼─────────┤
│ Total │ 15.00k │ 12.54k │ 277 │ 3.42M │ 11.49k │
╰────────────────────────────┴──────────────────┴────────┴─────────┴───────┴─────────╯查看日志
| |
为什么没有 Bouncer Metrics?
cscli metrics show bouncers
No bouncer metrics found.这不是错误,而是:
当前没有流量命中封禁规则