@ampsec/platform-client 62.22.0 → 62.23.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.
@@ -10,7 +10,7 @@ exports._CustomScoreValueDto = base_dto_1._BaseDto.extend({
10
10
  });
11
11
  exports._CustomScoreValueUpsertDto = exports._CustomScoreValueDto.partial(base_dto_1.UPSERT_DTO_MASK);
12
12
  exports._CustomScoreCohortDto = base_dto_1._BaseDto.extend({
13
- cohort: flows_dto_1._AmplifierCohortDto,
13
+ cohort: flows_dto_1._AmplifierCohortDto || zod_1.z.array(flows_dto_1._AmplifierCohortDto),
14
14
  multiplier: zod_1.z.number(),
15
15
  });
16
16
  exports._CustomScoreCohortUpsertDto = exports._CustomScoreCohortDto.partial(base_dto_1.UPSERT_DTO_MASK);
@@ -1 +1 @@
1
- {"version":3,"file":"customScores.dto.js","sourceRoot":"","sources":["../../../src/dto/customScores.dto.ts"],"names":[],"mappings":";;;AAAA,6BAAsB;AACtB,yCAAqD;AACrD,2CAAgD;AAEnC,QAAA,oBAAoB,GAAG,mBAAQ,CAAC,MAAM,CAAC;IAClD,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE;IACzB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;CAClB,CAAC,CAAC;AAGU,QAAA,0BAA0B,GAAG,4BAAoB,CAAC,OAAO,CAAC,0BAAe,CAAC,CAAC;AAG3E,QAAA,qBAAqB,GAAG,mBAAQ,CAAC,MAAM,CAAC;IACnD,MAAM,EAAE,+BAAmB;IAC3B,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE;CACvB,CAAC,CAAC;AAGU,QAAA,2BAA2B,GAAG,6BAAqB,CAAC,OAAO,CAAC,0BAAe,CAAC,CAAC"}
1
+ {"version":3,"file":"customScores.dto.js","sourceRoot":"","sources":["../../../src/dto/customScores.dto.ts"],"names":[],"mappings":";;;AAAA,6BAAsB;AACtB,yCAAqD;AACrD,2CAAgD;AAEnC,QAAA,oBAAoB,GAAG,mBAAQ,CAAC,MAAM,CAAC;IAClD,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE;IACzB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;CAClB,CAAC,CAAC;AAGU,QAAA,0BAA0B,GAAG,4BAAoB,CAAC,OAAO,CAAC,0BAAe,CAAC,CAAC;AAG3E,QAAA,qBAAqB,GAAG,mBAAQ,CAAC,MAAM,CAAC;IACnD,MAAM,EAAE,+BAAmB,IAAI,OAAC,CAAC,KAAK,CAAC,+BAAmB,CAAC;IAC3D,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE;CACvB,CAAC,CAAC;AAGU,QAAA,2BAA2B,GAAG,6BAAqB,CAAC,OAAO,CAAC,0BAAe,CAAC,CAAC"}
@@ -1,5 +1,7 @@
1
+ import { Category } from './category';
1
2
  import { FindingOutcome } from './finding.outcome';
2
3
  import { FindingSeverity } from './finding.severity';
