@contrast/agent 4.29.0 → 4.29.1
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/contrast.js +23 -21
- package/lib/util/config-diagnostics-utils.js +8 -8
- package/package.json +1 -1
- package/system-diagnostics.js +2 -1
package/lib/contrast.js
CHANGED
|
@@ -319,27 +319,29 @@ contrastAgent.bootstrap = function(args) {
|
|
|
319
319
|
);
|
|
320
320
|
})
|
|
321
321
|
.finally(async () => {
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
destination
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
322
|
+
if (!(process.env['CONTRAST__AGENT__DIAGNOSTICS__ENABLE'] === 'false')) {
|
|
323
|
+
let destination = process.env['CONTRAST__AGENT__DIAGNOSTICS__REPORT_PATH'];
|
|
324
|
+
if (destination == null) {
|
|
325
|
+
destination = agent.config._flat['agent.logger.path'].split('/');
|
|
326
|
+
destination.pop() && destination.push('contrast_effective_config.json');
|
|
327
|
+
destination = destination.join('/');
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
const args = {
|
|
331
|
+
quiet: (process.env['CONTRAST__AGENT__DIAGNOSTICS__QUIET'] === 'false') ? false : true,
|
|
332
|
+
output: destination,
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
try {
|
|
336
|
+
outputAgentConfigFile(agent, options, args, null);
|
|
337
|
+
} catch (err) {
|
|
338
|
+
outputAgentConfigFile(agent, options, args, err);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
if (!(process.env['CONTRAST__AGENT__SYSTEM_DIAGNOSTICS__ENABLE'] === 'false')) {
|
|
342
|
+
const info = fetchSystemInfo();
|
|
343
|
+
outputSystemInfo({ skip: false, quiet: true, output: 'contrast_system_info.json' }, info);
|
|
344
|
+
}
|
|
343
345
|
}
|
|
344
346
|
});
|
|
345
347
|
};
|
|
@@ -29,25 +29,25 @@ function getLoggerValues(option, config, tsData) {
|
|
|
29
29
|
tsValue = tsData.logFile;
|
|
30
30
|
break;
|
|
31
31
|
case 'agent.security_logger.syslog.enable':
|
|
32
|
-
tsValue = tsData.defend.syslog && tsData.defend.syslog.
|
|
32
|
+
tsValue = tsData.defend.syslog && tsData.defend.syslog.syslogEnabled;
|
|
33
33
|
break;
|
|
34
34
|
case 'agent.security_logger.syslog.ip':
|
|
35
|
-
tsValue = tsData.defend.syslog && tsData.defend.syslog.
|
|
35
|
+
tsValue = tsData.defend.syslog && tsData.defend.syslog.syslogIpAddress;
|
|
36
36
|
break;
|
|
37
37
|
case 'agent.security_logger.syslog.port':
|
|
38
|
-
tsValue = tsData.defend.syslog && tsData.defend.syslog.
|
|
38
|
+
tsValue = tsData.defend.syslog && tsData.defend.syslog.syslogPortNumber;
|
|
39
39
|
break;
|
|
40
|
-
case 'agent.security_logger.syslog.
|
|
41
|
-
tsValue = tsData.defend.syslog && tsData.defend.syslog.
|
|
40
|
+
case 'agent.security_logger.syslog.facility':
|
|
41
|
+
tsValue = tsData.defend.syslog && tsData.defend.syslog.syslogFacilityCode;
|
|
42
42
|
break;
|
|
43
43
|
case 'agent.security_logger.syslog.severity_exploited':
|
|
44
|
-
tsValue = tsData.defend.syslog && tsData.defend.syslog.
|
|
44
|
+
tsValue = tsData.defend.syslog && tsData.defend.syslog.syslogSeverityExploited;
|
|
45
45
|
break;
|
|
46
46
|
case 'agent.security_logger.syslog.severity_blocked':
|
|
47
|
-
tsValue = tsData.defend.syslog && tsData.defend.syslog.
|
|
47
|
+
tsValue = tsData.defend.syslog && tsData.defend.syslog.syslogSeverityBlocked;
|
|
48
48
|
break;
|
|
49
49
|
case 'agent.security_logger.syslog.severity_probed':
|
|
50
|
-
tsValue = tsData.defend.syslog && tsData.defend.syslog.
|
|
50
|
+
tsValue = tsData.defend.syslog && tsData.defend.syslog.syslogSeverityProbed;
|
|
51
51
|
break;
|
|
52
52
|
default:
|
|
53
53
|
break;
|
package/package.json
CHANGED
package/system-diagnostics.js
CHANGED
|
@@ -132,6 +132,7 @@ const diagnostics = {
|
|
|
132
132
|
|
|
133
133
|
fetchSystemInfo() {
|
|
134
134
|
const yaml = setup({}, logger);
|
|
135
|
+
const appPath = process.cwd();
|
|
135
136
|
|
|
136
137
|
const info = {
|
|
137
138
|
ReportDate: new Date(),
|
|
@@ -169,7 +170,7 @@ const diagnostics = {
|
|
|
169
170
|
Used: ((os.totalmem() - os.freemem()) / 1e6).toFixed(0).concat(' MB'),
|
|
170
171
|
}
|
|
171
172
|
},
|
|
172
|
-
Application: require(path.join(
|
|
173
|
+
Application: appPath ? require(path.join(appPath, 'package.json')) : null,
|
|
173
174
|
};
|
|
174
175
|
|
|
175
176
|
return info;
|