Skip to content

Commit

Permalink
Add allow-list config option to securitychecker_enlightn
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjaap committed Nov 19, 2022
1 parent 33449e8 commit 2e38185
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Task/SecurityCheckerEnlightn.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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();
Expand Down

0 comments on commit 2e38185

Please sign in to comment.