@ampsec/platform-client 45.2.0 → 45.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/src/dto/enums/findingKind.d.ts +2 -0
- package/build/src/dto/enums/findingKind.js +26 -1
- package/build/src/dto/enums/findingKind.js.map +1 -1
- package/build/src/dto/enums/index.d.ts +5 -2
- package/build/src/dto/enums/index.js +5 -2
- package/build/src/dto/enums/index.js.map +1 -1
- package/build/src/dto/findings.dto.d.ts +1 -3
- package/build/src/services/EngageApi.js +1 -1
- package/build/src/services/EngageApi.js.map +1 -1
- package/package.json +2 -2
- package/src/dto/enums/findingKind.ts +26 -0
- package/src/dto/enums/index.ts +5 -2
- package/src/dto/findings.dto.ts +1 -3
- package/src/services/EngageApi.ts +2 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FindingOutcome } from './finding.outcome';
|
|
1
2
|
export declare enum FindingKind {
|
|
2
3
|
NO_ACCOUNT = "NO_ACCOUNT",
|
|
3
4
|
MFA_NOT_ENABLED = "MFA_NOT_ENABLED",
|
|
@@ -10,3 +11,4 @@ export declare enum FindingKind {
|
|
|
10
11
|
VULNERABILITY_OUT_OF_SLA = "VULNERABILITY_OUT_OF_SLA",
|
|
11
12
|
WEB_GATEWAY_NOT_ACTIVE = "WEB_GATEWAY_NOT_ACTIVE"
|
|
12
13
|
}
|
|
14
|
+
export declare const lookupFindingOutcomeByKind: (kind: FindingKind) => FindingOutcome;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FindingKind = void 0;
|
|
3
|
+
exports.lookupFindingOutcomeByKind = exports.FindingKind = void 0;
|
|
4
|
+
const finding_outcome_1 = require("./finding.outcome");
|
|
4
5
|
/* eslint-disable no-unused-vars */
|
|
5
6
|
var FindingKind;
|
|
6
7
|
(function (FindingKind) {
|
|
@@ -20,4 +21,28 @@ var FindingKind;
|
|
|
20
21
|
// WEB_GATEWAY
|
|
21
22
|
FindingKind["WEB_GATEWAY_NOT_ACTIVE"] = "WEB_GATEWAY_NOT_ACTIVE";
|
|
22
23
|
})(FindingKind || (exports.FindingKind = FindingKind = {}));
|
|
24
|
+
const lookupFindingOutcomeByKind = (kind) => {
|
|
25
|
+
switch (kind) {
|
|
26
|
+
case FindingKind.NO_ACCOUNT:
|
|
27
|
+
case FindingKind.MFA_NOT_ENABLED:
|
|
28
|
+
case FindingKind.TRAINING_OVERDUE:
|
|
29
|
+
case FindingKind.DEVICE_NOT_MANAGED:
|
|
30
|
+
case FindingKind.VULNERABILITY_OUT_OF_SLA:
|
|
31
|
+
case FindingKind.WEB_GATEWAY_NOT_ACTIVE: {
|
|
32
|
+
return finding_outcome_1.FindingOutcome.REMEDIATION;
|
|
33
|
+
}
|
|
34
|
+
case FindingKind.IS_EXECUTIVE:
|
|
35
|
+
case FindingKind.HAS_PRODUCTION_ACCESS:
|
|
36
|
+
case FindingKind.HAS_PRIVILEGED_ACCESS: {
|
|
37
|
+
return finding_outcome_1.FindingOutcome.AWARENESS;
|
|
38
|
+
}
|
|
39
|
+
case FindingKind.FAILED_PHISHING: {
|
|
40
|
+
return finding_outcome_1.FindingOutcome.EDUCATION;
|
|
41
|
+
}
|
|
42
|
+
default: {
|
|
43
|
+
throw new Error(`Unable to lookup desired outcome for finding kind: ${kind}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
exports.lookupFindingOutcomeByKind = lookupFindingOutcomeByKind;
|
|
23
48
|
//# sourceMappingURL=findingKind.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findingKind.js","sourceRoot":"","sources":["../../../../src/dto/enums/findingKind.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,IAAY,WAoBX;AApBD,WAAY,WAAW;IACrB,MAAM;IACN,wCAAyB,CAAA;IAEzB,WAAW;IACX,kDAAmC,CAAA;IAC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ACD,KAAK,WAAW,CAAC,eAAe,CAAC,CAAC;YAChC,OAAO,gCAAc,CAAC,SAAS,CAAC;SACjC;QACD,OAAO,CAAC,CAAC;YACP,MAAM,IAAI,KAAK,CAAC,sDAAsD,IAAI,EAAE,CAAC,CAAC;SAC/E;KACF;AACH,CAAC,CAAC;AAtBW,QAAA,0BAA0B,8BAsBrC"}
|
|
@@ -3,14 +3,17 @@ export * from './agent.status';
|
|
|
3
3
|
export * from './ampSettingKeys.enum';
|
|
4
4
|
export * from './category';
|
|
5
5
|
export * from './connector.status';
|
|
6
|
+
export * from './contentStrategy.kind';
|
|
7
|
+
export * from './deliveryStrategy.kind';
|
|
6
8
|
export * from './findingKind';
|
|
7
9
|
export * from './finding.severity';
|
|
8
10
|
export * from './finding.status';
|
|
11
|
+
export * from './finding.outcome';
|
|
9
12
|
export * from './globalUser.type';
|
|
10
13
|
export * from './jobExecution.status';
|
|
11
14
|
export * from './notification.status';
|
|
15
|
+
export * from './requiredDataProperty.enum';
|
|
12
16
|
export * from './riskContributor.type';
|
|
13
17
|
export * from './saasComponentKind';
|
|
14
18
|
export * from './workflowStep.kind';
|
|
15
|
-
export * from './
|
|
16
|
-
export * from './deliveryStrategy.kind';
|
|
19
|
+
export * from './workflowTrigger.kind';
|
|
@@ -19,15 +19,18 @@ __exportStar(require("./agent.status"), exports);
|
|
|
19
19
|
__exportStar(require("./ampSettingKeys.enum"), exports);
|
|
20
20
|
__exportStar(require("./category"), exports);
|
|
21
21
|
__exportStar(require("./connector.status"), exports);
|
|
22
|
+
__exportStar(require("./contentStrategy.kind"), exports);
|
|
23
|
+
__exportStar(require("./deliveryStrategy.kind"), exports);
|
|
22
24
|
__exportStar(require("./findingKind"), exports);
|
|
23
25
|
__exportStar(require("./finding.severity"), exports);
|
|
24
26
|
__exportStar(require("./finding.status"), exports);
|
|
27
|
+
__exportStar(require("./finding.outcome"), exports);
|
|
25
28
|
__exportStar(require("./globalUser.type"), exports);
|
|
26
29
|
__exportStar(require("./jobExecution.status"), exports);
|
|
27
30
|
__exportStar(require("./notification.status"), exports);
|
|
31
|
+
__exportStar(require("./requiredDataProperty.enum"), exports);
|
|
28
32
|
__exportStar(require("./riskContributor.type"), exports);
|
|
29
33
|
__exportStar(require("./saasComponentKind"), exports);
|
|
30
34
|
__exportStar(require("./workflowStep.kind"), exports);
|
|
31
|
-
__exportStar(require("./
|
|
32
|
-
__exportStar(require("./deliveryStrategy.kind"), exports);
|
|
35
|
+
__exportStar(require("./workflowTrigger.kind"), exports);
|
|
33
36
|
//# sourceMappingURL=index.js.map
|
|
@@ -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,6CAA2B;AAC3B,qDAAmC;AACnC,gDAA8B;AAC9B,qDAAmC;AACnC,mDAAiC;AACjC,oDAAkC;AAClC,wDAAsC;AACtC,wDAAsC;AACtC,yDAAuC;AACvC,sDAAoC;AACpC,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,6CAA2B;AAC3B,qDAAmC;AACnC,yDAAuC;AACvC,0DAAwC;AACxC,gDAA8B;AAC9B,qDAAmC;AACnC,mDAAiC;AACjC,oDAAkC;AAClC,oDAAkC;AAClC,wDAAsC;AACtC,wDAAsC;AACtC,8DAA4C;AAC5C,yDAAuC;AACvC,sDAAoC;AACpC,sDAAoC;AACpC,yDAAuC"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { BaseDto, BaseUpsertDto } from './base.dto';
|
|
2
2
|
import { Category, FindingKind } from './enums';
|
|
3
|
-
import { FindingOutcome } from './enums
|
|
4
|
-
import { FindingSeverity } from './enums/finding.severity';
|
|
5
|
-
import { FindingStatus } from './enums/finding.status';
|
|
3
|
+
import { FindingOutcome, FindingSeverity, FindingStatus } from './enums';
|
|
6
4
|
import { SimpleProviderDto } from './providers.dto';
|
|
7
5
|
import { SimpleUserDto } from './users.dto';
|
|
8
6
|
export type FindingsStatusPathDto = {
|
|
@@ -33,7 +33,7 @@ class EngageApi {
|
|
|
33
33
|
this.findings = new data_service_1.AmpPatchDataServiceImpl(rest, constants_1.KIND.FINDINGS, constants_1.TARGET_API_ENGAGE);
|
|
34
34
|
this.identity = new UserIdentityService_1.UserIdentityService(rest);
|
|
35
35
|
this.notifications = new data_service_1.AmpDataServiceImpl(rest, constants_1.KIND.NOTIFICATIONS, constants_1.TARGET_API_ENGAGE);
|
|
36
|
-
this.providers = new data_service_1.AmpDataServiceImpl(rest, constants_1.KIND.PROVIDERS, constants_1.
|
|
36
|
+
this.providers = new data_service_1.AmpDataServiceImpl(rest, constants_1.KIND.PROVIDERS, constants_1.TARGET_API_ENGAGE);
|
|
37
37
|
this.reports = new reports_service_1.AmpReportServiceImpl(rest);
|
|
38
38
|
this.settings = new settings_service_1.AmpSettingsService(rest); // TODO: confirm it is not needed. Currently returns NOT_IMPLEMENTED error code
|
|
39
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EngageApi.js","sourceRoot":"","sources":["../../../src/services/EngageApi.ts"],"names":[],"mappings":";;;AACA,qDAAsD;AACtD,iDAAgH;AAChH,iCAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"EngageApi.js","sourceRoot":"","sources":["../../../src/services/EngageApi.ts"],"names":[],"mappings":";;;AACA,qDAAsD;AACtD,iDAAgH;AAChH,iCAA0E;AAC1E,2CAAoD;AACpD,uDAAyE;AACzE,yDAAsD;AACtD,oEAA+D;AAI/D;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAa,SAAS;IASpB,YAAY,IAAgB;QAC1B,IAAI,CAAC,UAAU,GAAG,IAAI,qCAAoB,CAAmC,IAAI,EAAE,gBAAI,CAAC,UAAU,EAAE,6BAAiB,CAAC,CAAC;QACvH,IAAI,CAAC,QAAQ,GAAG,IAAI,sCAAuB,CAAqC,IAAI,EAAE,gBAAI,CAAC,QAAQ,EAAE,6BAAiB,CAAC,CAAC;QACxH,IAAI,CAAC,QAAQ,GAAG,IAAI,yCAAmB,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAI,CAAC,aAAa,GAAG,IAAI,iCAAkB,CAAkB,IAAI,EAAE,gBAAI,CAAC,aAAa,EAAE,6BAAiB,CAAC,CAAC;QAC1G,IAAI,CAAC,SAAS,GAAG,IAAI,iCAAkB,CAAc,IAAI,EAAE,gBAAI,CAAC,SAAS,EAAE,6BAAiB,CAAC,CAAC;QAC9F,IAAI,CAAC,OAAO,GAAG,IAAI,sCAAoB,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAI,CAAC,QAAQ,GAAG,IAAI,qCAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,+EAA+E;IAC/H,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,OAAyB;QACvC,MAAM,IAAI,GAAG,IAAA,uBAAgB,EAAC,OAAO,CAAC,CAAC;QACvC,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;CACF;AAvBD,8BAuBC"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ampsec/platform-client",
|
|
3
|
-
"version": "45.
|
|
3
|
+
"version": "45.4.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"runkitExampleFilename": "example/main.js",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"dev": "tsc --watch",
|
|
8
|
+
"start:dev": "tsc --watch",
|
|
9
9
|
"prebuild": "rimraf build",
|
|
10
10
|
"build": "tsc",
|
|
11
11
|
"predocs": "rimraf public",
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import {FindingOutcome} from './finding.outcome';
|
|
2
|
+
|
|
1
3
|
/* eslint-disable no-unused-vars */
|
|
2
4
|
export enum FindingKind {
|
|
3
5
|
// ALL
|
|
@@ -20,3 +22,27 @@ export enum FindingKind {
|
|
|
20
22
|
// WEB_GATEWAY
|
|
21
23
|
WEB_GATEWAY_NOT_ACTIVE = 'WEB_GATEWAY_NOT_ACTIVE',
|
|
22
24
|
}
|
|
25
|
+
|
|
26
|
+
export const lookupFindingOutcomeByKind = (kind: FindingKind): FindingOutcome => {
|
|
27
|
+
switch (kind) {
|
|
28
|
+
case FindingKind.NO_ACCOUNT:
|
|
29
|
+
case FindingKind.MFA_NOT_ENABLED:
|
|
30
|
+
case FindingKind.TRAINING_OVERDUE:
|
|
31
|
+
case FindingKind.DEVICE_NOT_MANAGED:
|
|
32
|
+
case FindingKind.VULNERABILITY_OUT_OF_SLA:
|
|
33
|
+
case FindingKind.WEB_GATEWAY_NOT_ACTIVE: {
|
|
34
|
+
return FindingOutcome.REMEDIATION;
|
|
35
|
+
}
|
|
36
|
+
case FindingKind.IS_EXECUTIVE:
|
|
37
|
+
case FindingKind.HAS_PRODUCTION_ACCESS:
|
|
38
|
+
case FindingKind.HAS_PRIVILEGED_ACCESS: {
|
|
39
|
+
return FindingOutcome.AWARENESS;
|
|
40
|
+
}
|
|
41
|
+
case FindingKind.FAILED_PHISHING: {
|
|
42
|
+
return FindingOutcome.EDUCATION;
|
|
43
|
+
}
|
|
44
|
+
default: {
|
|
45
|
+
throw new Error(`Unable to lookup desired outcome for finding kind: ${kind}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
package/src/dto/enums/index.ts
CHANGED
|
@@ -3,14 +3,17 @@ export * from './agent.status';
|
|
|
3
3
|
export * from './ampSettingKeys.enum';
|
|
4
4
|
export * from './category';
|
|
5
5
|
export * from './connector.status';
|
|
6
|
+
export * from './contentStrategy.kind';
|
|
7
|
+
export * from './deliveryStrategy.kind';
|
|
6
8
|
export * from './findingKind';
|
|
7
9
|
export * from './finding.severity';
|
|
8
10
|
export * from './finding.status';
|
|
11
|
+
export * from './finding.outcome';
|
|
9
12
|
export * from './globalUser.type';
|
|
10
13
|
export * from './jobExecution.status';
|
|
11
14
|
export * from './notification.status';
|
|
15
|
+
export * from './requiredDataProperty.enum';
|
|
12
16
|
export * from './riskContributor.type';
|
|
13
17
|
export * from './saasComponentKind';
|
|
14
18
|
export * from './workflowStep.kind';
|
|
15
|
-
export * from './
|
|
16
|
-
export * from './deliveryStrategy.kind';
|
|
19
|
+
export * from './workflowTrigger.kind';
|
package/src/dto/findings.dto.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import {BaseDto, BaseUpsertDto} from './base.dto';
|
|
2
2
|
import {Category, FindingKind} from './enums';
|
|
3
|
-
import {FindingOutcome} from './enums
|
|
4
|
-
import {FindingSeverity} from './enums/finding.severity';
|
|
5
|
-
import {FindingStatus} from './enums/finding.status';
|
|
3
|
+
import {FindingOutcome, FindingSeverity, FindingStatus} from './enums';
|
|
6
4
|
import {SimpleProviderDto} from './providers.dto';
|
|
7
5
|
import {SimpleUserDto} from './users.dto';
|
|
8
6
|
|
|
@@ -2,7 +2,7 @@ import {ConnectorDto, ConnectorUpsertDto, FindingDto, FindingsStatusPathDto as F
|
|
|
2
2
|
import {AmpEntityServiceImpl} from './entity.service';
|
|
3
3
|
import {AmpDataService, AmpDataServiceImpl, AmpPatchDataService, AmpPatchDataServiceImpl} from './data.service';
|
|
4
4
|
import {AmpRestClientOptions, RestClient, getAmpRestClient} from './rest';
|
|
5
|
-
import {KIND,
|
|
5
|
+
import {KIND, TARGET_API_ENGAGE} from './constants';
|
|
6
6
|
import {AmpReportService, AmpReportServiceImpl} from './reports.service';
|
|
7
7
|
import {AmpSettingsService} from './settings.service';
|
|
8
8
|
import {UserIdentityService} from './rest/UserIdentityService';
|
|
@@ -42,7 +42,7 @@ export class EngageApi {
|
|
|
42
42
|
this.findings = new AmpPatchDataServiceImpl<FindingsStatusPatchDto, FindingDto>(rest, KIND.FINDINGS, TARGET_API_ENGAGE);
|
|
43
43
|
this.identity = new UserIdentityService(rest);
|
|
44
44
|
this.notifications = new AmpDataServiceImpl<NotificationDto>(rest, KIND.NOTIFICATIONS, TARGET_API_ENGAGE);
|
|
45
|
-
this.providers = new AmpDataServiceImpl<ProviderDto>(rest, KIND.PROVIDERS,
|
|
45
|
+
this.providers = new AmpDataServiceImpl<ProviderDto>(rest, KIND.PROVIDERS, TARGET_API_ENGAGE);
|
|
46
46
|
this.reports = new AmpReportServiceImpl(rest);
|
|
47
47
|
this.settings = new AmpSettingsService(rest); // TODO: confirm it is not needed. Currently returns NOT_IMPLEMENTED error code
|
|
48
48
|
}
|