Download the PHP package therealmkadmi/laravel-citadel without Composer

On this page you can find all versions of the php package therealmkadmi/laravel-citadel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-citadel

Laravel Citadel Documentation

Introduction

Laravel Citadel is a passive surveillance package designed to protect your public-facing endpoints. It provides a robust firewall system that analyzes incoming requests, detects anomalies, and blocks malicious traffic. The package is highly configurable and integrates seamlessly with Laravel applications.


Installation

  1. Install the package via Composer:

  2. Publish the configuration file:

  3. Add the middleware to your routes or global middleware stack as needed.

Configuration

The configuration file is located at config/citadel.php. Below are the available settings:

General Settings

Geofencing Settings

Device Analyzer Settings

IP Analyzer Settings

Burstiness Analyzer Settings

Payload Analyzer Settings

Spamminess Analyzer Settings

Ban Settings

API Settings


Middleware Groups

Laravel Citadel provides three middleware groups that you can use in your application:

1. Passive Monitoring Only (citadel-passive)

The passive middleware group only runs analyzers that don't make external requests. It provides monitoring and logging without blocking any requests, ideal for gathering intelligence about traffic patterns.

2. Active Protection (citadel-active)

The active middleware group runs analyzers that may make external requests (such as IP intelligence lookups) and will block malicious traffic. This includes geofencing and ban checking.

3. Complete Protection (citadel-protect)

For maximum security, the complete protection middleware group combines both active and passive analyzers. This is the original middleware group and provides backward compatibility.

Configuration

You can enable or disable each middleware group independently in your configuration:

This configuration also applies to your .env file:


Middleware

ProtectRouteMiddleware

Analyzes incoming requests using registered analyzers and blocks requests exceeding the configured threshold.

ApiAuthMiddleware

Authenticates API requests using a token.

GeofenceMiddleware

Blocks requests based on geographical location.

BanMiddleware

Checks if a request originates from a banned IP or fingerprint.


Analyzers

BurstinessAnalyzer

Detects rapid consecutive requests and suspicious patterns in request timing.

DeviceAnalyzer

Analyzes the User-Agent header to determine the type of device making the request.

IpAnalyzer

Analyzes the IP address for characteristics like being a datacenter, Tor exit node, or VPN.

PayloadAnalyzer

Analyzes the request payload for anomalies, missing fields, and malicious patterns.

SpamminessAnalyzer

Detects spam-like behavior in request payloads.


API Endpoints

Ban Endpoint

POST /api/citadel/ban

Parameters:

Response:

Unban Endpoint

POST /api/citadel/unban

Parameters:

Response:

Status Endpoint

GET /api/citadel/status

Response:


Commands

CitadelBanCommand

Bans a user by IP or fingerprint from the command line.

Usage:

CitadelUnbanCommand

Unbans a user by IP or fingerprint from the command line.

Usage:

CitadelCommand

Displays general information about the Citadel package.

Usage:


Usage Examples

Protecting Routes

Add the citadel-protect middleware group to your routes:

Using the API

Enable the API in the configuration file and set a token:

Make a request to ban an IP:

Customizing Analyzers

You can create custom analyzers by implementing the IRequestAnalyzer interface and registering them in the service provider.


Logging

Citadel logs various events, such as bans, unbans, and detected threats. You can configure the log channel in the citadel.php configuration file.


Testing

Run the test suite using PHPUnit:


Contributing

Contributions are welcome! Please follow the Laravel coding standards and submit a pull request.


License

Laravel Citadel is open-sourced software licensed under the MIT license.


All versions of laravel-citadel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0||^11.0||^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package therealmkadmi/laravel-citadel contains the following files

Loading the files please wait ....