承接 flowd/phirewall-preset-bad-ips 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

flowd/phirewall-preset-bad-ips

Composer 安装命令:

composer require flowd/phirewall-preset-bad-ips

包简介

Threat-intelligence IP blocklist preset for the Phirewall PHP firewall - bundles a public-domain bad-IP feed snapshot

README 文档

README

Block requests from known malicious IP addresses with flowd/phirewall.

Ships a snapshot of the public-domain stamparm/ipsum threat feed and exposes it as a PortableConfig blocklist (a ConfigLayer), materialized with Config::with().

Installation

composer require flowd/phirewall-preset-bad-ips

Usage

use Flowd\Phirewall\Config;
use Flowd\PhirewallPresetBadIps\Presets;

$config = (new Config($cache))->with(Presets::blocklist());
Preset Effect
Presets::blocklist() Blocks (403) requests whose client IP is in the bundled snapshot.
Presets::track(period) Counts matches without blocking, to measure false positives before enforcing.

The bundled list

The snapshot comes from stamparm/ipsum levels/3.txt (addresses seen on at least three source blacklists). ipsum is dedicated to the public domain under The Unlicense, which is why it can be bundled here; see resources/UPSTREAM-LICENSE. resources/manifest.json records the feed, level, address count and import time.

The repository ships a small placeholder sample. Populate the real list with:

bin/badip-import            # level 3 (default)
bin/badip-import --level=4  # tighter, fewer false positives

The scheduled Bad-IP Update workflow refreshes it and opens a pull request.

Limits to be aware of

  • The list keys on the client IP from REMOTE_ADDR. Behind a proxy or CDN that is the proxy address. Configure a trusted client-IP resolver on the Config, or the blocklist sees the proxy instead of the client.
  • A bundled snapshot goes stale between refreshes, and IP reputation is never perfect: a shared host or CGNAT address can be listed for one offender. Prefer a higher level for fewer false positives, and consider track() first. Override the rule by name to combine with your own allowlist.
  • ipsum is an aggregate of third-party lists; only the compiled artifact (what is bundled) is public domain.

Development

composer install
composer test     # rector (dry-run), php-cs-fixer (dry-run), phpunit, phpstan

License

LGPL-3.0-or-later (dual-licensed, proprietary licensing available), like flowd/phirewall. The bundled IP data is public domain (The Unlicense) from stamparm/ipsum.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0-or-later
  • 更新时间: 2026-06-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固