@ampsec/platform-client 55.7.0 → 55.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/build/src/dto/enums/computer.os.enum.d.ts +5 -0
  2. package/build/src/dto/enums/computer.os.enum.js +11 -0
  3. package/build/src/dto/enums/computer.os.enum.js.map +1 -0
  4. package/build/src/dto/enums/index.d.ts +2 -0
  5. package/build/src/dto/enums/index.js +2 -0
  6. package/build/src/dto/enums/index.js.map +1 -1
  7. package/build/src/dto/enums/mobile.os.enum.d.ts +4 -0
  8. package/build/src/dto/enums/mobile.os.enum.js +10 -0
  9. package/build/src/dto/enums/mobile.os.enum.js.map +1 -0
  10. package/build/src/dto/findingsInsights.dto.d.ts +39 -0
  11. package/build/src/dto/findingsInsights.dto.js +3 -0
  12. package/build/src/dto/findingsInsights.dto.js.map +1 -0
  13. package/build/src/dto/index.d.ts +1 -0
  14. package/build/src/dto/index.js +1 -0
  15. package/build/src/dto/index.js.map +1 -1
  16. package/build/src/dto/platform/index.d.ts +1 -0
  17. package/build/src/dto/platform/index.js +1 -0
  18. package/build/src/dto/platform/index.js.map +1 -1
  19. package/build/src/dto/platform/platform.findingsInsights.dto.d.ts +4 -0
  20. package/build/src/dto/platform/platform.findingsInsights.dto.js +3 -0
  21. package/build/src/dto/platform/platform.findingsInsights.dto.js.map +1 -0
  22. package/build/src/services/AmpApi.d.ts +2 -1
  23. package/build/src/services/AmpApi.js +1 -0
  24. package/build/src/services/AmpApi.js.map +1 -1
  25. package/build/src/services/AmpSdk.d.ts +2 -0
  26. package/build/src/services/AmpSdk.js +1 -0
  27. package/build/src/services/AmpSdk.js.map +1 -1
  28. package/build/src/services/constants.d.ts +1 -0
  29. package/build/src/services/constants.js +1 -0
  30. package/build/src/services/constants.js.map +1 -1
  31. package/build/src/services/contentful.service.d.ts +2 -3
  32. package/build/src/services/contentful.service.js +12 -4
  33. package/build/src/services/contentful.service.js.map +1 -1
  34. package/build/src/settings.d.ts +3 -0
  35. package/build/src/settings.js +4 -0
  36. package/build/src/settings.js.map +1 -1
  37. package/package.json +1 -1
  38. package/src/dto/enums/computer.os.enum.ts +6 -0
  39. package/src/dto/enums/index.ts +2 -0
  40. package/src/dto/enums/mobile.os.enum.ts +5 -0
  41. package/src/dto/findingsInsights.dto.ts +71 -0
  42. package/src/dto/index.ts +1 -0
  43. package/src/dto/platform/index.ts +1 -0
  44. package/src/dto/platform/platform.findingsInsights.dto.ts +6 -0
  45. package/src/services/AmpApi.ts +16 -1
  46. package/src/services/AmpSdk.ts +3 -0
  47. package/src/services/constants.ts +1 -0
  48. package/src/services/contentful.service.ts +13 -7
  49. package/src/settings.ts +5 -0
