@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 CHANGED
@@ -319,27 +319,29 @@ contrastAgent.bootstrap = function(args) {
319
319
  );
320
320
  })
321
321
  .finally(async () => {
322
- let destination = process.env['CONTRAST__AGENT__DIAGNOSTICS__REPORT_PATH'];
323
- if (destination == null) {
324
- destination = agent.config._flat['agent.logger.path'].split('/');
325
- destination.pop() && destination.push('contrast_effective_config.json');
326
- destination = destination.join('/');
327
- }
328
-
329
- const args = {
330
- quiet: (process.env['CONTRAST__AGENT__DIAGNOSTICS__QUIET'] === 'false') ? false : true,
331
- output: destination,
332
- };
333
-
334
- try {
335
- outputAgentConfigFile(agent, options, args, null);
336
- } catch (err) {
337
- outputAgentConfigFile(agent, options, args, err);
338
- }
339
-
340
- if (!(process.env['CONTRAST__AGENT__SYSTEM_DIAGNOSTICS__ENABLE'] === 'false')) {
341
- const info = fetchSystemInfo();
342
- outputSystemInfo({ skip: false, quiet: true, output: 'contrast_system_info.json' }, info);
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.enabled;
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.ipAddress;
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.port;
38
+ tsValue = tsData.defend.syslog && tsData.defend.syslog.syslogPortNumber;
39
39
  break;
40
- case 'agent.security_logger.syslog.fascility':
41
- tsValue = tsData.defend.syslog && tsData.defend.syslog.fascilityCode;
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.severityExploited;
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.severityBlocked;
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.severityProbed;
50
+ tsValue = tsData.defend.syslog && tsData.defend.syslog.syslogSeverityProbed;
51
51
  break;
52
52
  default:
53
53
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/agent",
3
- "version": "4.29.0",
3
+ "version": "4.29.1",
4
4
  "description": "Node.js security instrumentation by Contrast Security",
5
5
  "keywords": [
6
6
  "security",
@@ -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(process.env['PWD'], 'package.json')),
173
+ Application: appPath ? require(path.join(appPath, 'package.json')) : null,
173
174
  };
174
175
 
175
176
  return info;