@contrast/config 1.28.2 → 1.29.0
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/index.d.ts +6 -3
- package/lib/options.js +14 -1
- package/package.json +2 -2
package/lib/index.d.ts
CHANGED
|
@@ -17,10 +17,10 @@ import { ProtectRuleMode, Rule } from '@contrast/common';
|
|
|
17
17
|
import { LevelWithSilent } from 'pino';
|
|
18
18
|
export { ConfigSource } from './common.js';
|
|
19
19
|
|
|
20
|
-
export interface EffectiveEntry {
|
|
20
|
+
export interface EffectiveEntry<T> {
|
|
21
21
|
canonical_name: string;
|
|
22
22
|
name: string;
|
|
23
|
-
value:
|
|
23
|
+
value: T;
|
|
24
24
|
source: ConfigSource;
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -53,7 +53,7 @@ export interface ConfigOption<T> {
|
|
|
53
53
|
|
|
54
54
|
export interface Config {
|
|
55
55
|
_filepath: string;
|
|
56
|
-
_effectiveMap: Map<EffectiveEntry
|
|
56
|
+
_effectiveMap: Map<string, EffectiveEntry<any>>;
|
|
57
57
|
_errors: Error[];
|
|
58
58
|
_status: string,
|
|
59
59
|
|
|
@@ -213,6 +213,7 @@ export interface Config {
|
|
|
213
213
|
inventory: {
|
|
214
214
|
/** Default: `true` */
|
|
215
215
|
analyze_libraries: boolean;
|
|
216
|
+
gather_metadata_via: 'AWS' | 'Azure' | 'GCP' | undefined;
|
|
216
217
|
};
|
|
217
218
|
|
|
218
219
|
assess: {
|
|
@@ -292,6 +293,8 @@ export interface Config {
|
|
|
292
293
|
environment?: string;
|
|
293
294
|
tags?: string;
|
|
294
295
|
version?: string;
|
|
296
|
+
/** Default: `true` */
|
|
297
|
+
discover_cloud_resource: boolean;
|
|
295
298
|
};
|
|
296
299
|
getEffectiveSource(cannonicalName: string): any;
|
|
297
300
|
getEffectiveValue(cannonicalName: string): any;
|
package/lib/options.js
CHANGED
|
@@ -495,6 +495,12 @@ Example - \`/opt/Contrast/contrast.log\` creates a log in the \`/opt/Contrast\`
|
|
|
495
495
|
fn: castBoolean,
|
|
496
496
|
desc: 'Set to `false` to disable library analysis.',
|
|
497
497
|
},
|
|
498
|
+
{
|
|
499
|
+
name: 'inventory.gather_metadata_via',
|
|
500
|
+
arg: '<provider>',
|
|
501
|
+
enum: ['AWS', 'Azure', 'GCP'],
|
|
502
|
+
desc: 'Specifies the cloud provider from which the agent should gather metadata (such as resource identifiers). Options are `AWS`, `Azure`, or `GCP`'
|
|
503
|
+
},
|
|
498
504
|
// assess
|
|
499
505
|
{
|
|
500
506
|
name: 'assess.enable',
|
|
@@ -613,7 +619,7 @@ Example - \`label1, label2, label3\``,
|
|
|
613
619
|
},
|
|
614
620
|
{
|
|
615
621
|
name: 'application.metadata',
|
|
616
|
-
|
|
622
|
+
arg: '<metadata>',
|
|
617
623
|
desc: 'comma-separated list of key=value pairs that are applied to each application reported by the agent.',
|
|
618
624
|
},
|
|
619
625
|
// server
|
|
@@ -649,6 +655,13 @@ Example - \`label1, label2, label3\``,
|
|
|
649
655
|
arg: '<version>',
|
|
650
656
|
desc: "override the reported server version (if different from 'version' field in the application's package.json)",
|
|
651
657
|
},
|
|
658
|
+
{
|
|
659
|
+
name: 'server.discover_cloud_resource',
|
|
660
|
+
arg: '[false]',
|
|
661
|
+
default: true,
|
|
662
|
+
fn: castBoolean,
|
|
663
|
+
desc: 'Set to `false` to disable detection of cloud provider metadata such as resource identifiers.'
|
|
664
|
+
},
|
|
652
665
|
].map((opt) => Object.assign(opt, {
|
|
653
666
|
env: `CONTRAST__${opt.name.toUpperCase().replaceAll('.', '__')
|
|
654
667
|
.replaceAll('-', '_')}`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrast/config",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.29.0",
|
|
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.
|
|
20
|
+
"@contrast/common": "1.22.0",
|
|
21
21
|
"yaml": "^2.2.2"
|
|
22
22
|
}
|
|
23
23
|
}
|