@contrast/config 1.22.0 → 1.23.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/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright: 2023 Contrast Security, Inc
1
+ Copyright: 2024 Contrast Security, Inc
2
2
  Contact: support@contrastsecurity.com
3
3
  License: Commercial
4
4
 
package/lib/common.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright: 2023 Contrast Security, Inc
2
+ * Copyright: 2024 Contrast Security, Inc
3
3
  * Contact: support@contrastsecurity.com
4
4
  * License: Commercial
5
5
 
package/lib/config.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright: 2023 Contrast Security, Inc
2
+ * Copyright: 2024 Contrast Security, Inc
3
3
  * Contact: support@contrastsecurity.com
4
4
  * License: Commercial
5
5
 
@@ -34,6 +34,7 @@ const {
34
34
 
35
35
  const CONTRAST_CONFIG_PATH = 'CONTRAST_CONFIG_PATH';
36
36
  const CONTRAST_PREFIX = 'CONTRAST_';
37
+ const HOME_CONFIG_DIR = path.resolve(os.homedir(), '.config', 'contrast');
37
38
  const OS_CONFIG_DIR = os.platform() === 'win32'
38
39
  ? path.resolve(process.env.ProgramData || '', 'contrast')
39
40
  : '/etc/contrast';
@@ -130,7 +131,8 @@ module.exports = class Config {
130
131
  process.cwd(),
131
132
  path.resolve(OS_CONFIG_DIR, 'node'),
132
133
  OS_CONFIG_DIR,
133
- path.resolve(os.homedir(), '.config', 'contrast'),
134
+ path.resolve(HOME_CONFIG_DIR, 'node'),
135
+ HOME_CONFIG_DIR,
134
136
  ];
135
137
  }
136
138
 
package/lib/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright: 2023 Contrast Security, Inc
2
+ * Copyright: 2024 Contrast Security, Inc
3
3
  * Contact: support@contrastsecurity.com
4
4
  * License: Commercial
5
5
 
@@ -192,7 +192,7 @@ export interface Config {
192
192
  reporting: {
193
193
  /** Default: `true` */
194
194
  enable: boolean;
195
- /** Default: `1` */
195
+ /** Default: `100` */
196
196
  interval_ms: number;
197
197
  };
198
198
  };
@@ -202,6 +202,8 @@ export interface Config {
202
202
  /** 'Set the response duration (in milliseconds) after which we will warn that a request has been hanging.' Default: `5000` */
203
203
  warn_ms: number;
204
204
  };
205
+ /** Set the full path of the npm executable, used for library analysis. Default: `'npm'` */
206
+ npm_path: string;
205
207
  };
206
208
  };
207
209
 
@@ -262,11 +264,22 @@ export interface Config {
262
264
  */
263
265
  session_id: string | null;
264
266
 
267
+ /**
268
+ * How to report the application's group for auto-grouping
269
+ */
270
+ group: string | null;
271
+
272
+ /**
273
+ * Comma-separated list of key=value pairs that are applied to each application reported by the agent.
274
+ */
275
+ metadata: string | null;
276
+
265
277
  /**
266
278
  * Provide metadata used to create a new session within Contrast UI.
267
279
  * Default: `null`
268
280
  */
269
281
  session_metadata: string | null;
282
+
270
283
  };
271
284
 
272
285
  /** Reported server information overrides */
package/lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright: 2023 Contrast Security, Inc
2
+ * Copyright: 2024 Contrast Security, Inc
3
3
  * Contact: support@contrastsecurity.com
4
4
  * License: Commercial
5
5
 
package/lib/options.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright: 2023 Contrast Security, Inc
2
+ * Copyright: 2024 Contrast Security, Inc
3
3
  * Contact: support@contrastsecurity.com
4
4
  * License: Commercial
5
5
 
@@ -433,7 +433,8 @@ Example - \`/opt/Contrast/contrast.log\` creates a log in the \`/opt/Contrast\`
433
433
  {
434
434
  name: 'agent.node.library_usage.reporting.interval_ms',
435
435
  arg: '<num>',
436
- default: 1,
436
+ fn: parseNum,
437
+ default: 100,
437
438
  desc: 'Set the interval (in milliseconds) for collecting code events for library usage.',
438
439
  },
439
440
  {
@@ -450,6 +451,12 @@ Example - \`/opt/Contrast/contrast.log\` creates a log in the \`/opt/Contrast\`
450
451
  fn: parseNum,
451
452
  desc: 'Set the response duration (in milliseconds) after which we will warn that a request has been hanging.'
452
453
  },
454
+ {
455
+ name: 'agent.node.npm_path',
456
+ arg: '<path>',
457
+ default: 'npm',
458
+ desc: 'Set the full path of the npm executable, used for library analysis',
459
+ },
453
460
  // inventory
454
461
  {
455
462
  name: 'inventory.analyze_libraries',
@@ -569,6 +576,16 @@ Example - \`label1, label2, label3\``,
569
576
  default: null,
570
577
  desc: 'Provide metadata which is used to create a new session ID in the Contrast UI. Vulnerabilities discovered by the agent are associated with this new session. This value should be formatted as `key=value` pairs (conforming to RFC 2253). Available key names for this configuration are branchName, buildNumber, commitHash, committer, gitTag, repository, testRun, and version. This option and `application.session_id` are mutually exclusive; if both are set the agent will be disabled.',
571
578
  },
579
+ {
580
+ name: 'application.group',
581
+ arg: '<tags>',
582
+ desc: "how to report the application's group for auto-grouping",
583
+ },
584
+ {
585
+ name: 'application.metadata',
586
+ args: '<metadata>',
587
+ desc: 'comma-separated list of key=value pairs that are applied to each application reported by the agent.',
588
+ },
572
589
  // server
573
590
  {
574
591
  name: 'server.name',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/config",
3
- "version": "1.22.0",
3
+ "version": "1.23.1",
4
4
  "description": "An API for discovering Contrast agent configuration data",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
@@ -17,7 +17,7 @@
17
17
  "test": "../scripts/test.sh"
18
18
  },
19
19
  "dependencies": {
20
- "@contrast/common": "1.16.0",
20
+ "@contrast/common": "1.16.1",
21
21
  "yaml": "^2.2.2"
22
22
  }
23
23
  }