@contrast/agent 4.32.8 → 4.32.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/core/config/options.js +13 -17
- package/lib/core/config/util.js +5 -5
- package/package.json +2 -2
|
@@ -44,10 +44,6 @@ const path = require('path');
|
|
|
44
44
|
const util = require('util');
|
|
45
45
|
const _ = require('lodash');
|
|
46
46
|
|
|
47
|
-
const configPathEnvVars = {
|
|
48
|
-
path: 'CONTRAST_CONFIG_PATH',
|
|
49
|
-
};
|
|
50
|
-
|
|
51
47
|
/**
|
|
52
48
|
* Takes strings "true"|"t" or "false"|"f" (case insensitive) and return the appropriate boolean.
|
|
53
49
|
* If we can't match one of the two words, return true;
|
|
@@ -112,7 +108,7 @@ const misc = [
|
|
|
112
108
|
name: 'configFile',
|
|
113
109
|
abbrev: 'c',
|
|
114
110
|
// special case this guy because it should be settable via ENV
|
|
115
|
-
env:
|
|
111
|
+
env: 'CONTRAST_CONFIG_PATH',
|
|
116
112
|
arg: '<path>',
|
|
117
113
|
desc: 'set config file location. defaults to <app_root>/contrast_security.yaml',
|
|
118
114
|
},
|
|
@@ -541,11 +537,9 @@ const agent = [
|
|
|
541
537
|
name: 'agent.security_logger.level',
|
|
542
538
|
arg: '<level>',
|
|
543
539
|
fn: lowercase,
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
default: 'debug',
|
|
548
|
-
desc: 'security logging level (alert, crit, err, warning, notice, info, debug)',
|
|
540
|
+
enum: ['error', 'warn', 'debug', 'info', 'trace'],
|
|
541
|
+
default: 'error',
|
|
542
|
+
desc: 'security logging level (error, warn, debug, info, trace)',
|
|
549
543
|
},
|
|
550
544
|
{
|
|
551
545
|
name: 'agent.security_logger.path',
|
|
@@ -580,23 +574,26 @@ const agent = [
|
|
|
580
574
|
},
|
|
581
575
|
{
|
|
582
576
|
name: 'agent.security_logger.syslog.severity_exploited',
|
|
583
|
-
desc: 'Set the log level of Exploited attacks. Value options are ALERT/
|
|
584
|
-
enum: ['alert', '
|
|
577
|
+
desc: 'Set the log level of Exploited attacks. Value options are ALERT/CRITICAL/ERROR/WARNING/NOTICE/INFO/DEBUG',
|
|
578
|
+
enum: ['alert', 'critical', 'error', 'warning', 'notice', 'info', 'debug'],
|
|
585
579
|
arg: '<level>',
|
|
580
|
+
default: 'notice',
|
|
586
581
|
fn: lowercase,
|
|
587
582
|
},
|
|
588
583
|
{
|
|
589
584
|
name: 'agent.security_logger.syslog.severity_blocked',
|
|
590
|
-
desc: 'Set the log level of Exploited attacks. Value options are ALERT/
|
|
591
|
-
enum: ['alert', '
|
|
585
|
+
desc: 'Set the log level of Exploited attacks. Value options are ALERT/CRITICAL/ERROR/WARNING/NOTICE/INFO/DEBUG',
|
|
586
|
+
enum: ['alert', 'critical', 'error', 'warning', 'notice', 'info', 'debug'],
|
|
592
587
|
arg: '<level>',
|
|
588
|
+
default: 'notice',
|
|
593
589
|
fn: lowercase,
|
|
594
590
|
},
|
|
595
591
|
{
|
|
596
592
|
name: 'agent.security_logger.syslog.severity_probed',
|
|
597
|
-
desc: 'Set the log level of Probed attacks. Value options are ALERT/
|
|
598
|
-
enum: ['alert', '
|
|
593
|
+
desc: 'Set the log level of Probed attacks. Value options are ALERT/CRITICAL/ERROR/WARNING/NOTICE/INFO/DEBUG',
|
|
594
|
+
enum: ['alert', 'critical', 'error', 'warning', 'notice', 'info', 'debug'],
|
|
599
595
|
arg: '<level>',
|
|
596
|
+
default: 'warning',
|
|
600
597
|
fn: lowercase,
|
|
601
598
|
},
|
|
602
599
|
{
|
|
@@ -1019,7 +1016,6 @@ function getDefault(optionName) {
|
|
|
1019
1016
|
return option.default;
|
|
1020
1017
|
}
|
|
1021
1018
|
|
|
1022
|
-
module.exports.configPathEnvVars = configPathEnvVars;
|
|
1023
1019
|
module.exports.options = options;
|
|
1024
1020
|
module.exports.program = program;
|
|
1025
1021
|
module.exports.clearBaseCase = clearBaseCase;
|
package/lib/core/config/util.js
CHANGED
|
@@ -24,7 +24,6 @@ const stringify = require('json-stable-stringify');
|
|
|
24
24
|
|
|
25
25
|
const common = require('./options');
|
|
26
26
|
const configOptions = common.options;
|
|
27
|
-
const { configPathEnvVars } = common;
|
|
28
27
|
const util = module.exports;
|
|
29
28
|
|
|
30
29
|
/**
|
|
@@ -175,8 +174,7 @@ function checkConfigPath() {
|
|
|
175
174
|
function getConfigPath(cliOptions) {
|
|
176
175
|
return (
|
|
177
176
|
cliOptions.configFile ||
|
|
178
|
-
process.env[
|
|
179
|
-
process.env[configPathEnvVars.deprecated] ||
|
|
177
|
+
process.env['CONTRAST_CONFIG_PATH'] ||
|
|
180
178
|
checkConfigPath()
|
|
181
179
|
);
|
|
182
180
|
}
|
|
@@ -372,9 +370,11 @@ util.Config = Config;
|
|
|
372
370
|
util.setup = function setup(cliOptions, logger) {
|
|
373
371
|
mergePM2Envs();
|
|
374
372
|
|
|
373
|
+
const { script, configFile } = cliOptions;
|
|
375
374
|
const mergedCliOptions = mergeCliOptions(cliOptions, logger);
|
|
376
|
-
mergedCliOptions.script =
|
|
377
|
-
mergedCliOptions.configFile =
|
|
375
|
+
if (script) mergedCliOptions.script = script;
|
|
376
|
+
if (configFile) mergedCliOptions.configFile = configFile;
|
|
377
|
+
|
|
378
378
|
mergedCliOptions.validate();
|
|
379
379
|
|
|
380
380
|
return mergedCliOptions;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrast/agent",
|
|
3
|
-
"version": "4.32.
|
|
3
|
+
"version": "4.32.9",
|
|
4
4
|
"description": "Node.js security instrumentation by Contrast Security",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"security",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"@bmacnaughton/string-generator": "^1.0.0",
|
|
121
121
|
"@contrast/eslint-config": "^3.0.2",
|
|
122
122
|
"@contrast/fake-module": "file:test/mock/contrast-fake",
|
|
123
|
-
"@contrast/screener-service": "^1.12.
|
|
123
|
+
"@contrast/screener-service": "^1.12.14",
|
|
124
124
|
"@hapi/boom": "file:test/mock/boom",
|
|
125
125
|
"@hapi/hapi": "file:test/mock/hapi",
|
|
126
126
|
"@ls-lint/ls-lint": "^1.11.2",
|