mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
add a configuration option for custom malwaredb and newpackagelist urls.
This commit is contained in:
parent
5bc8b39f56
commit
1abe5932ad
8 changed files with 219 additions and 19 deletions
|
|
@ -198,3 +198,30 @@ export function getMinimumPackageAgeExclusions() {
|
|||
const allExclusions = [...envExclusions, ...configExclusions];
|
||||
return [...new Set(allExclusions)];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the malware list base URL with priority: CLI argument > environment variable > config file > default
|
||||
* @returns {string}
|
||||
*/
|
||||
export function getMalwareListBaseUrl() {
|
||||
// Priority 1: CLI argument
|
||||
const cliValue = cliArguments.getMalwareListBaseUrl();
|
||||
if (cliValue) {
|
||||
return cliValue;
|
||||
}
|
||||
|
||||
// Priority 2: Environment variable
|
||||
const envValue = environmentVariables.getMalwareListBaseUrl();
|
||||
if (envValue) {
|
||||
return envValue;
|
||||
}
|
||||
|
||||
// Priority 3: Config file
|
||||
const configValue = configFile.getMalwareListBaseUrl();
|
||||
if (configValue) {
|
||||
return configValue;
|
||||
}
|
||||
|
||||
// Default
|
||||
return "https://malware-list.aikido.dev";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue