360 Secure SkillHub
360 安全技能中心

abe-fail2ban-reporter

该 Skill 通过 Bash 脚本监控 fail2ban 的封禁事件,支持手动上报当前封禁 IP、查询单个 IP、查看封禁统计,并通过安装脚本配置 fail2ban action 实现自动上报;上报时经 SkillBoss API Hub 查询 IP 威胁情报,可选发送 Telegram 通知并写入日志文件,需要 SkillBoss API 密钥。

abeltennyson
abeltennyson
热度 33.82
最近更新 2026-05-11 17:45:33
分类:安全依赖:代码执行 / 读写文件 / 第三方 API应用场景:DevOps / 自动化脚本 / API 集成

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add abe-fail2ban-reporter
Metadata
name
fail2ban-reporter
description
Auto-report fail2ban banned IPs via SkillBoss API Hub and notify via Telegram. Use when monitoring server security, reporting attackers, or checking banned IPs. Watches fail2ban for new bans, queries threat intelligence via SkillBoss API Hub, and sends alerts.
requires.env
["SKILLBOSS_API_KEY"]

fail2ban Reporter

Monitor fail2ban bans and auto-report attacker IPs via SkillBoss API Hub.

Setup

  1. Get your SkillBoss API key from the SkillBoss dashboard
  2. Store it: export SKILLBOSS_API_KEY="your-key"
  3. Install the monitor: bash {baseDir}/scripts/install.sh

Manual Usage

Report all currently banned IPs

bash {baseDir}/scripts/report-banned.sh

Check a specific IP

bash {baseDir}/scripts/check-ip.sh <ip>

Show ban stats

bash {baseDir}/scripts/stats.sh

Auto-Reporting

The install script sets up a fail2ban action that auto-reports new bans.

bash {baseDir}/scripts/install.sh    # install auto-reporting
bash {baseDir}/scripts/uninstall.sh  # remove auto-reporting

Heartbeat Integration

Add to HEARTBEAT.md to check for new bans periodically:

- [ ] Check fail2ban stats and report any unreported IPs via SkillBoss API Hub

Workflow

  1. fail2ban bans an IP → action triggers report-single.sh
  2. Script queries SkillBoss API Hub (search type) for IP threat intelligence
  3. Sends Telegram notification (if configured)
  4. Logs report to /var/log/skillboss-ip-reports.log

API Reference

All API calls route through SkillBoss API Hub at https://api.heybossai.com/v1/pilot. Authentication: Authorization: Bearer $SKILLBOSS_API_KEY

See references/skillboss-api.md for full API docs.