4
+ import { SaasComponentKind } from './saasComponentKind';
3
5
  export declare enum FindingKind {
4
6
  NO_ACCOUNT = "NO_ACCOUNT",
5
7
  MFA_NOT_ENABLED = "MFA_NOT_ENABLED",
@@ -16,3 +18,22 @@ export declare const lookupFindingOutcomeByKind: (kind: FindingKind) => FindingO
16
18
  export declare const lookupFindingKindByCategory: (category: string) => FindingKind[];
17
19
  export declare const lookupFindingSeverityByKind: (kind: string) => FindingSeverity | undefined;
18
20
  export declare const lookupFindingDisplayValueByKind: (kind: string) => string;
21
+ export declare const generateInsights: (category: string, kind: string) => {
22
+ meta: {
23
+ kind: FindingKind;
24
+ severity: FindingSeverity;
25
+ displayValue: string;
26
+ };
27
+ rule: {
28
+ category: Category;
29
+ kind: SaasComponentKind;
30
+ aid: {
31
+ $has: boolean;
32
+ };
33
+ uid: {
34
+ $has: boolean;
35
+ };
36
+ findingCondition: Record<string, string | number | boolean | undefined>;
37
+ remediatedCondition: Record<string, string | number | boolean | undefined>;
38
+ };
39
+ };
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.lookupFindingDisplayValueByKind = exports.lookupFindingSeverityByKind = exports.lookupFindingKindByCategory = exports.lookupFindingOutcomeByKind = exports.FindingKind = void 0;
3
+ exports.generateInsights = exports.lookupFindingDisplayValueByKind = exports.lookupFindingSeverityByKind = exports.lookupFindingKindByCategory = exports.lookupFindingOutcomeByKind = exports.FindingKind = void 0;
4
4
  const category_1 = require("./category");
5
5
  const finding_outcome_1 = require("./finding.outcome");
6
6
  const finding_severity_1 = require("./finding.severity");
7
+ const saasComponentKind_1 = require("./saasComponentKind");
7
8
  var FindingKind;
8
9
  (function (FindingKind) {
9
10
  // ALL
@@ -106,4 +107,73 @@ const lookupFindingDisplayValueByKind = (kind) => {
106
107
  }
107
108
  };
108
109
  exports.lookupFindingDisplayValueByKind = lookupFindingDisplayValueByKind;
110
+ const generateInsights = (category, kind) => {
111
+ const insights = {
112
+ meta: {
113
+ kind: kind,
114
+ severity: (0, exports.lookupFindingSeverityByKind)(kind),
115
+ displayValue: (0, exports.lookupFindingDisplayValueByKind)(kind),
116
+ },
117
+ rule: {
118
+ category: category,
119
+ kind: '',
120
+ aid: { $has: false },
121
+ uid: { $has: false },
122
+ findingCondition: {},
123
+ remediatedCondition: {},
124
+ },
125
+ };
126
+ if (category === category_1.Category.EDR || category === category_1.Category.VULNERABILITY) {
127
+ insights.rule.aid = { $has: true };
128
+ }
129
+ else {
130
+ insights.rule.uid = { $has: true };
131
+ }
132
+ const setCondition = (key, value) => {
133
+ insights.rule.findingCondition[key] = value;
134
+ insights.rule.remediatedCondition[key] = !value;
135
+ };
136
+ switch (kind) {
137
+ case FindingKind.WEB_GATEWAY_NOT_ACTIVE:
138
+ setCondition('meta._findings.loggedIn', false);
139
+ insights.rule.kind = saasComponentKind_1.SaasComponentKind.WEB_GATEWAY_SESSION;
140
+ break;
141
+ case FindingKind.VULNERABILITY_OUT_OF_SLA:
142
+ setCondition('meta._findings.overdue', true);
143
+ insights.rule.kind = saasComponentKind_1.SaasComponentKind.VULNERABILITY;
144
+ break;
145
+ case FindingKind.TRAINING_OVERDUE:
146
+ setCondition('meta._findings.overdue', true);
147
+ insights.rule.kind = saasComponentKind_1.SaasComponentKind.TRAINING_ASSIGNMENT;
148
+ break;
149
+ case FindingKind.FAILED_PHISHING:
150
+ setCondition('meta._findings.failedPhishing', true);
151
+ insights.rule.kind = saasComponentKind_1.SaasComponentKind.PHISHING_RESULT;
152
+ break;
153
+ case FindingKind.DEVICE_NOT_MANAGED:
154
+ setCondition('meta._findings.active', false);
155
+ insights.rule.kind = saasComponentKind_1.SaasComponentKind.EDR_CONFIG;
156
+ break;
157
+ case FindingKind.MFA_NOT_ENABLED:
158
+ setCondition('meta._findings.enabled', false);
159
+ insights.rule.kind = saasComponentKind_1.SaasComponentKind.MFA_CONFIG;
160
+ break;
161
+ case FindingKind.IS_EXECUTIVE:
162
+ setCondition('meta._findings.isExecutive', true);
163
+ insights.rule.kind = saasComponentKind_1.SaasComponentKind.GROUP_MEMBERSHIP;
164
+ break;
165
+ case FindingKind.HAS_PRODUCTION_ACCESS:
166
+ setCondition('meta._findings.hasProdAccess', true);
167
+ insights.rule.kind = saasComponentKind_1.SaasComponentKind.GROUP_MEMBERSHIP;
168
+ break;
169
+ case FindingKind.HAS_PRIVILEGED_ACCESS:
170
+ setCondition('meta._findings.hasPrivilegedAccess', true);
171
+ insights.rule.kind = saasComponentKind_1.SaasComponentKind.GROUP_MEMBERSHIP;
172
+ break;
173
+ default:
174
+ break;
175
+ }
176
+ return insights;
177
+ };
178
+ exports.generateInsights = generateInsights;
109
179
  //# sourceMappingURL=findingKind.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"findingKind.js","sourceRoot":"","sources":["../../../../src/dto/enums/findingKind.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,uDAAiD;AACjD,yDAAmD;AAEnD,IAAY,WAoBX;AApBD,WAAY,WAAW;IACrB,MAAM;IACN,wCAAyB,CAAA;IAEzB,WAAW;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I,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;AApEW,QAAA,gBAAgB,oBAoE3B"}
@@ -66,7 +66,7 @@ export declare const _FindingSpecDto: z.ZodObject<{
66
66
  description: z.ZodUnion<[z.ZodString, z.ZodUnknown]>;
67
67
  severity: z.ZodNativeEnum<typeof FindingSeverity>;
68
68
  insights: z.ZodOptional<z.ZodObject<{
69
- meta: z.ZodObject<{
69
+ meta: z.ZodOptional<z.ZodObject<{
70
70
  kind: z.ZodNativeEnum<typeof FindingKind>;
71
71
  severity: z.ZodNativeEnum<typeof FindingSeverity>;
72
72
  displayValue: z.ZodString;
@@ -78,8 +78,8 @@ export declare const _FindingSpecDto: z.ZodObject<{
78
78
  displayValue: string;
79
79
  kind: FindingKind;
80
80
  severity: FindingSeverity;
81
- }>;
82
- rule: z.ZodObject<{
81
+ }>>;
82
+ rule: z.ZodOptional<z.ZodObject<{
83
83
  category: z.ZodNativeEnum<typeof Category>;
84
84
  kind: z.ZodNativeEnum<typeof SaasComponentKind>;
85
85
  aid: z.ZodOptional<z.ZodObject<{
@@ -120,14 +120,14 @@ export declare const _FindingSpecDto: z.ZodObject<{
120
120
  $has: boolean;
121
121
  } | undefined;
122
122
  remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
123
- }>;
123
+ }>>;
124
124
  }, "strip", z.ZodTypeAny, {
125
- meta: {
125
+ meta?: {
126
126
  displayValue: string;
127
127
  kind: FindingKind;
128
128
  severity: FindingSeverity;
129
- };
130
- rule: {
129
+ } | undefined;
130
+ rule?: {
131
131
  kind: SaasComponentKind;
132
132
  category: Category;
133
133
  findingCondition: Record<string, string | number | boolean | undefined>;
@@ -138,14 +138,14 @@ export declare const _FindingSpecDto: z.ZodObject<{
138
138
  $has: boolean;
139
139
  } | undefined;
140
140
  remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
141
- };
141
+ } | undefined;
142
142
  }, {
143
- meta: {
143
+ meta?: {
144
144
  displayValue: string;
145
145
  kind: FindingKind;
146
146
  severity: FindingSeverity;
147
- };
148
- rule: {
147
+ } | undefined;
148
+ rule?: {
149
149
  kind: SaasComponentKind;
150
150
  category: Category;
151
151
  findingCondition: Record<string, string | number | boolean | undefined>;
@@ -156,7 +156,7 @@ export declare const _FindingSpecDto: z.ZodObject<{
156
156
  $has: boolean;
157
157
  } | undefined;
158
158
  remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
159
- };
159
+ } | undefined;
160
160
  }>>;
161
161
  expireAfterDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
162
162
  }, "strip", z.ZodTypeAny, {
@@ -171,12 +171,12 @@ export declare const _FindingSpecDto: z.ZodObject<{
171
171
  cid?: string | undefined;
172
172
  description?: unknown;
173
173
  insights?: {
174
- meta: {
174
+ meta?: {
175
175
  displayValue: string;
176
176
  kind: FindingKind;
177
177
  severity: FindingSeverity;
178
- };
179
- rule: {
178
+ } | undefined;
179
+ rule?: {
180
180
  kind: SaasComponentKind;
181
181
  category: Category;
182
182
  findingCondition: Record<string, string | number | boolean | undefined>;
@@ -187,7 +187,7 @@ export declare const _FindingSpecDto: z.ZodObject<{
187
187
  $has: boolean;
188
188
  } | undefined;
189
189
  remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
190
- };
190
+ } | undefined;
191
191
  } | undefined;
192
192
  expireAfterDays?: number | null | undefined;
193
193
  }, {
@@ -202,12 +202,12 @@ export declare const _FindingSpecDto: z.ZodObject<{
202
202
  cid?: string | undefined;
203
203
  description?: unknown;
204
204
  insights?: {
205
- meta: {
205
+ meta?: {
206
206
  displayValue: string;
207
207
  kind: FindingKind;
208
208
  severity: FindingSeverity;
209
- };
210
- rule: {
209
+ } | undefined;
210
+ rule?: {
211
211
  kind: SaasComponentKind;
212
212
  category: Category;
213
213
  findingCondition: Record<string, string | number | boolean | undefined>;
@@ -218,7 +218,7 @@ export declare const _FindingSpecDto: z.ZodObject<{
218
218
  $has: boolean;
219
219
  } | undefined;
220
220
  remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
221
- };
221
+ } | undefined;
222
222
  } | undefined;
223
223
  expireAfterDays?: number | null | undefined;
224
224
  }>;
@@ -235,7 +235,7 @@ export declare const _FindingSpecUpsertDto: z.ZodObject<{
235
235
  eventType: z.ZodString;
236
236
  severity: z.ZodNativeEnum<typeof FindingSeverity>;
237
237
  insights: z.ZodOptional<z.ZodObject<{
238
- meta: z.ZodObject<{
238
+ meta: z.ZodOptional<z.ZodObject<{
239
239
  kind: z.ZodNativeEnum<typeof FindingKind>;
240
240
  severity: z.ZodNativeEnum<typeof FindingSeverity>;
241
241
  displayValue: z.ZodString;
@@ -247,8 +247,8 @@ export declare const _FindingSpecUpsertDto: z.ZodObject<{
247
247
  displayValue: string;
248
248
  kind: FindingKind;
249
249
  severity: FindingSeverity;
250
- }>;
251
- rule: z.ZodObject<{
250
+ }>>;
251
+ rule: z.ZodOptional<z.ZodObject<{
252
252
  category: z.ZodNativeEnum<typeof Category>;
253
253
  kind: z.ZodNativeEnum<typeof SaasComponentKind>;
254
254
  aid: z.ZodOptional<z.ZodObject<{
@@ -289,14 +289,14 @@ export declare const _FindingSpecUpsertDto: z.ZodObject<{
289
289
  $has: boolean;
290
290
  } | undefined;
291
291
  remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
292
- }>;
292
+ }>>;
293
293
  }, "strip", z.ZodTypeAny, {
294
- meta: {
294
+ meta?: {
295
295
  displayValue: string;
296
296
  kind: FindingKind;
297
297
  severity: FindingSeverity;
298
- };
299
- rule: {
298
+ } | undefined;
299
+ rule?: {
300
300
  kind: SaasComponentKind;
301
301
  category: Category;
302
302
  findingCondition: Record<string, string | number | boolean | undefined>;
@@ -307,14 +307,14 @@ export declare const _FindingSpecUpsertDto: z.ZodObject<{
307
307
  $has: boolean;
308
308
  } | undefined;
309
309
  remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
310
- };
310
+ } | undefined;
311
311
  }, {
312
- meta: {
312
+ meta?: {
313
313
  displayValue: string;
314
314
  kind: FindingKind;
315
315
  severity: FindingSeverity;
316
- };
317
- rule: {
316
+ } | undefined;
317
+ rule?: {
318
318
  kind: SaasComponentKind;
319
319
  category: Category;
320
320
  findingCondition: Record<string, string | number | boolean | undefined>;
@@ -325,7 +325,7 @@ export declare const _FindingSpecUpsertDto: z.ZodObject<{
325
325
  $has: boolean;
326
326
  } | undefined;
327
327
  remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
328
- };
328
+ } | undefined;
329
329
  }>>;
330
330
  expireAfterDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
331
331
  }, "strip", z.ZodTypeAny, {
@@ -340,12 +340,12 @@ export declare const _FindingSpecUpsertDto: z.ZodObject<{
340
340
  updatedAt?: string | undefined;
341
341
  deletedAt?: string | null | undefined;
342
342
  insights?: {
343
- meta: {
343
+ meta?: {
344
344
  displayValue: string;
345
345
  kind: FindingKind;
346
346
  severity: FindingSeverity;
347
- };
348
- rule: {
347
+ } | undefined;
348
+ rule?: {
349
349
  kind: SaasComponentKind;
350
350
  category: Category;
351
351
  findingCondition: Record<string, string | number | boolean | undefined>;
@@ -356,7 +356,7 @@ export declare const _FindingSpecUpsertDto: z.ZodObject<{
356
356
  $has: boolean;
357
357
  } | undefined;
358
358
  remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
359
- };
359
+ } | undefined;
360
360
  } | undefined;
361
361
  expireAfterDays?: number | null | undefined;
362
362
  }, {
@@ -371,12 +371,12 @@ export declare const _FindingSpecUpsertDto: z.ZodObject<{
371
371
  updatedAt?: string | undefined;
372
372
  deletedAt?: string | null | undefined;
373
373
  insights?: {
374
- meta: {
374
+ meta?: {
375
375
  displayValue: string;
376
376
  kind: FindingKind;
377
377
  severity: FindingSeverity;
378
- };
379
- rule: {
378
+ } | undefined;
379
+ rule?: {
380
380
  kind: SaasComponentKind;
381
381
  category: Category;
382
382
  findingCondition: Record<string, string | number | boolean | undefined>;
@@ -387,7 +387,7 @@ export declare const _FindingSpecUpsertDto: z.ZodObject<{
387
387
  $has: boolean;
388
388
  } | undefined;
389
389
  remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
390
- };
390
+ } | undefined;
391
391
  } | undefined;
392
392
  expireAfterDays?: number | null | undefined;
393
393
  }>;
@@ -15,12 +15,15 @@ exports._FindingSpecDto = base_dto_1._BaseDto.extend({
15
15
  severity: zod_1.z.nativeEnum(enums_2.FindingSeverity),
16
16
  insights: zod_1.z
17
17
  .object({
18
- meta: zod_1.z.object({
18
+ meta: zod_1.z
19
+ .object({
19
20
  kind: zod_1.z.nativeEnum(enums_1.FindingKind),
20
21
  severity: zod_1.z.nativeEnum(enums_2.FindingSeverity),
21
22
  displayValue: zod_1.z.string(),
22
- }),
23
- rule: zod_1.z.object({
23
+ })
24
+ .optional(),
25
+ rule: zod_1.z
26
+ .object({
24
27
  category: zod_1.z.nativeEnum(enums_1.Category),
25
28
  kind: zod_1.z.nativeEnum(enums_1.SaasComponentKind),
26
29
  aid: zod_1.z
@@ -35,7 +38,8 @@ exports._FindingSpecDto = base_dto_1._BaseDto.extend({
35
38
  .optional(),
36
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()])),
37
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(),
38
- }),
41
+ })
42
+ .optional(),
39
43
  })
40
44
  .optional(),
41
45
  expireAfterDays: zod_1.z.nullable(zod_1.z.number()).optional(),
@@ -1 +1 @@
1
- {"version":3,"file":"findings.dto.js","sourceRoot":"","sources":["../../../src/dto/findings.dto.ts"],"names":[],"mappings":";;;AAAA,6BAAsB;AAEtB,yCAA4D;AAC5D,mCAAiE;AACjE,mCAAuE;AAyDvE,MAAM,uBAAuB,GAAG,OAAC,CAAC,OAAO,EAAE,CAAC;AAC/B,QAAA,eAAe,GAAG,mBAAQ,CAAC,MAAM,CAAC;IAC7C,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE;IACxB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,WAAW,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,uBAAuB,CAAC,CAAC;IAC3D,QAAQ,EAAE,OAAC,CAAC,UAAU,CAAC,uBAAe,CAAC;IACvC,QAAQ,EAAE,OAAC;SACR,MAAM,CAAC;QACN,IAAI,EAAE,OAAC,CAAC,MAAM,CAAC;YACb,IAAI,EAAE,OAAC,CAAC,UAAU,CAAC,mBAAW,CAAC;YAC/B,QAAQ,EAAE,OAAC,CAAC,UAAU,CAAC,uBAAe,CAAC;YACvC,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE;SACzB,CAAC;QACF,IAAI,EAAE,OAAC,CAAC,MAAM,CAAC;YACb,QAAQ,EAAE,OAAC,CAAC,UAAU,CAAC,gBAAQ,CAAC;YAChC,IAAI,EAAE,OAAC,CAAC,UAAU,CAAC,yBAAiB,CAAC;YACrC,GAAG,EAAE,OAAC;iBACH,MAAM,CAAC;gBACN,IAAI,EAAE,OAAC,CAAC,OAAO,EAAE;aAClB,CAAC;iBACD,QAAQ,EAAE;YACb,GAAG,EAAE,OAAC;iBACH,MAAM,CAAC;gBACN,IAAI,EAAE,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,CAAC,OAAC,CAAC,OAAO,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;YACrG,mBAAmB,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,OAAO,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;SACpH,CAAC;aACD,QAAQ,EAAE;KACd,CAAC;SACD,QAAQ,EAAE;IACb,eAAe,EAAE,OAAC,CAAC,QAAQ,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CACnD,CAAC,CAAC;AAGU,QAAA,qBAAqB,GAAG,uBAAe,CAAC,OAAO,CAAC;IAC3D,EAAE,EAAE,IAAI;IACR,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;CAChB,CAAC,CAAC;AAGU,QAAA,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IACzC,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IACd,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE;IACxB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC"}
@@ -15,7 +15,7 @@ export declare const _PlatformFindingSpecDto: z.ZodObject<{
15
15
  eventType: z.ZodString;
16
16
  severity: z.ZodNativeEnum<typeof import("..").FindingSeverity>;
17
17
  insights: z.ZodOptional<z.ZodObject<{
18
- meta: z.ZodObject<{
18
+ meta: z.ZodOptional<z.ZodObject<{
19
19
  kind: z.ZodNativeEnum<typeof import("..").FindingKind>;
20
20
  severity: z.ZodNativeEnum<typeof import("..").FindingSeverity>;
21
21
  displayValue: z.ZodString;
@@ -27,8 +27,8 @@ export declare const _PlatformFindingSpecDto: z.ZodObject<{
27
27
  displayValue: string;
28
28
  kind: import("..").FindingKind;
29
29
  severity: import("..").FindingSeverity;
30
- }>;
31
- rule: z.ZodObject<{
30
+ }>>;
31
+ rule: z.ZodOptional<z.ZodObject<{
32
32
  category: z.ZodNativeEnum<typeof import("..").Category>;
33
33
  kind: z.ZodNativeEnum<typeof import("..").SaasComponentKind>;
34
34
  aid: z.ZodOptional<z.ZodObject<{
@@ -69,14 +69,14 @@ export declare const _PlatformFindingSpecDto: z.ZodObject<{
69
69
  $has: boolean;
70
70
  } | undefined;
71
71
  remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
72
- }>;
72
+ }>>;
73
73
  }, "strip", z.ZodTypeAny, {
74
- meta: {
74
+ meta?: {
75
75
  displayValue: string;
76
76
  kind: import("..").FindingKind;
77
77
  severity: import("..").FindingSeverity;
78
- };
79
- rule: {
78
+ } | undefined;
79
+ rule?: {
80
80
  kind: import("..").SaasComponentKind;
81
81
  category: import("..").Category;
82
82
  findingCondition: Record<string, string | number | boolean | undefined>;
@@ -87,14 +87,14 @@ export declare const _PlatformFindingSpecDto: z.ZodObject<{
87
87
  $has: boolean;
88
88
  } | undefined;
89
89
  remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
90
- };
90
+ } | undefined;
91
91
  }, {
92
- meta: {
92
+ meta?: {
93
93
  displayValue: string;
94
94
  kind: import("..").FindingKind;
95
95
  severity: import("..").FindingSeverity;
96
- };
97
- rule: {
96
+ } | undefined;
97
+ rule?: {
98
98
  kind: import("..").SaasComponentKind;
99
99
  category: import("..").Category;
100
100
  findingCondition: Record<string, string | number | boolean | undefined>;
@@ -105,7 +105,7 @@ export declare const _PlatformFindingSpecDto: z.ZodObject<{
105
105
  $has: boolean;
106
106
  } | undefined;
107
107
  remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
108
- };
108
+ } | undefined;
109
109
  }>>;
110
110
  expireAfterDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
111
111
  tid: z.ZodString;
@@ -122,12 +122,12 @@ export declare const _PlatformFindingSpecDto: z.ZodObject<{
122
122
  description?: unknown;
123
123
  cid?: string | undefined;
124
124
  insights?: {
125
- meta: {
125
+ meta?: {
126
126
  displayValue: string;
127
127
  kind: import("..").FindingKind;
128
128
  severity: import("..").FindingSeverity;
129
- };
130
- rule: {
129
+ } | undefined;
130
+ rule?: {
131
131
  kind: import("..").SaasComponentKind;
132
132
  category: import("..").Category;
133
133
  findingCondition: Record<string, string | number | boolean | undefined>;
@@ -138,7 +138,7 @@ export declare const _PlatformFindingSpecDto: z.ZodObject<{
138
138
  $has: boolean;
139
139
  } | undefined;
140
140
  remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
141
- };
141
+ } | undefined;
142
142
  } | undefined;
143
143
  expireAfterDays?: number | null | undefined;
144
144
  }, {
@@ -154,12 +154,12 @@ export declare const _PlatformFindingSpecDto: z.ZodObject<{
154
154
  description?: unknown;
155
155
  cid?: string | undefined;
156
156
  insights?: {
157
- meta: {
157
+ meta?: {
158
158
  displayValue: string;
159
159
  kind: import("..").FindingKind;
160
160
  severity: import("..").FindingSeverity;
161
- };
162
- rule: {
161
+ } | undefined;
162
+ rule?: {
163
163
  kind: import("..").SaasComponentKind;
164
164
  category: import("..").Category;
165
165
  findingCondition: Record<string, string | number | boolean | undefined>;
@@ -170,7 +170,7 @@ export declare const _PlatformFindingSpecDto: z.ZodObject<{
170
170
  $has: boolean;
171
171
  } | undefined;
172
172
  remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
173
- };
173
+ } | undefined;
174
174
  } | undefined;
175
175
  expireAfterDays?: number | null | undefined;
176
176
  }>;
@@ -187,7 +187,7 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<{
187
187
  eventType: z.ZodString;
188
188
  severity: z.ZodNativeEnum<typeof import("..").FindingSeverity>;
189
189
  insights: z.ZodOptional<z.ZodObject<{
190
- meta: z.ZodObject<{
190
+ meta: z.ZodOptional<z.ZodObject<{
191
191
  kind: z.ZodNativeEnum<typeof import("..").FindingKind>;
192
192
  severity: z.ZodNativeEnum<typeof import("..").FindingSeverity>;
193
193
  displayValue: z.ZodString;
@@ -199,8 +199,8 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<{
199
199
  displayValue: string;
200
200
  kind: import("..").FindingKind;
201
201
  severity: import("..").FindingSeverity;
202
- }>;
203
- rule: z.ZodObject<{
202
+ }>>;
203
+ rule: z.ZodOptional<z.ZodObject<{
204
204
  category: z.ZodNativeEnum<typeof import("..").Category>;
205
205
  kind: z.ZodNativeEnum<typeof import("..").SaasComponentKind>;
206
206
  aid: z.ZodOptional<z.ZodObject<{
@@ -241,14 +241,14 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<{
241
241
  $has: boolean;
242
242
  } | undefined;
243
243
  remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
244
- }>;
244
+ }>>;
245
245
  }, "strip", z.ZodTypeAny, {
246
- meta: {
246
+ meta?: {
247
247
  displayValue: string;
248
248
  kind: import("..").FindingKind;
249
249
  severity: import("..").FindingSeverity;
250
- };
251
- rule: {
250
+ } | undefined;
251
+ rule?: {
252
252
  kind: import("..").SaasComponentKind;
253
253
  category: import("..").Category;
254
254
  findingCondition: Record<string, string | number | boolean | undefined>;
@@ -259,14 +259,14 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<{
259
259
  $has: boolean;
260
260
  } | undefined;
261
261
  remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
262
- };
262
+ } | undefined;
263
263
  }, {
264
- meta: {
264
+ meta?: {
265
265
  displayValue: string;
266
266
  kind: import("..").FindingKind;
267
267
  severity: import("..").FindingSeverity;
268
- };
269
- rule: {
268
+ } | undefined;
269
+ rule?: {
270
270
  kind: import("..").SaasComponentKind;
271
271
  category: import("..").Category;
272
272
  findingCondition: Record<string, string | number | boolean | undefined>;
@@ -277,7 +277,7 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<{
277
277
  $has: boolean;
278
278
  } | undefined;
279
279
  remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
280
- };
280
+ } | undefined;
281
281
  }>>;
282
282
  expireAfterDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
283
283
  tid: z.ZodString;
@@ -294,12 +294,12 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<{
294
294
  updatedAt?: string | undefined;
295
295
  deletedAt?: string | null | undefined;
296
296
  insights?: {
297
- meta: {
297
+ meta?: {
298
298
  displayValue: string;
299
299
  kind: import("..").FindingKind;
300
300
  severity: import("..").FindingSeverity;
301
- };
302
- rule: {
301
+ } | undefined;
302
+ rule?: {
303
303
  kind: import("..").SaasComponentKind;
304
304
  category: import("..").Category;
305
305
  findingCondition: Record<string, string | number | boolean | undefined>;
@@ -310,7 +310,7 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<{
310
310
  $has: boolean;
311
311
  } | undefined;
312
312
  remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
313
- };
313
+ } | undefined;
314
314
  } | undefined;
315
315
  expireAfterDays?: number | null | undefined;
316
316
  }, {
@@ -326,12 +326,12 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<{
326
326
  updatedAt?: string | undefined;
327
327
  deletedAt?: string | null | undefined;
328
328
  insights?: {
329
- meta: {
329
+ meta?: {
330
330
  displayValue: string;
331
331
  kind: import("..").FindingKind;
332
332
  severity: import("..").FindingSeverity;
333
- };
334
- rule: {
333
+ } | undefined;
334
+ rule?: {
335
335
  kind: import("..").SaasComponentKind;
336
336
  category: import("..").Category;
337
337
  findingCondition: Record<string, string | number | boolean | undefined>;
@@ -342,7 +342,7 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<{
342
342
  $has: boolean;
343
343
  } | undefined;
344
344
  remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
345
- };
345
+ } | undefined;
346
346
  } | undefined;
347
347
  expireAfterDays?: number | null | undefined;
348
348
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ampsec/platform-client",
3
- "version": "62.22.0",
3
+ "version": "62.23.0",
4
4
  "description": "",
5
5
  "main": "build/src/index.js",
6
6
  "runkitExampleFilename": "example/main.js",
@@ -12,7 +12,7 @@ export const _CustomScoreValueUpsertDto = _CustomScoreValueDto.partial(UPSERT_DT
12
12
  export type CustomScoreValueUpsertDto = z.infer<typeof _CustomScoreValueUpsertDto>;
13
13
 
14
14
  export const _CustomScoreCohortDto = _BaseDto.extend({
15
- cohort: _AmplifierCohortDto,
15
+ cohort: _AmplifierCohortDto || z.array(_AmplifierCohortDto),
16
16
  multiplier: z.number(),
17
17
  });
18
18
  export type CustomScoreCohortDto = z.infer<typeof _CustomScoreCohortDto>;
@@ -1,6 +1,7 @@
1
1
  import {Category} from './category';
2
2
  import {FindingOutcome} from './finding.outcome';
3
3
  import {FindingSeverity} from './finding.severity';
4
+ import {SaasComponentKind} from './saasComponentKind';
4
5
 
5
6
  export enum FindingKind {
6
7
  // ALL
@@ -107,3 +108,73 @@ export const lookupFindingDisplayValueByKind = (kind: string): string => {
107
108
  return kind.toLowerCase();
108
109
  }
109
110
  };
111
+
112
+ export const generateInsights = (category: string, kind: string) => {
113
+ type Condition = Record<string, boolean | string | number | undefined>;
114
+ const insights = {
115
+ meta: {
116
+ kind: kind as FindingKind,
117
+ severity: lookupFindingSeverityByKind(kind) as FindingSeverity,
118
+ displayValue: lookupFindingDisplayValueByKind(kind),
119
+ },
120
+ rule: {
121
+ category: category as Category,
122
+ kind: '' as SaasComponentKind,
123
+ aid: {$has: false},
124
+ uid: {$has: false},
125
+ findingCondition: {} as Condition,
126
+ remediatedCondition: {} as Condition,
127
+ },
128
+ };
129
+ if (category === Category.EDR || category === Category.VULNERABILITY) {
130
+ insights.rule.aid = {$has: true};
131
+ } else {
132
+ insights.rule.uid = {$has: true};
133
+ }
134
+ const setCondition = (key: string, value: boolean) => {
135
+ insights.rule.findingCondition[key] = value;
136
+ insights.rule.remediatedCondition[key] = !value;
137
+ };
138
+
139
+ switch (kind) {
140
+ case FindingKind.WEB_GATEWAY_NOT_ACTIVE:
141
+ setCondition('meta._findings.loggedIn', false);
142
+ insights.rule.kind = SaasComponentKind.WEB_GATEWAY_SESSION;
143
+ break;
144
+ case FindingKind.VULNERABILITY_OUT_OF_SLA:
145
+ setCondition('meta._findings.overdue', true);
146
+ insights.rule.kind = SaasComponentKind.VULNERABILITY;
147
+ break;
148
+ case FindingKind.TRAINING_OVERDUE:
149
+ setCondition('meta._findings.overdue', true);
150
+ insights.rule.kind = SaasComponentKind.TRAINING_ASSIGNMENT;
151
+ break;
152
+ case FindingKind.FAILED_PHISHING:
153
+ setCondition('meta._findings.failedPhishing', true);
154
+ insights.rule.kind = SaasComponentKind.PHISHING_RESULT;
155
+ break;
156
+ case FindingKind.DEVICE_NOT_MANAGED:
157
+ setCondition('meta._findings.active', false);
158
+ insights.rule.kind = SaasComponentKind.EDR_CONFIG;
159
+ break;
160
+ case FindingKind.MFA_NOT_ENABLED:
161
+ setCondition('meta._findings.enabled', false);
162
+ insights.rule.kind = SaasComponentKind.MFA_CONFIG;
163
+ break;
164
+ case FindingKind.IS_EXECUTIVE:
165
+ setCondition('meta._findings.isExecutive', true);
166
+ insights.rule.kind = SaasComponentKind.GROUP_MEMBERSHIP;
167
+ break;
168
+ case FindingKind.HAS_PRODUCTION_ACCESS:
169
+ setCondition('meta._findings.hasProdAccess', true);
170
+ insights.rule.kind = SaasComponentKind.GROUP_MEMBERSHIP;
171
+ break;
172
+ case FindingKind.HAS_PRIVILEGED_ACCESS:
173
+ setCondition('meta._findings.hasPrivilegedAccess', true);
174
+ insights.rule.kind = SaasComponentKind.GROUP_MEMBERSHIP;
175
+ break;
176
+ default:
177
+ break;
178
+ }
179
+ return insights;
180
+ };
@@ -69,27 +69,31 @@ export const _FindingSpecDto = _BaseDto.extend({
69
69
  severity: z.nativeEnum(FindingSeverity),
70
70
  insights: z
71
71
  .object({
72
- meta: z.object({
73
- kind: z.nativeEnum(FindingKind),
74
- severity: z.nativeEnum(FindingSeverity),
75
- displayValue: z.string(),
76
- }),
77
- rule: z.object({
78
- category: z.nativeEnum(Category),
79
- kind: z.nativeEnum(SaasComponentKind),
80
- aid: z
81
- .object({
82
- $has: z.boolean(),
83
- })
84
- .optional(),
85
- uid: z
86
- .object({
87
- $has: z.boolean(),
88
- })
89
- .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(),
92
- }),
72
+ meta: z
73
+ .object({
74
+ kind: z.nativeEnum(FindingKind),
75
+ severity: z.nativeEnum(FindingSeverity),
76
+ displayValue: z.string(),
77
+ })
78
+ .optional(),
79
+ rule: z
80
+ .object({
81
+ category: z.nativeEnum(Category),
82
+ kind: z.nativeEnum(SaasComponentKind),
83
+ aid: z
84
+ .object({
85
+ $has: z.boolean(),
86
+ })
87
+ .optional(),
88
+ uid: z
89
+ .object({
90
+ $has: z.boolean(),
91
+ })
92
+ .optional(),
93
+ findingCondition: z.record(z.string(), z.union([z.boolean(), z.string(), z.number(), z.undefined()])),
94
+ remediatedCondition: z.record(z.string(), z.union([z.boolean(), z.string(), z.number(), z.undefined()])).optional(),
95
+ })
96
+ .optional(),
93
97
  })
94
98
  .optional(),
95
99
  expireAfterDays: z.nullable(z.number()).optional(),