@contrast/agent 4.25.0 → 4.25.2

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.
@@ -402,14 +402,15 @@ const agent = [
402
402
  arg: '[false]',
403
403
  default: true,
404
404
  fn: castBoolean,
405
- desc: 'whether to use speedracer for input analysis when enabled',
405
+ desc: 'Should be set to [true] in order to communicate with TeamServer.' +
406
+ 'The place of input analysis depends on the value of agent.node.native_input_analysis',
406
407
  },
407
408
  {
408
409
  name: 'agent.node.native_input_analysis',
409
410
  arg: '[true]',
410
411
  default: false,
411
412
  fn: castBoolean,
412
- desc: 'do agent-native input analysis prior to any external analysis',
413
+ desc: 'if true - input analysis is done via agent-lib, otherwise it is done by SpeedRacer',
413
414
  },
414
415
  {
415
416
  name: 'agent.node.analysis_log_dir',
@@ -22,6 +22,7 @@ const {
22
22
  } = require('./constants');
23
23
 
24
24
  const VERSION_REGEX = /^npm@(\S+)\s+(\S+)$/m;
25
+ const isWin32 = process.platform === 'win32';
25
26
 
26
27
  const execFile = util.promisify(require('child_process').execFile);
27
28
 
@@ -38,11 +39,13 @@ const execFile = util.promisify(require('child_process').execFile);
38
39
  * @param {*} logger
39
40
  * @returns {Promise<Result>}
40
41
  */
42
+ // eslint-disable-next-line complexity
41
43
  module.exports = async function listInstalled(cwd, logger) {
42
44
  const execFileOpts = {
43
45
  cwd,
44
46
  env: { ...process.env, NODE_OPTIONS: undefined },
45
47
  maxBuffer: 1024 * 1024 * 128,
48
+ shell: isWin32
46
49
  };
47
50
  let stdout;
48
51
 
@@ -169,7 +169,7 @@ class Speedracer {
169
169
  this.logger.info('starting contrast-service');
170
170
  this.startTime = Date.now();
171
171
 
172
- const speedracerPath = path.resolve(
172
+ let speedracerPath = path.resolve(
173
173
  __dirname,
174
174
  '..',
175
175
  '..',
@@ -179,6 +179,10 @@ class Speedracer {
179
179
  `contrast-service-${process.platform}-${process.arch}`
180
180
  );
181
181
 
182
+ if (process.platform === 'win32') {
183
+ speedracerPath = `${speedracerPath}.exe`;
184
+ }
185
+
182
186
  try {
183
187
  fs.statSync(speedracerPath);
184
188
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/agent",
3
- "version": "4.25.0",
3
+ "version": "4.25.2",
4
4
  "description": "Node.js security instrumentation by Contrast Security",
5
5
  "keywords": [
6
6
  "security",