Download the PHP package wdmg/yii2-guard without Composer

On this page you can find all versions of the php package wdmg/yii2-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 yii2-guard

Yii2 Downloads Packagist Version Progress GitHub license

Yii2 Guard

Security system for Yii2. The extension is able to detect and repel Overdrive attack, XSS attack, LFI / RFI / RCE attack, PHP / SQL injection attacks, and block by over rate limit. As well as block the user by IP and network (possible to add blocking client manually).

This module is an integral part of the Butterfly.СMS content management system, but can also be used as an standalone extension.

Copyrights (c) 2019-2021 W.D.M.Group, Ukraine

Requirements

Installation

To install the module, run the following command in the console:

$ composer require "wdmg/yii2-guard"

Configure

To add a module to the project, add the following data in your configuration file:

'modules' => [
    ...
    'guard' => [
        'class' => 'wdmg\guard\Module',
        'routePrefix' => 'admin'
        'useFilters': true, // flag for use filters
        'filters': [ // flag for use request filters
            'xss': true,
            'lfi': true,
            'php': true,
            'sql': true
        ],
        'patterns': [ // security filters (regexp patterns)
            'xss': '/(<.*?(script|body|object|iframe|applet|meta|style|form|frameset|frame|svg).*?>)|(base64|data\\:|fromCharCode|expression|onmouse|onload|alert|getcookie|document\\.)/uim',
            'lfi': '/((\\.|%2e){2,}(\\/|%5c|\\\\)|php:\\/\\/|file:\\/\\/|expect:\\/\\/|zip:\\/\\/|yii\\.php|init\\.php|web\\.php|params\\.php|db\\.php|console\\.php|test\\.php|test_db\\.php|phpinfo|passwd|htaccess)/uism',
            'php': '/(php:\\/\\/|(eval|preg_replace|require|include|call_user|create_func|array_filter|array_reduce|array_walk|array_map|reflection)\\()/uism',
            'sql': '/(UNION|SELECT|OUTFILE|ALTER|INSERT|DROP|TRUNCATE|({%tables}))\\s/uism'
        ],
        'useRateLimit': true, // flag for use requests limitation
        'rateLimit': 60, // request limit`s per minute
        'rateLimitIgnoringIP': [ // ignoring by IP
            '::1',
            '127.0.0.1',
        ],
        'rateLimitIgnoringRoutes': [ // ignoring by request route
            '/admin'
        ],
        'rateLimitExceptionRoutes': [ // exception from ignoring by request route
            '/admin/login'
            '/admin/restore'
        ],
        'rateLimitIgnoringRequests': [ // ignoring by request type
            'post': false,
            'get': false,
            'ajax': true
        ],
        'rateLimitErrorMessage': 'Your request limit has been exceeded! Try later.', // request limit error message
        'useOverdriveLimit': true, // flag for use overdrive limitation
        'overdriveLimit': [ // limit for $_POST and $_GET data overdrive
            'post': 200,
            'get': 100
        ],
        'maxAttempts': 5, // maximum number of attack attempts before blocking
        'attemptsDuration': 3600, // time in seconds of storage the history of attempted attacks in the cache
        'releaseTime': 3600, // time in seconds of removal restrictions (time of blocking)
        'useIpRange': true, // use blocking also by a range of network IP addresses
        'forbiddenLayout': "@wdmg/guard/views/layouts/default" // use forbidden error layout for frontend
        'useFileSystemScan': true, // use a file system scan for modification
        'fileSystemScan': [ // file system scan options
            'scanInterval': 21600,
            'autoClear': true,
            'onlyTypes': [
                '*.php',
                '*.js'
            ],
            'exceptTypes': [],
            'excludesPath': [
                '@runtime',
                '@tests',
                '@runtime/cache',
                '@webroot/assets'
            ]
        ],
        'scanReport': [ // options for sending scan notifications by email
            'emailViewPath': [
                'html': '@wdmg/guard/mail/report-html',
                'text': '@wdmg/guard/mail/report-text'
            ],
            'reportEmail': '[email protected]'
        ]
    ],
    ...
],

Routing

Use the Module::dashboardNavItems() method of the module to generate a navigation items list for NavBar, like this:

Status and version [ready to use]


All versions of yii2-guard with dependencies

PHP Build Version
Package Version
Requires yiisoft/yii2 Version ^2.0.40
wdmg/yii2-base Version ^1.3.0
wdmg/yii2-helpers Version ^1.4.0
wdmg/yii2-validators Version ^1.0.6
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 wdmg/yii2-guard contains the following files

Loading the files please wait ....