@mitre/hdf-converters 3.4.3 → 3.4.4
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/dist/index.d.ts +37 -24
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -30
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -114,6 +114,31 @@ interface V2Result {
|
|
|
114
114
|
resourceId?: string;
|
|
115
115
|
[key: string]: unknown;
|
|
116
116
|
}
|
|
117
|
+
interface V2StatusOverride {
|
|
118
|
+
type: string;
|
|
119
|
+
status?: string;
|
|
120
|
+
impact?: {
|
|
121
|
+
value: number;
|
|
122
|
+
};
|
|
123
|
+
reason?: string;
|
|
124
|
+
appliedBy?: {
|
|
125
|
+
type?: string;
|
|
126
|
+
identifier?: string;
|
|
127
|
+
};
|
|
128
|
+
appliedAt?: string;
|
|
129
|
+
expiresAt?: string;
|
|
130
|
+
[key: string]: unknown;
|
|
131
|
+
}
|
|
132
|
+
interface V2Poam {
|
|
133
|
+
type: string;
|
|
134
|
+
explanation?: string;
|
|
135
|
+
appliedBy?: {
|
|
136
|
+
type?: string;
|
|
137
|
+
identifier?: string;
|
|
138
|
+
};
|
|
139
|
+
appliedAt?: string;
|
|
140
|
+
[key: string]: unknown;
|
|
141
|
+
}
|
|
117
142
|
interface V2Requirement {
|
|
118
143
|
id: string;
|
|
119
144
|
title?: string;
|
|
@@ -133,6 +158,14 @@ interface V2Requirement {
|
|
|
133
158
|
waiverData?: Record<string, unknown>;
|
|
134
159
|
results?: V2Result[];
|
|
135
160
|
effectiveStatus?: string;
|
|
161
|
+
effectiveImpact?: number;
|
|
162
|
+
disposition?: string;
|
|
163
|
+
statusOverrides?: V2StatusOverride[];
|
|
164
|
+
poams?: V2Poam[];
|
|
165
|
+
cwe?: string[];
|
|
166
|
+
cvss?: Array<{
|
|
167
|
+
baseSeverity?: string;
|
|
168
|
+
}>;
|
|
136
169
|
[key: string]: unknown;
|
|
137
170
|
}
|
|
138
171
|
interface V2Group {
|
|
@@ -173,6 +206,10 @@ interface V2Baseline {
|
|
|
173
206
|
algorithm: string;
|
|
174
207
|
value: string;
|
|
175
208
|
};
|
|
209
|
+
resultsChecksum?: {
|
|
210
|
+
algorithm?: string;
|
|
211
|
+
value?: string;
|
|
212
|
+
};
|
|
176
213
|
depends?: V2Dependency[];
|
|
177
214
|
parentBaseline?: string;
|
|
178
215
|
status?: string;
|
|
@@ -197,30 +234,6 @@ interface HDFV2Results {
|
|
|
197
234
|
remediation?: unknown;
|
|
198
235
|
extensions?: Record<string, unknown>;
|
|
199
236
|
}
|
|
200
|
-
/**
|
|
201
|
-
* Convert HDF v1.0 results to v2.0 format.
|
|
202
|
-
*
|
|
203
|
-
* Performs comprehensive transformation at all levels:
|
|
204
|
-
* - Top-level: version removed, profiles → baselines, platform → components
|
|
205
|
-
* - Baselines: sha256 → checksum, controls → requirements, field renaming
|
|
206
|
-
* - Requirements: snake_case → camelCase, status → effectiveStatus
|
|
207
|
-
* - Results: snake_case → camelCase for all fields
|
|
208
|
-
*
|
|
209
|
-
* @param v1Data - HDF v1.0 results object
|
|
210
|
-
* @returns HDF v2.0 results object
|
|
211
|
-
*
|
|
212
|
-
* @example
|
|
213
|
-
* ```typescript
|
|
214
|
-
* const v1 = {
|
|
215
|
-
* version: "1.0.0",
|
|
216
|
-
* platform: { name: "ubuntu", release: "20.04" },
|
|
217
|
-
* profiles: [...],
|
|
218
|
-
* statistics: {...}
|
|
219
|
-
* };
|
|
220
|
-
* const v2 = convertV1ToV2(v1);
|
|
221
|
-
* // v2 = { baselines: [...], components: [{...}], statistics: {...} }
|
|
222
|
-
* ```
|
|
223
|
-
*/
|
|
224
237
|
declare function convertV1ToV2(v1Data: HDFV1Results): HDFV2Results;
|
|
225
238
|
/**
|
|
226
239
|
* Validate that data appears to be HDF v1.0 format.
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../converters/legacyhdf-to-hdf/typescript/converter.ts","../converters/asff-to-hdf/typescript/converter.ts","../converters/sarif-to-hdf/typescript/converter.ts","../converters/junit-to-hdf/typescript/converter.ts","../converters/xccdf-results-to-hdf/typescript/converter.ts","../converters/ckl-to-hdf/typescript/converter.ts","../converters/cklb-to-hdf/typescript/converter.ts","../converters/hdf-to-ckl/typescript/converter.ts","../converters/hdf-to-cklb/typescript/converter.ts","../converters/snyk-to-hdf/typescript/converter.ts","../converters/grype-to-hdf/typescript/converter.ts","../converters/defectdojo-to-hdf/typescript/converter.ts","../converters/nessus-to-hdf/typescript/converter.ts","../converters/sonarqube-to-hdf/typescript/converter.ts","../converters/aws-config-to-hdf/typescript/converter.ts","../converters/checkov-to-hdf/typescript/converter.ts","../converters/gosec-to-hdf/typescript/converter.ts","../converters/nikto-to-hdf/typescript/converter.ts","../converters/zap-to-hdf/typescript/converter.ts","../converters/cyclonedx-to-hdf/typescript/converter.ts","../converters/hdf-to-csv/typescript/converter.ts","../converters/hdf-to-ecs/typescript/converter.ts","../converters/hdf-to-splunk/typescript/converter.ts","../converters/hdf-to-ocsf/typescript/converter.ts","../converters/hdf-to-asff/typescript/converter.ts","../converters/splunk-to-hdf/typescript/converter.ts","../converters/hdf-to-xml/typescript/converter.ts","../converters/gitlab-to-hdf/typescript/converter.ts","../converters/trufflehog-to-hdf/typescript/converter.ts","../converters/hipcheck-to-hdf/typescript/converter.ts","../converters/burpsuite-to-hdf/typescript/converter.ts","../converters/dbprotect-to-hdf/typescript/converter.ts","../converters/twistlock-to-hdf/typescript/converter.ts","../converters/deptrack-to-hdf/typescript/converter.ts","../converters/jfrog-xray-to-hdf/typescript/converter.ts","../converters/neuvector-to-hdf/typescript/converter.ts","../converters/fortify-to-hdf/typescript/converter.ts","../converters/prisma-to-hdf/typescript/converter.ts","../converters/netsparker-to-hdf/typescript/converter.ts","../converters/scoutsuite-to-hdf/typescript/converter.ts","../converters/conveyor-to-hdf/typescript/converter.ts","../converters/veracode-to-hdf/typescript/converter.ts","../converters/msft-secure-score-to-hdf/typescript/converter.ts","../converters/msft-defender-devops-to-hdf/typescript/converter.ts","../converters/msft-defender-cloud-to-hdf/typescript/converter.ts","../converters/msft-defender-endpoint-to-hdf/typescript/converter.ts","../converters/hdf-to-xccdf/typescript/converter.ts","../converters/hdf-to-oscal-sar/typescript/converter.ts","../converters/hdf-to-oscal-poam/typescript/converter.ts","../converters/ionchannel-to-hdf/typescript/converter.ts","../converters/openvex-to-hdf/typescript/converter.ts","../converters/csaf-vex-to-hdf/typescript/converter.ts","../converters/cyclonedx-vex-to-hdf/typescript/converter.ts","../converters/hdf-to-csaf-vex/typescript/converter.ts","../converters/hdf-to-openvex/typescript/converter.ts","../converters/hdf-to-cyclonedx-vex/typescript/converter.ts","../converters/oscal-to-hdf/typescript/detect.ts","../converters/oscal-to-hdf/typescript/converter-catalog.ts","../converters/oscal-to-hdf/typescript/converter-profile.ts","../converters/oscal-to-hdf/typescript/converter-component.ts","../converters/oscal-to-hdf/typescript/converter-ssp.ts","../converters/oscal-to-hdf/typescript/converter-sap.ts","../converters/oscal-to-hdf/typescript/converter-poam.ts","../converters/oscal-to-hdf/typescript/converter-sar.ts"],"mappings":";;;;;;;;;;;;UAkBiB;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;GACC;;UAGc;EACf;EACA;EACA;EACA,eAAe;IAAO;IAAe;;EACrC;EACA;EACA,OAAO;EACP;EACA;IACE;IACA;;EAEF,cAAc;EACd,UAAU;EACV;GACC;;UAGc;EACf;EACA;EACA;GACC;;UAGc;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;GACC;;UAGc;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS;EACT,WAAW;EACX;EACA,UAAU;EACV;EACA;EACA;EACA;GACC;;UAGc;EACf;EACA;EACA;GACC;;UAGc;EACf;EACA,UAAU;EACV,UAAU;EACV;EACA;EACA;GACC;;UAKc;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;GACC;;UAGc;EACf;EACA;EACA;EACA,eAAe;IAAO;IAAe;;EACrC;EACA;EACA,OAAO;EACP;EACA;IACE;IACA;;EAEF,aAAa;EACb,UAAU;EACV;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../converters/legacyhdf-to-hdf/typescript/converter.ts","../converters/asff-to-hdf/typescript/converter.ts","../converters/sarif-to-hdf/typescript/converter.ts","../converters/junit-to-hdf/typescript/converter.ts","../converters/xccdf-results-to-hdf/typescript/converter.ts","../converters/ckl-to-hdf/typescript/converter.ts","../converters/cklb-to-hdf/typescript/converter.ts","../converters/hdf-to-ckl/typescript/converter.ts","../converters/hdf-to-cklb/typescript/converter.ts","../converters/snyk-to-hdf/typescript/converter.ts","../converters/grype-to-hdf/typescript/converter.ts","../converters/defectdojo-to-hdf/typescript/converter.ts","../converters/nessus-to-hdf/typescript/converter.ts","../converters/sonarqube-to-hdf/typescript/converter.ts","../converters/aws-config-to-hdf/typescript/converter.ts","../converters/checkov-to-hdf/typescript/converter.ts","../converters/gosec-to-hdf/typescript/converter.ts","../converters/nikto-to-hdf/typescript/converter.ts","../converters/zap-to-hdf/typescript/converter.ts","../converters/cyclonedx-to-hdf/typescript/converter.ts","../converters/hdf-to-csv/typescript/converter.ts","../converters/hdf-to-ecs/typescript/converter.ts","../converters/hdf-to-splunk/typescript/converter.ts","../converters/hdf-to-ocsf/typescript/converter.ts","../converters/hdf-to-asff/typescript/converter.ts","../converters/splunk-to-hdf/typescript/converter.ts","../converters/hdf-to-xml/typescript/converter.ts","../converters/gitlab-to-hdf/typescript/converter.ts","../converters/trufflehog-to-hdf/typescript/converter.ts","../converters/hipcheck-to-hdf/typescript/converter.ts","../converters/burpsuite-to-hdf/typescript/converter.ts","../converters/dbprotect-to-hdf/typescript/converter.ts","../converters/twistlock-to-hdf/typescript/converter.ts","../converters/deptrack-to-hdf/typescript/converter.ts","../converters/jfrog-xray-to-hdf/typescript/converter.ts","../converters/neuvector-to-hdf/typescript/converter.ts","../converters/fortify-to-hdf/typescript/converter.ts","../converters/prisma-to-hdf/typescript/converter.ts","../converters/netsparker-to-hdf/typescript/converter.ts","../converters/scoutsuite-to-hdf/typescript/converter.ts","../converters/conveyor-to-hdf/typescript/converter.ts","../converters/veracode-to-hdf/typescript/converter.ts","../converters/msft-secure-score-to-hdf/typescript/converter.ts","../converters/msft-defender-devops-to-hdf/typescript/converter.ts","../converters/msft-defender-cloud-to-hdf/typescript/converter.ts","../converters/msft-defender-endpoint-to-hdf/typescript/converter.ts","../converters/hdf-to-xccdf/typescript/converter.ts","../converters/hdf-to-oscal-sar/typescript/converter.ts","../converters/hdf-to-oscal-poam/typescript/converter.ts","../converters/ionchannel-to-hdf/typescript/converter.ts","../converters/openvex-to-hdf/typescript/converter.ts","../converters/csaf-vex-to-hdf/typescript/converter.ts","../converters/cyclonedx-vex-to-hdf/typescript/converter.ts","../converters/hdf-to-csaf-vex/typescript/converter.ts","../converters/hdf-to-openvex/typescript/converter.ts","../converters/hdf-to-cyclonedx-vex/typescript/converter.ts","../converters/oscal-to-hdf/typescript/detect.ts","../converters/oscal-to-hdf/typescript/converter-catalog.ts","../converters/oscal-to-hdf/typescript/converter-profile.ts","../converters/oscal-to-hdf/typescript/converter-component.ts","../converters/oscal-to-hdf/typescript/converter-ssp.ts","../converters/oscal-to-hdf/typescript/converter-sap.ts","../converters/oscal-to-hdf/typescript/converter-poam.ts","../converters/oscal-to-hdf/typescript/converter-sar.ts"],"mappings":";;;;;;;;;;;;UAkBiB;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;GACC;;UAGc;EACf;EACA;EACA;EACA,eAAe;IAAO;IAAe;;EACrC;EACA;EACA,OAAO;EACP;EACA;IACE;IACA;;EAEF,cAAc;EACd,UAAU;EACV;GACC;;UAGc;EACf;EACA;EACA;GACC;;UAGc;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;GACC;;UAGc;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS;EACT,WAAW;EACX;EACA,UAAU;EACV;EACA;EACA;EACA;GACC;;UAGc;EACf;EACA;EACA;GACC;;UAGc;EACf;EACA,UAAU;EACV,UAAU;EACV;EACA;EACA;GACC;;UAKc;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;GACC;;UAGc;EACf;EACA;EACA;IAAU;;EACV;EACA;IAAa;IAAe;;EAC5B;EACA;GACC;;UAGc;EACf;EACA;EACA;IAAa;IAAe;;EAC5B;GACC;;UAGc;EACf;EACA;EACA;EACA,eAAe;IAAO;IAAe;;EACrC;EACA;EACA,OAAO;EACP;EACA;IACE;IACA;;EAEF,aAAa;EACb,UAAU;EACV;EACA;EACA;EACA,kBAAkB;EAClB,QAAQ;EACR;EACA,OAAO;IAAO;;GACb;;UAGc;EACf;EACA;EACA;GACC;;UAGc;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;GACC;;UAGc;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS;EACT,eAAe;EACf;IACE;IACA;;EAEF;IACE;IACA;;EAEF,UAAU;EACV;EACA;EACA;EACA;GACC;;UAGc;EACf,WAAW;EACX;EACA;EACA;EACA;IAAS;IAAe;IAAkB;;EAC1C;EACA;EACA;EACA;EACA;EACA,aAAa;;iBAgrBC,cAAc,QAAQ,eAAe;;;;;;;iBAgErC,QAAQ,gBAAgB,QAAQ;;;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"}
|
package/dist/index.js
CHANGED
|
@@ -753,30 +753,6 @@ function convertProfile(v1Profile) {
|
|
|
753
753
|
if (v1Profile.depends?.length) v2Baseline.depends = v1Profile.depends.map(convertDependency);
|
|
754
754
|
return v2Baseline;
|
|
755
755
|
}
|
|
756
|
-
/**
|
|
757
|
-
* Convert HDF v1.0 results to v2.0 format.
|
|
758
|
-
*
|
|
759
|
-
* Performs comprehensive transformation at all levels:
|
|
760
|
-
* - Top-level: version removed, profiles → baselines, platform → components
|
|
761
|
-
* - Baselines: sha256 → checksum, controls → requirements, field renaming
|
|
762
|
-
* - Requirements: snake_case → camelCase, status → effectiveStatus
|
|
763
|
-
* - Results: snake_case → camelCase for all fields
|
|
764
|
-
*
|
|
765
|
-
* @param v1Data - HDF v1.0 results object
|
|
766
|
-
* @returns HDF v2.0 results object
|
|
767
|
-
*
|
|
768
|
-
* @example
|
|
769
|
-
* ```typescript
|
|
770
|
-
* const v1 = {
|
|
771
|
-
* version: "1.0.0",
|
|
772
|
-
* platform: { name: "ubuntu", release: "20.04" },
|
|
773
|
-
* profiles: [...],
|
|
774
|
-
* statistics: {...}
|
|
775
|
-
* };
|
|
776
|
-
* const v2 = convertV1ToV2(v1);
|
|
777
|
-
* // v2 = { baselines: [...], components: [{...}], statistics: {...} }
|
|
778
|
-
* ```
|
|
779
|
-
*/
|
|
780
756
|
function convertV1ToV2(v1Data) {
|
|
781
757
|
validateInputSize(JSON.stringify(v1Data), "legacyhdf-to-hdf");
|
|
782
758
|
const v2 = {
|
|
@@ -3044,7 +3020,7 @@ function buildKev(k) {
|
|
|
3044
3020
|
if (k.notes) out.notes = k.notes;
|
|
3045
3021
|
return out;
|
|
3046
3022
|
}
|
|
3047
|
-
function convertMatchToRequirement(match, isIgnored) {
|
|
3023
|
+
function convertMatchToRequirement(match, isIgnored, targetName, startTime) {
|
|
3048
3024
|
const vuln = match.vulnerability;
|
|
3049
3025
|
const cveId = vuln.id;
|
|
3050
3026
|
const severity = vuln.severity;
|
|
@@ -3067,11 +3043,12 @@ function convertMatchToRequirement(match, isIgnored) {
|
|
|
3067
3043
|
status,
|
|
3068
3044
|
codeDesc: buildCodeDesc$8(match),
|
|
3069
3045
|
message,
|
|
3070
|
-
startTime
|
|
3046
|
+
startTime
|
|
3071
3047
|
};
|
|
3072
3048
|
const tags = buildNistCciTags(DEFAULT_STATIC_ANALYSIS_NIST_TAGS, nistToCci(DEFAULT_STATIC_ANALYSIS_NIST_TAGS));
|
|
3073
3049
|
const requirement = {
|
|
3074
3050
|
id: isIgnored ? `Grype-Ignored-Match/${cveId}` : `Grype/${cveId}`,
|
|
3051
|
+
title: `Grype found a vulnerability to ${cveId} in ${targetName}`,
|
|
3075
3052
|
impact,
|
|
3076
3053
|
results: [result],
|
|
3077
3054
|
tags,
|
|
@@ -3110,19 +3087,21 @@ async function convertGrypeToHdf(input, converterVersion = "1.0.0") {
|
|
|
3110
3087
|
const resultsChecksum = await inputChecksum(input);
|
|
3111
3088
|
const grypeData = parseJSON(input);
|
|
3112
3089
|
const requirements = [];
|
|
3090
|
+
const targetName = grypeData.source?.target?.userInput || "Grype Scan";
|
|
3091
|
+
const scanTime = grypeData.descriptor?.timestamp ? parseTimestamp(grypeData.descriptor.timestamp) : null;
|
|
3092
|
+
const resultStart = scanTime ?? /* @__PURE__ */ new Date("0001-01-01T00:00:00Z");
|
|
3113
3093
|
if (grypeData.matches && grypeData.matches.length > 0) {
|
|
3114
3094
|
const { items: limitedMatches, truncated: truncatedMatches } = limitArray(grypeData.matches);
|
|
3115
3095
|
/* v8 ignore next -- truncation only triggers with >100K items */
|
|
3116
3096
|
if (truncatedMatches) console.warn(`WARNING: Input truncated at ${limitedMatches.length} match items (original: ${grypeData.matches.length})`);
|
|
3117
|
-
for (const match of limitedMatches) requirements.push(convertMatchToRequirement(match, false));
|
|
3097
|
+
for (const match of limitedMatches) requirements.push(convertMatchToRequirement(match, false, targetName, resultStart));
|
|
3118
3098
|
}
|
|
3119
3099
|
if (grypeData.ignoredMatches && grypeData.ignoredMatches.length > 0) {
|
|
3120
3100
|
const { items: limitedIgnored, truncated: truncatedIgnored } = limitArray(grypeData.ignoredMatches);
|
|
3121
3101
|
/* v8 ignore next -- truncation only triggers with >100K items */
|
|
3122
3102
|
if (truncatedIgnored) console.warn(`WARNING: Input truncated at ${limitedIgnored.length} ignoredMatch items (original: ${grypeData.ignoredMatches.length})`);
|
|
3123
|
-
for (const match of limitedIgnored) requirements.push(convertMatchToRequirement(match, true));
|
|
3103
|
+
for (const match of limitedIgnored) requirements.push(convertMatchToRequirement(match, true, targetName, resultStart));
|
|
3124
3104
|
}
|
|
3125
|
-
const targetName = grypeData.source?.target?.userInput || "Grype Scan";
|
|
3126
3105
|
if (requirements.length === 0) requirements.push(buildNoFindingsRequirement("grype-no-findings", `Grype scanned ${targetName} and reported zero vulnerable components.`, /* @__PURE__ */ new Date()));
|
|
3127
3106
|
const baseline = createMinimalBaseline(targetName, requirements, { resultsChecksum });
|
|
3128
3107
|
return buildHdfResults({
|
|
@@ -3135,7 +3114,7 @@ async function convertGrypeToHdf(input, converterVersion = "1.0.0") {
|
|
|
3135
3114
|
type: TargetType.Artifact,
|
|
3136
3115
|
name: targetName
|
|
3137
3116
|
}],
|
|
3138
|
-
timestamp:
|
|
3117
|
+
timestamp: scanTime ?? void 0
|
|
3139
3118
|
});
|
|
3140
3119
|
}
|
|
3141
3120
|
//#endregion
|