Download the PHP package neelkanthk/laravel-surveillance without Composer
On this page you can find all versions of the php package neelkanthk/laravel-surveillance. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download neelkanthk/laravel-surveillance
More information about neelkanthk/laravel-surveillance
Files in neelkanthk/laravel-surveillance
Package laravel-surveillance
Short Description Put users, IP addresses and anonymous browser fingerprints on surveillance and block malicious ones.
License MIT
Informations about the package laravel-surveillance
Laravel Surveillance
Laravel Surveillance is a package to put malicious users, IP addresses and anonymous browser fingerprints under surveillance, write surveillance logs and block malicious ones from accessing the app.
Please read the IMPORTANT INFORMATION below before using this package
This package collects and processes various attributes that may be Personal Identifiable Information and this should therefore be disclosed and screened before adopting this package. This packages author does not take responsibility for any compliance issues users may face. Please consult legal expertise to use responsibly.
This package provides:
1. A middleware to be used on routes.
2. A command line interface to enable/disable surveillance and block/unblock access.
3. A fluent API to programmatically enable/disable surveillance, block/unblock access and log the requests at runtime.
4. By default the package used MySQL database as storage but the package can be extended to use virtually any storage technology.
NOTE: This package does not provide a client side library for browser fingerprinting. FingerprintJS Open Source is a good library to use for client side browser fingerprinting.
Important Announcement !
Introducing Laravel Surveillance UI : A package which provides Graphical UI for Laravel Surveillance and integrates within your existing application.
Minimum Requirements
1. Laravel 6.0
2. PHP 7.2
Installation
1. Install the package via composer:
2.1. Publish the migration files:
2.2. Publish language files:
3. Run the migrations
4. After migrations have been run two tables will be created in the database namely surveillance_managers
and surveillance_logs
5. You can publish the config file with:
This is the contents of the file that will be published at config/surveillance.php
:
CLI Usage
Enable surveillance for an IP Address
Disable surveillance for an IP Address
Enable surveillance for a User ID
Disable surveillance for a User ID
Enable surveillance for Browser Fingerprint
Disable surveillance for Browser Fingerprint
Block an IP Address
UnBlock an IP Address
Block a User ID
UnBlock a User ID
Block a Browser Fingerprint
UnBlock a Browser Fingerprint
Remove a Surveillance record from Database
Middleware Usage
You can use the 'surveillance' middleware on any route or route group just like any other middleware.
NOTE: The middleware looks for the browser fingerprint in the header name as set in the fingerprint-header-key
inside config/surveillance.php
Programmatic Usage
Enable Surveillance
Block Access
Logging a Request (Works when surveillance in enabled on User ID, IP Address or Browser Fingerprint)
Allowed Types
Currently only userid, ip and fingerprint types are allowed.
Customizing and Overriding the defaults
To override the default surveillance management functionality
Step 1: Extend the SurveillanceManagerRepository
Class and override all of its methods
Step 2: Provide the custom class in the config/surveillance.php
file's manager-repository
key
To override the default logging funtionality
Step 1: Extend the SurveillanceLogRepository
Class and override all of its methods
Step 2: Provide the custom class in the config/surveillance.php
file's log-repository
key
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
Credits
- Neelkanth Kaushik
- All Contributors
- CCTV Icon