@ampsec/platform-client 70.2.0 → 70.3.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/build/src/dto/coverage.dto.d.ts +12 -12
- package/build/src/dto/customActions.dto.d.ts +7 -7
- package/build/src/dto/enums/findingKind.d.ts +13 -13
- package/build/src/dto/enums/findingKind.js +25 -24
- package/build/src/dto/enums/findingKind.js.map +1 -1
- package/build/src/dto/findings.dto.d.ts +25 -7
- package/build/src/dto/findings.dto.js +4 -3
- package/build/src/dto/findings.dto.js.map +1 -1
- package/build/src/dto/flows.dto.d.ts +23 -23
- package/build/src/dto/platform/platform.customActions.dto.d.ts +5 -5
- package/build/src/dto/platform/platform.findings.dto.d.ts +14 -0
- package/build/src/dto/platform/platform.flows.dto.d.ts +14 -14
- package/build/src/dto/platform/platform.ops.dto.d.ts +95 -0
- package/build/src/dto/platform/platform.ops.dto.js +20 -0
- package/build/src/dto/platform/platform.ops.dto.js.map +1 -0
- package/build/src/dto/platform/platform.saasAssets.dto.d.ts +6 -6
- package/build/src/dto/platform/platform.tenants.dto.d.ts +1234 -0
- package/build/src/dto/platform/platform.tenants.dto.js +96 -0
- package/build/src/dto/platform/platform.tenants.dto.js.map +1 -1
- package/build/src/dto/saasAssets.dto.d.ts +16 -16
- package/build/src/dto/users.dto.d.ts +2 -2
- package/build/src/services/AmpSdk.d.ts +3 -2
- package/build/src/services/AmpSdk.js +2 -1
- package/build/src/services/AmpSdk.js.map +1 -1
- package/build/src/services/contentful.service.d.ts +6 -6
- package/build/src/services/rest/TenantsService.d.ts +27 -0
- package/build/src/services/rest/TenantsService.js +69 -0
- package/build/src/services/rest/TenantsService.js.map +1 -0
- package/package.json +1 -1
- package/src/dto/enums/findingKind.ts +28 -26
- package/src/dto/findings.dto.ts +4 -2
- package/src/dto/platform/platform.ops.dto.ts +22 -0
- package/src/dto/platform/platform.tenants.dto.ts +110 -0
- package/src/services/AmpSdk.ts +3 -4
- package/src/services/rest/TenantsService.ts +69 -0
|
@@ -1,3 +1,99 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports._TenantCountReportDto = exports._FlowsCountReport = exports._NotificationsCountReport = exports._FindingsCountReport = exports._SaasCompCountReport = exports._UserCountReport = exports._AssetCountReport = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const enums_1 = require("../enums");
|
|
6
|
+
const flows_dto_1 = require("../flows.dto");
|
|
7
|
+
// TODO add "missing from" reports to better understand coverage gaps
|
|
8
|
+
exports._AssetCountReport = zod_1.z.object({
|
|
9
|
+
byType: zod_1.z.object({ assetType: zod_1.z.nativeEnum(enums_1.GlobalAssetType), total: zod_1.z.number() }).array(),
|
|
10
|
+
// TODO byConnector: z.object({cid: z.string(), active: z.number(), inactive: z.number(), total: z.number()}).array(),
|
|
11
|
+
byConnector: zod_1.z.object({ cid: zod_1.z.string(), assetType: zod_1.z.nativeEnum(enums_1.GlobalAssetType), total: zod_1.z.number() }).array(),
|
|
12
|
+
totalAssets: zod_1.z.number(),
|
|
13
|
+
totalSaasAssets: zod_1.z.number(),
|
|
14
|
+
totalStagedAssets: zod_1.z.number(),
|
|
15
|
+
links: zod_1.z.object({
|
|
16
|
+
withUsers: zod_1.z.number(),
|
|
17
|
+
withoutUsers: zod_1.z.number(),
|
|
18
|
+
withVulns: zod_1.z.number(),
|
|
19
|
+
withoutVulns: zod_1.z.number(),
|
|
20
|
+
withUserAssignedVulns: zod_1.z.number(),
|
|
21
|
+
withOrphanedVulns: zod_1.z.number(),
|
|
22
|
+
}),
|
|
23
|
+
});
|
|
24
|
+
exports._UserCountReport = zod_1.z.object({
|
|
25
|
+
byConnectorStatus: zod_1.z.object({ cid: zod_1.z.string(), userType: zod_1.z.nativeEnum(enums_1.GlobalUserType), total: zod_1.z.number() }).array(),
|
|
26
|
+
byType: zod_1.z.object({ userType: zod_1.z.nativeEnum(enums_1.GlobalUserType), total: zod_1.z.number() }).array(),
|
|
27
|
+
totalUsers: zod_1.z.number(),
|
|
28
|
+
totalSaasUsers: zod_1.z.number(),
|
|
29
|
+
totalStagedUsers: zod_1.z.number(),
|
|
30
|
+
links: zod_1.z.object({
|
|
31
|
+
withDevices: zod_1.z.number(),
|
|
32
|
+
withoutDevices: zod_1.z.number(),
|
|
33
|
+
}),
|
|
34
|
+
});
|
|
35
|
+
exports._SaasCompCountReport = zod_1.z.object({
|
|
36
|
+
byConnectorKind: zod_1.z.object({ cid: zod_1.z.string(), kind: zod_1.z.string(), total: zod_1.z.number() }).array(),
|
|
37
|
+
totalSaasComps: zod_1.z.number(),
|
|
38
|
+
totalStagedSaasComps: zod_1.z.number(),
|
|
39
|
+
links: zod_1.z.object({
|
|
40
|
+
withUsers: zod_1.z.number(),
|
|
41
|
+
withoutUsers: zod_1.z.number(),
|
|
42
|
+
withDevices: zod_1.z.number(),
|
|
43
|
+
withoutDevices: zod_1.z.number(),
|
|
44
|
+
orphaned: zod_1.z.number(),
|
|
45
|
+
}),
|
|
46
|
+
});
|
|
47
|
+
const _RecentFindingSummaryReport = zod_1.z.object({
|
|
48
|
+
openWithUser: zod_1.z.number(),
|
|
49
|
+
openWithoutUser: zod_1.z.number(),
|
|
50
|
+
closedWithUser: zod_1.z.number(),
|
|
51
|
+
closedWithoutUser: zod_1.z.number(),
|
|
52
|
+
});
|
|
53
|
+
exports._FindingsCountReport = zod_1.z.object({
|
|
54
|
+
connectorKindSeverityStatus: zod_1.z
|
|
55
|
+
.object({
|
|
56
|
+
cid: zod_1.z.string().nullable(),
|
|
57
|
+
kind: zod_1.z.union([zod_1.z.nativeEnum(enums_1.FindingKind), zod_1.z.string()]),
|
|
58
|
+
severity: zod_1.z.nativeEnum(enums_1.FindingSeverity),
|
|
59
|
+
status: zod_1.z.nativeEnum(enums_1.FindingStatus),
|
|
60
|
+
total: zod_1.z.number(),
|
|
61
|
+
})
|
|
62
|
+
.array(),
|
|
63
|
+
total: _RecentFindingSummaryReport,
|
|
64
|
+
total90d: _RecentFindingSummaryReport,
|
|
65
|
+
pending: zod_1.z.number(),
|
|
66
|
+
links: zod_1.z.object({
|
|
67
|
+
withUsers: zod_1.z.number(),
|
|
68
|
+
withoutUsers: zod_1.z.number(),
|
|
69
|
+
withDevices: zod_1.z.number(),
|
|
70
|
+
withoutDevices: zod_1.z.number(),
|
|
71
|
+
}),
|
|
72
|
+
});
|
|
73
|
+
exports._NotificationsCountReport = zod_1.z.object({
|
|
74
|
+
total: zod_1.z.number(),
|
|
75
|
+
total7d: zod_1.z.number(),
|
|
76
|
+
total30d: zod_1.z.number(),
|
|
77
|
+
total90d: zod_1.z.number(),
|
|
78
|
+
});
|
|
79
|
+
const _FlowStatusSummaryReport = zod_1.z.object({
|
|
80
|
+
active: zod_1.z.number(),
|
|
81
|
+
closed: zod_1.z.number(),
|
|
82
|
+
});
|
|
83
|
+
exports._FlowsCountReport = zod_1.z.object({
|
|
84
|
+
specsByStatusTrigger: zod_1.z.object({ status: zod_1.z.nativeEnum(flows_dto_1.FlowSpecStatusKind), trigger: zod_1.z.string(), total: zod_1.z.number() }).array(),
|
|
85
|
+
statesByBucketStatus: zod_1.z.object({ status: zod_1.z.string(), bucket: zod_1.z.union([zod_1.z.nativeEnum(enums_1.FindingKind), zod_1.z.string()]), total: zod_1.z.number() }).array(),
|
|
86
|
+
total: _FlowStatusSummaryReport,
|
|
87
|
+
total7d: _FlowStatusSummaryReport,
|
|
88
|
+
total30d: _FlowStatusSummaryReport,
|
|
89
|
+
total90d: _FlowStatusSummaryReport,
|
|
90
|
+
});
|
|
91
|
+
exports._TenantCountReportDto = zod_1.z.object({
|
|
92
|
+
users: exports._UserCountReport,
|
|
93
|
+
assets: exports._AssetCountReport,
|
|
94
|
+
saasComp: exports._SaasCompCountReport,
|
|
95
|
+
findings: exports._FindingsCountReport,
|
|
96
|
+
notifications: exports._NotificationsCountReport,
|
|
97
|
+
flows: exports._FlowsCountReport,
|
|
98
|
+
});
|
|
3
99
|
//# sourceMappingURL=platform.tenants.dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.tenants.dto.js","sourceRoot":"","sources":["../../../../src/dto/platform/platform.tenants.dto.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"platform.tenants.dto.js","sourceRoot":"","sources":["../../../../src/dto/platform/platform.tenants.dto.ts"],"names":[],"mappings":";;;AAAA,6BAAsB;AAEtB,oCAAsG;AACtG,4CAAgD;AAMhD,qEAAqE;AAExD,QAAA,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;IACxC,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC,EAAC,SAAS,EAAE,OAAC,CAAC,UAAU,CAAC,uBAAe,CAAC,EAAE,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,EAAC,CAAC,CAAC,KAAK,EAAE;IACvF,sHAAsH;IACtH,WAAW,EAAE,OAAC,CAAC,MAAM,CAAC,EAAC,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,OAAC,CAAC,UAAU,CAAC,uBAAe,CAAC,EAAE,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,EAAC,CAAC,CAAC,KAAK,EAAE;IAC7G,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE;IACvB,eAAe,EAAE,OAAC,CAAC,MAAM,EAAE;IAC3B,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE;IAC7B,KAAK,EAAE,OAAC,CAAC,MAAM,CAAC;QACd,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;QACrB,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE;QACxB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;QACrB,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE;QACxB,qBAAqB,EAAE,OAAC,CAAC,MAAM,EAAE;QACjC,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE;KAC9B,CAAC;CACH,CAAC,CAAC;AAGU,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
@@ -46,8 +46,8 @@ export declare const _SaasAssetMeta: z.ZodObject<{
|
|
|
46
46
|
make?: string | undefined;
|
|
47
47
|
model?: string | undefined;
|
|
48
48
|
lastActivityTime?: string | undefined;
|
|
49
|
-
deviceName?: string | undefined;
|
|
50
49
|
serialNumber?: string | undefined;
|
|
50
|
+
deviceName?: string | undefined;
|
|
51
51
|
macAddresses?: string[] | undefined;
|
|
52
52
|
owner?: {
|
|
53
53
|
email?: string | undefined;
|
|
@@ -62,8 +62,8 @@ export declare const _SaasAssetMeta: z.ZodObject<{
|
|
|
62
62
|
make?: string | undefined;
|
|
63
63
|
model?: string | undefined;
|
|
64
64
|
lastActivityTime?: string | undefined;
|
|
65
|
-
deviceName?: string | undefined;
|
|
66
65
|
serialNumber?: string | undefined;
|
|
66
|
+
deviceName?: string | undefined;
|
|
67
67
|
macAddresses?: string[] | undefined;
|
|
68
68
|
owner?: {
|
|
69
69
|
email?: string | undefined;
|
|
@@ -81,8 +81,8 @@ export declare const _SaasAssetMeta: z.ZodObject<{
|
|
|
81
81
|
make?: string | undefined;
|
|
82
82
|
model?: string | undefined;
|
|
83
83
|
lastActivityTime?: string | undefined;
|
|
84
|
-
deviceName?: string | undefined;
|
|
85
84
|
serialNumber?: string | undefined;
|
|
85
|
+
deviceName?: string | undefined;
|
|
86
86
|
macAddresses?: string[] | undefined;
|
|
87
87
|
owner?: {
|
|
88
88
|
email?: string | undefined;
|
|
@@ -100,8 +100,8 @@ export declare const _SaasAssetMeta: z.ZodObject<{
|
|
|
100
100
|
make?: string | undefined;
|
|
101
101
|
model?: string | undefined;
|
|
102
102
|
lastActivityTime?: string | undefined;
|
|
103
|
-
deviceName?: string | undefined;
|
|
104
103
|
serialNumber?: string | undefined;
|
|
104
|
+
deviceName?: string | undefined;
|
|
105
105
|
macAddresses?: string[] | undefined;
|
|
106
106
|
owner?: {
|
|
107
107
|
email?: string | undefined;
|
|
@@ -188,8 +188,8 @@ export declare const _SaasAssetUpsertDto: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
188
188
|
make?: string | undefined;
|
|
189
189
|
model?: string | undefined;
|
|
190
190
|
lastActivityTime?: string | undefined;
|
|
191
|
-
deviceName?: string | undefined;
|
|
192
191
|
serialNumber?: string | undefined;
|
|
192
|
+
deviceName?: string | undefined;
|
|
193
193
|
macAddresses?: string[] | undefined;
|
|
194
194
|
owner?: {
|
|
195
195
|
email?: string | undefined;
|
|
@@ -204,8 +204,8 @@ export declare const _SaasAssetUpsertDto: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
204
204
|
make?: string | undefined;
|
|
205
205
|
model?: string | undefined;
|
|
206
206
|
lastActivityTime?: string | undefined;
|
|
207
|
-
deviceName?: string | undefined;
|
|
208
207
|
serialNumber?: string | undefined;
|
|
208
|
+
deviceName?: string | undefined;
|
|
209
209
|
macAddresses?: string[] | undefined;
|
|
210
210
|
owner?: {
|
|
211
211
|
email?: string | undefined;
|
|
@@ -223,8 +223,8 @@ export declare const _SaasAssetUpsertDto: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
223
223
|
make?: string | undefined;
|
|
224
224
|
model?: string | undefined;
|
|
225
225
|
lastActivityTime?: string | undefined;
|
|
226
|
-
deviceName?: string | undefined;
|
|
227
226
|
serialNumber?: string | undefined;
|
|
227
|
+
deviceName?: string | undefined;
|
|
228
228
|
macAddresses?: string[] | undefined;
|
|
229
229
|
owner?: {
|
|
230
230
|
email?: string | undefined;
|
|
@@ -242,8 +242,8 @@ export declare const _SaasAssetUpsertDto: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
242
242
|
make?: string | undefined;
|
|
243
243
|
model?: string | undefined;
|
|
244
244
|
lastActivityTime?: string | undefined;
|
|
245
|
-
deviceName?: string | undefined;
|
|
246
245
|
serialNumber?: string | undefined;
|
|
246
|
+
deviceName?: string | undefined;
|
|
247
247
|
macAddresses?: string[] | undefined;
|
|
248
248
|
owner?: {
|
|
249
249
|
email?: string | undefined;
|
|
@@ -272,8 +272,8 @@ export declare const _SaasAssetUpsertDto: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
272
272
|
make?: string | undefined;
|
|
273
273
|
model?: string | undefined;
|
|
274
274
|
lastActivityTime?: string | undefined;
|
|
275
|
-
deviceName?: string | undefined;
|
|
276
275
|
serialNumber?: string | undefined;
|
|
276
|
+
deviceName?: string | undefined;
|
|
277
277
|
macAddresses?: string[] | undefined;
|
|
278
278
|
owner?: {
|
|
279
279
|
email?: string | undefined;
|
|
@@ -307,8 +307,8 @@ export declare const _SaasAssetUpsertDto: z.ZodObject<z.objectUtil.extendShape<z
|
|
|
307
307
|
make?: string | undefined;
|
|
308
308
|
model?: string | undefined;
|
|
309
309
|
lastActivityTime?: string | undefined;
|
|
310
|
-
deviceName?: string | undefined;
|
|
311
310
|
serialNumber?: string | undefined;
|
|
311
|
+
deviceName?: string | undefined;
|
|
312
312
|
macAddresses?: string[] | undefined;
|
|
313
313
|
owner?: {
|
|
314
314
|
email?: string | undefined;
|
|
@@ -401,8 +401,8 @@ export declare const _SaasAssetDto: z.ZodObject<z.objectUtil.extendShape<z.objec
|
|
|
401
401
|
make?: string | undefined;
|
|
402
402
|
model?: string | undefined;
|
|
403
403
|
lastActivityTime?: string | undefined;
|
|
404
|
-
deviceName?: string | undefined;
|
|
405
404
|
serialNumber?: string | undefined;
|
|
405
|
+
deviceName?: string | undefined;
|
|
406
406
|
macAddresses?: string[] | undefined;
|
|
407
407
|
owner?: {
|
|
408
408
|
email?: string | undefined;
|
|
@@ -417,8 +417,8 @@ export declare const _SaasAssetDto: z.ZodObject<z.objectUtil.extendShape<z.objec
|
|
|
417
417
|
make?: string | undefined;
|
|
418
418
|
model?: string | undefined;
|
|
419
419
|
lastActivityTime?: string | undefined;
|
|
420
|
-
deviceName?: string | undefined;
|
|
421
420
|
serialNumber?: string | undefined;
|
|
421
|
+
deviceName?: string | undefined;
|
|
422
422
|
macAddresses?: string[] | undefined;
|
|
423
423
|
owner?: {
|
|
424
424
|
email?: string | undefined;
|
|
@@ -436,8 +436,8 @@ export declare const _SaasAssetDto: z.ZodObject<z.objectUtil.extendShape<z.objec
|
|
|
436
436
|
make?: string | undefined;
|
|
437
437
|
model?: string | undefined;
|
|
438
438
|
lastActivityTime?: string | undefined;
|
|
439
|
-
deviceName?: string | undefined;
|
|
440
439
|
serialNumber?: string | undefined;
|
|
440
|
+
deviceName?: string | undefined;
|
|
441
441
|
macAddresses?: string[] | undefined;
|
|
442
442
|
owner?: {
|
|
443
443
|
email?: string | undefined;
|
|
@@ -455,8 +455,8 @@ export declare const _SaasAssetDto: z.ZodObject<z.objectUtil.extendShape<z.objec
|
|
|
455
455
|
make?: string | undefined;
|
|
456
456
|
model?: string | undefined;
|
|
457
457
|
lastActivityTime?: string | undefined;
|
|
458
|
-
deviceName?: string | undefined;
|
|
459
458
|
serialNumber?: string | undefined;
|
|
459
|
+
deviceName?: string | undefined;
|
|
460
460
|
macAddresses?: string[] | undefined;
|
|
461
461
|
owner?: {
|
|
462
462
|
email?: string | undefined;
|
|
@@ -497,8 +497,8 @@ export declare const _SaasAssetDto: z.ZodObject<z.objectUtil.extendShape<z.objec
|
|
|
497
497
|
make?: string | undefined;
|
|
498
498
|
model?: string | undefined;
|
|
499
499
|
lastActivityTime?: string | undefined;
|
|
500
|
-
deviceName?: string | undefined;
|
|
501
500
|
serialNumber?: string | undefined;
|
|
501
|
+
deviceName?: string | undefined;
|
|
502
502
|
macAddresses?: string[] | undefined;
|
|
503
503
|
owner?: {
|
|
504
504
|
email?: string | undefined;
|
|
@@ -532,8 +532,8 @@ export declare const _SaasAssetDto: z.ZodObject<z.objectUtil.extendShape<z.objec
|
|
|
532
532
|
make?: string | undefined;
|
|
533
533
|
model?: string | undefined;
|
|
534
534
|
lastActivityTime?: string | undefined;
|
|
535
|
-
deviceName?: string | undefined;
|
|
536
535
|
serialNumber?: string | undefined;
|
|
536
|
+
deviceName?: string | undefined;
|
|
537
537
|
macAddresses?: string[] | undefined;
|
|
538
538
|
owner?: {
|
|
539
539
|
email?: string | undefined;
|
|
@@ -19,9 +19,9 @@ export declare const _SimpleUserDto: z.ZodObject<{
|
|
|
19
19
|
id?: string | undefined;
|
|
20
20
|
organization?: string | undefined;
|
|
21
21
|
department?: string | undefined;
|
|
22
|
+
score?: number | undefined;
|
|
22
23
|
firstName?: string | undefined;
|
|
23
24
|
lastName?: string | undefined;
|
|
24
|
-
score?: number | undefined;
|
|
25
25
|
active?: boolean | undefined;
|
|
26
26
|
lastActivity?: string | undefined;
|
|
27
27
|
}, {
|
|
@@ -29,9 +29,9 @@ export declare const _SimpleUserDto: z.ZodObject<{
|
|
|
29
29
|
id?: string | undefined;
|
|
30
30
|
organization?: string | undefined;
|
|
31
31
|
department?: string | undefined;
|
|
32
|
+
score?: number | undefined;
|
|
32
33
|
firstName?: string | undefined;
|
|
33
34
|
lastName?: string | undefined;
|
|
34
|
-
score?: number | undefined;
|
|
35
35
|
active?: boolean | undefined;
|
|
36
36
|
lastActivity?: string | undefined;
|
|
37
37
|
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PlatformActionExecutionDto, PlatformActionExecutionUpsertDto, PlatformCustomActionDto, PlatformCustomActionUpsertDto, PlatformCustomScoreCohortDto, PlatformCustomScoreCohortUpsertDto, PlatformCustomScoreValueDto, PlatformCustomScoreValueUpsertDto, PlatformFindingSpecDto, PlatformFindingSpecUpsertDto, PlatformFlowSpecDto, PlatformFlowSpecUpsertDto, PlatformFlowStateDto, PlatformFlowStateUpsertDto, PlatformJobExecutionStateDto, PlatformJobExecutionStateUpsertDto, PlatformJobSpecDto, PlatformJobSpecUpsertDto, PlatformNotificationDto, PlatformNotificationUpsertDto, PlatformProviderUpsertDto, PlatformReportResultDto, PlatformReportResultUpsertDto, PlatformRiskContributorDto, PlatformRiskContributorUpsertDto, PlatformSaasComponentDto, PlatformSaasComponentUpsertDto, PlatformStagedSaasAssetDto, PlatformStagedSaasAssetUpsertDto, PlatformStagedSaasUserDto, PlatformStagedSaasUserUpsertDto, PlatformTokenDto, PlatformTokenUpsertDto, ProviderDto
|
|
1
|
+
import { PlatformActionExecutionDto, PlatformActionExecutionUpsertDto, PlatformCustomActionDto, PlatformCustomActionUpsertDto, PlatformCustomScoreCohortDto, PlatformCustomScoreCohortUpsertDto, PlatformCustomScoreValueDto, PlatformCustomScoreValueUpsertDto, PlatformFindingSpecDto, PlatformFindingSpecUpsertDto, PlatformFlowSpecDto, PlatformFlowSpecUpsertDto, PlatformFlowStateDto, PlatformFlowStateUpsertDto, PlatformJobExecutionStateDto, PlatformJobExecutionStateUpsertDto, PlatformJobSpecDto, PlatformJobSpecUpsertDto, PlatformNotificationDto, PlatformNotificationUpsertDto, PlatformProviderUpsertDto, PlatformReportResultDto, PlatformReportResultUpsertDto, PlatformRiskContributorDto, PlatformRiskContributorUpsertDto, PlatformSaasComponentDto, PlatformSaasComponentUpsertDto, PlatformStagedSaasAssetDto, PlatformStagedSaasAssetUpsertDto, PlatformStagedSaasUserDto, PlatformStagedSaasUserUpsertDto, PlatformTokenDto, PlatformTokenUpsertDto, ProviderDto } from '../dto';
|
|
2
2
|
import { AmpEntityService, AmpSdkAssetService, AmpSdkTenantService, AmpSdkUserService, TruncatableAmpEntityService } from './entity.service';
|
|
3
3
|
import { AmpRestClientOptions, RestClient } from './rest';
|
|
4
4
|
import { EnumService } from './rest/EnumService';
|
|
@@ -8,6 +8,7 @@ import { ContentfulService } from './contentful.service';
|
|
|
8
8
|
import { FindingsInsightsService } from './findingsInsights.service';
|
|
9
9
|
import { PlatformConnectorService } from './connector.platform.service';
|
|
10
10
|
import { PlatformAgentService } from './AgentsService';
|
|
11
|
+
import { TenantsService } from './rest/TenantsService';
|
|
11
12
|
import { FindingsService } from './findings.service';
|
|
12
13
|
export type AmpSdkOptions = AmpRestClientOptions;
|
|
13
14
|
/**
|
|
@@ -47,7 +48,7 @@ export declare class AmpSdkServices {
|
|
|
47
48
|
readonly stagedSaaSComponents: TruncatableAmpEntityService<PlatformSaasComponentUpsertDto, PlatformSaasComponentDto>;
|
|
48
49
|
readonly stagedSaaSUsers: TruncatableAmpEntityService<PlatformStagedSaasUserUpsertDto, PlatformStagedSaasUserDto>;
|
|
49
50
|
readonly settings: AmpSdkSettingsService;
|
|
50
|
-
readonly tenants:
|
|
51
|
+
readonly tenants: TenantsService;
|
|
51
52
|
readonly tokens: AmpSdkTenantService<PlatformTokenUpsertDto, PlatformTokenDto>;
|
|
52
53
|
readonly users: AmpSdkUserService;
|
|
53
54
|
constructor(rest: RestClient);
|
|
@@ -11,6 +11,7 @@ const contentful_service_1 = require("./contentful.service");
|
|
|
11
11
|
const findingsInsights_service_1 = require("./findingsInsights.service");
|
|
12
12
|
const connector_platform_service_1 = require("./connector.platform.service");
|
|
13
13
|
const AgentsService_1 = require("./AgentsService");
|
|
14
|
+
const TenantsService_1 = require("./rest/TenantsService");
|
|
14
15
|
const findings_service_1 = require("./findings.service");
|
|
15
16
|
/**
|
|
16
17
|
* AMP API
|
|
@@ -50,7 +51,7 @@ class AmpSdkServices {
|
|
|
50
51
|
this.stagedSaaSComponents = new entity_service_1.TruncatableAmpEntityServiceImpl(rest, constants_1.KIND.STAGED_SAAS_COMPONENTS, constants_1.TARGET_API_PLATFORM);
|
|
51
52
|
this.stagedSaaSUsers = new entity_service_1.TruncatableAmpEntityServiceImpl(rest, constants_1.KIND.STAGED_SAAS_USERS, constants_1.TARGET_API_PLATFORM);
|
|
52
53
|
this.settings = new settings_service_1.AmpSdkSettingsService(rest);
|
|
53
|
-
this.tenants = new
|
|
54
|
+
this.tenants = new TenantsService_1.TenantsService(rest, constants_1.TARGET_API_PLATFORM);
|
|
54
55
|
this.tokens = new entity_service_1.AmpEntityServiceImpl(rest, constants_1.KIND.TOKENS, constants_1.TARGET_API_PLATFORM);
|
|
55
56
|
this.users = new entity_service_1.AmpSdkUserService(rest, constants_1.TARGET_API_PLATFORM);
|
|
56
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmpSdk.js","sourceRoot":"","sources":["../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QACxE,IAAI,CAAC,cAAc,GAAG,IAAI,+CAA0B,CAAC,IAAI,EAAE,+BAAmB,CAAC,CAAC;QAChF,IAAI,CAAC,SAAS,GAAG,IAAI,0CAAqB,CAAC,IAAI,EAAE,+BAAmB,CAAC,CAAC;QACtE,IAAI,CAAC,gBAAgB,GAAG,IAAI,gDAA+B,CAA+D,IAAI,EAAE,gBAAI,CAAC,kBAAkB,EAAE,+BAAmB,CAAC,CAAC;QAC9K,IAAI,CAAC,oBAAoB,GAAG,IAAI,gDAA+B,CAC7D,IAAI,EACJ,gBAAI,CAAC,sBAAsB,EAC3B,+BAAmB,CACpB,CAAC;QACF,IAAI,CAAC,eAAe,GAAG,IAAI,gDAA+B,CAA6D,IAAI,EAAE,gBAAI,CAAC,iBAAiB,EAAE,+BAAmB,CAAC,CAAC;QAE1K,IAAI,CAAC,QAAQ,GAAG,IAAI,wCAAqB,CAAC,IAAI,CAAC,CAAC;QAChD,IAAI,CAAC,OAAO,GAAG,IAAI,+BAAc,CAAC,IAAI,EAAE,+BAAmB,CAAC,CAAC;QAC7D,IAAI,CAAC,MAAM,GAAG,IAAI,qCAAoB,CAA2C,IAAI,EAAE,gBAAI,CAAC,MAAM,EAAE,+BAAmB,CAAC,CAAC;QACzH,IAAI,CAAC,KAAK,GAAG,IAAI,kCAAiB,CAAC,IAAI,EAAE,+BAAmB,CAAC,CAAC;IAChE,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,OAAsB;QACpC,MAAM,IAAI,GAAG,IAAA,uBAAgB,EAAC,OAAO,CAAC,CAAC;QACvC,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;CACF;AA1ED,wCA0EC"}
|
|
@@ -107,14 +107,14 @@ declare const _FindingContent: z.ZodObject<{
|
|
|
107
107
|
timeToComplete: z.ZodOptional<z.ZodString>;
|
|
108
108
|
instructions: z.ZodType<EntryFieldTypes.RichText, z.ZodTypeDef, any>;
|
|
109
109
|
}, "strip", z.ZodTypeAny, {
|
|
110
|
-
title: string;
|
|
111
110
|
kind: string;
|
|
111
|
+
title: string;
|
|
112
112
|
instructions: EntryFieldTypes.RichText;
|
|
113
113
|
displayText?: string | undefined;
|
|
114
114
|
timeToComplete?: string | undefined;
|
|
115
115
|
}, {
|
|
116
|
-
title: string;
|
|
117
116
|
kind: string;
|
|
117
|
+
title: string;
|
|
118
118
|
displayText?: string | undefined;
|
|
119
119
|
timeToComplete?: string | undefined;
|
|
120
120
|
instructions?: any;
|
|
@@ -154,14 +154,14 @@ declare const _Integration: z.ZodObject<{
|
|
|
154
154
|
timeToComplete: z.ZodOptional<z.ZodString>;
|
|
155
155
|
instructions: z.ZodType<EntryFieldTypes.RichText, z.ZodTypeDef, any>;
|
|
156
156
|
}, "strip", z.ZodTypeAny, {
|
|
157
|
-
title: string;
|
|
158
157
|
kind: string;
|
|
158
|
+
title: string;
|
|
159
159
|
instructions: EntryFieldTypes.RichText;
|
|
160
160
|
displayText?: string | undefined;
|
|
161
161
|
timeToComplete?: string | undefined;
|
|
162
162
|
}, {
|
|
163
|
-
title: string;
|
|
164
163
|
kind: string;
|
|
164
|
+
title: string;
|
|
165
165
|
displayText?: string | undefined;
|
|
166
166
|
timeToComplete?: string | undefined;
|
|
167
167
|
instructions?: any;
|
|
@@ -179,8 +179,8 @@ declare const _Integration: z.ZodObject<{
|
|
|
179
179
|
}, "strip", z.ZodTypeAny, {
|
|
180
180
|
name: string;
|
|
181
181
|
findings: {
|
|
182
|
-
title: string;
|
|
183
182
|
kind: string;
|
|
183
|
+
title: string;
|
|
184
184
|
instructions: EntryFieldTypes.RichText;
|
|
185
185
|
displayText?: string | undefined;
|
|
186
186
|
timeToComplete?: string | undefined;
|
|
@@ -206,8 +206,8 @@ declare const _Integration: z.ZodObject<{
|
|
|
206
206
|
}, {
|
|
207
207
|
name: string;
|
|
208
208
|
findings: {
|
|
209
|
-
title: string;
|
|
210
209
|
kind: string;
|
|
210
|
+
title: string;
|
|
211
211
|
displayText?: string | undefined;
|
|
212
212
|
timeToComplete?: string | undefined;
|
|
213
213
|
instructions?: any;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { TenantCountReportDto, TenantDto, TenantUpsertDto } from '../../dto';
|
|
2
|
+
import { TargetApi } from '../constants';
|
|
3
|
+
import { AmpEntityServiceImpl } from '../entity.service';
|
|
4
|
+
import { RestClient } from './RestClient';
|
|
5
|
+
import { OpsRpcResult } from '../../dto/platform/platform.ops.dto';
|
|
6
|
+
export declare class TenantsService extends AmpEntityServiceImpl<TenantUpsertDto, TenantDto> {
|
|
7
|
+
constructor(rest: RestClient, targetApi?: TargetApi);
|
|
8
|
+
countReport(tid: string): Promise<TenantCountReportDto>;
|
|
9
|
+
/**
|
|
10
|
+
* !!! WARNING !!! 🚨 💀 🚨 💀 🚨 💀 🚨 💀
|
|
11
|
+
* This method will permanently HARD delete any soft deleted tenant data, including the tenant itsself. There is no UNDO!
|
|
12
|
+
*
|
|
13
|
+
* @param tid Tenant id to clean
|
|
14
|
+
* @returns void
|
|
15
|
+
* @deprecated do not use this function... unless you REALLY mean it! Note: this is more of a warning than true deprecation.
|
|
16
|
+
*/
|
|
17
|
+
hardDelete(tid: string): Promise<OpsRpcResult>;
|
|
18
|
+
/**
|
|
19
|
+
* !!! WARNING !!! 🚨 💀 🚨 💀 🚨 💀 🚨 💀
|
|
20
|
+
* This method will permanently HARD delete a tenant and associated data. There is no UNDO!
|
|
21
|
+
*
|
|
22
|
+
* @param tid Tenant id to delete
|
|
23
|
+
* @returns void
|
|
24
|
+
* @deprecated Use truncate instead... unless you REALLY mean it! Note: this is more of a warning than true deprecation.
|
|
25
|
+
*/
|
|
26
|
+
removeTenant(tid: string): Promise<OpsRpcResult>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TenantsService = void 0;
|
|
4
|
+
const dto_1 = require("../../dto");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
6
|
+
const entity_service_1 = require("../entity.service");
|
|
7
|
+
const platform_ops_dto_1 = require("../../dto/platform/platform.ops.dto");
|
|
8
|
+
class TenantsService extends entity_service_1.AmpEntityServiceImpl {
|
|
9
|
+
constructor(rest, targetApi = 'api') {
|
|
10
|
+
super(rest, constants_1.KIND.TENANTS, targetApi);
|
|
11
|
+
}
|
|
12
|
+
countReport(tid) {
|
|
13
|
+
const url = `/${this.targetApi}/v1/${this.kind}/${tid}/count_report`;
|
|
14
|
+
return this.rest
|
|
15
|
+
.call({
|
|
16
|
+
url,
|
|
17
|
+
method: 'GET',
|
|
18
|
+
})
|
|
19
|
+
.then(res => dto_1._TenantCountReportDto.parse(res.data));
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* !!! WARNING !!! 🚨 💀 🚨 💀 🚨 💀 🚨 💀
|
|
23
|
+
* This method will permanently HARD delete any soft deleted tenant data, including the tenant itsself. There is no UNDO!
|
|
24
|
+
*
|
|
25
|
+
* @param tid Tenant id to clean
|
|
26
|
+
* @returns void
|
|
27
|
+
* @deprecated do not use this function... unless you REALLY mean it! Note: this is more of a warning than true deprecation.
|
|
28
|
+
*/
|
|
29
|
+
hardDelete(tid) {
|
|
30
|
+
const url = `/${this.targetApi}/v1/ops/rpc`;
|
|
31
|
+
return this.rest
|
|
32
|
+
.call({
|
|
33
|
+
url,
|
|
34
|
+
method: 'POST',
|
|
35
|
+
data: {
|
|
36
|
+
op: 'hardDelete',
|
|
37
|
+
input: {
|
|
38
|
+
tid,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
})
|
|
42
|
+
.then(res => platform_ops_dto_1._OpsRpcResult.parse(res.data));
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* !!! WARNING !!! 🚨 💀 🚨 💀 🚨 💀 🚨 💀
|
|
46
|
+
* This method will permanently HARD delete a tenant and associated data. There is no UNDO!
|
|
47
|
+
*
|
|
48
|
+
* @param tid Tenant id to delete
|
|
49
|
+
* @returns void
|
|
50
|
+
* @deprecated Use truncate instead... unless you REALLY mean it! Note: this is more of a warning than true deprecation.
|
|
51
|
+
*/
|
|
52
|
+
removeTenant(tid) {
|
|
53
|
+
const url = `/${this.targetApi}/v1/ops/rpc`;
|
|
54
|
+
return this.rest
|
|
55
|
+
.call({
|
|
56
|
+
url,
|
|
57
|
+
method: 'POST',
|
|
58
|
+
data: {
|
|
59
|
+
op: 'removeTenant',
|
|
60
|
+
input: {
|
|
61
|
+
tid,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
})
|
|
65
|
+
.then(res => platform_ops_dto_1._OpsRpcResult.parse(res.data));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.TenantsService = TenantsService;
|
|
69
|
+
//# sourceMappingURL=TenantsService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TenantsService.js","sourceRoot":"","sources":["../../../../src/services/rest/TenantsService.ts"],"names":[],"mappings":";;;AAAA,mCAAkG;AAClG,4CAA6C;AAC7C,sDAAuD;AAEvD,0EAAgF;AAEhF,MAAa,cAAe,SAAQ,qCAAgD;IAClF,YAAY,IAAgB,EAAE,YAAuB,KAAK;QACxD,KAAK,CAAC,IAAI,EAAE,gBAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IACvC,CAAC;IAED,WAAW,CAAC,GAAW;QACrB,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,SAAS,OAAO,IAAI,CAAC,IAAI,IAAI,GAAG,eAAe,CAAC;QACrE,OAAO,IAAI,CAAC,IAAI;aACb,IAAI,CAAC;YACJ,GAAG;YACH,MAAM,EAAE,KAAK;SACd,CAAC;aACD,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,2BAAqB,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IACxD,CAAC;IAED;;;;;;;OAOG;IACH,UAAU,CAAC,GAAW;QACpB,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,SAAS,aAAa,CAAC;QAC5C,OAAO,IAAI,CAAC,IAAI;aACb,IAAI,CAAC;YACJ,GAAG;YACH,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,EAAE,EAAE,YAAY;gBAChB,KAAK,EAAE;oBACL,GAAG;iBACJ;aACF;SACF,CAAC;aACD,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,gCAAa,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IAChD,CAAC;IAED;;;;;;;OAOG;IACH,YAAY,CAAC,GAAW;QACtB,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,SAAS,aAAa,CAAC;QAC5C,OAAO,IAAI,CAAC,IAAI;aACb,IAAI,CAAC;YACJ,GAAG;YACH,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,EAAE,EAAE,cAAc;gBAClB,KAAK,EAAE;oBACL,GAAG;iBACJ;aACF;SACF,CAAC;aACD,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,gCAAa,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IAChD,CAAC;CACF;AA9DD,wCA8DC"}
|
package/package.json
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {FindingSpecInsights} from '../findings.dto';
|
|
1
2
|
import {Category} from './category';
|
|
2
3
|
import {FindingOutcome} from './finding.outcome';
|
|
3
4
|
import {FindingSeverity} from './finding.severity';
|
|
@@ -214,7 +215,7 @@ export const lookupFindingDisplayValueByKind = (kind: string): string => {
|
|
|
214
215
|
|
|
215
216
|
export const generateInsights = (category: string, kind: string) => {
|
|
216
217
|
type Condition = Record<string, boolean | string | number | undefined>;
|
|
217
|
-
const insights = {
|
|
218
|
+
const insights: FindingSpecInsights = {
|
|
218
219
|
meta: {
|
|
219
220
|
kind: kind as FindingKind,
|
|
220
221
|
severity: lookupFindingSeverityByKind(kind) as FindingSeverity,
|
|
@@ -230,84 +231,85 @@ export const generateInsights = (category: string, kind: string) => {
|
|
|
230
231
|
remediatedCondition: {} as Condition,
|
|
231
232
|
},
|
|
232
233
|
};
|
|
234
|
+
const rule = insights.rule!;
|
|
233
235
|
if (category === Category.EDR || category === Category.VULNERABILITY) {
|
|
234
|
-
|
|
236
|
+
rule.aid = {$has: true};
|
|
235
237
|
} else {
|
|
236
|
-
|
|
238
|
+
rule.uid = {$has: true};
|
|
237
239
|
}
|
|
238
|
-
const setCondition = (key: string, value: boolean) => {
|
|
239
|
-
|
|
240
|
-
|
|
240
|
+
const setCondition = (key: string, value: boolean | string) => {
|
|
241
|
+
rule.findingCondition![key] = value;
|
|
242
|
+
rule.remediatedCondition![key] = !value;
|
|
241
243
|
};
|
|
242
244
|
|
|
243
245
|
switch (kind) {
|
|
244
246
|
case FindingKind.WEB_GATEWAY_NOT_ACTIVE:
|
|
245
247
|
setCondition('meta._findings.loggedIn', false);
|
|
246
|
-
|
|
248
|
+
rule.kind = SaasComponentKind.WEB_GATEWAY_SESSION;
|
|
247
249
|
break;
|
|
248
250
|
case FindingKind.CRITICAL_VULNERABILITY_OUT_OF_SLA:
|
|
249
251
|
setCondition('meta._findings.overdue', true);
|
|
250
|
-
|
|
251
|
-
|
|
252
|
+
rule.kind = SaasComponentKind.VULNERABILITY;
|
|
253
|
+
rule.severity = FindingSeverity.CRITICAL;
|
|
252
254
|
break;
|
|
253
255
|
case FindingKind.HIGH_VULNERABILITY_OUT_OF_SLA:
|
|
254
256
|
setCondition('meta._findings.overdue', true);
|
|
255
|
-
|
|
256
|
-
|
|
257
|
+
rule.kind = SaasComponentKind.VULNERABILITY;
|
|
258
|
+
rule.severity = FindingSeverity.HIGH;
|
|
257
259
|
break;
|
|
258
260
|
case FindingKind.MEDIUM_VULNERABILITY_OUT_OF_SLA:
|
|
259
261
|
setCondition('meta._findings.overdue', true);
|
|
260
|
-
|
|
261
|
-
|
|
262
|
+
rule.kind = SaasComponentKind.VULNERABILITY;
|
|
263
|
+
rule.severity = FindingSeverity.MEDIUM;
|
|
262
264
|
break;
|
|
263
265
|
case FindingKind.LOW_VULNERABILITY_OUT_OF_SLA:
|
|
264
266
|
setCondition('meta._findings.overdue', true);
|
|
265
|
-
|
|
266
|
-
|
|
267
|
+
rule.kind = SaasComponentKind.VULNERABILITY;
|
|
268
|
+
rule.severity = FindingSeverity.LOW;
|
|
267
269
|
break;
|
|
268
270
|
case FindingKind.TRAINING_OVERDUE:
|
|
269
271
|
setCondition('meta._findings.overdue', true);
|
|
270
|
-
|
|
272
|
+
rule.kind = SaasComponentKind.TRAINING_ASSIGNMENT;
|
|
271
273
|
break;
|
|
272
274
|
case FindingKind.FAILED_PHISHING:
|
|
273
275
|
setCondition('meta._findings.failedPhishing', true);
|
|
274
|
-
|
|
276
|
+
rule.kind = SaasComponentKind.PHISHING_RESULT;
|
|
275
277
|
break;
|
|
276
278
|
case FindingKind.DEVICE_NOT_MANAGED:
|
|
277
279
|
setCondition('meta._findings.active', false);
|
|
278
|
-
|
|
280
|
+
rule.kind = SaasComponentKind.EDR_CONFIG;
|
|
279
281
|
break;
|
|
280
282
|
case FindingKind.FIREWALL_DISABLED:
|
|
281
283
|
setCondition('meta._findings.isFirewallDisabled', true);
|
|
282
|
-
|
|
284
|
+
rule.kind = SaasComponentKind.EDR_CONFIG;
|
|
283
285
|
break;
|
|
284
286
|
case FindingKind.SCREENSAVER_DISABLED:
|
|
285
287
|
setCondition('meta._findings.isScreenSaverDisabled', true);
|
|
286
|
-
|
|
288
|
+
rule.kind = SaasComponentKind.EDR_CONFIG;
|
|
287
289
|
break;
|
|
288
290
|
case FindingKind.DEVICE_NOT_ENCRYPTED:
|
|
289
291
|
setCondition('meta._findings.isDeviceNotEncrypted', true);
|
|
290
|
-
|
|
292
|
+
rule.kind = SaasComponentKind.EDR_CONFIG;
|
|
291
293
|
break;
|
|
292
294
|
case FindingKind.MFA_NOT_ENABLED:
|
|
293
295
|
setCondition('meta._findings.enabled', false);
|
|
294
|
-
|
|
296
|
+
rule.kind = SaasComponentKind.MFA_CONFIG;
|
|
295
297
|
break;
|
|
296
298
|
case FindingKind.MFA_NOT_SECURE:
|
|
297
299
|
setCondition('meta._findings.hasInsecureFactors', true);
|
|
298
|
-
|
|
300
|
+
rule.kind = SaasComponentKind.MFA_CONFIG;
|
|
299
301
|
break;
|
|
300
302
|
case FindingKind.IS_EXECUTIVE:
|
|
301
303
|
setCondition('meta._findings.isExecutive', true);
|
|
302
|
-
|
|
304
|
+
rule.kind = SaasComponentKind.GROUP_MEMBERSHIP;
|
|
303
305
|
break;
|
|
304
306
|
case FindingKind.HAS_PRODUCTION_ACCESS:
|
|
305
307
|
setCondition('meta._findings.hasProdAccess', true);
|
|
306
|
-
|
|
308
|
+
rule.kind = SaasComponentKind.GROUP_MEMBERSHIP;
|
|
307
309
|
break;
|
|
308
310
|
case FindingKind.HAS_PRIVILEGED_ACCESS:
|
|
309
311
|
setCondition('meta._findings.hasPrivilegedAccess', true);
|
|
310
|
-
|
|
312
|
+
rule.kind = SaasComponentKind.GROUP_MEMBERSHIP;
|
|
311
313
|
break;
|
|
312
314
|
default:
|
|
313
315
|
break;
|