Download the PHP package ali1/cakephp-bruteforce without Composer

On this page you can find all versions of the php package ali1/cakephp-bruteforce. 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 cakephp-bruteforce

CakePHP Brute Force Plugin

Framework PHP

A CakePHP 5 plugin providing cache-backed brute-force protection for controller actions. The limiter is implemented in this package; it is not a wrapper around BruteForceShield.

Features

Requirements

Development

Install development dependencies and run focused affected checks before push. The full local suite is available when useful; hosted full tests/static analysis run nightly and full standards run weekly as checks-only:

The gate runs CakePHP coding standards, PHPStan, and the PHPUnit suite.

The lock files live in PHP's system temporary directory and coordinate workers on one host. Each cache configuration uses a fixed pool of 256 striped locks, so rotating client addresses cannot create unbounded files. A multi-host deployment must put that directory on shared storage or add a distributed lock before sharing one limiter cache across hosts.

Installation

Load the plugin in src/Application.php:

Load the component in a controller:

Basic use

Call validate() before checking or acting on submitted credentials:

The component throws Bruteforce\Exception\TooManyAttemptsException when a limit is reached or protection cannot safely persist the attempt.

Applications upgrading from version 6.0 may temporarily keep importing Ali1\BruteForceShield\Configuration; this package provides that name as a deprecated compatibility class. New code should use Bruteforce\Configuration.

Limiter options

The fifth validate() argument accepts additional options. For applications migrating from a local limiter whose third argument was an options array, the component also accepts that array directly as its third argument.

Option Default Meaning
timeWindow 300 Per-IP rolling window in seconds
totalLimit 8 Distinct attempts allowed per IP
stricterKey null Field receiving a lower per-value limit
stricterLimit null Distinct attempts allowed for stricterKey
globalTotalLimit 100 Distinct attempts allowed across all IPs
globalStricterLimit per-IP value Cross-IP limit for stricterKey
globalTimeWindow per-IP value Cross-IP rolling window in seconds
skipGlobal false Explicitly disable the cross-IP check for this request
challengeKeys all fields Submitted fields included in duplicate and limit checks
caseInsensitiveKeys none Fields lowercased before comparison, commonly usernames
cache component argument CakePHP cache configuration name

The cross-IP budget is enabled by default. It is the backstop when an attacker can rotate source addresses or when a proxy configuration mistakenly accepts spoofed X-Forwarded-For values. Set an application-specific value based on legitimate aggregate traffic; disable it only when another trusted edge enforces an equivalent global budget.

Proxy configuration

The component accepts ServerRequest::clientIp() only when it is a valid single IP address and otherwise falls back to the direct REMOTE_ADDR. This validation does not make an untrusted forwarding header trustworthy. If CakePHP request proxy trust is enabled, configure an explicit allowlist of trusted reverse-proxy addresses; never enable unrestricted proxy trust. Keep the global budget enabled even with a correct allowlist.

Stored and logged data

Every non-empty scalar challenge value is normalized in memory and stored only as HMAC-SHA256(value, Security.salt). The random-looking cache value is deterministic so duplicate and stricter-key comparisons remain efficient, but an attacker who obtains only the shared cache cannot run an offline dictionary attack without the server secret.

Blocked-attempt logs contain the client IP, action name, limiting scope, submitted field names, and attempt count. They never contain submitted values. The legacy addUnencryptedKey() method is retained only so existing applications keep running; it no longer causes plaintext cache storage or logging and should be removed from application code.

URL-token protection

Secret URL tokens use the same protection and must not be marked for plaintext handling:


All versions of cakephp-bruteforce with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
cakephp/cakephp Version ^5.0
ext-json Version *
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 ali1/cakephp-bruteforce contains the following files

Loading the files please wait ...