@@ -0,0 +1,5 @@
1
+ export declare enum ComputerOs {
2
+ MACOS = "MACOS",
3
+ WINDOWS = "WINDOWS",
4
+ LINUX = "LINUX"
5
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ComputerOs = void 0;
4
+ /* eslint-disable no-unused-vars */
5
+ var ComputerOs;
6
+ (function (ComputerOs) {
7
+ ComputerOs["MACOS"] = "MACOS";
8
+ ComputerOs["WINDOWS"] = "WINDOWS";
9
+ ComputerOs["LINUX"] = "LINUX";
10
+ })(ComputerOs || (exports.ComputerOs = ComputerOs = {}));
11
+ //# sourceMappingURL=computer.os.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computer.os.enum.js","sourceRoot":"","sources":["../../../../src/dto/enums/computer.os.enum.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,6BAAe,CAAA;IACf,iCAAmB,CAAA;IACnB,6BAAe,CAAA;AACjB,CAAC,EAJW,UAAU,0BAAV,UAAU,QAIrB"}
@@ -3,6 +3,7 @@ export * from './agent.status';
3
3
  export * from './ampSettingKeys.enum';
4
4
  export * from './callToAction.enum';
5
5
  export * from './category';
6
+ export * from './computer.os.enum';
6
7
  export * from './connector.status';
7
8
  export * from './contact.type';
8
9
  export * from './contentStrategy.kind';
@@ -13,6 +14,7 @@ export * from './finding.status';
13
14
  export * from './finding.outcome';
14
15
  export * from './globalUser.type';
15
16
  export * from './jobExecution.status';
17
+ export * from './mobile.os.enum';
16
18
  export * from './notification.status';
17
19
  export * from './requiredDataProperty.enum';
18
20
  export * from './riskContributor.type';
@@ -19,6 +19,7 @@ __exportStar(require("./agent.status"), exports);
19
19
  __exportStar(require("./ampSettingKeys.enum"), exports);
20
20
  __exportStar(require("./callToAction.enum"), exports);
21
21
  __exportStar(require("./category"), exports);
22
+ __exportStar(require("./computer.os.enum"), exports);
22
23
  __exportStar(require("./connector.status"), exports);
23
24
  __exportStar(require("./contact.type"), exports);
24
25
  __exportStar(require("./contentStrategy.kind"), exports);
@@ -29,6 +30,7 @@ __exportStar(require("./finding.status"), exports);
29
30
  __exportStar(require("./finding.outcome"), exports);
30
31
  __exportStar(require("./globalUser.type"), exports);
31
32
  __exportStar(require("./jobExecution.status"), exports);
33
+ __exportStar(require("./mobile.os.enum"), exports);
32
34
  __exportStar(require("./notification.status"), exports);
33
35
  __exportStar(require("./requiredDataProperty.enum"), exports);
34
36
  __exportStar(require("./riskContributor.type"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/dto/enums/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,iDAA+B;AAC/B,wDAAsC;AACtC,sDAAoC;AACpC,6CAA2B;AAC3B,qDAAmC;AACnC,iDAA+B;AAC/B,yDAAuC;AACvC,0DAAwC;AACxC,gDAA8B;AAC9B,qDAAmC;AACnC,mDAAiC;AACjC,oDAAkC;AAClC,oDAAkC;AAClC,wDAAsC;AACtC,wDAAsC;AACtC,8DAA4C;AAC5C,yDAAuC;AACvC,sDAAoC;AACpC,qEAAmD;AACnD,sDAAoC;AACpC,yDAAuC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/dto/enums/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,iDAA+B;AAC/B,wDAAsC;AACtC,sDAAoC;AACpC,6CAA2B;AAC3B,qDAAmC;AACnC,qDAAmC;AACnC,iDAA+B;AAC/B,yDAAuC;AACvC,0DAAwC;AACxC,gDAA8B;AAC9B,qDAAmC;AACnC,mDAAiC;AACjC,oDAAkC;AAClC,oDAAkC;AAClC,wDAAsC;AACtC,mDAAiC;AACjC,wDAAsC;AACtC,8DAA4C;AAC5C,yDAAuC;AACvC,sDAAoC;AACpC,qEAAmD;AACnD,sDAAoC;AACpC,yDAAuC"}
@@ -0,0 +1,4 @@
1
+ export declare enum MobileOs {
2
+ ANDROID = "ANDROID",
3
+ IOS = "IOS"
4
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MobileOs = void 0;
4
+ /* eslint-disable no-unused-vars */
5
+ var MobileOs;
6
+ (function (MobileOs) {
7
+ MobileOs["ANDROID"] = "ANDROID";
8
+ MobileOs["IOS"] = "IOS";
9
+ })(MobileOs || (exports.MobileOs = MobileOs = {}));
10
+ //# sourceMappingURL=mobile.os.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mobile.os.enum.js","sourceRoot":"","sources":["../../../../src/dto/enums/mobile.os.enum.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,+BAAmB,CAAA;IACnB,uBAAW,CAAA;AACb,CAAC,EAHW,QAAQ,wBAAR,QAAQ,QAGnB"}
@@ -0,0 +1,39 @@
1
+ import { BaseDto, BaseUpsertDto } from './base.dto';
2
+ import { Category, FindingKind } from './enums';
3
+ import { FindingSeverity, FindingStatus } from './enums';
4
+ import { ComputerOs } from './enums/computer.os.enum';
5
+ import { MobileOs } from './enums/mobile.os.enum';
6
+ export type FindingsInsightsUpsertDto = BaseUpsertDto & {
7
+ closed_at?: string;
8
+ category: Category;
9
+ kind: FindingKind;
10
+ status: FindingStatus;
11
+ severity: FindingSeverity;
12
+ number_of_engagements: number;
13
+ title: string;
14
+ description: string;
15
+ provider_name: string;
16
+ user_id: string;
17
+ user_organization: string;
18
+ user_department: string;
19
+ user_title: string;
20
+ user_score: number;
21
+ user_emails: string;
22
+ user_type: string;
23
+ user_name: string;
24
+ user_is_executive: boolean;
25
+ user_has_priv_access: boolean;
26
+ user_has_prod_access: boolean;
27
+ user_mfa_not_enabled: boolean;
28
+ user_has_open_vulns: boolean;
29
+ user_total_open_vulns_count: number;
30
+ user_open_crit_vulns_count: number;
31
+ user_open_high_vulns_count: number;
32
+ user_open_med_vulns_count: number;
33
+ user_open_low_vulns_count: number;
34
+ user_open_failed_phishing_count: number;
35
+ user_open_overdue_training_count: number;
36
+ user_computer_os?: ComputerOs;
37
+ user_mobile_os?: MobileOs;
38
+ };
39
+ export type FindingsInsightsDto = BaseDto & FindingsInsightsUpsertDto;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=findingsInsights.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findingsInsights.dto.js","sourceRoot":"","sources":["../../../src/dto/findingsInsights.dto.ts"],"names":[],"mappings":""}
@@ -10,6 +10,7 @@ export * from './enum.dto';
10
10
  export * from './enums';
11
11
  export * from './extKeyMap.dto';
12
12
  export * from './findings.dto';
13
+ export * from './findingsInsights.dto';
13
14
  export * from './jwt';
14
15
  export * from './message.dto';
15
16
  export * from './notification.dto';
@@ -26,6 +26,7 @@ __exportStar(require("./enum.dto"), exports);
26
26
  __exportStar(require("./enums"), exports);
27
27
  __exportStar(require("./extKeyMap.dto"), exports);
28
28
  __exportStar(require("./findings.dto"), exports);
29
+ __exportStar(require("./findingsInsights.dto"), exports);
29
30
  __exportStar(require("./jwt"), exports);
30
31
  __exportStar(require("./message.dto"), exports);
31
32
  __exportStar(require("./notification.dto"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dto/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,+CAA6B;AAC7B,8CAA4B;AAC5B,6CAA2B;AAC3B,mDAAiC;AACjC,8CAA4B;AAC5B,yDAAuC;AACvC,0DAAwC;AACxC,6CAA2B;AAC3B,0CAAwB;AACxB,kDAAgC;AAChC,iDAA+B;AAC/B,wCAAsB;AACtB,gDAA8B;AAC9B,qDAAmC;AACnC,6CAA2B;AAC3B,6CAA2B;AAC3B,kDAAgC;AAChC,sDAAoC;AACpC,yDAAuC;AACvC,mDAAiC;AACjC,uDAAqC;AACrC,kDAAgC;AAChC,mDAAiC;AACjC,gDAA8B;AAC9B,8CAA4B;AAC5B,iDAA+B;AAC/B,sDAAoC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dto/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,+CAA6B;AAC7B,8CAA4B;AAC5B,6CAA2B;AAC3B,mDAAiC;AACjC,8CAA4B;AAC5B,yDAAuC;AACvC,0DAAwC;AACxC,6CAA2B;AAC3B,0CAAwB;AACxB,kDAAgC;AAChC,iDAA+B;AAC/B,yDAAuC;AACvC,wCAAsB;AACtB,gDAA8B;AAC9B,qDAAmC;AACnC,6CAA2B;AAC3B,6CAA2B;AAC3B,kDAAgC;AAChC,sDAAoC;AACpC,yDAAuC;AACvC,mDAAiC;AACjC,uDAAqC;AACrC,kDAAgC;AAChC,mDAAiC;AACjC,gDAA8B;AAC9B,8CAA4B;AAC5B,iDAA+B;AAC/B,sDAAoC"}
@@ -1,6 +1,7 @@
1
1
  export * from './platform.agents.dto';
2
2
  export * from './platform.assets.dto';
3
3
  export * from './platform.connectors.dto';
4
+ export * from './platform.findingsInsights.dto';
4
5
  export * from './platform.findings.dto';
5
6
  export * from './platform.jobExecutionState.dto';
6
7
  export * from './platform.jobSpec.dto';
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./platform.agents.dto"), exports);
18
18
  __exportStar(require("./platform.assets.dto"), exports);
19
19
  __exportStar(require("./platform.connectors.dto"), exports);
20
+ __exportStar(require("./platform.findingsInsights.dto"), exports);
20
21
  __exportStar(require("./platform.findings.dto"), exports);
21
22
  __exportStar(require("./platform.jobExecutionState.dto"), exports);
22
23
  __exportStar(require("./platform.jobSpec.dto"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/dto/platform/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,wDAAsC;AACtC,4DAA0C;AAC1C,0DAAwC;AACxC,mEAAiD;AACjD,yDAAuC;AACvC,8DAA4C;AAC5C,2DAAyC;AACzC,+DAA6C;AAC7C,iEAA+C;AAC/C,4DAA0C;AAC1C,gEAA8C;AAC9C,2DAAyC;AACzC,4DAA0C;AAC1C,yDAAuC;AACvC,uDAAqC;AACrC,qDAAmC;AACnC,0DAAwC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/dto/platform/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,wDAAsC;AACtC,4DAA0C;AAC1C,kEAAgD;AAChD,0DAAwC;AACxC,mEAAiD;AACjD,yDAAuC;AACvC,8DAA4C;AAC5C,2DAAyC;AACzC,+DAA6C;AAC7C,iEAA+C;AAC/C,4DAA0C;AAC1C,gEAA8C;AAC9C,2DAAyC;AACzC,4DAA0C;AAC1C,yDAAuC;AACvC,uDAAqC;AACrC,qDAAmC;AACnC,0DAAwC"}
@@ -0,0 +1,4 @@
1
+ import { FindingsInsightsDto, FindingsInsightsUpsertDto } from '../findingsInsights.dto';
2
+ import { TenantBased, UpsertTenantBased } from './tenant.based.dto';
3
+ export type PlatformFindingsInsightsUpsertDto = FindingsInsightsUpsertDto & UpsertTenantBased;
4
+ export type PlatformFindingsInsightsDto = FindingsInsightsDto & TenantBased;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=platform.findingsInsights.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform.findingsInsights.dto.js","sourceRoot":"","sources":["../../../../src/dto/platform/platform.findingsInsights.dto.ts"],"names":[],"mappings":""}
@@ -1,4 +1,4 @@
1
- import { AgentDto, AgentUpsertDto, AssetDto, ProviderDto, ReportResultDto, SaasAssetDto, SaasComponentDto, SaasUserDto, TenantDto, TenantUpsertDto, UserDto } from '../dto';
1
+ import { AgentDto, AgentUpsertDto, AssetDto, FindingsInsightsDto, ProviderDto, ReportResultDto, SaasAssetDto, SaasComponentDto, SaasUserDto, TenantDto, TenantUpsertDto, UserDto } from '../dto';
2
2
  import { AmpEntityService, AmpDataService, AmpReportService, AmpSettingsService, ConnectorsService, FindingsService, NotificationService } from '.';
3
3
  import { AmpRestClientOptions, AgentIdentityService, ConnectorInstallService, EnumService, RestClient } from './rest';
4
4
  export type AmpApiOptions = AmpRestClientOptions;
@@ -20,6 +20,7 @@ export declare class AmpApi {
20
20
  readonly connectors: ConnectorsService;
21
21
  readonly enums: EnumService;
22
22
  readonly findings: FindingsService;
23
+ readonly findingsInsights: AmpDataService<FindingsInsightsDto>;
23
24
  readonly identity: AgentIdentityService;
24
25
  readonly install: ConnectorInstallService;
25
26
  readonly notifications: NotificationService;
@@ -23,6 +23,7 @@ class AmpApi {
23
23
  this.connectors = new _1.ConnectorsService(rest);
24
24
  this.enums = new rest_1.DefaultEnumService(rest);
25
25
  this.findings = new _1.FindingsService(rest);
26
+ this.findingsInsights = new _1.AmpDataServiceImpl(rest, constants_1.KIND.FINDINGS_INSIGHTS);
26
27
  this.identity = new rest_1.AgentIdentityService(rest);
27
28
  this.install = new rest_1.ConnectorInstallService(rest, constants_1.TARGET_API_AGENT);
28
29
  this.notifications = new _1.NotificationService(rest);
@@ -1 +1 @@
1
- {"version":3,"file":"AmpApi.js","sourceRoot":"","sources":["../../../src/services/AmpApi.ts"],"names":[],"mappings":";;;AACA,wBAWW;AACX,2CAAmD;AACnD,iCAA0J;AAI1J;;;;;;;;;;;GAWG;AACH,MAAa,MAAM;IAmBjB,YAAY,IAAgB;QAC1B,IAAI,CAAC,MAAM,GAAG,IAAI,uBAAoB,CAA2B,IAAI,EAAE,gBAAI,CAAC,MAAM,CAAC,CAAC;QACpF,IAAI,CAAC,KAAK,GAAG,IAAI,qBAAkB,CAAW,IAAI,EAAE,gBAAI,CAAC,MAAM,CAAC,CAAC;QACjE,IAAI,CAAC,UAAU,GAAG,IAAI,oBAAiB,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAI,CAAC,KAAK,GAAG,IAAI,yBAAkB,CAAC,IAAI,CAAC,CAAC;QAC1C,IAAI,CAAC,QAAQ,GAAG,IAAI,kBAAe,CAAC,IAAI,CAAC,CAAC;QAC1C,IAAI,CAAC,QAAQ,GAAG,IAAI,2BAAoB,CAAC,IAAI,CAAC,CAAC;QAC/C,IAAI,CAAC,OAAO,GAAG,IAAI,8BAAuB,CAAC,IAAI,EAAE,4BAAgB,CAAC,CAAC;QACnE,IAAI,CAAC,aAAa,GAAG,IAAI,sBAAmB,CAAC,IAAI,CAAC,CAAC;QACnD,IAAI,CAAC,SAAS,GAAG,IAAI,qBAAkB,CAAc,IAAI,EAAE,gBAAI,CAAC,SAAS,CAAC,CAAC;QAC3E,IAAI,CAAC,aAAa,GAAG,IAAI,qBAAkB,CAAkB,IAAI,EAAE,gBAAI,CAAC,cAAc,CAAC,CAAC;QACxF,IAAI,CAAC,OAAO,GAAG,IAAI,uBAAoB,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAI,CAAC,UAAU,GAAG,IAAI,qBAAkB,CAAe,IAAI,EAAE,gBAAI,CAAC,WAAW,CAAC,CAAC;QAC/E,IAAI,CAAC,c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AAI,MAAM,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CACF;AA7CD,wBA6CC"}
@@ -7,6 +7,7 @@ import { EnumService } from './rest/EnumService';
7
7
  import { AmpSdkSettingsService } from './settings.service';
8
8
  import { AmpSaaSEntityService, AmpSdkSaasAssetService, AmpSdkSaasComponentService, AmpSdkSaasUserService } from './saasEntity.service';
9
9
  import { ContentfulService } from './contentful.service';
10
+ import { PlatformFindingsInsightsDto, PlatformFindingsInsightsUpsertDto } from '../dto/platform/platform.findingsInsights.dto';
10
11
  export type AmpSdkOptions = AmpRestClientOptions;
11
12
  /**
12
13
  * AMP API
@@ -24,6 +25,7 @@ export declare class AmpSdkServices {
24
25
  readonly contentful: ContentfulService;
25
26
  readonly enums: EnumService;
26
27
  readonly findings: AmpSaaSEntityService<PlatformFindingUpsertDto, PlatformFindingDto>;
28
+ readonly findingsInsights: AmpSaaSEntityService<PlatformFindingsInsightsUpsertDto, PlatformFindingsInsightsDto>;
27
29
  readonly jobExecutions: AmpEntityService<PlatformJobExecutionStateUpsertDto, PlatformJobExecutionStateDto>;
28
30
  readonly jobs: AmpEntityService<PlatformJobSpecUpsertDto, PlatformJobSpecDto>;
29
31
  readonly notifications: AmpEntityService<PlatformNotificationUpsertDto, PlatformNotificationDto>;
@@ -25,6 +25,7 @@ class AmpSdkServices {
25
25
  this.contentful = new contentful_service_1.ContentfulService();
26
26
  this.enums = new EnumService_1.DefaultEnumService(rest, constants_1.TARGET_API_PLATFORM);
27
27
  this.findings = new saasEntity_service_1.AmpSaaSEntityServiceImpl(rest, constants_1.KIND.FINDINGS, constants_1.TARGET_API_PLATFORM);
28
+ this.findingsInsights = new saasEntity_service_1.AmpSaaSEntityServiceImpl(rest, constants_1.KIND.FINDINGS_INSIGHTS, constants_1.TARGET_API_PLATFORM);
28
29
  this.jobExecutions = new entity_service_1.AmpEntityServiceImpl(rest, constants_1.KIND.JOB_EXECUTIONS, constants_1.TARGET_API_PLATFORM);
29
30
  this.jobs = new entity_service_1.AmpEntityServiceImpl(rest, constants_1.KIND.JOB_SPEC, constants_1.TARGET_API_PLATFORM);
30
31
  this.notifications = new entity_service_1.AmpEntityServiceImpl(rest, constants_1.KIND.NOTIFICATIONS, constants_1.TARGET_API_PLATFORM);
@@ -1 +1 @@
1
- {"version":3,"file":"AmpSdk.js","sourceRoot":"","sources":["../../../src/services/AmpSdk.ts"],"names":[],"mappings":";;;AAoBA,qDAAoI;AACpI,iCAA0E;AAC1E,2CAAsD;AAGtD,oDAAmE;AACnE,yDAAyD;AACzD,6DAA+J;AAC/J,6DAAuD;AAIvD;;;;;;;;GAQG;AACH,MAAa,cAAc;IAqBzB,YAAY,IAAgB;QAC1B,IAAI,CAAC,MAAM,GAAG,IAAI,qCAAoB,CAA2C,IAAI,EAAE,gBAAI,CAAC,MAAM,EAAE,+BAAmB,CAAC,CAAC;QACzH,IAAI,CAAC,KAAK,GAAG,IAAI,mCAAkB,CAAC,IAAI,EAAE,+BAAmB,CAAC,CAAC;QAC/D,IAAI,CAAC,UAAU,GAAG,IAAI,qCAAoB,CAAmD,IAAI,EAAE,gBAAI,CAAC,UAAU,EAAE,+BAAmB,CAAC,CAAC;QACzI,IAAI,CAAC,UAAU,GAAG,IAAI,sCAAiB,EAAE,CAAC;QAC1C,IAAI,CAAC,KAAK,GAAG,IAAI,gCAAkB,CAAC,IAAI,EAAE,+BAAmB,CAAC,CAAC;QAC/D,IAAI,CAAC,QAAQ,GAAG,IAAI,6CAAwB,CAA+C,IAAI,EAAE,gBAAI,CAAC,QAAQ,EAAE,+BAAmB,CAAC,CAAC;QACrI,IAAI,CAAC,aAAa,GAAG,IAAI,qCAAoB,CAAmE,IAAI,EAAE,gBAAI,CAAC,cAAc,EAAE,+BAAmB,CAAC,CAAC;QAChK,IAAI,CAAC,IAAI,GAAG,IAAI,qCAAoB,CAA+C,IAAI,EAAE,gBAAI,CAAC,QAAQ,EAAE,+BAAmB,CAAC,CAAC;QAC7H,IAAI,CAAC,aAAa,GAAG,I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IZATIONS: string;
15
15
  ENUM_TITLES: string;
16
16
  FINDINGS: string;
17
+ FINDINGS_INSIGHTS: string;
17
18
  JOB_EXECUTIONS: string;
18
19
  JOB_SPEC: string;
19
20
  NOTIFICATIONS: string;
@@ -13,6 +13,7 @@ exports.KIND = {
13
13
  ENUM_ORGANIZATIONS: 'organizations',
14
14
  ENUM_TITLES: 'titles',
15
15
  FINDINGS: 'findings',
16
+ FINDINGS_INSIGHTS: 'findings_insights',
16
17
  JOB_EXECUTIONS: 'job_executions',
17
18
  JOB_SPEC: 'jobs',
18
19
  NOTIFICATIONS: 'notifications',
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/services/constants.ts"],"names":[],"mappings":";;;AAIa,QAAA,2BAA2B,GAAG,CAAC,CAAC;AAGhC,QAAA,mBAAmB,GAAc,UAAU,CAAC;AAC5C,QAAA,gBAAgB,GAAc,KAAK,CAAC;AACpC,QAAA,iBAAiB,GAAc,KAAK,CAAC;AAErC,QAAA,IAAI,GAAG;IAClB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,YAAY;IACxB,gBAAgB,EAAE,aAAa;IAC/B,kBAAkB,EAAE,eAAe;IACnC,WAAW,EAAE,QAAQ;IACrB,QAAQ,EAAE,UAAU;IACpB,cAAc,EAAE,gBAAgB;IAChC,QAAQ,EAAE,MAAM;IAChB,aAAa,EAAE,eAAe;IAC9B,SAAS,EAAE,WAAW;IACtB,cAAc,EAAE,gBAAgB;IAChC,iBAAiB,EAAE,mBAAmB;IACtC,WAAW,EAAE,aAAa;IAC1B,eAAe,EAAE,iBAAiB;IAClC,UAAU,EAAE,YAAY;IACxB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,iBAAiB,EAAE,mBAAmB;CACvC,CAAC;AAEW,QAAA,OAAO,GAAG;IACrB,YAAY,EAAE,cAAc;IAC5B,yBAAyB,EAAE,qCAAqC;IAChE,yBAAyB,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EAAE,mBAAmB;IACtC,qBAAqB,EAAE,uBAAuB;IAC9C,2BAA2B,EAAE,6BAA6B;IAC1D,YAAY,EAAE,0BAA0B;IACxC,qBAAqB,EAAE,uBAAuB;IAC9C,gBAAgB,EAAE,kBAAkB;IACpC,WAAW,EAAE,aAAa;IAC1B,mBAAmB;IACnB,kBAAkB,EAAE,sBAAsB;CAC3C,CAAC"}
@@ -1,5 +1,4 @@
1
- import type { Entry, EntrySkeletonType, EntryFieldTypes, EntryCollection } from 'contentful/dist/types';
2
- import * as contentful from 'contentful';
1
+ import type { Entry, EntrySkeletonType, EntryFieldTypes, EntryCollection, ContentfulClientApi } from 'contentful/dist/types';
3
2
  export type MessageTemplate = EntrySkeletonType & {
4
3
  contentTypeId: 'messageTemplate';
5
4
  fields: {
@@ -20,7 +19,7 @@ export type MessageTemplate = EntrySkeletonType & {
20
19
  * If these are not set, a warning will be logged.
21
20
  **/
22
21
  export declare class ContentfulService {
23
- protected readonly contentfulClient: contentful.ContentfulClientApi<undefined>;
22
+ protected readonly contentfulClient: ContentfulClientApi<undefined> | undefined;
24
23
  /**
25
24
  * This contructs the ContentfulService. The following environment variables
26
25
  * must be set:
@@ -50,6 +50,9 @@ class ContentfulService {
50
50
  return messageTemplates;
51
51
  };
52
52
  this.getContentfulEntries = async (contentType, include) => {
53
+ if (!this.contentfulClient) {
54
+ throw new Error('Contenful client not initialized because of missing configurations: CONTENTFUL_SPACE_ID and CONTENTFUL_ACCESS_TOKEN must be set in the environment');
55
+ }
53
56
  const entries = await this.contentfulClient.getEntries({
54
57
  content_type: contentType,
55
58
  ...(include ? { include } : {}),
@@ -57,16 +60,21 @@ class ContentfulService {
57
60
  return entries;
58
61
  };
59
62
  this.getContentfulEntry = async (entryId) => {
63
+ if (!this.contentfulClient) {
64
+ throw new Error('Contenful client not initialized because of missing configurations: CONTENTFUL_SPACE_ID and CONTENTFUL_ACCESS_TOKEN must be set in the environment');
65
+ }
60
66
  const entry = await this.contentfulClient.getEntry(entryId);
61
67
  return entry;
62
68
  };
63
69
  if (!process.env.CONTENTFUL_SPACE_ID || !process.env.CONTENTFUL_ACCESS_TOKEN) {
64
70
  console.warn('CONTENTFUL_SPACE_ID and CONTENTFUL_ACCESS_TOKEN must be set in the environment');
65
71
  }
66
- this.contentfulClient = contentful.createClient({
67
- space: process.env.CONTENTFUL_SPACE_ID || '',
68
- accessToken: process.env.CONTENTFUL_ACCESS_TOKEN || '',
69
- });
72
+ else {
73
+ this.contentfulClient = contentful.createClient({
74
+ space: process.env.CONTENTFUL_SPACE_ID || '',
75
+ accessToken: process.env.CONTENTFUL_ACCESS_TOKEN || '',
76
+ });
77
+ }
70
78
  }
71
79
  }
72
80
  exports.ContentfulService = ContentfulService;
@@ -1 +1 @@
1
- {"version":3,"file":"contentful.service.js","sourceRoot":"","sources":["../../../src/services/contentful.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,uDAAyC;AAYzC;;;;;;;;;IASI;AACJ,MAAa,iBAAiB;IAE5B;;;;;;;OAOG;IACH;QAWA,wBAAmB,GAAG,KAAK,IAA+C,EAAE;YAC1E,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAkB,iBAAiB,EAAE,CAAC,CAAC,CAAC;YAChG,OAAO,gBAAgB,CAAC;QAC1B,CAAC,CAAC;QAEF,yBAAoB,GAAG,KAAK,EAA+B,WAAmB,EAAE,OAAgB,EAA+B,EAAE;YAC/H,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAI;gBACxD,YAAY,EAAE,WAAW;gBACzB,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAC,OAAO,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC;aAC9B,CAAC,CAAC;YACH,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC;QAEF,uBAAkB,GAAG,KAAK,EAA+B,OAAe,EAAqB,EAAE;YAC7F,MAAM,KAAK,GAAG,MAAM,IAA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AC;YACH,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC;QAEF,uBAAkB,GAAG,KAAK,EAA+B,OAAe,EAAqB,EAAE;YAC7F,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;gBAC1B,MAAM,IAAI,KAAK,CAAC,oJAAoJ,CAAC,CAAC;aACvK;YACD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAI,OAAO,CAAC,CAAC;YAC/D,OAAO,KAAK,CAAC;QACf,CAAC,CAAC;QAhCA,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE;YAC5E,OAAO,CAAC,IAAI,CAAC,gFAAgF,CAAC,CAAC;SAChG;aAAM;YACL,IAAI,CAAC,gBAAgB,GAAG,UAAU,CAAC,YAAY,CAAC;gBAC9C,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,EAAE;gBAC5C,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,uBAAuB,IAAI,EAAE;aACvD,CAAC,CAAC;SACJ;IACH,CAAC;CAyBF;AA5CD,8CA4CC"}
@@ -77,4 +77,7 @@ export declare const AMP_SETTINGS: {
77
77
  SLACK_CONTACT_SECURITY_CHANNEL: import("./services").TypedAmpSettingsKey<string | undefined>;
78
78
  SLACK_CONTACT_SECURITY_TEMPLATE: import("./services").TypedAmpSettingsKey<string>;
79
79
  };
80
+ knowBe4: {
81
+ KNOWBE4_PHISHING_EXP: import("./services").TypedAmpSettingsKey<string>;
82
+ };
80
83
  };
@@ -48,6 +48,9 @@ const GOOGLE_SETTINGS = {
48
48
  GOOGLE_PRIV_ACCESS_GROUPS: services_1.AmpSettingsMap.asKey('google.groups.priv.extIds', []),
49
49
  GOOGLE_SERV_ACCT_GROUPS: services_1.AmpSettingsMap.asKey('google.groups.servAcct.extIds', []),
50
50
  };
51
+ const KNOWBE4_SETTINGS = {
52
+ KNOWBE4_PHISHING_EXP: services_1.AmpSettingsMap.asKey('knowbe4.phising.expiration', '90 days'),
53
+ };
51
54
  const OKTA_SETTINGS = {
52
55
  OKTA_EXECUTIVE_GROUPS: services_1.AmpSettingsMap.asKey('okta.groups.exec.extIds', []),
53
56
  OKTA_PROD_ACCESS_GROUPS: services_1.AmpSettingsMap.asKey('okta.groups.prod.extIds', []),
@@ -105,5 +108,6 @@ exports.AMP_SETTINGS = {
105
108
  google: { ...GOOGLE_SETTINGS },
106
109
  okta: { ...OKTA_SETTINGS },
107
110
  slack: { ...SLACK_SETTINGS },
111
+ knowBe4: { ...KNOWBE4_SETTINGS },
108
112
  };
109
113
  //# sourceMappingURL=settings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../src/settings.ts"],"names":[],"mappings":";;;AACA,yCAA0C;AAE1C;;2BAE2B;AAC3B;;;;GAIG;AACH,MAAM,eAAe,GAAG;IACtB,oEAAoE;IACpE,UAAU,EAAE,yBAAc,CAAC,KAAK,CAAU,iCAAiC,EAAE,IAAI,CAAC;IAClF,4CAA4C;IAC5C,YAAY,EAAE,yBAAc,CAAC,KAAK,CAAU,eAAe,EAAE,KAAK,CAAC;IACnE,sDAAsD;IACtD,mBAAmB,EAAE,yBAAc,CAAC,KAAK,CAAsB,0BAA0B,CAAC;IAC1F;;;;;;;OAOG;IACH,cAAc,EAAE,yBAAc,CAAC,KAAK,CAAS,iBAAiB,EAAE,SAAS,CAAC;IAC1E;;OAEG;IACH,mBAAmB,EAAE,yBAAc,CAAC,KAAK,CAAS,yBAAyB,CAAC;CAC7E,CAAC;AAEF;;;GAGG;AACH,MAAM,iCAAiC,GAAG;IACxC,0CAA0C;IAC1C,qBAAqB,EAAE,yBAAc,CAAC,KAAK,CAAU,uBAAuB,EAAE,KAAK,CAAC;CACrF,CAAC;AAEF;;sBAEsB;AACtB,MAAM,eAAe,GAAG;IACtB,uBAAuB,EAAE,yBAAc,CAAC,KAAK,CAAW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EAAE,yBAAc,CAAC,KAAK,CAAkC,kCAAkC,CAAC;KAC7H;IACD;;;OAGG;IACH,iBAAiB,EAAE;QACjB,GAAG,iCAAiC;KACrC;IACD;;0BAEsB;IACtB,MAAM,EAAE,EAAC,GAAG,eAAe,EAAC;IAC5B,IAAI,EAAE,EAAC,GAAG,aAAa,EAAC;IACxB,KAAK,EAAE,EAAC,GAAG,cAAc,EAAC;IAC1B,OAAO,EAAE,EAAC,GAAG,gBAAgB,EAAC;CAC/B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ampsec/platform-client",
3
- "version": "55.7.0",
3
+ "version": "55.8.0",
4
4
  "description": "",
5
5
  "main": "build/src/index.js",
6
6
  "runkitExampleFilename": "example/main.js",
@@ -0,0 +1,6 @@
1
+ /* eslint-disable no-unused-vars */
2
+ export enum ComputerOs {
3
+ MACOS = 'MACOS',
4
+ WINDOWS = 'WINDOWS',
5
+ LINUX = 'LINUX',
6
+ }
@@ -3,6 +3,7 @@ export * from './agent.status';
3
3
  export * from './ampSettingKeys.enum';
4
4
  export * from './callToAction.enum';
5
5
  export * from './category';
6
+ export * from './computer.os.enum';
6
7
  export * from './connector.status';
7
8
  export * from './contact.type';
8
9
  export * from './contentStrategy.kind';
@@ -13,6 +14,7 @@ export * from './finding.status';
13
14
  export * from './finding.outcome';
14
15
  export * from './globalUser.type';
15
16
  export * from './jobExecution.status';
17
+ export * from './mobile.os.enum';
16
18
  export * from './notification.status';
17
19
  export * from './requiredDataProperty.enum';
18
20
  export * from './riskContributor.type';
@@ -0,0 +1,5 @@
1
+ /* eslint-disable no-unused-vars */
2
+ export enum MobileOs {
3
+ ANDROID = 'ANDROID',
4
+ IOS = 'IOS',
5
+ }
@@ -0,0 +1,71 @@
1
+ import {BaseDto, BaseUpsertDto} from './base.dto';
2
+ import {Category, FindingKind} from './enums';
3
+ import {FindingSeverity, FindingStatus} from './enums';
4
+ import {ComputerOs} from './enums/computer.os.enum';
5
+ import {MobileOs} from './enums/mobile.os.enum';
6
+
7
+ export type FindingsInsightsUpsertDto = BaseUpsertDto & {
8
+ closed_at?: string;
9
+
10
+ category: Category;
11
+
12
+ kind: FindingKind;
13
+
14
+ status: FindingStatus;
15
+
16
+ severity: FindingSeverity;
17
+
18
+ number_of_engagements: number;
19
+
20
+ title: string;
21
+
22
+ description: string;
23
+
24
+ provider_name: string;
25
+
26
+ user_id: string;
27
+
28
+ user_organization: string;
29
+
30
+ user_department: string;
31
+
32
+ user_title: string;
33
+
34
+ user_score: number;
35
+
36
+ user_emails: string;
37
+
38
+ user_type: string;
39
+
40
+ user_name: string;
41
+
42
+ user_is_executive: boolean;
43
+
44
+ user_has_priv_access: boolean;
45
+
46
+ user_has_prod_access: boolean;
47
+
48
+ user_mfa_not_enabled: boolean;
49
+
50
+ user_has_open_vulns: boolean;
51
+
52
+ user_total_open_vulns_count: number;
53
+
54
+ user_open_crit_vulns_count: number;
55
+
56
+ user_open_high_vulns_count: number;
57
+
58
+ user_open_med_vulns_count: number;
59
+
60
+ user_open_low_vulns_count: number;
61
+
62
+ user_open_failed_phishing_count: number;
63
+
64
+ user_open_overdue_training_count: number;
65
+
66
+ user_computer_os?: ComputerOs;
67
+
68
+ user_mobile_os?: MobileOs;
69
+ };
70
+
71
+ export type FindingsInsightsDto = BaseDto & FindingsInsightsUpsertDto;
package/src/dto/index.ts CHANGED
@@ -10,6 +10,7 @@ export * from './enum.dto';
10
10
  export * from './enums';
11
11
  export * from './extKeyMap.dto';
12
12
  export * from './findings.dto';
13
+ export * from './findingsInsights.dto';
13
14
  export * from './jwt';
14
15
  export * from './message.dto';
15
16
  export * from './notification.dto';
@@ -1,6 +1,7 @@
1
1
  export * from './platform.agents.dto';
2
2
  export * from './platform.assets.dto';
3
3
  export * from './platform.connectors.dto';
4
+ export * from './platform.findingsInsights.dto';
4
5
  export * from './platform.findings.dto';
5
6
  export * from './platform.jobExecutionState.dto';
6
7
  export * from './platform.jobSpec.dto';
@@ -0,0 +1,6 @@
1
+ import {FindingsInsightsDto, FindingsInsightsUpsertDto} from '../findingsInsights.dto';
2
+ import {TenantBased, UpsertTenantBased} from './tenant.based.dto';
3
+
4
+ export type PlatformFindingsInsightsUpsertDto = FindingsInsightsUpsertDto & UpsertTenantBased;
5
+
6
+ export type PlatformFindingsInsightsDto = FindingsInsightsDto & TenantBased;
@@ -1,4 +1,17 @@
1
- import {AgentDto, AgentUpsertDto, AssetDto, ProviderDto, ReportResultDto, SaasAssetDto, SaasComponentDto, SaasUserDto, TenantDto, TenantUpsertDto, UserDto} from '../dto';
1
+ import {
2
+ AgentDto,
3
+ AgentUpsertDto,
4
+ AssetDto,
5
+ FindingsInsightsDto,
6
+ ProviderDto,
7
+ ReportResultDto,
8
+ SaasAssetDto,
9
+ SaasComponentDto,
10
+ SaasUserDto,
11
+ TenantDto,
12
+ TenantUpsertDto,
13
+ UserDto,
14
+ } from '../dto';
2
15
  import {
3
16
  AmpEntityService,
4
17
  AmpEntityServiceImpl,
@@ -34,6 +47,7 @@ export class AmpApi {
34
47
  readonly connectors: ConnectorsService;
35
48
  readonly enums: EnumService;
36
49
  readonly findings: FindingsService;
50
+ readonly findingsInsights: AmpDataService<FindingsInsightsDto>;
37
51
  readonly identity: AgentIdentityService;
38
52
  readonly install: ConnectorInstallService;
39
53
  readonly notifications: NotificationService;
@@ -53,6 +67,7 @@ export class AmpApi {
53
67
  this.connectors = new ConnectorsService(rest);
54
68
  this.enums = new DefaultEnumService(rest);
55
69
  this.findings = new FindingsService(rest);
70
+ this.findingsInsights = new AmpDataServiceImpl<FindingsInsightsDto>(rest, KIND.FINDINGS_INSIGHTS);
56
71
  this.identity = new AgentIdentityService(rest);
57
72
  this.install = new ConnectorInstallService(rest, TARGET_API_AGENT);
58
73
  this.notifications = new NotificationService(rest);
@@ -27,6 +27,7 @@ import {DefaultEnumService, EnumService} from './rest/EnumService';
27
27
  import {AmpSdkSettingsService} from './settings.service';
28
28
  import {AmpSaaSEntityService, AmpSaaSEntityServiceImpl, AmpSdkSaasAssetService, AmpSdkSaasComponentService, AmpSdkSaasUserService} from './saasEntity.service';
29
29
  import {ContentfulService} from './contentful.service';
30
+ import {PlatformFindingsInsightsDto, PlatformFindingsInsightsUpsertDto} from '../dto/platform/platform.findingsInsights.dto';
30
31
 
31
32
  export type AmpSdkOptions = AmpRestClientOptions;
32
33
 
@@ -46,6 +47,7 @@ export class AmpSdkServices {
46
47
  readonly contentful: ContentfulService;
47
48
  readonly enums: EnumService;
48
49
  readonly findings: AmpSaaSEntityService<PlatformFindingUpsertDto, PlatformFindingDto>;
50
+ readonly findingsInsights: AmpSaaSEntityService<PlatformFindingsInsightsUpsertDto, PlatformFindingsInsightsDto>;
49
51
  readonly jobExecutions: AmpEntityService<PlatformJobExecutionStateUpsertDto, PlatformJobExecutionStateDto>;
50
52
  readonly jobs: AmpEntityService<PlatformJobSpecUpsertDto, PlatformJobSpecDto>;
51
53
  readonly notifications: AmpEntityService<PlatformNotificationUpsertDto, PlatformNotificationDto>;
@@ -67,6 +69,7 @@ export class AmpSdkServices {
67
69
  this.contentful = new ContentfulService();
68
70
  this.enums = new DefaultEnumService(rest, TARGET_API_PLATFORM);
69
71
  this.findings = new AmpSaaSEntityServiceImpl<PlatformFindingUpsertDto, PlatformFindingDto>(rest, KIND.FINDINGS, TARGET_API_PLATFORM);
72
+ this.findingsInsights = new AmpSaaSEntityServiceImpl<PlatformFindingsInsightsUpsertDto, PlatformFindingsInsightsDto>(rest, KIND.FINDINGS_INSIGHTS, TARGET_API_PLATFORM);
70
73
  this.jobExecutions = new AmpEntityServiceImpl<PlatformJobExecutionStateUpsertDto, PlatformJobExecutionStateDto>(rest, KIND.JOB_EXECUTIONS, TARGET_API_PLATFORM);
71
74
  this.jobs = new AmpEntityServiceImpl<PlatformJobSpecUpsertDto, PlatformJobSpecDto>(rest, KIND.JOB_SPEC, TARGET_API_PLATFORM);
72
75
  this.notifications = new AmpEntityServiceImpl<PlatformNotificationUpsertDto, PlatformNotificationDto>(rest, KIND.NOTIFICATIONS, TARGET_API_PLATFORM);
@@ -17,6 +17,7 @@ export const KIND = {
17
17
  ENUM_ORGANIZATIONS: 'organizations',
18
18
  ENUM_TITLES: 'titles',
19
19
  FINDINGS: 'findings',
20
+ FINDINGS_INSIGHTS: 'findings_insights',
20
21
  JOB_EXECUTIONS: 'job_executions',
21
22
  JOB_SPEC: 'jobs',
22
23
  NOTIFICATIONS: 'notifications',
@@ -1,4 +1,4 @@
1
- import type {Entry, EntrySkeletonType, EntryFieldTypes, EntryCollection} from 'contentful/dist/types';
1
+ import type {Entry, EntrySkeletonType, EntryFieldTypes, EntryCollection, ContentfulClientApi} from 'contentful/dist/types';
2
2
  import * as contentful from 'contentful';
3
3
 
4
4
  export type MessageTemplate = EntrySkeletonType & {
@@ -22,7 +22,7 @@ export type MessageTemplate = EntrySkeletonType & {
22
22
  * If these are not set, a warning will be logged.
23
23
  **/
24
24
  export class ContentfulService {
25
- protected readonly contentfulClient;
25
+ protected readonly contentfulClient: ContentfulClientApi<undefined> | undefined;
26
26
  /**
27
27
  * This contructs the ContentfulService. The following environment variables
28
28
  * must be set:
@@ -34,12 +34,12 @@ export class ContentfulService {
34
34
  constructor() {
35
35
  if (!process.env.CONTENTFUL_SPACE_ID || !process.env.CONTENTFUL_ACCESS_TOKEN) {
36
36
  console.warn('CONTENTFUL_SPACE_ID and CONTENTFUL_ACCESS_TOKEN must be set in the environment');
37
+ } else {
38
+ this.contentfulClient = contentful.createClient({
39
+ space: process.env.CONTENTFUL_SPACE_ID || '',
40
+ accessToken: process.env.CONTENTFUL_ACCESS_TOKEN || '',
41
+ });
37
42
  }
38
-
39
- this.contentfulClient = contentful.createClient({
40
- space: process.env.CONTENTFUL_SPACE_ID || '',
41
- accessToken: process.env.CONTENTFUL_ACCESS_TOKEN || '',
42
- });
43
43
  }
44
44
 
45
45
  getMessageTemplates = async (): Promise<EntryCollection<MessageTemplate>> => {
@@ -48,6 +48,9 @@ export class ContentfulService {
48
48
  };
49
49
 
50
50
  getContentfulEntries = async <T extends EntrySkeletonType>(contentType: string, include?: number): Promise<EntryCollection<T>> => {
51
+ if (!this.contentfulClient) {
52
+ throw new Error('Contenful client not initialized because of missing configurations: CONTENTFUL_SPACE_ID and CONTENTFUL_ACCESS_TOKEN must be set in the environment');
53
+ }
51
54
  const entries = await this.contentfulClient.getEntries<T>({
52
55
  content_type: contentType,
53
56
  ...(include ? {include} : {}),
@@ -56,6 +59,9 @@ export class ContentfulService {
56
59
  };
57
60
 
58
61
  getContentfulEntry = async <T extends EntrySkeletonType>(entryId: string): Promise<Entry<T>> => {
62
+ if (!this.contentfulClient) {
63
+ throw new Error('Contenful client not initialized because of missing configurations: CONTENTFUL_SPACE_ID and CONTENTFUL_ACCESS_TOKEN must be set in the environment');
64
+ }
59
65
  const entry = await this.contentfulClient.getEntry<T>(entryId);
60
66
  return entry;
61
67
  };
package/src/settings.ts CHANGED
@@ -50,6 +50,10 @@ const GOOGLE_SETTINGS = {
50
50
  GOOGLE_SERV_ACCT_GROUPS: AmpSettingsMap.asKey<string[]>('google.groups.servAcct.extIds', []),
51
51
  };
52
52
 
53
+ const KNOWBE4_SETTINGS = {
54
+ KNOWBE4_PHISHING_EXP: AmpSettingsMap.asKey<string>('knowbe4.phising.expiration', '90 days'),
55
+ };
56
+
53
57
  const OKTA_SETTINGS = {
54
58
  OKTA_EXECUTIVE_GROUPS: AmpSettingsMap.asKey<string[]>('okta.groups.exec.extIds', []),
55
59
  OKTA_PROD_ACCESS_GROUPS: AmpSettingsMap.asKey<string[]>('okta.groups.prod.extIds', []),
@@ -112,4 +116,5 @@ export const AMP_SETTINGS = {
112
116
  google: {...GOOGLE_SETTINGS},
113
117
  okta: {...OKTA_SETTINGS},
114
118
  slack: {...SLACK_SETTINGS},
119
+ knowBe4: {...KNOWBE4_SETTINGS},
115
120
  };