@mitre/hdf-converters 2.10.8 → 2.10.13
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/README.md +18 -15
- package/lib/index.d.ts +3 -0
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -1
- package/lib/package.json +9 -4
- package/lib/src/ckl-mapper/checklist-jsonix-converter.d.ts +3 -2
- package/lib/src/ckl-mapper/checklist-jsonix-converter.js +50 -6
- package/lib/src/ckl-mapper/checklist-jsonix-converter.js.map +1 -1
- package/lib/src/ckl-mapper/checklist-mapper.js +54 -27
- package/lib/src/ckl-mapper/checklist-mapper.js.map +1 -1
- package/lib/src/ckl-mapper/checklist-metadata-utils.d.ts +19 -0
- package/lib/src/ckl-mapper/checklist-metadata-utils.js +154 -0
- package/lib/src/ckl-mapper/checklist-metadata-utils.js.map +1 -0
- package/lib/src/gosec-mapper.d.ts +1 -1
- package/lib/src/gosec-mapper.js +57 -30
- package/lib/src/gosec-mapper.js.map +1 -1
- package/lib/src/msft-secure-score-mapper.d.ts +33 -0
- package/lib/src/msft-secure-score-mapper.js +254 -0
- package/lib/src/msft-secure-score-mapper.js.map +1 -0
- package/lib/src/trufflehog-mapper.d.ts +15 -0
- package/lib/src/trufflehog-mapper.js +103 -0
- package/lib/src/trufflehog-mapper.js.map +1 -0
- package/lib/src/utils/fingerprinting.d.ts +2 -0
- package/lib/src/utils/fingerprinting.js +9 -0
- package/lib/src/utils/fingerprinting.js.map +1 -1
- package/lib/src/utils/parseJson.d.ts +5 -0
- package/lib/src/utils/parseJson.js +13 -0
- package/lib/src/utils/parseJson.js.map +1 -0
- package/lib/src/utils/result.d.ts +7 -0
- package/lib/src/utils/result.js +3 -0
- package/lib/src/utils/result.js.map +1 -0
- package/package.json +9 -4
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.throwIfInvalidAssetMetadata = exports.throwIfInvalidProfileMetadata = exports.validateChecklistMetadata = exports.validateChecklistProfileMetadata = exports.validateChecklistAssetMetadata = exports.InvalidChecklistMetadataException = void 0;
|
|
30
|
+
const validator_1 = require("validator");
|
|
31
|
+
const checklistJsonix_1 = require("./checklistJsonix");
|
|
32
|
+
const Revalidator = __importStar(require("revalidator"));
|
|
33
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
34
|
+
class InvalidChecklistMetadataException extends Error {
|
|
35
|
+
}
|
|
36
|
+
exports.InvalidChecklistMetadataException = InvalidChecklistMetadataException;
|
|
37
|
+
const assetMetadataSchema = {
|
|
38
|
+
properties: {
|
|
39
|
+
hostfqdn: {
|
|
40
|
+
type: 'string',
|
|
41
|
+
conform: (fqdn) => !fqdn || (0, validator_1.isFQDN)(fqdn) || (0, validator_1.isIP)(fqdn),
|
|
42
|
+
message: 'Host FQDN'
|
|
43
|
+
},
|
|
44
|
+
hostip: {
|
|
45
|
+
type: 'string',
|
|
46
|
+
conform: (ip) => !ip || (0, validator_1.isIP)(ip),
|
|
47
|
+
message: 'Host IP'
|
|
48
|
+
},
|
|
49
|
+
hostmac: {
|
|
50
|
+
type: 'string',
|
|
51
|
+
conform: (mac) => !mac || (0, validator_1.isMACAddress)(mac),
|
|
52
|
+
message: 'Host MAC'
|
|
53
|
+
},
|
|
54
|
+
role: {
|
|
55
|
+
type: 'string',
|
|
56
|
+
enum: Object.values(checklistJsonix_1.Role),
|
|
57
|
+
message: 'Role'
|
|
58
|
+
},
|
|
59
|
+
assettype: {
|
|
60
|
+
type: 'string',
|
|
61
|
+
enum: Object.values(checklistJsonix_1.Assettype),
|
|
62
|
+
message: 'Asset Type'
|
|
63
|
+
},
|
|
64
|
+
techarea: {
|
|
65
|
+
type: 'string',
|
|
66
|
+
enum: Object.values(checklistJsonix_1.Techarea),
|
|
67
|
+
message: 'Tech Area'
|
|
68
|
+
},
|
|
69
|
+
webordatabase: {
|
|
70
|
+
type: 'boolean',
|
|
71
|
+
message: 'Web or Database STIG'
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
const profileMetadataSchema = {
|
|
76
|
+
properties: {
|
|
77
|
+
version: {
|
|
78
|
+
type: 'integer',
|
|
79
|
+
minimum: 0,
|
|
80
|
+
message: 'Version must be a non-negative integer'
|
|
81
|
+
},
|
|
82
|
+
releasenumber: {
|
|
83
|
+
type: 'integer',
|
|
84
|
+
minimum: 0,
|
|
85
|
+
message: 'Release number must be a non-negative integer'
|
|
86
|
+
},
|
|
87
|
+
releasedate: {
|
|
88
|
+
type: 'string',
|
|
89
|
+
conform: (date) => !date || !Number.isNaN(Date.parse(date)),
|
|
90
|
+
message: 'Release date must be a valid date'
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
function validateChecklistAssetMetadata(asset) {
|
|
95
|
+
const errors = Revalidator.validate(asset, assetMetadataSchema).errors;
|
|
96
|
+
if (errors.length === 0)
|
|
97
|
+
return { ok: true, value: true };
|
|
98
|
+
const invalidFields = errors.map((e) => `${e.message} (${lodash_1.default.get(asset, e.property)})`);
|
|
99
|
+
const message = `Invalid checklist metadata fields:\n\t${invalidFields.join('\n\t')}`;
|
|
100
|
+
return { ok: false, error: { invalid: errors.map((e) => e.property), message } };
|
|
101
|
+
}
|
|
102
|
+
exports.validateChecklistAssetMetadata = validateChecklistAssetMetadata;
|
|
103
|
+
function validateChecklistProfileMetadata(metadata) {
|
|
104
|
+
const errors = Revalidator.validate(metadata, {
|
|
105
|
+
...profileMetadataSchema
|
|
106
|
+
}).errors;
|
|
107
|
+
if (errors.length === 0)
|
|
108
|
+
return { ok: true, value: true };
|
|
109
|
+
const invalidFields = errors.map((e) => `${e.message} (${lodash_1.default.get(metadata, e.property)})`);
|
|
110
|
+
const message = `Invalid checklist profile metadata fields:\n\t${invalidFields.join('\n\t')}`;
|
|
111
|
+
return { ok: false, error: { invalid: errors.map((e) => e.property), message } };
|
|
112
|
+
}
|
|
113
|
+
exports.validateChecklistProfileMetadata = validateChecklistProfileMetadata;
|
|
114
|
+
function validateChecklistMetadata(metadata) {
|
|
115
|
+
let invalid = [];
|
|
116
|
+
const messages = [];
|
|
117
|
+
const assetResult = validateChecklistAssetMetadata({
|
|
118
|
+
...metadata,
|
|
119
|
+
webordatabase: metadata.webordatabase === 'true',
|
|
120
|
+
targetkey: null
|
|
121
|
+
});
|
|
122
|
+
if (!assetResult.ok) {
|
|
123
|
+
invalid = invalid.concat(assetResult.error.invalid);
|
|
124
|
+
messages.push(assetResult.error.message);
|
|
125
|
+
}
|
|
126
|
+
for (const profile of metadata.profiles) {
|
|
127
|
+
const profileResult = validateChecklistProfileMetadata(profile);
|
|
128
|
+
if (!profileResult.ok) {
|
|
129
|
+
invalid = invalid.concat(profileResult.error.invalid);
|
|
130
|
+
messages.push(`In profile ${profile.name}:\n${profileResult.error.message.split(':\n').at(-1)}`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (invalid.length === 0)
|
|
134
|
+
return { ok: true, value: true };
|
|
135
|
+
const message = messages.join('\n');
|
|
136
|
+
return { ok: false, error: { invalid, message } };
|
|
137
|
+
}
|
|
138
|
+
exports.validateChecklistMetadata = validateChecklistMetadata;
|
|
139
|
+
function throwIfInvalidProfileMetadata(profileMetadata) {
|
|
140
|
+
if (profileMetadata) {
|
|
141
|
+
const results = validateChecklistProfileMetadata(profileMetadata);
|
|
142
|
+
if (!results.ok) {
|
|
143
|
+
throw new InvalidChecklistMetadataException(results.error.message);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
exports.throwIfInvalidProfileMetadata = throwIfInvalidProfileMetadata;
|
|
148
|
+
function throwIfInvalidAssetMetadata(metadata) {
|
|
149
|
+
const result = validateChecklistAssetMetadata(metadata);
|
|
150
|
+
if (!result.ok)
|
|
151
|
+
throw new InvalidChecklistMetadataException(result.error.message);
|
|
152
|
+
}
|
|
153
|
+
exports.throwIfInvalidAssetMetadata = throwIfInvalidAssetMetadata;
|
|
154
|
+
//# sourceMappingURL=checklist-metadata-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checklist-metadata-utils.js","sourceRoot":"","sources":["../../../src/ckl-mapper/checklist-metadata-utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAqD;AAGrD,uDAAmE;AACnE,yDAA2C;AAC3C,oDAAuB;AAEvB,MAAa,iCAAkC,SAAQ,KAAK;CAAG;AAA/D,8EAA+D;AAE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,CAAC,IAAI,CACX,cAAc,OAAO,CAAC,IAAI,MAAM,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAClF,CAAC;SACH;KACF;IAED,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAC,CAAC;IAEzD,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpC,OAAO,EAAC,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAC,OAAO,EAAE,OAAO,EAAC,EAAC,CAAC;AAChD,CAAC;AA7BD,8DA6BC;AAED,SAAgB,6BAA6B,CAAC,eAA8B;IAC1E,IAAI,eAAe,EAAE;QACnB,MAAM,OAAO,GAAG,gCAAgC,CAAC,eAAe,CAAC,CAAC;QAClE,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE;YACf,MAAM,IAAI,iCAAiC,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;SACpE;KACF;AACH,CAAC;AAPD,sEAOC;AAED,SAAgB,2BAA2B,CAAC,QAAe;IACzD,MAAM,MAAM,GAAG,8BAA8B,CAAC,QAAQ,CAAC,CAAC;IACxD,IAAI,CAAC,MAAM,CAAC,EAAE;QACZ,MAAM,IAAI,iCAAiC,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AACtE,CAAC;AAJD,kEAIC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExecJSON } from 'inspecjs';
|
|
2
2
|
import { BaseConverter, ILookupPath, MappedTransform } from './base-converter';
|
|
3
|
-
export declare class
|
|
3
|
+
export declare class GosecMapper extends BaseConverter {
|
|
4
4
|
withRaw: boolean;
|
|
5
5
|
mappings: MappedTransform<ExecJSON.Execution & {
|
|
6
6
|
passthrough: unknown;
|
package/lib/src/gosec-mapper.js
CHANGED
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
26
|
+
exports.GosecMapper = void 0;
|
|
27
27
|
const inspecjs_1 = require("inspecjs");
|
|
28
28
|
const _ = __importStar(require("lodash"));
|
|
29
29
|
const package_json_1 = require("../package.json");
|
|
@@ -31,32 +31,43 @@ const base_converter_1 = require("./base-converter");
|
|
|
31
31
|
const CweNistMapping_1 = require("./mappings/CweNistMapping");
|
|
32
32
|
const CWE_NIST_MAPPING = new CweNistMapping_1.CweNistMapping();
|
|
33
33
|
const DEFAULT_NIST_TAG = ['SI-2', 'RA-5'];
|
|
34
|
+
const IMPACT_MAPPING = new Map([
|
|
35
|
+
['high', 0.7],
|
|
36
|
+
['medium', 0.5],
|
|
37
|
+
['low', 0.3]
|
|
38
|
+
]);
|
|
34
39
|
function nistTag(input) {
|
|
35
40
|
const cwe = [`${_.get(input, 'id')}`];
|
|
36
41
|
return CWE_NIST_MAPPING.nistFilter(cwe, DEFAULT_NIST_TAG);
|
|
37
42
|
}
|
|
43
|
+
function formatStatus(input) {
|
|
44
|
+
return `${_.get(input, 'nosec')}` === 'false' &&
|
|
45
|
+
`${_.get(input, 'suppressions')}` === 'null'
|
|
46
|
+
? inspecjs_1.ExecJSON.ControlResultStatus.Failed
|
|
47
|
+
: inspecjs_1.ExecJSON.ControlResultStatus.Skipped;
|
|
48
|
+
}
|
|
49
|
+
function formatSkipMessage(input) {
|
|
50
|
+
const suppressions = _.get(input, 'suppressions');
|
|
51
|
+
if (`${suppressions}` === 'null') {
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
if (!Array.isArray(suppressions)) {
|
|
55
|
+
return 'No justification provided';
|
|
56
|
+
}
|
|
57
|
+
return suppressions
|
|
58
|
+
.map((suppression) => `${suppression.justification ? suppression.justification : 'No justification provided'} (${suppression.kind})`)
|
|
59
|
+
.join('\n');
|
|
60
|
+
}
|
|
61
|
+
function formatCodeDesc(input) {
|
|
62
|
+
return `Rule ${_.get(input, 'rule_id')} violation detected at:\nFile: ${_.get(input, 'file')}\nLine: ${_.get(input, 'line')}\nColumn: ${_.get(input, 'column')}`;
|
|
63
|
+
}
|
|
38
64
|
function formatMessage(input) {
|
|
39
|
-
return `${_.get(input, '
|
|
65
|
+
return `${_.get(input, 'confidence')} confidence of rule violation at:\n${_.get(input, 'code')}`;
|
|
40
66
|
}
|
|
41
|
-
class
|
|
67
|
+
class GosecMapper extends base_converter_1.BaseConverter {
|
|
42
68
|
constructor(gosecJson, withRaw = false) {
|
|
43
69
|
super(JSON.parse(gosecJson));
|
|
44
70
|
this.mappings = {
|
|
45
|
-
passthrough: {
|
|
46
|
-
transformer: (data) => {
|
|
47
|
-
return {
|
|
48
|
-
auxiliary_data: [
|
|
49
|
-
{
|
|
50
|
-
name: 'Gosec',
|
|
51
|
-
data: {
|
|
52
|
-
'Golang errors': _.get(data, 'Golang errors')
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
],
|
|
56
|
-
...(this.withRaw && { raw: data })
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
71
|
platform: {
|
|
61
72
|
name: 'Heimdall Tools',
|
|
62
73
|
release: package_json_1.version
|
|
@@ -65,8 +76,8 @@ class GoSecMapper extends base_converter_1.BaseConverter {
|
|
|
65
76
|
statistics: {},
|
|
66
77
|
profiles: [
|
|
67
78
|
{
|
|
68
|
-
name: '
|
|
69
|
-
title: 'gosec',
|
|
79
|
+
name: 'gosec Scan',
|
|
80
|
+
title: 'gosec Scan',
|
|
70
81
|
version: { path: 'GosecVersion' },
|
|
71
82
|
supports: [],
|
|
72
83
|
attributes: [],
|
|
@@ -81,22 +92,22 @@ class GoSecMapper extends base_converter_1.BaseConverter {
|
|
|
81
92
|
path: 'cwe',
|
|
82
93
|
transformer: nistTag
|
|
83
94
|
},
|
|
84
|
-
cwe: { path: 'cwe' }
|
|
85
|
-
nosec: { path: 'nosec' },
|
|
86
|
-
suppressions: { path: 'suppressions' },
|
|
87
|
-
severity: { path: 'severity' },
|
|
88
|
-
confidence: { path: 'confidence' }
|
|
95
|
+
cwe: { path: 'cwe' }
|
|
89
96
|
},
|
|
90
97
|
refs: [],
|
|
91
98
|
source_location: {},
|
|
92
99
|
title: { path: 'details' },
|
|
93
100
|
id: { path: 'rule_id' },
|
|
94
101
|
desc: '',
|
|
95
|
-
impact:
|
|
102
|
+
impact: {
|
|
103
|
+
path: 'severity',
|
|
104
|
+
transformer: (0, base_converter_1.impactMapping)(IMPACT_MAPPING)
|
|
105
|
+
},
|
|
96
106
|
results: [
|
|
97
107
|
{
|
|
98
|
-
status:
|
|
99
|
-
|
|
108
|
+
status: { transformer: formatStatus },
|
|
109
|
+
skip_message: { transformer: formatSkipMessage },
|
|
110
|
+
code_desc: { transformer: formatCodeDesc },
|
|
100
111
|
message: { transformer: formatMessage },
|
|
101
112
|
start_time: ''
|
|
102
113
|
}
|
|
@@ -105,10 +116,26 @@ class GoSecMapper extends base_converter_1.BaseConverter {
|
|
|
105
116
|
],
|
|
106
117
|
sha256: ''
|
|
107
118
|
}
|
|
108
|
-
]
|
|
119
|
+
],
|
|
120
|
+
passthrough: {
|
|
121
|
+
transformer: (data) => {
|
|
122
|
+
return {
|
|
123
|
+
auxiliary_data: [
|
|
124
|
+
{
|
|
125
|
+
name: 'gosec',
|
|
126
|
+
data: {
|
|
127
|
+
'Golang errors': _.get(data, 'Golang errors'),
|
|
128
|
+
Stats: _.get(data, 'Stats')
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
],
|
|
132
|
+
...(this.withRaw && { raw: data })
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
}
|
|
109
136
|
};
|
|
110
137
|
this.withRaw = withRaw;
|
|
111
138
|
}
|
|
112
139
|
}
|
|
113
|
-
exports.
|
|
140
|
+
exports.GosecMapper = GosecMapper;
|
|
114
141
|
//# sourceMappingURL=gosec-mapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gosec-mapper.js","sourceRoot":"","sources":["../../src/gosec-mapper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAkC;AAClC,0CAA4B;AAC5B,kDAAgE;AAChE,
|
|
1
|
+
{"version":3,"file":"gosec-mapper.js","sourceRoot":"","sources":["../../src/gosec-mapper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAkC;AAClC,0CAA4B;AAC5B,kDAAgE;AAChE,qDAK0B;AAC1B,8DAAyD;AAEzD,MAAM,gBAAgB,GAAG,IAAI,+BAAc,EAAE,CAAC;AAC9C,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAC;IAClD,CAAC,MAAM,EAAE,GAAG,CAAC;IACb,CAAC,QAAQ,EAAE,GAAG,CAAC;IACf,CAAC,KAAK,EAAE,GAAG,CAAC;CACb,CAAC,CAAC;AAEH,SAAS,OAAO,CAAC,KAA8B;IAC7C,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IACtC,OAAO,gBAAgB,CAAC,UAAU,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;AAC5D,CAAC;AAGD,SAAS,YAAY,CAAC,KAA8B;IAClD,OAAO,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,KAAK,OAAO;QAC3C,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,cAAc,CAAC,EAAE,KAAK,MAAM;QAC5C,CAAC,CAAC,mBAAQ,CAAC,mBAAmB,CAAC,MAAM;QACrC,CAAC,CAAC,mBAAQ,CAAC,mBA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OAAO;gCACb,IAAI,EAAE;oCACJ,eAAe,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,eAAe,CAAC;oCAC7C,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC;iCAC5B;6BACF;yBACF;wBACD,GAAG,CAAC,IAAI,CAAC,OAAO,IAAI,EAAC,GAAG,EAAE,IAAI,EAAC,CAAC;qBACjC,CAAC;gBACJ,CAAC;aACF;SACF,CAAC;QAGA,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF;AA7ED,kCA6EC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { SecureScore, SecureScoreControlProfile } from '@microsoft/microsoft-graph-types';
|
|
2
|
+
import { ExecJSON } from 'inspecjs';
|
|
3
|
+
import { BaseConverter, ILookupPath, MappedTransform } from './base-converter';
|
|
4
|
+
export type ProfileResponse = {
|
|
5
|
+
'@odata.context': string;
|
|
6
|
+
'@odata.nextLink': string;
|
|
7
|
+
value: SecureScoreControlProfile[];
|
|
8
|
+
};
|
|
9
|
+
export type SecureScoreResponse = {
|
|
10
|
+
'@odata.context': string;
|
|
11
|
+
'@odata.nextLink': string;
|
|
12
|
+
value: SecureScore[];
|
|
13
|
+
};
|
|
14
|
+
export type CombinedResponse = {
|
|
15
|
+
secureScore: SecureScoreResponse;
|
|
16
|
+
profiles: ProfileResponse;
|
|
17
|
+
};
|
|
18
|
+
export declare class MsftSecureScoreResults {
|
|
19
|
+
data: CombinedResponse;
|
|
20
|
+
withRaw: boolean;
|
|
21
|
+
constructor(combinedJson: string, withRaw?: boolean);
|
|
22
|
+
toHdf(): ExecJSON.Execution[];
|
|
23
|
+
}
|
|
24
|
+
export declare class MsftSecureScoreMapper extends BaseConverter {
|
|
25
|
+
withRaw: boolean;
|
|
26
|
+
rawData: CombinedResponse;
|
|
27
|
+
getProfiles: (controlName: string) => SecureScoreControlProfile[];
|
|
28
|
+
memoizedGetProfiles(): (controlName: string) => SecureScoreControlProfile[];
|
|
29
|
+
mappings: MappedTransform<ExecJSON.Execution & {
|
|
30
|
+
passthrough: unknown;
|
|
31
|
+
}, ILookupPath>;
|
|
32
|
+
constructor(secureScore_and_profiles_combined: string, withRaw?: boolean);
|
|
33
|
+
}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.MsftSecureScoreMapper = exports.MsftSecureScoreResults = void 0;
|
|
27
|
+
const inspecjs_1 = require("inspecjs");
|
|
28
|
+
const package_json_1 = require("../package.json");
|
|
29
|
+
const base_converter_1 = require("./base-converter");
|
|
30
|
+
const _ = __importStar(require("lodash"));
|
|
31
|
+
const global_1 = require("./utils/global");
|
|
32
|
+
class MsftSecureScoreResults {
|
|
33
|
+
constructor(combinedJson, withRaw = false) {
|
|
34
|
+
this.data = JSON.parse(combinedJson);
|
|
35
|
+
this.withRaw = withRaw;
|
|
36
|
+
}
|
|
37
|
+
toHdf() {
|
|
38
|
+
return this.data.secureScore.value.map((element) => new MsftSecureScoreMapper(JSON.stringify({
|
|
39
|
+
secureScore: {
|
|
40
|
+
value: [element],
|
|
41
|
+
..._.pick(this.data.secureScore, [
|
|
42
|
+
'@odata.context',
|
|
43
|
+
'@odata.context'
|
|
44
|
+
])
|
|
45
|
+
},
|
|
46
|
+
profiles: this.data.profiles
|
|
47
|
+
}), this.withRaw).toHdf());
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.MsftSecureScoreResults = MsftSecureScoreResults;
|
|
51
|
+
class MsftSecureScoreMapper extends base_converter_1.BaseConverter {
|
|
52
|
+
memoizedGetProfiles() {
|
|
53
|
+
const cache = {};
|
|
54
|
+
return (controlName) => {
|
|
55
|
+
if (Object.prototype.hasOwnProperty.call(cache, controlName)) {
|
|
56
|
+
return cache[controlName];
|
|
57
|
+
}
|
|
58
|
+
return (cache[controlName] = this.rawData.profiles.value.filter((profile) => profile.id === controlName));
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
constructor(secureScore_and_profiles_combined, withRaw = false) {
|
|
62
|
+
const rawParams = JSON.parse(secureScore_and_profiles_combined);
|
|
63
|
+
super(rawParams.secureScore.value[0]);
|
|
64
|
+
this.mappings = {
|
|
65
|
+
platform: {
|
|
66
|
+
name: 'Heimdall Tools',
|
|
67
|
+
release: package_json_1.version
|
|
68
|
+
},
|
|
69
|
+
version: package_json_1.version,
|
|
70
|
+
statistics: {},
|
|
71
|
+
profiles: [
|
|
72
|
+
{
|
|
73
|
+
name: 'Microsoft Secure Score Scan',
|
|
74
|
+
title: {
|
|
75
|
+
transformer: (data) => `Azure Secure Score report - Tenant ID: ${data.azureTenantId} - Run ID: ${data.id}`
|
|
76
|
+
},
|
|
77
|
+
supports: [],
|
|
78
|
+
attributes: [],
|
|
79
|
+
groups: [],
|
|
80
|
+
status: 'loaded',
|
|
81
|
+
controls: [
|
|
82
|
+
{
|
|
83
|
+
path: 'controlScores',
|
|
84
|
+
id: {
|
|
85
|
+
transformer: (data) => `${data.controlCategory}:${data.controlName}`
|
|
86
|
+
},
|
|
87
|
+
title: {
|
|
88
|
+
transformer: (data) => {
|
|
89
|
+
const titles = this.getProfiles(data.controlName || '')
|
|
90
|
+
.filter((profile) => profile.title !== undefined)
|
|
91
|
+
.map((profile) => profile.title);
|
|
92
|
+
if (titles.length > 0) {
|
|
93
|
+
return titles.join('\n');
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
return [data.controlCategory || '', data.controlName || '']
|
|
97
|
+
.filter((title) => title)
|
|
98
|
+
.join(':');
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
desc: { path: 'description' },
|
|
103
|
+
impact: {
|
|
104
|
+
transformer: (data) => {
|
|
105
|
+
const knownMaxScores = this.getProfiles(data.controlName || '').map((profile) => profile.maxScore || 0);
|
|
106
|
+
if (knownMaxScores.length === 0) {
|
|
107
|
+
return 0.5;
|
|
108
|
+
}
|
|
109
|
+
const highMaxScore = Math.max(...knownMaxScores);
|
|
110
|
+
return highMaxScore / 10.0;
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
refs: [],
|
|
114
|
+
tags: {
|
|
115
|
+
transformer: (data) => ({
|
|
116
|
+
...(0, global_1.conditionallyProvideAttribute)('category', this.getProfiles(data.controlName || '').map((profile) => profile.controlCategory), (() => {
|
|
117
|
+
const result = this.getProfiles(data.controlName || '')
|
|
118
|
+
.map((profile) => profile.controlCategory)
|
|
119
|
+
.filter((v) => Boolean(v));
|
|
120
|
+
return result.length > 0;
|
|
121
|
+
})()),
|
|
122
|
+
...(0, global_1.conditionallyProvideAttribute)('maxScore', this.getProfiles(data.controlName || '').map((profile) => profile.maxScore), (() => {
|
|
123
|
+
const result = this.getProfiles(data.controlName || '')
|
|
124
|
+
.map((profile) => profile.maxScore)
|
|
125
|
+
.filter((v) => Boolean(v));
|
|
126
|
+
return result.length > 0;
|
|
127
|
+
})()),
|
|
128
|
+
...(0, global_1.conditionallyProvideAttribute)('rank', this.getProfiles(data.controlName || '').map((profile) => profile.rank), (() => {
|
|
129
|
+
const result = this.getProfiles(data.controlName || '')
|
|
130
|
+
.map((profile) => profile.rank)
|
|
131
|
+
.filter((v) => Boolean(v));
|
|
132
|
+
return result.length > 0;
|
|
133
|
+
})()),
|
|
134
|
+
...(0, global_1.conditionallyProvideAttribute)('tiers', this.getProfiles(data.controlName || '').map((profile) => profile.tier), (() => {
|
|
135
|
+
const result = this.getProfiles(data.controlName || '')
|
|
136
|
+
.map((profile) => profile.tier)
|
|
137
|
+
.filter((v) => Boolean(v));
|
|
138
|
+
return result.length > 0;
|
|
139
|
+
})()),
|
|
140
|
+
...(0, global_1.conditionallyProvideAttribute)('threats', _.uniq(this.getProfiles(data.controlName || '').map((profile) => profile.threats)), (() => {
|
|
141
|
+
const result = this.getProfiles(data.controlName || '')
|
|
142
|
+
.map((profile) => profile.threats)
|
|
143
|
+
.filter((v) => Boolean(v));
|
|
144
|
+
return result.length > 0;
|
|
145
|
+
})()),
|
|
146
|
+
...(0, global_1.conditionallyProvideAttribute)('services', _.uniq(this.getProfiles(data.controlName || '').map((profile) => profile.service)), (() => {
|
|
147
|
+
const result = this.getProfiles(data.controlName || '')
|
|
148
|
+
.map((profile) => profile.service)
|
|
149
|
+
.filter((v) => Boolean(v));
|
|
150
|
+
return result.length > 0;
|
|
151
|
+
})()),
|
|
152
|
+
...(0, global_1.conditionallyProvideAttribute)('userImpacts', _.uniq(this.getProfiles(data.controlName || '').map((profile) => profile.userImpact)), (() => {
|
|
153
|
+
const result = this.getProfiles(data.controlName || '')
|
|
154
|
+
.map((profile) => profile.userImpact)
|
|
155
|
+
.filter((v) => Boolean(v));
|
|
156
|
+
return result.length > 0;
|
|
157
|
+
})())
|
|
158
|
+
}),
|
|
159
|
+
nist: global_1.DEFAULT_STATIC_CODE_ANALYSIS_NIST_TAGS
|
|
160
|
+
},
|
|
161
|
+
source_location: {},
|
|
162
|
+
descriptions: [
|
|
163
|
+
{
|
|
164
|
+
data: {
|
|
165
|
+
transformer: (data) => {
|
|
166
|
+
const profiles = this.getProfiles(data.controlName || '');
|
|
167
|
+
const remediationSteps = profiles
|
|
168
|
+
.map((profile) => { var _a; return (_a = profile.remediation) === null || _a === void 0 ? void 0 : _a.toString(); })
|
|
169
|
+
.filter((remediation) => remediation !== undefined);
|
|
170
|
+
return remediationSteps.join('\n');
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
label: 'fix'
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
data: {
|
|
177
|
+
transformer: (data) => {
|
|
178
|
+
const profiles = this.getProfiles(data.controlName || '');
|
|
179
|
+
const impact = profiles
|
|
180
|
+
.map((profile) => { var _a; return (_a = profile.remediationImpact) === null || _a === void 0 ? void 0 : _a.toString(); })
|
|
181
|
+
.filter((remediationImpact) => remediationImpact !== undefined);
|
|
182
|
+
return impact.join('\n');
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
label: 'rationale'
|
|
186
|
+
}
|
|
187
|
+
],
|
|
188
|
+
results: [
|
|
189
|
+
{
|
|
190
|
+
status: {
|
|
191
|
+
transformer: (data) => {
|
|
192
|
+
if (data.scoreInPercentage === 100) {
|
|
193
|
+
return inspecjs_1.ExecJSON.ControlResultStatus.Passed;
|
|
194
|
+
}
|
|
195
|
+
const knownMaxScores = this.getProfiles(data.controlName || '').map((profile) => profile.maxScore || 0);
|
|
196
|
+
const highMaxScore = Math.max(...knownMaxScores);
|
|
197
|
+
if (knownMaxScores.length === 0) {
|
|
198
|
+
return inspecjs_1.ExecJSON.ControlResultStatus.Failed;
|
|
199
|
+
}
|
|
200
|
+
else if (data.score === undefined) {
|
|
201
|
+
return inspecjs_1.ExecJSON.ControlResultStatus.Error;
|
|
202
|
+
}
|
|
203
|
+
else if (data.score === highMaxScore) {
|
|
204
|
+
return inspecjs_1.ExecJSON.ControlResultStatus.Passed;
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
return inspecjs_1.ExecJSON.ControlResultStatus.Failed;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
code_desc: {
|
|
212
|
+
transformer: (data) => data.implementationStatus
|
|
213
|
+
},
|
|
214
|
+
start_time: { transformer: () => this.data.createdDateTime }
|
|
215
|
+
}
|
|
216
|
+
]
|
|
217
|
+
}
|
|
218
|
+
],
|
|
219
|
+
sha256: ''
|
|
220
|
+
}
|
|
221
|
+
],
|
|
222
|
+
passthrough: {
|
|
223
|
+
transformer: () => {
|
|
224
|
+
return {
|
|
225
|
+
auxiliary_data: [
|
|
226
|
+
{
|
|
227
|
+
name: 'Microsoft Secure Score',
|
|
228
|
+
data: {
|
|
229
|
+
reportId: this.rawData.secureScore.value[0].id,
|
|
230
|
+
tenantId: this.rawData.secureScore.value[0].azureTenantId,
|
|
231
|
+
profiles: this.rawData.profiles,
|
|
232
|
+
enabledServices: this.rawData.secureScore.value[0].enabledServices,
|
|
233
|
+
averageComparativeScores: this.rawData.secureScore.value[0].averageComparativeScores,
|
|
234
|
+
currentScore: this.rawData.secureScore.value[0].currentScore,
|
|
235
|
+
maxScore: this.rawData.secureScore.value[0].maxScore,
|
|
236
|
+
secureScores: _.pick(this.rawData.secureScore, [
|
|
237
|
+
'@odata.context',
|
|
238
|
+
'@odata.nextLink'
|
|
239
|
+
])
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
],
|
|
243
|
+
...(this.withRaw && { raw: this.rawData })
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
this.withRaw = withRaw;
|
|
249
|
+
this.rawData = rawParams;
|
|
250
|
+
this.getProfiles = this.memoizedGetProfiles();
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
exports.MsftSecureScoreMapper = MsftSecureScoreMapper;
|
|
254
|
+
//# sourceMappingURL=msft-secure-score-mapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"msft-secure-score-mapper.js","sourceRoot":"","sources":["../../src/msft-secure-score-mapper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,uCAAkC;AAClC,kDAAgE;AAChE,qDAA6E;AAC7E,0CAA4B;AAC5B,2CAGwB;AAmBxB,MAAa,sBAAsB;IAIjC,YAAY,YAAoB,EAAE,OAAO,GAAG,KAAK;QAC/C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QACrC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,KAAK;QACH,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CACjD,IAAI,qBAAqB,CACvB,IAAI,CAAC,SAAS,CAAC;YACb,WAAW,EAAE;gBACX,KAAK,EAAE,CAAC,OAAO,CAAC;gBAChB,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;oBAC/B,gBAAgB;oBAChB,gBAAgB;iBACjB,CAAC;aACH;YACD,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ;SAC7B,CAAC,EACF,IAAI,CAAC,OAAO,CACb,CAAC,KAAK,EAAE,CACV,CAAC;IACJ,CAAC;CACF;AA1BD,wDA0BC;AAED,MAAa,qBAAsB,SAAQ,8BAAa;IAKtD,mBAAmB;QACjB,MAAM,KAAK,GAAgD,EAAE,CAAC;QAE9D,OAAO,CAAC,WAAmB,EAA+B,EAAE;YAC1D,IAAI,MAAM,CAAC,SAAS,CAAC,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