2017 © Pedro Peláez
 

project laravel-composer-security

Security checker for composer.lock.

image

padosoft/laravel-composer-security

Security checker for composer.lock.

  • Saturday, January 7, 2017
  • by lopadova
  • Repository
  • 8 Watchers
  • 28 Stars
  • 878 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 24 Versions
  • 0 % Grown

The README.md

LARAVEL COMPOSER SECURITY COMMAND

Latest Version on Packagist ![Software License][ico-license] Build Status ![Coverage Status][ico-scrutinizer] Quality Score ![Total Downloads][ico-downloads] SensioLabsInsight, (*1)

This is a Laravel 5.1/5.2/5.3 package that provides an artisan command for testing security vulnerabilties into your composer.lock files. Is ready and tested for php7.0 and php7.1 too., (*2)

Table of Contents

PREREQUISITES

LARAVEL 5.1+ GUZZLE 6+, (*3)

INSTALL

This package can be installed through Composer., (*4)

``` bash composer require padosoft/laravel-composer-security, (*5)

You must install this service provider.

``` php
// config/app.php
'provider' => [
    ...
    Padosoft\LaravelComposerSecurity\ComposerSecurityCheckServiceProvider::class,
    ...
];

You don't need to register the command in app/Console/Kernel.php, because it provides by ComposerSecurtyCheckServiceProvider register() method., (*6)

You can publish the config file of this package with this command: ``` bash php artisan vendor:publish --provider="Padosoft\LaravelComposerSecurity\ComposerSecurityCheckServiceProvider", (*7)

The following config file will be published in `config/composer-security-check.php`
``` php
return array(
    'mailSubjectSuccess' => env(
        'SECURITY_CHECK_SUBJECT_SUCCESS',
        '[composer-security-check]: Ok - no vulnerabilities detected.'
    ),
    'mailSubjetcAlarm' => env(
        'SECURITY_CHECK_SUBJECT_ALARM',
        '[composer-security-check]: Alarm - vulnerabilities detected.'
    ),
    'mailFrom' => env('SECURITY_CHECK_MESSAGE_FROM', 'info@example.com'),
    'mailFromName' => env('SECURITY_CHECK_MESSAGE_FROM_NAME', 'Info Example'),
    'mailViewName' => env('SECURITY_CHECK_MAIL_VIEW_NAME', 'composer-security-check::mail'),
    'logFilePath' => env('SECURITY_CHECK_LOG_FILE_PATH', storage_path().'/composersecurityCheck.log')
 );

In config folder you can copy from .env.example the settings for yours .env file used in composer-security-check.php. If you use mathiasgrimm/laravel-env-validator in config folder you'll find and example for validate the env settings., (*8)

USAGE

When the installation is done you can easily run command to print help:, (*9)

php artisan composer-security:check

The composer-security:check command looks for every composer.lock file in the given path and foreach composer.lock check for security issues in the project dependencies: php composer-security:check, (*10)

If you omit path argument, command look into current folder., (*11)

You can also pass the path as an argument: php composer-security:check /path/to/my/repos, (*12)

You can use * in path argument as jolly character i.e. /var/www/*/*/, (*13)

By default, the command displays the result in console, but you can also send an html email by using the --mailoption:, (*14)

php composer-security:check /path/to/my/repos --mail=mymail@mydomain.me

EXAMPLE:

Here is a basic example to check composer.lock into these dir:, (*15)

php artisan composer-security:check "/dir/to/check/*/*/"

Here is an example to send output report to mail:, (*16)

php artisan composer-security:check "/dir/to/check/*/*/" --mail=mymail@mydomain

