diff --git a/src/Task/SecurityChecker.php b/src/Task/SecurityChecker.php index a312973c..d57f67c0 100644 --- a/src/Task/SecurityChecker.php +++ b/src/Task/SecurityChecker.php @@ -22,6 +22,7 @@ public static function getConfigurableOptions(): OptionsResolver 'end_point' => null, 'timeout' => null, 'run_always' => false, + 'allow-list' => [], ]); $resolver->addAllowedTypes('lockfile', ['string']); @@ -29,6 +30,7 @@ public static function getConfigurableOptions(): OptionsResolver $resolver->addAllowedTypes('end_point', ['null', 'string']); $resolver->addAllowedTypes('timeout', ['null', 'int']); $resolver->addAllowedTypes('run_always', ['bool']); + $resolver->addAllowedTypes('allow-list', ['array']); return $resolver; } diff --git a/src/Task/SecurityCheckerEnlightn.php b/src/Task/SecurityCheckerEnlightn.php index 27d615d2..81bf9873 100644 --- a/src/Task/SecurityCheckerEnlightn.php +++ b/src/Task/SecurityCheckerEnlightn.php @@ -19,10 +19,12 @@ public static function getConfigurableOptions(): OptionsResolver $resolver->setDefaults([ 'lockfile' => './composer.lock', 'run_always' => false, + 'allow-list' => [] ]); $resolver->addAllowedTypes('lockfile', ['string']); $resolver->addAllowedTypes('run_always', ['bool']); + $resolver->addAllowedTypes('allow-list', ['array']); return $resolver; } @@ -45,6 +47,9 @@ public function run(ContextInterface $context): TaskResultInterface $arguments = $this->processBuilder->createArgumentsForCommand('security-checker'); $arguments->add('security:check'); $arguments->addOptionalArgument('%s', $config['lockfile']); + foreach ($config['allow-list'] as $cve) { + $arguments->addOptionalArgument('--allow-list=%s', $cve); + } $process = $this->processBuilder->buildProcess($arguments); $process->run(); diff --git a/test/Unit/Task/SecurityCheckerEnlightnTest.php b/test/Unit/Task/SecurityCheckerEnlightnTest.php index a15104a3..c4ae44c8 100644 --- a/test/Unit/Task/SecurityCheckerEnlightnTest.php +++ b/test/Unit/Task/SecurityCheckerEnlightnTest.php @@ -27,6 +27,7 @@ public function provideConfigurableOptions(): iterable [ 'lockfile' => './composer.lock', 'run_always' => false, + 'allow-list' => [], ] ]; }