@contrast/core 1.7.0 → 1.8.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
CHANGED
|
@@ -23,6 +23,7 @@ import { Protect } from '@contrast/protect';
|
|
|
23
23
|
import { Rewriter } from '@contrast/rewriter';
|
|
24
24
|
import RequireHook from '@contrast/require-hook';
|
|
25
25
|
import { Scopes } from '@contrast/scopes';
|
|
26
|
+
import { Deadzones } from '@contrast/deadzones';
|
|
26
27
|
|
|
27
28
|
export interface Core {
|
|
28
29
|
agentify: Agentify<Core>;
|
|
@@ -36,6 +37,7 @@ export interface Core {
|
|
|
36
37
|
protect: Protect;
|
|
37
38
|
rewriter: Rewriter;
|
|
38
39
|
scopes: Scopes;
|
|
40
|
+
deadzones: Deadzones;
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
declare function init(): Core;
|
package/lib/index.js
CHANGED
|
@@ -30,8 +30,10 @@ module.exports = function init(core = {}) {
|
|
|
30
30
|
require('@contrast/rewriter')(core);
|
|
31
31
|
require('@contrast/dep-hooks')(core);
|
|
32
32
|
require('@contrast/scopes')(core);
|
|
33
|
+
require('@contrast/deadzones')(core);
|
|
33
34
|
require('@contrast/reporter').default(core);
|
|
34
35
|
require('@contrast/agentify')(core);
|
|
36
|
+
require('@contrast/instrumentation')(core);
|
|
35
37
|
|
|
36
38
|
return core;
|
|
37
39
|
};
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
'use strict';
|
|
17
17
|
|
|
18
|
-
const {
|
|
18
|
+
const { traverseKeys } = require('@contrast/common');
|
|
19
19
|
const { CONTRAST_REDACTED } = require('./constants');
|
|
20
20
|
|
|
21
21
|
module.exports = function(core) {
|
|
@@ -35,13 +35,11 @@ module.exports = function(core) {
|
|
|
35
35
|
let redactedText;
|
|
36
36
|
if (!target) return;
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
redactedText = undefined;
|
|
44
|
-
}
|
|
38
|
+
traverseKeys(target, (path, type, value, obj) => {
|
|
39
|
+
redactedText = getRedactedText(value);
|
|
40
|
+
if (redactedText) {
|
|
41
|
+
obj[value] = redactedText;
|
|
42
|
+
redactedText = undefined;
|
|
45
43
|
}
|
|
46
44
|
});
|
|
47
45
|
}
|
|
@@ -84,7 +84,7 @@ module.exports = function (core) {
|
|
|
84
84
|
|
|
85
85
|
if (policy.maskAttackVector) {
|
|
86
86
|
// attack values
|
|
87
|
-
const inputAnalysis = Object.entries(msg.protect?.
|
|
87
|
+
const inputAnalysis = Object.entries(msg.protect?.resultsMap);
|
|
88
88
|
for (const [, results] of inputAnalysis) {
|
|
89
89
|
for (const result of results) {
|
|
90
90
|
const redactedText = getRedactedText(result.key);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrast/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "Preconfigured Contrast agent core services and models",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
|
|
@@ -17,15 +17,17 @@
|
|
|
17
17
|
"test": "../scripts/test.sh"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@contrast/agentify": "1.
|
|
21
|
-
"@contrast/common": "
|
|
22
|
-
"@contrast/config": "1.
|
|
20
|
+
"@contrast/agentify": "1.2.0",
|
|
21
|
+
"@contrast/common": "1.2.0",
|
|
22
|
+
"@contrast/config": "1.4.0",
|
|
23
23
|
"@contrast/dep-hooks": "1.0.5",
|
|
24
24
|
"@contrast/fn-inspect": "^3.2.0",
|
|
25
|
+
"@contrast/instrumentation": "1.0.0",
|
|
25
26
|
"@contrast/logger": "1.1.1",
|
|
26
|
-
"@contrast/patcher": "1.0
|
|
27
|
-
"@contrast/reporter": "1.
|
|
27
|
+
"@contrast/patcher": "1.1.0",
|
|
28
|
+
"@contrast/reporter": "1.7.0",
|
|
28
29
|
"@contrast/rewriter": "1.2.0",
|
|
29
|
-
"@contrast/scopes": "1.2.0"
|
|
30
|
+
"@contrast/scopes": "1.2.0",
|
|
31
|
+
"@contrast/deadzones": "1.0.0"
|
|
30
32
|
}
|
|
31
|
-
}
|
|
33
|
+
}
|