Skip to content

Commit eda6d36

Browse files
committed
Add --allow-list option to SecurityCheckerEnlightn task
- Document new option in enlightn.md with example usage - Fix argument formatting to use comma-separated values for --allow-list - Update unit test to include the new option in default configuration This change allows users to specify CVEs that should be ignored during security checks when they've been assessed and determined not to pose a risk.
1 parent bed10e9 commit eda6d36

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

doc/tasks/securitychecker/enlightn.md

+14
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,17 @@ If your `composer.lock` file is located in an exotic location, you can specify t
3636
*Default: false*
3737

3838
When this option is set to `false`, the task will only run when the `composer.lock` file has changed. If it is set to `true`, the `composer.lock` file will be checked on every commit.
39+
40+
**allow_list**
41+
42+
*Default: []*
43+
44+
This option allows you to specify a list of CVE identifiers that should be ignored during the security check. This is useful if you have assessed certain vulnerabilities and determined that they do not pose a risk to your project. The CVE identifiers should be provided as an array of strings. For example:
45+
46+
```yaml
47+
allow_list:
48+
- CVE-2018-15133
49+
- CVE-2024-51755
50+
- CVE-2024-45411
51+
```
52+

src/Task/SecurityCheckerEnlightn.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function run(ContextInterface $context): TaskResultInterface
5252
$arguments = $this->processBuilder->createArgumentsForCommand('security-checker');
5353
$arguments->add('security:check');
5454
$arguments->addOptionalArgument('%s', $config['lockfile']);
55-
$arguments->addArgumentArrayWithSeparatedValue('--allow-list', $config['allow_list'] ?? []);
55+
$arguments->addOptionalCommaSeparatedArgument('--allow-list=%s', $config['allow_list']);
5656

5757
$process = $this->processBuilder->buildProcess($arguments);
5858
$process->run();

test/Unit/Task/SecurityCheckerEnlightnTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public function provideConfigurableOptions(): iterable
2727
[
2828
'lockfile' => './composer.lock',
2929
'run_always' => false,
30+
'allow_list' => [],
3031
]
3132
];
3233
}

0 commit comments

Comments
 (0)