承接 restruct/silverstripe-waf 相关项目开发

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

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

restruct/silverstripe-waf

Composer 安装命令:

composer require restruct/silverstripe-waf

包简介

PHP-level Web Application Firewall for Silverstripe - blocks vulnerability scanners, bad bots, and malicious IPs

README 文档

README

PHP-level Web Application Firewall for Silverstripe CMS. Blocks vulnerability scanners, malicious bots, and bad IPs without requiring a separate WAF service.

Features

  • Early PHP Filter — Blocks requests before Silverstripe loads (minimal overhead)
  • Early Filter Banning — Self-contained fail2ban alternative, bans repeat offenders at the PHP level
  • Pattern-based blocking — WordPress probes, webshells, config file access, path traversal
  • IP Blocklists — Auto-sync from threat intelligence feeds (FireHOL, Binary Defense)
  • Rate Limiting — Hard limits with soft progressive delays
  • Privileged IPs — Elevated rate limits for trusted IPs (still subject to all security checks)
  • Auto-banning — Automatically ban IPs after repeated violations
  • ModelAdmin Guard — Prevents PHP errors from scanner probes on admin URLs
  • Fail2ban Integration — Log format compatible with fail2ban filters
  • CMS Admin — View blocked requests, manage bans and privileged IPs
  • QueuedJobs Support — Auto-schedules blocklist sync if module is installed

Requirements

  • PHP 8.1+
  • Silverstripe Framework 5.0+ or 6.0+

Installation

composer require restruct/silverstripe-waf
vendor/bin/sake dev/build flush=1

Enable Early Filter (Recommended)

Add to your public/index.php at the very top, before use statements:

<?php

// WAF Early Filter - runs before framework loads
$wafFilter = dirname(__DIR__) . '/vendor/restruct/silverstripe-waf/_waf_early_filter.php';
if (file_exists($wafFilter)) {
    require_once $wafFilter;
}

use SilverStripe\Control\HTTPApplication;
// ... rest of index.php

Why before use statements? The use statements are just namespace aliases (resolved at compile time), so the practical difference is minimal. However, placing the WAF filter first makes the security-first intent clear and ensures blocked requests parse the absolute minimum PHP before exiting.

Quick Configuration

All configuration is in _config/config.yml with extensive inline comments. The defaults work well for most sites. Common overrides:

Restruct\SilverStripe\Waf\Middleware\WafMiddleware:
  rate_limit_requests: 150      # Max requests per IP per minute
  ban_threshold: 10             # Violations before auto-ban
  ban_duration: 3600            # Ban duration in seconds (1 hour)
  early_ban_enabled: true       # Self-contained fail2ban alternative

  whitelisted_ips:
    - '127.0.0.1'
    - '::1'
    # - '10.0.0.0/8'            # Office network

CMS Admin

Access via the WAF menu item in the CMS:

  • Blocked Requests — View blocked request log with reason, detail, URI, and user agent
  • Banned IPs — Manage banned IPs (add/remove bans)
  • Privileged IPs — Manage elevated rate limits for trusted IPs (protected from auto-ban)
  • Blocklist Status — View sync status and source health

Works in all storage modes — no database required for file mode.

Documentation

Topic Description
Configuration Storage modes, rate limiting, whitelists, privileged IPs, user-agents
Early Filter Blocked patterns, early banning, pattern philosophy
ModelAdmin Guard Protect ModelAdmin from scanner probes
Fail2ban Fail2ban integration + Laravel Forge setup
Performance TTFB benchmarks, memory footprint, optimizations
Extending Custom patterns, blocklist sources, environment variables, testing

Complementary Module

Pairs well with restruct/silverstripe-security-baseline which provides authentication security (password policy, brute-force, logging).

License

MIT

restruct/silverstripe-waf 适用场景与选型建议

restruct/silverstripe-waf 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 51 次下载、GitHub Stars 达 1, 最近一次更新时间为 2026 年 02 月 08 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「security」 「firewall」 「silverstripe」 「waf」 「rate-limiting」 「ip-blocking」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 restruct/silverstripe-waf 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 restruct/silverstripe-waf 我们能提供哪些服务?
定制开发 / 二次开发

基于 restruct/silverstripe-waf 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-08