Firewall
INEX SPA - Firewall System Documentation
š Feature: Firewall Protection
The Firewall system in INEX SPA helps protect your application from malicious access, unwanted bots, and rate abuse. It is a lightweight, file-based rule checker that runs before the main application loads.
š ļø Enable the Firewall
To enable the Firewall system, open your .env
file and set the following:
Once enabled, you can use the Firewall system manually by calling the Firewall class directly.
š Files and Structure
Firewall Rules File:
/Json/firewall.json
Firewall Class:
/core/functions/PHP/classes/Firewall.php
āļø How It Works
INEX SPA loads the rules from
/Json/firewall.json
.You can manually check requests using the static method:
The function compares the visitor's IP or user-agent against the rule list.
If a match is found, the request is blocked with a 403 error.
š firewall.json Example
block_ips
: IP addresses to block.block_user_agents
: Partial or full matches of bad user-agents.redirect_blocked_to
: Page will redirect if blocked
š” Future versions may include rate limiting and temporary bans.
ā Important Notes
The firewall only runs if
USE_FIREWALL=true
is set in.env
.Country blocking uses a simple IP-to-country detection. Make sure the IP location file is available if needed.
For full control, you can extend the
Firewall.php
class.
ā
Status
ā Lightweight ā Easy to configure ā Extensible ā No external libraries
Ā© INEX SPA Team - Firewall System
Last updated