PHPackages                             aayushgauba/aiwaf - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. aayushgauba/aiwaf

ActiveLibrary[Security](/categories/security)

aayushgauba/aiwaf
=================

Adaptive Intelligent Web Application Firewall for PHP

04PHPCI failing

Since Jun 28Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/aiwaf-project/aiwaf-php)[ Packagist](https://packagist.org/packages/aayushgauba/aiwaf)[ RSS](/packages/aayushgauba-aiwaf/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

AIWAF PHP
=========

[](#aiwaf-php)

Adaptive, trainable web-application firewall middleware for PHP applications.

This README is an end-to-end guide: install, integrate, train, tune, validate, and operate.

What You Get
------------

[](#what-you-get)

- Header profile validation
- IP blocking and allowlisting helpers
- Rate limiting with pluggable backends
- Dynamic keyword detection
- UUID tamper checks
- Honeypot checks
- Isolation Forest anomaly scoring
- Log-based trainer with telemetry and route-awareness hooks

Requirements
------------

[](#requirements)

- PHP &gt;= 7.4
- Composer
- Optional: ext-redis when using Redis adapters/drivers

Package Configuration (Composer)
--------------------------------

[](#package-configuration-composer)

`composer.json` package-level defaults and scripts:

- Name: `aayushgauba/aiwaf`
- Type: `library`
- License: `MIT`
- Runtime dependency: `php >= 7.4`
- Suggested extension: `ext-redis` (only required for Redis adapter/driver)
- PSR-4 autoload: `AIWAF\\` -&gt; `src/`
- Dev autoload: `AIWAF\\Tests\\` -&gt; `tests/`
- Composer scripts:
    - `composer test`
    - `composer run cover-everything`
    - `composer run test-adapters-matrix`
    - `composer run validate-all`

Install
-------

[](#install)

```
composer require aayushgauba/aiwaf
```

End-to-End Setup
----------------

[](#end-to-end-setup)

### 1. Initialize resources

[](#1-initialize-resources)

```
php setup.php
```

Runtime artifacts are stored under `resources/` by default:

- `blocked_ips.json`
- `dynamic_keywords.json`
- `request_features.csv`
- `forest_model.json`

### 2. Add protection to your bootstrap/front controller

[](#2-add-protection-to-your-bootstrapfront-controller)

Run AIWAF before output is sent.

```
