Add the artisan command to check for security vulns
This commit is contained in:
parent
18f7fe85f9
commit
c2a8d22d91
1 changed files with 53 additions and 0 deletions
53
app/Console/Commands/SecurityCheck.php
Normal file
53
app/Console/Commands/SecurityCheck.php
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
use SensioLabs\Security\SecurityChecker;
|
||||||
|
|
||||||
|
class SecurityCheck extends Command
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The name and signature of the console command.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $signature = 'security:check';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The console command description.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = 'Run the SensioLab’s Security Check tool';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Security Checker intergation service.
|
||||||
|
*
|
||||||
|
* @var SecurityChecker
|
||||||
|
*/
|
||||||
|
protected $securityChecker;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new command instance.
|
||||||
|
*
|
||||||
|
* @param SecurityChecker $SecurityChecker
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function __construct(SecurityChecker $securityChecker)
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
|
$this->securityChecker = $securityChecker;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the console command.
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
return $this->securityChecker->check(base_path() . '/composer.lock');
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue