@ampsec/platform-client 67.1.0 → 68.0.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/build/src/dto/enums/findingKind.d.ts +6 -2
- package/build/src/dto/enums/findingKind.js +51 -21
- package/build/src/dto/enums/findingKind.js.map +1 -1
- package/build/src/dto/findings.dto.d.ts +114 -0
- package/build/src/dto/findings.dto.js +27 -27
- package/build/src/dto/findings.dto.js.map +1 -1
- package/build/src/dto/platform/platform.findings.dto.d.ts +14 -0
- package/build/src/services/settings.service.d.ts +6 -6
- package/package.json +1 -1
- package/src/dto/enums/findingKind.ts +51 -21
- package/src/dto/findings.dto.ts +29 -27
|
@@ -11,13 +11,16 @@ export declare enum FindingKind {
|
|
|
11
11
|
FAILED_PHISHING = "FAILED_PHISHING",
|
|
12
12
|
TRAINING_OVERDUE = "TRAINING_OVERDUE",
|
|
13
13
|
DEVICE_NOT_MANAGED = "DEVICE_NOT_MANAGED",
|
|
14
|
-
|
|
14
|
+
CRITICAL_VULNERABILITY_OUT_OF_SLA = "CRITICAL_VULNERABILITY_OUT_OF_SLA",
|
|
15
|
+
HIGH_VULNERABILITY_OUT_OF_SLA = "HIGH_VULNERABILITY_OUT_OF_SLA",
|
|
16
|
+
MEDIUM_VULNERABILITY_OUT_OF_SLA = "MEDIUM_VULNERABILITY_OUT_OF_SLA",
|
|
17
|
+
LOW_VULNERABILITY_OUT_OF_SLA = "LOW_VULNERABILITY_OUT_OF_SLA",
|
|
15
18
|
WEB_GATEWAY_NOT_ACTIVE = "WEB_GATEWAY_NOT_ACTIVE"
|
|
16
19
|
}
|
|
17
20
|
export declare const lookupFindingOutcomeByKind: (kind: FindingKind) => FindingOutcome;
|
|
18
21
|
export declare const lookupFindingKindByCategory: (category: string) => FindingKind[];
|
|
19
22
|
export declare const lookupFindingSeverityByKind: (kind: string) => FindingSeverity | undefined;
|
|
20
|
-
export declare const lookupFindingScoreByCategoryKindAndSeverity: (category: Category, kind: string
|
|
23
|
+
export declare const lookupFindingScoreByCategoryKindAndSeverity: (category: Category, kind: string) => number;
|
|
21
24
|
export declare const lookupFindingDisplayValueByKind: (kind: string) => string;
|
|
22
25
|
export declare const generateInsights: (category: string, kind: string) => {
|
|
23
26
|
meta: {
|
|
@@ -34,6 +37,7 @@ export declare const generateInsights: (category: string, kind: string) => {
|
|
|
34
37
|
uid: {
|
|
35
38
|
$has: boolean;
|
|
36
39
|
};
|
|
40
|
+
severity: FindingSeverity;
|
|
37
41
|
findingCondition: Record<string, string | number | boolean | undefined>;
|
|
38
42
|
remediatedCondition: Record<string, string | number | boolean | undefined>;
|
|
39
43
|
};
|
|
@@ -19,7 +19,10 @@ var FindingKind;
|
|
|
19
19
|
FindingKind["TRAINING_OVERDUE"] = "TRAINING_OVERDUE";
|
|
20
20
|
// EDR
|
|
21
21
|
FindingKind["DEVICE_NOT_MANAGED"] = "DEVICE_NOT_MANAGED";
|
|
22
|
-
FindingKind["
|
|
22
|
+
FindingKind["CRITICAL_VULNERABILITY_OUT_OF_SLA"] = "CRITICAL_VULNERABILITY_OUT_OF_SLA";
|
|
23
|
+
FindingKind["HIGH_VULNERABILITY_OUT_OF_SLA"] = "HIGH_VULNERABILITY_OUT_OF_SLA";
|
|
24
|
+
FindingKind["MEDIUM_VULNERABILITY_OUT_OF_SLA"] = "MEDIUM_VULNERABILITY_OUT_OF_SLA";
|
|
25
|
+
FindingKind["LOW_VULNERABILITY_OUT_OF_SLA"] = "LOW_VULNERABILITY_OUT_OF_SLA";
|
|
23
26
|
// WEB_GATEWAY
|
|
24
27
|
FindingKind["WEB_GATEWAY_NOT_ACTIVE"] = "WEB_GATEWAY_NOT_ACTIVE";
|
|
25
28
|
})(FindingKind || (exports.FindingKind = FindingKind = {}));
|
|
@@ -29,7 +32,10 @@ const lookupFindingOutcomeByKind = (kind) => {
|
|
|
29
32
|
case FindingKind.MFA_NOT_ENABLED:
|
|
30
33
|
case FindingKind.TRAINING_OVERDUE:
|
|
31
34
|
case FindingKind.DEVICE_NOT_MANAGED:
|
|
32
|
-
case FindingKind.
|
|
35
|
+
case FindingKind.CRITICAL_VULNERABILITY_OUT_OF_SLA:
|
|
36
|
+
case FindingKind.HIGH_VULNERABILITY_OUT_OF_SLA:
|
|
37
|
+
case FindingKind.MEDIUM_VULNERABILITY_OUT_OF_SLA:
|
|
38
|
+
case FindingKind.LOW_VULNERABILITY_OUT_OF_SLA:
|
|
33
39
|
case FindingKind.WEB_GATEWAY_NOT_ACTIVE: {
|
|
34
40
|
return finding_outcome_1.FindingOutcome.REMEDIATION;
|
|
35
41
|
}
|
|
@@ -62,7 +68,12 @@ const lookupFindingKindByCategory = (category) => {
|
|
|
62
68
|
return [FindingKind.WEB_GATEWAY_NOT_ACTIVE];
|
|
63
69
|
}
|
|
64
70
|
case category_1.Category.VULNERABILITY: {
|
|
65
|
-
return [
|
|
71
|
+
return [
|
|
72
|
+
FindingKind.CRITICAL_VULNERABILITY_OUT_OF_SLA,
|
|
73
|
+
FindingKind.HIGH_VULNERABILITY_OUT_OF_SLA,
|
|
74
|
+
FindingKind.MEDIUM_VULNERABILITY_OUT_OF_SLA,
|
|
75
|
+
FindingKind.LOW_VULNERABILITY_OUT_OF_SLA,
|
|
76
|
+
];
|
|
66
77
|
}
|
|
67
78
|
case category_1.Category.NOTIFICATION: {
|
|
68
79
|
return [];
|
|
@@ -81,9 +92,18 @@ const lookupFindingSeverityByKind = (kind) => {
|
|
|
81
92
|
case FindingKind.HAS_PRIVILEGED_ACCESS:
|
|
82
93
|
case FindingKind.DEVICE_NOT_MANAGED:
|
|
83
94
|
case FindingKind.WEB_GATEWAY_NOT_ACTIVE:
|
|
84
|
-
case FindingKind.
|
|
95
|
+
case FindingKind.CRITICAL_VULNERABILITY_OUT_OF_SLA: {
|
|
96
|
+
return finding_severity_1.FindingSeverity.CRITICAL;
|
|
97
|
+
}
|
|
98
|
+
case FindingKind.HIGH_VULNERABILITY_OUT_OF_SLA: {
|
|
85
99
|
return finding_severity_1.FindingSeverity.HIGH;
|
|
86
100
|
}
|
|
101
|
+
case FindingKind.MEDIUM_VULNERABILITY_OUT_OF_SLA: {
|
|
102
|
+
return finding_severity_1.FindingSeverity.MEDIUM;
|
|
103
|
+
}
|
|
104
|
+
case FindingKind.LOW_VULNERABILITY_OUT_OF_SLA: {
|
|
105
|
+
return finding_severity_1.FindingSeverity.LOW;
|
|
106
|
+
}
|
|
87
107
|
case FindingKind.FAILED_PHISHING:
|
|
88
108
|
case FindingKind.TRAINING_OVERDUE: {
|
|
89
109
|
return finding_severity_1.FindingSeverity.MEDIUM;
|
|
@@ -95,7 +115,7 @@ const lookupFindingSeverityByKind = (kind) => {
|
|
|
95
115
|
};
|
|
96
116
|
exports.lookupFindingSeverityByKind = lookupFindingSeverityByKind;
|
|
97
117
|
// https://docs.google.com/spreadsheets/d/18Ow9GGBvioAx4agnpnJGV4qnOWeLK941L7SrF4tzZiM/edit#gid=0
|
|
98
|
-
const lookupFindingScoreByCategoryKindAndSeverity = (category, kind
|
|
118
|
+
const lookupFindingScoreByCategoryKindAndSeverity = (category, kind) => {
|
|
99
119
|
switch (category) {
|
|
100
120
|
case category_1.Category.EDR: {
|
|
101
121
|
switch (kind) {
|
|
@@ -109,21 +129,14 @@ const lookupFindingScoreByCategoryKindAndSeverity = (category, kind, severity) =
|
|
|
109
129
|
switch (kind) {
|
|
110
130
|
case FindingKind.DEVICE_NOT_MANAGED:
|
|
111
131
|
return 10;
|
|
112
|
-
case FindingKind.
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
case finding_severity_1.FindingSeverity.LOW:
|
|
121
|
-
return 2;
|
|
122
|
-
case finding_severity_1.FindingSeverity.INFO:
|
|
123
|
-
default:
|
|
124
|
-
return 0;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
132
|
+
case FindingKind.CRITICAL_VULNERABILITY_OUT_OF_SLA:
|
|
133
|
+
return 15;
|
|
134
|
+
case FindingKind.HIGH_VULNERABILITY_OUT_OF_SLA:
|
|
135
|
+
return 9;
|
|
136
|
+
case FindingKind.MEDIUM_VULNERABILITY_OUT_OF_SLA:
|
|
137
|
+
return 5;
|
|
138
|
+
case FindingKind.LOW_VULNERABILITY_OUT_OF_SLA:
|
|
139
|
+
return 2;
|
|
127
140
|
default:
|
|
128
141
|
return 0;
|
|
129
142
|
}
|
|
@@ -195,6 +208,7 @@ const generateInsights = (category, kind) => {
|
|
|
195
208
|
kind: '',
|
|
196
209
|
aid: { $has: false },
|
|
197
210
|
uid: { $has: false },
|
|
211
|
+
severity: undefined,
|
|
198
212
|
findingCondition: {},
|
|
199
213
|
remediatedCondition: {},
|
|
200
214
|
},
|
|
@@ -214,9 +228,25 @@ const generateInsights = (category, kind) => {
|
|
|
214
228
|
setCondition('meta._findings.loggedIn', false);
|
|
215
229
|
insights.rule.kind = saasComponentKind_1.SaasComponentKind.WEB_GATEWAY_SESSION;
|
|
216
230
|
break;
|
|
217
|
-
case FindingKind.
|
|
231
|
+
case FindingKind.CRITICAL_VULNERABILITY_OUT_OF_SLA:
|
|
232
|
+
setCondition('meta._findings.overdue', true);
|
|
233
|
+
insights.rule.kind = saasComponentKind_1.SaasComponentKind.VULNERABILITY;
|
|
234
|
+
insights.rule.severity = finding_severity_1.FindingSeverity.CRITICAL;
|
|
235
|
+
break;
|
|
236
|
+
case FindingKind.HIGH_VULNERABILITY_OUT_OF_SLA:
|
|
237
|
+
setCondition('meta._findings.overdue', true);
|
|
238
|
+
insights.rule.kind = saasComponentKind_1.SaasComponentKind.VULNERABILITY;
|
|
239
|
+
insights.rule.severity = finding_severity_1.FindingSeverity.HIGH;
|
|
240
|
+
break;
|
|
241
|
+
case FindingKind.MEDIUM_VULNERABILITY_OUT_OF_SLA:
|
|
242
|
+
setCondition('meta._findings.overdue', true);
|
|
243
|
+
insights.rule.kind = saasComponentKind_1.SaasComponentKind.VULNERABILITY;
|
|
244
|
+
insights.rule.severity = finding_severity_1.FindingSeverity.MEDIUM;
|
|
245
|
+
break;
|
|
246
|
+
case FindingKind.LOW_VULNERABILITY_OUT_OF_SLA:
|
|
218
247
|
setCondition('meta._findings.overdue', true);
|
|
219
248
|
insights.rule.kind = saasComponentKind_1.SaasComponentKind.VULNERABILITY;
|
|
249
|
+
insights.rule.severity = finding_severity_1.FindingSeverity.LOW;
|
|
220
250
|
break;
|
|
221
251
|
case FindingKind.TRAINING_OVERDUE:
|
|
222
252
|
setCondition('meta._findings.overdue', true);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findingKind.js","sourceRoot":"","sources":["../../../../src/dto/enums/findingKind.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,uDAAiD;AACjD,yDAAmD;AACnD,2DAAsD;AAEtD,IAAY,
|
|
1
|
+
{"version":3,"file":"findingKind.js","sourceRoot":"","sources":["../../../../src/dto/enums/findingKind.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,uDAAiD;AACjD,yDAAmD;AACnD,2DAAsD;AAEtD,IAAY,WAuBX;AAvBD,WAAY,WAAW;IACrB,MAAM;IACN,wCAAyB,CAAA;IAEzB,WAAW;IACX,kDAAmC,CAAA;IACnC,4CAA6B,CAAA;IAC7B,8DAA+C,CAAA;IAC/C,8DAA+C,CAAA;IAE/C,WAAW;IACX,kDAAmC,CAAA;IACnC,oDAAqC,CAAA;IAErC,MAAM;IACN,wDAAyC,CAAA;IACzC,sFAAuE,CAAA;IACvE,8EAA+D,CAAA;IAC/D,kFAAmE,CAAA;IACnE,4EAA6D,CAAA;IAE7D,cAAc;IACd,gEAAiD,CAAA;AACnD,CAAC,EAvBW,WAAW,2BAAX,WAAW,QAuBtB;AAEM,MAAM,0BAA0B,GAAG,CAAC,IAAiB,EAAkB,EAAE;IAC9E,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,WAAW,CAAC,UAAU,CAAC;QAC5B,KAAK,WAAW,CAAC,eAAe,CAAC;QACjC,K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,CAAC,IAAI,CAAC,IAAI,GAAG,qCAAiB,CAAC,eAAe,CAAC;YACvD,MAAM;QACR,KAAK,WAAW,CAAC,kBAAkB;YACjC,YAAY,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC;YAC7C,QAAQ,CAAC,IAAI,CAAC,IAAI,GAAG,qCAAiB,CAAC,UAAU,CAAC;YAClD,MAAM;QACR,KAAK,WAAW,CAAC,eAAe;YAC9B,YAAY,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;YAC9C,QAAQ,CAAC,IAAI,CAAC,IAAI,GAAG,qCAAiB,CAAC,UAAU,CAAC;YAClD,MAAM;QACR,KAAK,WAAW,CAAC,YAAY;YAC3B,YAAY,CAAC,4BAA4B,EAAE,IAAI,CAAC,CAAC;YACjD,QAAQ,CAAC,IAAI,CAAC,IAAI,GAAG,qCAAiB,CAAC,gBAAgB,CAAC;YACxD,MAAM;QACR,KAAK,WAAW,CAAC,qBAAqB;YACpC,YAAY,CAAC,8BAA8B,EAAE,IAAI,CAAC,CAAC;YACnD,QAAQ,CAAC,IAAI,CAAC,IAAI,GAAG,qCAAiB,CAAC,gBAAgB,CAAC;YACxD,MAAM;QACR,KAAK,WAAW,CAAC,qBAAqB;YACpC,YAAY,CAAC,oCAAoC,EAAE,IAAI,CAAC,CAAC;YACzD,QAAQ,CAAC,IAAI,CAAC,IAAI,GAAG,qCAAiB,CAAC,gBAAgB,CAAC;YACxD,MAAM;QACR;YACE,MAAM;IACV,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AArFW,QAAA,gBAAgB,oBAqF3B"}
|
|
@@ -58,6 +58,104 @@ export type FindingDto = BaseDto & FindingUpsertDto & {
|
|
|
58
58
|
/** Optionally populated when requested through query param `include=meta`. Comes from `saasComp.meta` */
|
|
59
59
|
meta?: SaasComponentMeta;
|
|
60
60
|
};
|
|
61
|
+
declare const _FindingSpecInsights: z.ZodObject<{
|
|
62
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
63
|
+
kind: z.ZodNativeEnum<typeof FindingKind>;
|
|
64
|
+
severity: z.ZodNativeEnum<typeof FindingSeverity>;
|
|
65
|
+
displayValue: z.ZodString;
|
|
66
|
+
}, "strip", z.ZodTypeAny, {
|
|
67
|
+
displayValue: string;
|
|
68
|
+
kind: FindingKind;
|
|
69
|
+
severity: FindingSeverity;
|
|
70
|
+
}, {
|
|
71
|
+
displayValue: string;
|
|
72
|
+
kind: FindingKind;
|
|
73
|
+
severity: FindingSeverity;
|
|
74
|
+
}>>;
|
|
75
|
+
rule: z.ZodOptional<z.ZodObject<{
|
|
76
|
+
category: z.ZodNativeEnum<typeof Category>;
|
|
77
|
+
kind: z.ZodNativeEnum<typeof SaasComponentKind>;
|
|
78
|
+
aid: z.ZodOptional<z.ZodObject<{
|
|
79
|
+
$has: z.ZodBoolean;
|
|
80
|
+
}, "strip", z.ZodTypeAny, {
|
|
81
|
+
$has: boolean;
|
|
82
|
+
}, {
|
|
83
|
+
$has: boolean;
|
|
84
|
+
}>>;
|
|
85
|
+
uid: z.ZodOptional<z.ZodObject<{
|
|
86
|
+
$has: z.ZodBoolean;
|
|
87
|
+
}, "strip", z.ZodTypeAny, {
|
|
88
|
+
$has: boolean;
|
|
89
|
+
}, {
|
|
90
|
+
$has: boolean;
|
|
91
|
+
}>>;
|
|
92
|
+
severity: z.ZodOptional<z.ZodNativeEnum<typeof FindingSeverity>>;
|
|
93
|
+
findingCondition: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodNumber, z.ZodUndefined]>>;
|
|
94
|
+
remediatedCondition: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodNumber, z.ZodUndefined]>>>;
|
|
95
|
+
}, "strip", z.ZodTypeAny, {
|
|
96
|
+
kind: SaasComponentKind;
|
|
97
|
+
category: Category;
|
|
98
|
+
findingCondition: Record<string, string | number | boolean | undefined>;
|
|
99
|
+
aid?: {
|
|
100
|
+
$has: boolean;
|
|
101
|
+
} | undefined;
|
|
102
|
+
uid?: {
|
|
103
|
+
$has: boolean;
|
|
104
|
+
} | undefined;
|
|
105
|
+
severity?: FindingSeverity | undefined;
|
|
106
|
+
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
107
|
+
}, {
|
|
108
|
+
kind: SaasComponentKind;
|
|
109
|
+
category: Category;
|
|
110
|
+
findingCondition: Record<string, string | number | boolean | undefined>;
|
|
111
|
+
aid?: {
|
|
112
|
+
$has: boolean;
|
|
113
|
+
} | undefined;
|
|
114
|
+
uid?: {
|
|
115
|
+
$has: boolean;
|
|
116
|
+
} | undefined;
|
|
117
|
+
severity?: FindingSeverity | undefined;
|
|
118
|
+
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
119
|
+
}>>;
|
|
120
|
+
}, "strip", z.ZodTypeAny, {
|
|
121
|
+
meta?: {
|
|
122
|
+
displayValue: string;
|
|
123
|
+
kind: FindingKind;
|
|
124
|
+
severity: FindingSeverity;
|
|
125
|
+
} | undefined;
|
|
126
|
+
rule?: {
|
|
127
|
+
kind: SaasComponentKind;
|
|
128
|
+
category: Category;
|
|
129
|
+
findingCondition: Record<string, string | number | boolean | undefined>;
|
|
130
|
+
aid?: {
|
|
131
|
+
$has: boolean;
|
|
132
|
+
} | undefined;
|
|
133
|
+
uid?: {
|
|
134
|
+
$has: boolean;
|
|
135
|
+
} | undefined;
|
|
136
|
+
severity?: FindingSeverity | undefined;
|
|
137
|
+
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
138
|
+
} | undefined;
|
|
139
|
+
}, {
|
|
140
|
+
meta?: {
|
|
141
|
+
displayValue: string;
|
|
142
|
+
kind: FindingKind;
|
|
143
|
+
severity: FindingSeverity;
|
|
144
|
+
} | undefined;
|
|
145
|
+
rule?: {
|
|
146
|
+
kind: SaasComponentKind;
|
|
147
|
+
category: Category;
|
|
148
|
+
findingCondition: Record<string, string | number | boolean | undefined>;
|
|
149
|
+
aid?: {
|
|
150
|
+
$has: boolean;
|
|
151
|
+
} | undefined;
|
|
152
|
+
uid?: {
|
|
153
|
+
$has: boolean;
|
|
154
|
+
} | undefined;
|
|
155
|
+
severity?: FindingSeverity | undefined;
|
|
156
|
+
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
157
|
+
} | undefined;
|
|
158
|
+
}>;
|
|
61
159
|
export declare const _FindingSpecDto: z.ZodObject<{
|
|
62
160
|
id: z.ZodString;
|
|
63
161
|
createdAt: z.ZodString;
|
|
@@ -100,6 +198,7 @@ export declare const _FindingSpecDto: z.ZodObject<{
|
|
|
100
198
|
}, {
|
|
101
199
|
$has: boolean;
|
|
102
200
|
}>>;
|
|
201
|
+
severity: z.ZodOptional<z.ZodNativeEnum<typeof FindingSeverity>>;
|
|
103
202
|
findingCondition: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodNumber, z.ZodUndefined]>>;
|
|
104
203
|
remediatedCondition: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodNumber, z.ZodUndefined]>>>;
|
|
105
204
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -112,6 +211,7 @@ export declare const _FindingSpecDto: z.ZodObject<{
|
|
|
112
211
|
uid?: {
|
|
113
212
|
$has: boolean;
|
|
114
213
|
} | undefined;
|
|
214
|
+
severity?: FindingSeverity | undefined;
|
|
115
215
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
116
216
|
}, {
|
|
117
217
|
kind: SaasComponentKind;
|
|
@@ -123,6 +223,7 @@ export declare const _FindingSpecDto: z.ZodObject<{
|
|
|
123
223
|
uid?: {
|
|
124
224
|
$has: boolean;
|
|
125
225
|
} | undefined;
|
|
226
|
+
severity?: FindingSeverity | undefined;
|
|
126
227
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
127
228
|
}>>;
|
|
128
229
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -141,6 +242,7 @@ export declare const _FindingSpecDto: z.ZodObject<{
|
|
|
141
242
|
uid?: {
|
|
142
243
|
$has: boolean;
|
|
143
244
|
} | undefined;
|
|
245
|
+
severity?: FindingSeverity | undefined;
|
|
144
246
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
145
247
|
} | undefined;
|
|
146
248
|
}, {
|
|
@@ -159,6 +261,7 @@ export declare const _FindingSpecDto: z.ZodObject<{
|
|
|
159
261
|
uid?: {
|
|
160
262
|
$has: boolean;
|
|
161
263
|
} | undefined;
|
|
264
|
+
severity?: FindingSeverity | undefined;
|
|
162
265
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
163
266
|
} | undefined;
|
|
164
267
|
}>>;
|
|
@@ -194,6 +297,7 @@ export declare const _FindingSpecDto: z.ZodObject<{
|
|
|
194
297
|
uid?: {
|
|
195
298
|
$has: boolean;
|
|
196
299
|
} | undefined;
|
|
300
|
+
severity?: FindingSeverity | undefined;
|
|
197
301
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
198
302
|
} | undefined;
|
|
199
303
|
} | undefined;
|
|
@@ -228,6 +332,7 @@ export declare const _FindingSpecDto: z.ZodObject<{
|
|
|
228
332
|
uid?: {
|
|
229
333
|
$has: boolean;
|
|
230
334
|
} | undefined;
|
|
335
|
+
severity?: FindingSeverity | undefined;
|
|
231
336
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
232
337
|
} | undefined;
|
|
233
338
|
} | undefined;
|
|
@@ -235,6 +340,7 @@ export declare const _FindingSpecDto: z.ZodObject<{
|
|
|
235
340
|
outcome?: FindingOutcome | undefined;
|
|
236
341
|
score?: number | undefined;
|
|
237
342
|
}>;
|
|
343
|
+
export type FindingSpecInsights = z.infer<typeof _FindingSpecInsights>;
|
|
238
344
|
export type FindingSpecDto = z.infer<typeof _FindingSpecDto>;
|
|
239
345
|
export declare const _FindingSpecUpsertDto: z.ZodObject<{
|
|
240
346
|
name: z.ZodString;
|
|
@@ -280,6 +386,7 @@ export declare const _FindingSpecUpsertDto: z.ZodObject<{
|
|
|
280
386
|
}, {
|
|
281
387
|
$has: boolean;
|
|
282
388
|
}>>;
|
|
389
|
+
severity: z.ZodOptional<z.ZodNativeEnum<typeof FindingSeverity>>;
|
|
283
390
|
findingCondition: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodNumber, z.ZodUndefined]>>;
|
|
284
391
|
remediatedCondition: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodNumber, z.ZodUndefined]>>>;
|
|
285
392
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -292,6 +399,7 @@ export declare const _FindingSpecUpsertDto: z.ZodObject<{
|
|
|
292
399
|
uid?: {
|
|
293
400
|
$has: boolean;
|
|
294
401
|
} | undefined;
|
|
402
|
+
severity?: FindingSeverity | undefined;
|
|
295
403
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
296
404
|
}, {
|
|
297
405
|
kind: SaasComponentKind;
|
|
@@ -303,6 +411,7 @@ export declare const _FindingSpecUpsertDto: z.ZodObject<{
|
|
|
303
411
|
uid?: {
|
|
304
412
|
$has: boolean;
|
|
305
413
|
} | undefined;
|
|
414
|
+
severity?: FindingSeverity | undefined;
|
|
306
415
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
307
416
|
}>>;
|
|
308
417
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -321,6 +430,7 @@ export declare const _FindingSpecUpsertDto: z.ZodObject<{
|
|
|
321
430
|
uid?: {
|
|
322
431
|
$has: boolean;
|
|
323
432
|
} | undefined;
|
|
433
|
+
severity?: FindingSeverity | undefined;
|
|
324
434
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
325
435
|
} | undefined;
|
|
326
436
|
}, {
|
|
@@ -339,6 +449,7 @@ export declare const _FindingSpecUpsertDto: z.ZodObject<{
|
|
|
339
449
|
uid?: {
|
|
340
450
|
$has: boolean;
|
|
341
451
|
} | undefined;
|
|
452
|
+
severity?: FindingSeverity | undefined;
|
|
342
453
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
343
454
|
} | undefined;
|
|
344
455
|
}>>;
|
|
@@ -373,6 +484,7 @@ export declare const _FindingSpecUpsertDto: z.ZodObject<{
|
|
|
373
484
|
uid?: {
|
|
374
485
|
$has: boolean;
|
|
375
486
|
} | undefined;
|
|
487
|
+
severity?: FindingSeverity | undefined;
|
|
376
488
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
377
489
|
} | undefined;
|
|
378
490
|
} | undefined;
|
|
@@ -407,6 +519,7 @@ export declare const _FindingSpecUpsertDto: z.ZodObject<{
|
|
|
407
519
|
uid?: {
|
|
408
520
|
$has: boolean;
|
|
409
521
|
} | undefined;
|
|
522
|
+
severity?: FindingSeverity | undefined;
|
|
410
523
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
411
524
|
} | undefined;
|
|
412
525
|
} | undefined;
|
|
@@ -454,3 +567,4 @@ export declare const _CustomFindingPayload: z.ZodObject<{
|
|
|
454
567
|
context?: unknown;
|
|
455
568
|
}>;
|
|
456
569
|
export type CustomFindingPayload = z.infer<typeof _CustomFindingPayload>;
|
|
570
|
+
export {};
|
|
@@ -6,42 +6,42 @@ const base_dto_1 = require("./base.dto");
|
|
|
6
6
|
const enums_1 = require("./enums");
|
|
7
7
|
const enums_2 = require("./enums");
|
|
8
8
|
const _FindingSpecDescription = zod_1.z.unknown();
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
const _FindingSpecInsights = zod_1.z.object({
|
|
10
|
+
meta: zod_1.z
|
|
11
|
+
.object({
|
|
12
|
+
kind: zod_1.z.nativeEnum(enums_1.FindingKind),
|
|
13
|
+
severity: zod_1.z.nativeEnum(enums_2.FindingSeverity),
|
|
14
|
+
displayValue: zod_1.z.string(),
|
|
15
|
+
})
|
|
16
|
+
.optional(),
|
|
17
|
+
rule: zod_1.z
|
|
17
18
|
.object({
|
|
18
|
-
|
|
19
|
+
category: zod_1.z.nativeEnum(enums_1.Category),
|
|
20
|
+
kind: zod_1.z.nativeEnum(enums_1.SaasComponentKind),
|
|
21
|
+
aid: zod_1.z
|
|
19
22
|
.object({
|
|
20
|
-
|
|
21
|
-
severity: zod_1.z.nativeEnum(enums_2.FindingSeverity),
|
|
22
|
-
displayValue: zod_1.z.string(),
|
|
23
|
+
$has: zod_1.z.boolean(),
|
|
23
24
|
})
|
|
24
25
|
.optional(),
|
|
25
|
-
|
|
26
|
+
uid: zod_1.z
|
|
26
27
|
.object({
|
|
27
|
-
|
|
28
|
-
kind: zod_1.z.nativeEnum(enums_1.SaasComponentKind),
|
|
29
|
-
aid: zod_1.z
|
|
30
|
-
.object({
|
|
31
|
-
$has: zod_1.z.boolean(),
|
|
32
|
-
})
|
|
33
|
-
.optional(),
|
|
34
|
-
uid: zod_1.z
|
|
35
|
-
.object({
|
|
36
|
-
$has: zod_1.z.boolean(),
|
|
37
|
-
})
|
|
38
|
-
.optional(),
|
|
39
|
-
findingCondition: zod_1.z.record(zod_1.z.string(), zod_1.z.union([zod_1.z.boolean(), zod_1.z.string(), zod_1.z.number(), zod_1.z.undefined()])),
|
|
40
|
-
remediatedCondition: zod_1.z.record(zod_1.z.string(), zod_1.z.union([zod_1.z.boolean(), zod_1.z.string(), zod_1.z.number(), zod_1.z.undefined()])).optional(),
|
|
28
|
+
$has: zod_1.z.boolean(),
|
|
41
29
|
})
|
|
42
30
|
.optional(),
|
|
31
|
+
severity: zod_1.z.nativeEnum(enums_2.FindingSeverity).optional(),
|
|
32
|
+
findingCondition: zod_1.z.record(zod_1.z.string(), zod_1.z.union([zod_1.z.boolean(), zod_1.z.string(), zod_1.z.number(), zod_1.z.undefined()])),
|
|
33
|
+
remediatedCondition: zod_1.z.record(zod_1.z.string(), zod_1.z.union([zod_1.z.boolean(), zod_1.z.string(), zod_1.z.number(), zod_1.z.undefined()])).optional(),
|
|
43
34
|
})
|
|
44
35
|
.optional(),
|
|
36
|
+
});
|
|
37
|
+
exports._FindingSpecDto = base_dto_1._BaseDto.extend({
|
|
38
|
+
cid: zod_1.z.string().nullable().optional(),
|
|
39
|
+
name: zod_1.z.string(),
|
|
40
|
+
displayValue: zod_1.z.string(),
|
|
41
|
+
eventType: zod_1.z.string(),
|
|
42
|
+
description: zod_1.z.union([zod_1.z.string(), _FindingSpecDescription]),
|
|
43
|
+
severity: zod_1.z.nativeEnum(enums_2.FindingSeverity),
|
|
44
|
+
insights: _FindingSpecInsights.optional(),
|
|
45
45
|
expireAfterDays: zod_1.z.nullable(zod_1.z.number()).optional(),
|
|
46
46
|
outcome: zod_1.z.nativeEnum(enums_2.FindingOutcome).optional(), // TODO add column and form field??? Or just default to REMEDIATION?
|
|
47
47
|
kind: zod_1.z.nativeEnum(enums_1.FindingSpecKind),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findings.dto.js","sourceRoot":"","sources":["../../../src/dto/findings.dto.ts"],"names":[],"mappings":";;;AAAA,6BAAsB;AAEtB,yCAA6E;AAC7E,mCAAkF;AAClF,mCAAuE;AA6DvE,MAAM,uBAAuB,GAAG,OAAC,CAAC,OAAO,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"findings.dto.js","sourceRoot":"","sources":["../../../src/dto/findings.dto.ts"],"names":[],"mappings":";;;AAAA,6BAAsB;AAEtB,yCAA6E;AAC7E,mCAAkF;AAClF,mCAAuE;AA6DvE,MAAM,uBAAuB,GAAG,OAAC,CAAC,OAAO,EAAE,CAAC;AAC5C,MAAM,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IACpC,IAAI,EAAE,OAAC;SACJ,MAAM,CAAC;QACN,IAAI,EAAE,OAAC,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QAAQ,EAAE;IACpC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,OAAO,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAChC,CAAC,CAAC"}
|
|
@@ -47,6 +47,7 @@ export declare const _PlatformFindingSpecDto: z.ZodObject<{
|
|
|
47
47
|
}, {
|
|
48
48
|
$has: boolean;
|
|
49
49
|
}>>;
|
|
50
|
+
severity: z.ZodOptional<z.ZodNativeEnum<typeof import("..").FindingSeverity>>;
|
|
50
51
|
findingCondition: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodNumber, z.ZodUndefined]>>;
|
|
51
52
|
remediatedCondition: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodNumber, z.ZodUndefined]>>>;
|
|
52
53
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -59,6 +60,7 @@ export declare const _PlatformFindingSpecDto: z.ZodObject<{
|
|
|
59
60
|
uid?: {
|
|
60
61
|
$has: boolean;
|
|
61
62
|
} | undefined;
|
|
63
|
+
severity?: import("..").FindingSeverity | undefined;
|
|
62
64
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
63
65
|
}, {
|
|
64
66
|
kind: import("..").SaasComponentKind;
|
|
@@ -70,6 +72,7 @@ export declare const _PlatformFindingSpecDto: z.ZodObject<{
|
|
|
70
72
|
uid?: {
|
|
71
73
|
$has: boolean;
|
|
72
74
|
} | undefined;
|
|
75
|
+
severity?: import("..").FindingSeverity | undefined;
|
|
73
76
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
74
77
|
}>>;
|
|
75
78
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -88,6 +91,7 @@ export declare const _PlatformFindingSpecDto: z.ZodObject<{
|
|
|
88
91
|
uid?: {
|
|
89
92
|
$has: boolean;
|
|
90
93
|
} | undefined;
|
|
94
|
+
severity?: import("..").FindingSeverity | undefined;
|
|
91
95
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
92
96
|
} | undefined;
|
|
93
97
|
}, {
|
|
@@ -106,6 +110,7 @@ export declare const _PlatformFindingSpecDto: z.ZodObject<{
|
|
|
106
110
|
uid?: {
|
|
107
111
|
$has: boolean;
|
|
108
112
|
} | undefined;
|
|
113
|
+
severity?: import("..").FindingSeverity | undefined;
|
|
109
114
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
110
115
|
} | undefined;
|
|
111
116
|
}>>;
|
|
@@ -142,6 +147,7 @@ export declare const _PlatformFindingSpecDto: z.ZodObject<{
|
|
|
142
147
|
uid?: {
|
|
143
148
|
$has: boolean;
|
|
144
149
|
} | undefined;
|
|
150
|
+
severity?: import("..").FindingSeverity | undefined;
|
|
145
151
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
146
152
|
} | undefined;
|
|
147
153
|
} | undefined;
|
|
@@ -177,6 +183,7 @@ export declare const _PlatformFindingSpecDto: z.ZodObject<{
|
|
|
177
183
|
uid?: {
|
|
178
184
|
$has: boolean;
|
|
179
185
|
} | undefined;
|
|
186
|
+
severity?: import("..").FindingSeverity | undefined;
|
|
180
187
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
181
188
|
} | undefined;
|
|
182
189
|
} | undefined;
|
|
@@ -228,6 +235,7 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<{
|
|
|
228
235
|
}, {
|
|
229
236
|
$has: boolean;
|
|
230
237
|
}>>;
|
|
238
|
+
severity: z.ZodOptional<z.ZodNativeEnum<typeof import("..").FindingSeverity>>;
|
|
231
239
|
findingCondition: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodNumber, z.ZodUndefined]>>;
|
|
232
240
|
remediatedCondition: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodNumber, z.ZodUndefined]>>>;
|
|
233
241
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -240,6 +248,7 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<{
|
|
|
240
248
|
uid?: {
|
|
241
249
|
$has: boolean;
|
|
242
250
|
} | undefined;
|
|
251
|
+
severity?: import("..").FindingSeverity | undefined;
|
|
243
252
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
244
253
|
}, {
|
|
245
254
|
kind: import("..").SaasComponentKind;
|
|
@@ -251,6 +260,7 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<{
|
|
|
251
260
|
uid?: {
|
|
252
261
|
$has: boolean;
|
|
253
262
|
} | undefined;
|
|
263
|
+
severity?: import("..").FindingSeverity | undefined;
|
|
254
264
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
255
265
|
}>>;
|
|
256
266
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -269,6 +279,7 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<{
|
|
|
269
279
|
uid?: {
|
|
270
280
|
$has: boolean;
|
|
271
281
|
} | undefined;
|
|
282
|
+
severity?: import("..").FindingSeverity | undefined;
|
|
272
283
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
273
284
|
} | undefined;
|
|
274
285
|
}, {
|
|
@@ -287,6 +298,7 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<{
|
|
|
287
298
|
uid?: {
|
|
288
299
|
$has: boolean;
|
|
289
300
|
} | undefined;
|
|
301
|
+
severity?: import("..").FindingSeverity | undefined;
|
|
290
302
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
291
303
|
} | undefined;
|
|
292
304
|
}>>;
|
|
@@ -323,6 +335,7 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<{
|
|
|
323
335
|
uid?: {
|
|
324
336
|
$has: boolean;
|
|
325
337
|
} | undefined;
|
|
338
|
+
severity?: import("..").FindingSeverity | undefined;
|
|
326
339
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
327
340
|
} | undefined;
|
|
328
341
|
} | undefined;
|
|
@@ -358,6 +371,7 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<{
|
|
|
358
371
|
uid?: {
|
|
359
372
|
$has: boolean;
|
|
360
373
|
} | undefined;
|
|
374
|
+
severity?: import("..").FindingSeverity | undefined;
|
|
361
375
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
362
376
|
} | undefined;
|
|
363
377
|
} | undefined;
|
|
@@ -17,14 +17,14 @@ export declare class AmpSettingsService {
|
|
|
17
17
|
protected readonly targetApi: string;
|
|
18
18
|
constructor(rest: RestClient, targetApi?: TargetApi);
|
|
19
19
|
getSettingsMap: (tid?: string) => Promise<AmpSettingsMap>;
|
|
20
|
-
createMultiple: <T>(keyValues: {
|
|
20
|
+
createMultiple: <T>(keyValues: Array<{
|
|
21
21
|
key: T;
|
|
22
22
|
value: T;
|
|
23
|
-
}
|
|
23
|
+
}> | Array<{
|
|
24
24
|
key: string;
|
|
25
25
|
value: unknown;
|
|
26
|
-
}
|
|
27
|
-
create: <T>(key: string | T, value: unknown, cid?: string) => Promise<AmpSettingDto>;
|
|
26
|
+
}>, cid?: string) => Promise<AmpSettingDto[]>;
|
|
27
|
+
create: <T>(key: string | T, value: unknown | T, cid?: string) => Promise<AmpSettingDto>;
|
|
28
28
|
update: (id: string, entity: AmpSettingUpsertDto) => Promise<AmpSettingDto>;
|
|
29
29
|
updateAll: (data: {
|
|
30
30
|
id: string;
|
|
@@ -43,7 +43,7 @@ export declare class AmpSdkSettingsService {
|
|
|
43
43
|
cid: string | null;
|
|
44
44
|
tid: string;
|
|
45
45
|
}>) => Promise<AmpSettingDto[]>;
|
|
46
|
-
create: <T>(key: string | T, value: unknown, tid: string, cid: string | null) => Promise<AmpSettingDto>;
|
|
46
|
+
create: <T>(key: string | T, value: unknown | T, tid: string, cid: string | null) => Promise<AmpSettingDto>;
|
|
47
47
|
update: (id: string, entity: AmpSettingUpsertDto) => Promise<AmpSettingDto>;
|
|
48
48
|
delete: (id: string) => Promise<AmpSettingDto>;
|
|
49
49
|
}
|
|
@@ -58,5 +58,5 @@ export declare class AmpSettingsMap {
|
|
|
58
58
|
getConnectorSettings: (cid: string) => RawAmpSettingsMap | undefined;
|
|
59
59
|
getConnectorDtos: (cid: string) => AmpSettingDto[];
|
|
60
60
|
getRawMap: () => TenantSettingsMap<AmpSettingDto>;
|
|
61
|
-
static asKey: <T>(key: AmpSettingKey, defaultValue?: T
|
|
61
|
+
static asKey: <T>(key: AmpSettingKey, defaultValue?: T) => TypedAmpSettingsKey<T>;
|
|
62
62
|
}
|
package/package.json
CHANGED
|
@@ -19,7 +19,10 @@ export enum FindingKind {
|
|
|
19
19
|
|
|
20
20
|
// EDR
|
|
21
21
|
DEVICE_NOT_MANAGED = 'DEVICE_NOT_MANAGED',
|
|
22
|
-
|
|
22
|
+
CRITICAL_VULNERABILITY_OUT_OF_SLA = 'CRITICAL_VULNERABILITY_OUT_OF_SLA',
|
|
23
|
+
HIGH_VULNERABILITY_OUT_OF_SLA = 'HIGH_VULNERABILITY_OUT_OF_SLA',
|
|
24
|
+
MEDIUM_VULNERABILITY_OUT_OF_SLA = 'MEDIUM_VULNERABILITY_OUT_OF_SLA',
|
|
25
|
+
LOW_VULNERABILITY_OUT_OF_SLA = 'LOW_VULNERABILITY_OUT_OF_SLA',
|
|
23
26
|
|
|
24
27
|
// WEB_GATEWAY
|
|
25
28
|
WEB_GATEWAY_NOT_ACTIVE = 'WEB_GATEWAY_NOT_ACTIVE',
|
|
@@ -31,7 +34,10 @@ export const lookupFindingOutcomeByKind = (kind: FindingKind): FindingOutcome =>
|
|
|
31
34
|
case FindingKind.MFA_NOT_ENABLED:
|
|
32
35
|
case FindingKind.TRAINING_OVERDUE:
|
|
33
36
|
case FindingKind.DEVICE_NOT_MANAGED:
|
|
34
|
-
case FindingKind.
|
|
37
|
+
case FindingKind.CRITICAL_VULNERABILITY_OUT_OF_SLA:
|
|
38
|
+
case FindingKind.HIGH_VULNERABILITY_OUT_OF_SLA:
|
|
39
|
+
case FindingKind.MEDIUM_VULNERABILITY_OUT_OF_SLA:
|
|
40
|
+
case FindingKind.LOW_VULNERABILITY_OUT_OF_SLA:
|
|
35
41
|
case FindingKind.WEB_GATEWAY_NOT_ACTIVE: {
|
|
36
42
|
return FindingOutcome.REMEDIATION;
|
|
37
43
|
}
|
|
@@ -64,7 +70,12 @@ export const lookupFindingKindByCategory = (category: string): FindingKind[] =>
|
|
|
64
70
|
return [FindingKind.WEB_GATEWAY_NOT_ACTIVE];
|
|
65
71
|
}
|
|
66
72
|
case Category.VULNERABILITY: {
|
|
67
|
-
return [
|
|
73
|
+
return [
|
|
74
|
+
FindingKind.CRITICAL_VULNERABILITY_OUT_OF_SLA,
|
|
75
|
+
FindingKind.HIGH_VULNERABILITY_OUT_OF_SLA,
|
|
76
|
+
FindingKind.MEDIUM_VULNERABILITY_OUT_OF_SLA,
|
|
77
|
+
FindingKind.LOW_VULNERABILITY_OUT_OF_SLA,
|
|
78
|
+
];
|
|
68
79
|
}
|
|
69
80
|
case Category.NOTIFICATION: {
|
|
70
81
|
return [];
|
|
@@ -83,9 +94,18 @@ export const lookupFindingSeverityByKind = (kind: string): FindingSeverity | und
|
|
|
83
94
|
case FindingKind.HAS_PRIVILEGED_ACCESS:
|
|
84
95
|
case FindingKind.DEVICE_NOT_MANAGED:
|
|
85
96
|
case FindingKind.WEB_GATEWAY_NOT_ACTIVE:
|
|
86
|
-
case FindingKind.
|
|
97
|
+
case FindingKind.CRITICAL_VULNERABILITY_OUT_OF_SLA: {
|
|
98
|
+
return FindingSeverity.CRITICAL;
|
|
99
|
+
}
|
|
100
|
+
case FindingKind.HIGH_VULNERABILITY_OUT_OF_SLA: {
|
|
87
101
|
return FindingSeverity.HIGH;
|
|
88
102
|
}
|
|
103
|
+
case FindingKind.MEDIUM_VULNERABILITY_OUT_OF_SLA: {
|
|
104
|
+
return FindingSeverity.MEDIUM;
|
|
105
|
+
}
|
|
106
|
+
case FindingKind.LOW_VULNERABILITY_OUT_OF_SLA: {
|
|
107
|
+
return FindingSeverity.LOW;
|
|
108
|
+
}
|
|
89
109
|
case FindingKind.FAILED_PHISHING:
|
|
90
110
|
case FindingKind.TRAINING_OVERDUE: {
|
|
91
111
|
return FindingSeverity.MEDIUM;
|
|
@@ -97,7 +117,7 @@ export const lookupFindingSeverityByKind = (kind: string): FindingSeverity | und
|
|
|
97
117
|
};
|
|
98
118
|
|
|
99
119
|
// https://docs.google.com/spreadsheets/d/18Ow9GGBvioAx4agnpnJGV4qnOWeLK941L7SrF4tzZiM/edit#gid=0
|
|
100
|
-
export const lookupFindingScoreByCategoryKindAndSeverity = (category: Category, kind: string
|
|
120
|
+
export const lookupFindingScoreByCategoryKindAndSeverity = (category: Category, kind: string): number => {
|
|
101
121
|
switch (category) {
|
|
102
122
|
case Category.EDR: {
|
|
103
123
|
switch (kind) {
|
|
@@ -111,21 +131,14 @@ export const lookupFindingScoreByCategoryKindAndSeverity = (category: Category,
|
|
|
111
131
|
switch (kind) {
|
|
112
132
|
case FindingKind.DEVICE_NOT_MANAGED:
|
|
113
133
|
return 10;
|
|
114
|
-
case FindingKind.
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
case FindingSeverity.LOW:
|
|
123
|
-
return 2;
|
|
124
|
-
case FindingSeverity.INFO:
|
|
125
|
-
default:
|
|
126
|
-
return 0;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
134
|
+
case FindingKind.CRITICAL_VULNERABILITY_OUT_OF_SLA:
|
|
135
|
+
return 15;
|
|
136
|
+
case FindingKind.HIGH_VULNERABILITY_OUT_OF_SLA:
|
|
137
|
+
return 9;
|
|
138
|
+
case FindingKind.MEDIUM_VULNERABILITY_OUT_OF_SLA:
|
|
139
|
+
return 5;
|
|
140
|
+
case FindingKind.LOW_VULNERABILITY_OUT_OF_SLA:
|
|
141
|
+
return 2;
|
|
129
142
|
default:
|
|
130
143
|
return 0;
|
|
131
144
|
}
|
|
@@ -198,6 +211,7 @@ export const generateInsights = (category: string, kind: string) => {
|
|
|
198
211
|
kind: '' as SaasComponentKind,
|
|
199
212
|
aid: {$has: false},
|
|
200
213
|
uid: {$has: false},
|
|
214
|
+
severity: undefined as unknown as FindingSeverity,
|
|
201
215
|
findingCondition: {} as Condition,
|
|
202
216
|
remediatedCondition: {} as Condition,
|
|
203
217
|
},
|
|
@@ -217,9 +231,25 @@ export const generateInsights = (category: string, kind: string) => {
|
|
|
217
231
|
setCondition('meta._findings.loggedIn', false);
|
|
218
232
|
insights.rule.kind = SaasComponentKind.WEB_GATEWAY_SESSION;
|
|
219
233
|
break;
|
|
220
|
-
case FindingKind.
|
|
234
|
+
case FindingKind.CRITICAL_VULNERABILITY_OUT_OF_SLA:
|
|
235
|
+
setCondition('meta._findings.overdue', true);
|
|
236
|
+
insights.rule.kind = SaasComponentKind.VULNERABILITY;
|
|
237
|
+
insights.rule.severity = FindingSeverity.CRITICAL;
|
|
238
|
+
break;
|
|
239
|
+
case FindingKind.HIGH_VULNERABILITY_OUT_OF_SLA:
|
|
240
|
+
setCondition('meta._findings.overdue', true);
|
|
241
|
+
insights.rule.kind = SaasComponentKind.VULNERABILITY;
|
|
242
|
+
insights.rule.severity = FindingSeverity.HIGH;
|
|
243
|
+
break;
|
|
244
|
+
case FindingKind.MEDIUM_VULNERABILITY_OUT_OF_SLA:
|
|
245
|
+
setCondition('meta._findings.overdue', true);
|
|
246
|
+
insights.rule.kind = SaasComponentKind.VULNERABILITY;
|
|
247
|
+
insights.rule.severity = FindingSeverity.MEDIUM;
|
|
248
|
+
break;
|
|
249
|
+
case FindingKind.LOW_VULNERABILITY_OUT_OF_SLA:
|
|
221
250
|
setCondition('meta._findings.overdue', true);
|
|
222
251
|
insights.rule.kind = SaasComponentKind.VULNERABILITY;
|
|
252
|
+
insights.rule.severity = FindingSeverity.LOW;
|
|
223
253
|
break;
|
|
224
254
|
case FindingKind.TRAINING_OVERDUE:
|
|
225
255
|
setCondition('meta._findings.overdue', true);
|
package/src/dto/findings.dto.ts
CHANGED
|
@@ -64,47 +64,49 @@ export type FindingDto = BaseDto &
|
|
|
64
64
|
};
|
|
65
65
|
|
|
66
66
|
const _FindingSpecDescription = z.unknown();
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
67
|
+
const _FindingSpecInsights = z.object({
|
|
68
|
+
meta: z
|
|
69
|
+
.object({
|
|
70
|
+
kind: z.nativeEnum(FindingKind),
|
|
71
|
+
severity: z.nativeEnum(FindingSeverity),
|
|
72
|
+
displayValue: z.string(),
|
|
73
|
+
})
|
|
74
|
+
.optional(),
|
|
75
|
+
rule: z
|
|
75
76
|
.object({
|
|
76
|
-
|
|
77
|
+
category: z.nativeEnum(Category),
|
|
78
|
+
kind: z.nativeEnum(SaasComponentKind),
|
|
79
|
+
aid: z
|
|
77
80
|
.object({
|
|
78
|
-
|
|
79
|
-
severity: z.nativeEnum(FindingSeverity),
|
|
80
|
-
displayValue: z.string(),
|
|
81
|
+
$has: z.boolean(),
|
|
81
82
|
})
|
|
82
83
|
.optional(),
|
|
83
|
-
|
|
84
|
+
uid: z
|
|
84
85
|
.object({
|
|
85
|
-
|
|
86
|
-
kind: z.nativeEnum(SaasComponentKind),
|
|
87
|
-
aid: z
|
|
88
|
-
.object({
|
|
89
|
-
$has: z.boolean(),
|
|
90
|
-
})
|
|
91
|
-
.optional(),
|
|
92
|
-
uid: z
|
|
93
|
-
.object({
|
|
94
|
-
$has: z.boolean(),
|
|
95
|
-
})
|
|
96
|
-
.optional(),
|
|
97
|
-
findingCondition: z.record(z.string(), z.union([z.boolean(), z.string(), z.number(), z.undefined()])),
|
|
98
|
-
remediatedCondition: z.record(z.string(), z.union([z.boolean(), z.string(), z.number(), z.undefined()])).optional(),
|
|
86
|
+
$has: z.boolean(),
|
|
99
87
|
})
|
|
100
88
|
.optional(),
|
|
89
|
+
severity: z.nativeEnum(FindingSeverity).optional(),
|
|
90
|
+
findingCondition: z.record(z.string(), z.union([z.boolean(), z.string(), z.number(), z.undefined()])),
|
|
91
|
+
remediatedCondition: z.record(z.string(), z.union([z.boolean(), z.string(), z.number(), z.undefined()])).optional(),
|
|
101
92
|
})
|
|
102
93
|
.optional(),
|
|
94
|
+
});
|
|
95
|
+
export const _FindingSpecDto = _BaseDto.extend({
|
|
96
|
+
cid: z.string().nullable().optional(),
|
|
97
|
+
name: z.string(),
|
|
98
|
+
displayValue: z.string(),
|
|
99
|
+
eventType: z.string(),
|
|
100
|
+
description: z.union([z.string(), _FindingSpecDescription]),
|
|
101
|
+
severity: z.nativeEnum(FindingSeverity),
|
|
102
|
+
insights: _FindingSpecInsights.optional(),
|
|
103
103
|
expireAfterDays: z.nullable(z.number()).optional(),
|
|
104
104
|
outcome: z.nativeEnum(FindingOutcome).optional(), // TODO add column and form field??? Or just default to REMEDIATION?
|
|
105
105
|
kind: z.nativeEnum(FindingSpecKind),
|
|
106
106
|
score: z.number().optional(),
|
|
107
107
|
});
|
|
108
|
+
|
|
109
|
+
export type FindingSpecInsights = z.infer<typeof _FindingSpecInsights>;
|
|
108
110
|
export type FindingSpecDto = z.infer<typeof _FindingSpecDto>;
|
|
109
111
|
|
|
110
112
|
export const _FindingSpecUpsertDto = _FindingSpecDto.partial(UPSERT_DTO_MASK);
|