Here is an example to ignore two composer.lock vulnerabilities into two dir (if command found any vulnerabilities into these dir, write it into output but the email subject isn't set to ALERT):, (*17)

php artisan composer-security:check "/dir/to/check/*/*/" --mail=mymail@mydomain --whitelist="/dir/to/put/in/witelist,/another/dir/to/put/in/witelist"

SCHEDULE COMMAND

You can schedule a daily (or weekly etc..) report easly, by adding this line into schedule method in app/Console/Kernel.php :, (*18)

// app/console/Kernel.php

protected function schedule(Schedule $schedule)
{
    ...
    $schedule->command('composer-security:check "/dir/to/check/" --mail=mymail@mydomain')
            ->daily()
            ->withoutOverlapping()
            ->sendOutputTo(Config::get('composer-security-check.logFilePath'));
}

SCREENSHOOTS

OUTPUT CONSOLE: screenshoot, (*19)

EMAIL VIEW WITH ALERT: screenshoot, (*20)

EMAIL VIEW WITH VULNERABILITY WITELISTED: screenshoot, (*21)

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details., (*22)

Security

If you discover any security related issues, please email instead of using the issue tracker., (*23)

API Documentation

Please see API documentation at https://padosoft.github.io/laravel-composer-security - master, (*24)

Credits

About Padosoft

Padosoft is a software house based in Florence, Italy. Specialized in E-commerce and web sites., (*25)

License

The MIT License (MIT). Please see License File for more information., (*26)

The Versions

07/01 2017

dev-master

9999999-dev

Security checker for composer.lock.

  Sources   Download

MIT

The Requires

 

The Development Requires

composer security

07/01 2017

1.5.1

1.5.1.0

Security checker for composer.lock.

  Sources   Download

MIT

The Requires

 

The Development Requires

composer security

17/09 2016

1.5.0

1.5.0.0

Security checker for composer.lock.

  Sources   Download

MIT

The Requires

 

The Development Requires

composer security

17/09 2016

dev-laravel53-php71

dev-laravel53-php71

Security checker for composer.lock.

  Sources   Download

MIT

The Requires

 

The Development Requires

composer security

18/08 2016

1.4.6

1.4.6.0

Security checker for composer.lock.

  Sources   Download

MIT

The Requires

 

The Development Requires

composer security

08/08 2016

1.4.5

1.4.5.0

Security checker for composer.lock.

  Sources   Download

MIT

The Requires

 

The Development Requires

composer security

08/08 2016

1.4.4

1.4.4.0

Security checker for composer.lock.

  Sources   Download

MIT

The Requires

 

The Development Requires

composer security

15/03 2016

1.4.3

1.4.3.0

Security checker for composer.lock.

  Sources   Download

MIT

The Requires

 

The Development Requires

composer security

15/03 2016

1.4.2

1.4.2.0

Security checker for composer.lock.

  Sources   Download

MIT

The Requires

 

The Development Requires

composer security

22/02 2016

1.4.1

1.4.1.0

Security checker for composer.lock.

  Sources   Download

MIT

The Requires

 

The Development Requires

composer security

05/02 2016

1.4.0

1.4.0.0

Security checker for composer.lock.

  Sources   Download

MIT

The Requires

 

The Development Requires

composer security

02/02 2016

1.3.4

1.3.4.0

Security checker for composer.lock.

  Sources   Download

MIT

The Requires

 

The Development Requires

composer security

28/01 2016

1.3.3

1.3.3.0

Security checker for composer.lock.

  Sources   Download

MIT

The Requires

 

The Development Requires

composer security

20/01 2016

1.3.2

1.3.2.0

Security checker for composer.lock.

  Sources   Download

MIT

The Requires

 

composer security

14/01 2016

1.3.1

1.3.1.0

Security checker for composer.lock.

  Sources   Download

MIT

The Requires

 

composer security

14/01 2016

1.3

1.3.0.0

Security checker for composer.lock.

  Sources   Download

MIT

The Requires

 

composer security

15/12 2015

1.2

1.2.0.0

Security checker for composer.lock.

  Sources   Download

MIT

The Requires

 

composer security

15/12 2015

1.1

1.1.0.0

Security checker for composer.lock.

  Sources   Download

MIT

The Requires

 

composer security