Download the PHP package apkk/laravel-security-guard without Composer

On this page you can find all versions of the php package apkk/laravel-security-guard. 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-security-guard

Laravel Security Guard

tests

Detailed Japanese reference

Laravel Security Guard adds an application-level layer of protection to Laravel applications. It detects known attack paths, can persistently block abusive IP addresses, and provides opt-in rate limits, administrator IP allowlists, one-time submission tokens, and safe security notifications.

It is not a replacement for a WAF, CDN, web-server hardening, or secure application code. Use it as one layer in a defence-in-depth design.

Requirements

Support policy

Only Laravel majors that are within Laravel's security-fix window are supported.

Laravel PHP Support status
13.x 8.3 / 8.4 / 8.5 Supported
12.x 8.2 / 8.3 / 8.4 Supported
11.x — Unsupported
10.x — Unsupported

Install

Migrations are loaded by the package. Publish them only when your application needs to own the migration files:

Installing the package does not change request handling. Public request protection is only active after you deliberately register its middleware.

Safe first deployment

Apply the package in staging before production, and enable one capability at a time.

1. Give the package its own cache namespace

In config/security-guard.php, replace the default security-guard prefix with a value unique to the application and environment:

This prevents separate applications or environments sharing a cache server from sharing block state, notification quotas, or one-time tokens.

2. Resolve the real client IP safely

The default laravel_request driver uses Laravel's Request::ip(). If a reverse proxy, CDN, or load balancer is in front of PHP, configure Laravel's trusted proxies before enabling the public middleware. Trust only the known proxy address or CIDR; do not trust arbitrary forwarding headers.

If PHP receives connections directly from clients, use REMOTE_ADDR instead:

Verify the resolved address with a real staging request. security-guard:status <ip> reports the guard state of the IP you supply; it does not show the client IP resolved from an HTTP request.

3. Run the configuration doctor

Fix every warning before continuing. In strict mode the command exits with 2 for warnings and 1 for failures, making it suitable for CI and deployment checks.

4. Register public request protection

Known attack-path detection and persistent blocking need to run before Laravel routes a request, including requests for routes that do not exist. Register the middleware globally in bootstrap/app.php:

Before production, add monitoring, office, and maintenance addresses to permanent_block.ignored_ips where appropriate, then test blocking, release, and re-blocking in staging.

Capabilities

Capability Default state Use it for
Known attack-path detection and persistent IP blocks Ready when public middleware is registered Blocking requests for common probe paths and repeated abuse
Public rate limiting Disabled Limiting public traffic by IP
Verified crawler access Disabled Giving verified Googlebot and Bingbot a separate, non-persistent limit
Administrator IP allowlists Disabled Restricting authenticated administration by subject and IP/CIDR
Sensitive-route profiles Disabled Adding IP and identifier limits to login, reset, or other sensitive routes
One-time submission tokens Disabled Preventing duplicate confirmation-page submissions
Security event notifications Disabled Sending bounded, queued security alerts
Management UI Disabled Reviewing and releasing blocked IP addresses behind authentication and authorization

Every module has its own enablement and exclusion rules. Do not enable rate limits, allowlists, notifications, or crawler handling until their dependencies and failure behaviour have been reviewed.

CIDR safety

Ignored-IP and administrator allowlist rules accept individual IP addresses and CIDR networks. An IPv4 rule does not cross IP families: it never matches an IPv4-mapped IPv6 address. An invalid or unparseable rule matches nothing, never every address.

Common commands

Run php artisan list security-guard to see all package commands, including administrator IP allowlist and verified-crawler range maintenance commands.

Documentation

This README intentionally covers the safe first deployment. The full configuration and operations reference is being prepared for the documentation site.

Until then, the published configuration file, config/security-guard.php, is the source of truth for defaults. The current detailed reference is available in Japanese: configuration and operations reference.

Support and security

Development

License

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


All versions of laravel-security-guard with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-mbstring Version *
illuminate/bus Version ^12.61.1 || ^13.12.0
illuminate/cache Version ^12.61.1 || ^13.12.0
illuminate/console Version ^12.61.1 || ^13.12.0
illuminate/contracts Version ^12.61.1 || ^13.12.0
illuminate/database Version ^12.61.1 || ^13.12.0
illuminate/http Version ^12.61.1 || ^13.12.0
illuminate/queue Version ^12.61.1 || ^13.12.0
illuminate/support Version ^12.61.1 || ^13.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 apkk/laravel-security-guard contains the following files

Loading the files please wait ...