@mitre/hdf-converters 3.4.1 → 3.4.3
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 +2 -0
- package/dist/index.d.ts +13 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +376 -20
- package/dist/index.js.map +1 -1
- package/dist/register-all-WRR-vAZf.js.map +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -23,11 +23,13 @@ All converter output conforms to the [HDF JSON Schema](https://mitre.github.io/h
|
|
|
23
23
|
| CycloneDX (SBOM) | `convertCyclonedxToHdf` | JSON |
|
|
24
24
|
| CycloneDX VEX (→ HDF Amendments) | `convertCyclonedxVexToHdf` | JSON |
|
|
25
25
|
| DBProtect | `convertDbprotectToHdf` | XML |
|
|
26
|
+
| DefectDojo | `convertDefectDojoToHdf` | JSON |
|
|
26
27
|
| Dependency-Track | `convertDeptrackToHdf` | JSON |
|
|
27
28
|
| Fortify | `convertFortifyToHdf` | XML |
|
|
28
29
|
| GitLab Security Report | `convertGitlabToHdf` | JSON |
|
|
29
30
|
| Gosec | `convertGosecToHdf` | JSON |
|
|
30
31
|
| Grype | `convertGrypeToHdf` | JSON |
|
|
32
|
+
| Hipcheck | `convertHipcheckToHdf` | JSON |
|
|
31
33
|
| Ion Channel | `convertIonchannelToHdf` | JSON |
|
|
32
34
|
| JFrog Xray | `convertJfrogXrayToHdf` | JSON |
|
|
33
35
|
| JUnit | `convertJunitToHdf` | XML |
|
package/dist/index.d.ts
CHANGED
|
@@ -318,6 +318,9 @@ declare function convertSnykToHdf(input: string, converterVersion?: string): Pro
|
|
|
318
318
|
//#region converters/grype-to-hdf/typescript/converter.d.ts
|
|
319
319
|
declare function convertGrypeToHdf(input: string, converterVersion?: string): Promise<string>;
|
|
320
320
|
//#endregion
|
|
321
|
+
//#region converters/defectdojo-to-hdf/typescript/converter.d.ts
|
|
322
|
+
declare function convertDefectDojoToHdf(input: string, converterVersion?: string): Promise<string>;
|
|
323
|
+
//#endregion
|
|
321
324
|
//#region converters/nessus-to-hdf/typescript/converter.d.ts
|
|
322
325
|
/**
|
|
323
326
|
* Convert Nessus XML scan results to HDF format
|
|
@@ -435,6 +438,15 @@ declare function convertGitlabToHdf(input: string, converterVersion?: string): P
|
|
|
435
438
|
*/
|
|
436
439
|
declare function convertTrufflehogToHdf(input: string, converterVersion?: string): Promise<string>;
|
|
437
440
|
//#endregion
|
|
441
|
+
//#region converters/hipcheck-to-hdf/typescript/converter.d.ts
|
|
442
|
+
/**
|
|
443
|
+
* Converts a MITRE Hipcheck `hc check --format json` report to HDF Results.
|
|
444
|
+
*
|
|
445
|
+
* @param input - Hipcheck JSON report string
|
|
446
|
+
* @returns HDF JSON string
|
|
447
|
+
*/
|
|
448
|
+
declare function convertHipcheckToHdf(input: string, converterVersion?: string): Promise<string>;
|
|
449
|
+
//#endregion
|
|
438
450
|
//#region converters/burpsuite-to-hdf/typescript/converter.d.ts
|
|
439
451
|
/**
|
|
440
452
|
* Converts BurpSuite Pro XML export to HDF format.
|
|
@@ -800,5 +812,5 @@ declare function convertOscalPoamToHdf(input: string): Promise<string>;
|
|
|
800
812
|
*/
|
|
801
813
|
declare function convertOscalSarToHdf(input: string): Promise<string>;
|
|
802
814
|
//#endregion
|
|
803
|
-
export { type HDFV1Results, type HDFV2Results, convertAsffToHdf, convertAwsConfigToHdf, convertBurpsuiteToHdf, convertCheckovToHdf, convertCklToHdf, convertCklbToHdf, convertConveyorToHdf, convertCsafVexToHdf, convertCyclonedxToHdf, convertCyclonedxVexToHdf, convertDbprotectToHdf, convertDeptrackToHdf, convertFortifyToHdf, convertGitlabToHdf, convertGosecToHdf, convertGrypeToHdf, convertHdfToAsff, convertHdfToCkl, convertHdfToCklb, convertHdfToCsafVex, convertHdfToCsv, convertHdfToCyclonedxVex, convertHdfToEcs, convertHdfToOcsf, convertHdfToOpenVex, convertHdfToOscalPoam, convertHdfToOscalSar, convertHdfToSplunk, convertHdfToXccdf, convertHdfToXml, convertIonchannelToHdf, convertJfrogXrayToHdf, convertJunitToHdf, convertMsftDefenderCloudToHdf, convertMsftDefenderDevopsToHdf, convertMsftDefenderEndpointToHdf, convertMsftSecureScoreToHdf, convertNessusToHdf, convertNetsparkerToHdf, convertNeuvectorToHdf, convertNiktoToHdf, convertOpenVexToHdf, convertOscalCatalogToHdf, convertOscalComponentToHdf, convertOscalPoamToHdf, convertOscalProfileToHdf, convertOscalSapToHdf, convertOscalSarToHdf, convertOscalSspToHdf, convertPrismaToHdf, convertSarifToHdf, convertScoutsuiteToHdf, convertSnykToHdf, convertSonarqubeToHdf, convertSplunkToHdf, convertTrufflehogToHdf, convertTwistlockToHdf, convertV1ToV2, convertVeracodeToHdf, convertXccdfResultsToHdf, convertZapToHdf, detectOscalDocumentType, isHDFV1 };
|
|
815
|
+
export { type HDFV1Results, type HDFV2Results, convertAsffToHdf, convertAwsConfigToHdf, convertBurpsuiteToHdf, convertCheckovToHdf, convertCklToHdf, convertCklbToHdf, convertConveyorToHdf, convertCsafVexToHdf, convertCyclonedxToHdf, convertCyclonedxVexToHdf, convertDbprotectToHdf, convertDefectDojoToHdf, convertDeptrackToHdf, convertFortifyToHdf, convertGitlabToHdf, convertGosecToHdf, convertGrypeToHdf, convertHdfToAsff, convertHdfToCkl, convertHdfToCklb, convertHdfToCsafVex, convertHdfToCsv, convertHdfToCyclonedxVex, convertHdfToEcs, convertHdfToOcsf, convertHdfToOpenVex, convertHdfToOscalPoam, convertHdfToOscalSar, convertHdfToSplunk, convertHdfToXccdf, convertHdfToXml, convertHipcheckToHdf, convertIonchannelToHdf, convertJfrogXrayToHdf, convertJunitToHdf, convertMsftDefenderCloudToHdf, convertMsftDefenderDevopsToHdf, convertMsftDefenderEndpointToHdf, convertMsftSecureScoreToHdf, convertNessusToHdf, convertNetsparkerToHdf, convertNeuvectorToHdf, convertNiktoToHdf, convertOpenVexToHdf, convertOscalCatalogToHdf, convertOscalComponentToHdf, convertOscalPoamToHdf, convertOscalProfileToHdf, convertOscalSapToHdf, convertOscalSarToHdf, convertOscalSspToHdf, convertPrismaToHdf, convertSarifToHdf, convertScoutsuiteToHdf, convertSnykToHdf, convertSonarqubeToHdf, convertSplunkToHdf, convertTrufflehogToHdf, convertTwistlockToHdf, convertV1ToV2, convertVeracodeToHdf, convertXccdfResultsToHdf, convertZapToHdf, detectOscalDocumentType, isHDFV1 };
|
|
804
816
|
//# sourceMappingURL=index.d.ts.map
|
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/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/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;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,eAAe;EACf;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;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqcC,cAAc,QAAQ,eAAe;;;;;;;iBAgErC,QAAQ,gBAAgB,QAAQ;;;;
|
|
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;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,eAAe;EACf;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;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqcC,cAAc,QAAQ,eAAe;;;;;;;iBAgErC,QAAQ,gBAAgB,QAAQ;;;;iBClO1B,iBAAiB,eAAe,4BAA6B;;;iBC7U7D,kBAAkB,eAAe,4BAA6B;;;;;;iBC7E9D,kBAAkB,eAAe,4BAA6B;;;iBCqN9D,yBAAyB,eAAe,4BAA6B;;;;;;;;;;;;iBChSrE,gBAAgB,gBAAgB;;;;;;;;;;;;iBCAhC,iBAAiB,gBAAgB;;;;;;;;;;;;;;;;;iBCGvC,gBAAgB;;;;;;;;;;;;;;;;iBCDhB,iBAAiB;;;;;;;;;;;;iBCyNX,iBAAiB,eAAe,4BAA6B;;;iBCkQ7D,kBAAkB,eAAe,4BAA6B;;;iBCjP9D,uBAAuB,eAAe,4BAA6B;;;;;;iBC7FnE,mBAAmB,mBAAmB,4BAA6B,QAAQ;;;;;;;;;iBC8D3E,sBAAsB,eAAe,4BAA6B;;;;;;;;;;iBC8DlE,sBAAsB,eAAe,4BAA6B;;;;;;;;;;;iBCxHlE,oBAAoB,eAAe,4BAA6B;;;;;;;;;;;iBCRhE,kBAAkB,eAAe,4BAA6B;;;iBC/D9D,kBAAkB,eAAe,4BAA+B;;;iBC+EhE,gBAAgB,eAAe,4BAA6B;;;;;;;;;iBC8B5D,sBAAsB,eAAe,4BAA6B;;;;;;;;iBCjKxE,gBAAgB;;;iBCChB,gBAAgB,eAAe;;;iBCG/B,mBAAmB,eAAe;;;iBCKlC,iBAAiB,eAAe;;;iBCFhC,iBAAiB,eAAe;;;;;;;;;;;;;;iBC8G1B,mBAAmB,eAAe,4BAA6B;;;;;;;;iBCjJrE,gBAAgB;;;iBC+NV,mBAAmB,eAAe,4BAA6B;;;;;;;;;;iBC6B/D,uBAAuB,eAAe,4BAA6B;;;;;;;;;iBC/DnE,qBAAqB,eAAe,4BAA6B;;;;;;;;;;;;iBChFjE,sBAAsB,eAAe,4BAA6B;;;;;;;;;;;iBC6GlE,sBAAsB,eAAe,4BAA6B;;;;;;;;;;;;iBCoMlE,sBAAsB,eAAe,4BAA6B;;;;;;;;;iBCrLlE,qBAAqB,eAAe,4BAA6B;;;;;;;;;iBCEjE,sBAAsB,eAAe,4BAA6B;;;;;;;;;;;;;;;;;iBC7BlE,sBAAsB,eAAe,4BAA6B;;;;;;;;;;;;;iBCwGlE,oBAAoB,eAAe,4BAA6B;;;;;;;;;;;;;;;;;iBClChE,mBAAmB,eAAe,4BAA6B;;;;;;;;;;iBCsB/D,uBAAuB,eAAe,4BAA6B;;;;;;;;;;iBChFnE,uBAAuB,eAAe,4BAA6B;;;;;;;;;;iBCmDnE,qBAAqB,eAAe,4BAA6B;;;;;;;;;;;;;;;;;;;;;iBC8HjE,qBAAqB,eAAe,4BAA6B;;;;;;;;;;;;iBC9KjE,4BAA4B,eAAe,4BAA6B;;;;;;;;iBC7KxE,+BAA+B,eAAe,4BAA6B;;;;;;;;;iBC4H3E,8BAA8B,eAAe,4BAA6B;;;;;;;;;;iBCoG1E,iCAAiC,eAAe,4BAA6B;;;;;;;;;iBC3PnF,kBAAkB;;;;;;;;;iBCUZ,qBAAqB,gBAAgB;;;;;;;;;;;;;;iBCRrC,sBAAsB,gBAAgB;;;iBCoKtC,uBAAuB,eAAe,4BAA6B;;;iBCxHnE,oBACpB,eACA,4BACC,QAAQ;;;iBCiEW,oBACpB,eACA,4BACC,QAAQ;;;iBC1CW,yBACpB,eACA,4BACC,QAAQ;;;iBCVK,oBAAoB,eAAe;;;iBC9C7B,oBACpB,eACA,2BACC;;;iBC0DmB,yBACpB,eACA,2BACC;;;;;;;;;KC1GS;;;;;;;iBAeI,wBAAwB,gBAAgB;;;;;;;;;iBCClC,yBAAyB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCYzC,yBACpB,sBACA,uBACC;;;;;;;;;;;;;;iBCtBmB,2BAA2B,gBAAgB;;;;;;;;;;;;;;iBCY3C,qBAAqB,gBAAgB;;;;;;;;;;;;;;iBCKrC,qBAAqB,gBAAgB;;;;;;;;;;;;;;iBCOrC,sBAAsB,gBAAgB;;;;;;;;;;;;;;iBCCtC,qBAAqB,gBAAgB"}
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { n as detectConverter, t as registerAllFingerprints } from "./register-a
|
|
|
2
2
|
import { flattenOverlays } from "@mitre/hdf-parsers";
|
|
3
3
|
import { buildCsv, buildXml, cvssScoreToSeverity, formatTimestamp, formatTimestampSeconds, impactToSeverity, normalizeHdfTimestamps, parseCsv, parseJSON, parsePurl, parseTimestamp, parseXml, parseXmlWithArrays, severityToImpact, sha256, stripHtml as stripHTML, trimUtcFraction } from "@mitre/hdf-utilities";
|
|
4
4
|
import { Applicability, AuthorizationStatus, CVSSSeverity, CategorizationLevel, ControlType, Ecosystem, EvidenceType, HashAlgorithm, IdentityType, Justification, MilestoneStatus, OverrideType, PlanType, ResultStatus, TargetType, VerificationMethodEnum, Version, createDescription, createMinimalBaseline, createRequirement, createResult, severityToImpact as severityToImpact$1 } from "@mitre/hdf-schema";
|
|
5
|
-
import { DEFAULT_COMPONENT_MANAGEMENT_NIST_TAGS, DEFAULT_REMEDIATION_NIST_TAGS, DEFAULT_STATIC_ANALYSIS_NIST_TAGS, DEFAULT_STATIC_ANALYSIS_NIST_TAGS as DEFAULT_STATIC_ANALYSIS_NIST_TAGS$1, awsConfigMappedRevisions, getAwsConfigNistControlByIdentifier, getAwsConfigNistControlByName, getAwsConfigNistControlsBySubstring, getCCINistMappings, getCurrentNistRevision, getCweNistControl, getNessusNistControl, getNiktoNistControl, getOwaspNistControl, getScoutsuiteNistControl, isNistStrict, nistToCci } from "@mitre/hdf-mappings";
|
|
5
|
+
import { DEFAULT_COMPONENT_MANAGEMENT_NIST_TAGS, DEFAULT_CONFIG_MANAGEMENT_NIST_TAGS, DEFAULT_REMEDIATION_NIST_TAGS, DEFAULT_STATIC_ANALYSIS_NIST_TAGS, DEFAULT_STATIC_ANALYSIS_NIST_TAGS as DEFAULT_STATIC_ANALYSIS_NIST_TAGS$1, awsConfigMappedRevisions, getAwsConfigNistControlByIdentifier, getAwsConfigNistControlByName, getAwsConfigNistControlsBySubstring, getCCINistMappings, getCurrentNistRevision, getCweNistControl, getHipcheckNistControls, getNessusNistControl, getNiktoNistControl, getOwaspNistControl, getScoutsuiteNistControl, isNistStrict, nistToCci } from "@mitre/hdf-mappings";
|
|
6
6
|
//#region shared/typescript/converterutil.ts
|
|
7
7
|
/**
|
|
8
8
|
* Shared utilities for TypeScript HDF converters.
|
|
@@ -973,7 +973,7 @@ function controlId(f) {
|
|
|
973
973
|
* the shared awsconfig mapping, falling back to the static analysis default
|
|
974
974
|
* bundle (matching the SAF CLI) when no config rule applies.
|
|
975
975
|
*/
|
|
976
|
-
function nistTags(group) {
|
|
976
|
+
function nistTags$1(group) {
|
|
977
977
|
if (group.length > 0 && productOf(group[0]) === "trivy" && trivyCVE(group[0])) return DEFAULT_REMEDIATION_NIST_TAGS$1;
|
|
978
978
|
const out = [];
|
|
979
979
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -981,10 +981,15 @@ function nistTags(group) {
|
|
|
981
981
|
seen.add(tag);
|
|
982
982
|
out.push(tag);
|
|
983
983
|
}
|
|
984
|
-
|
|
984
|
+
if (out.length > 0) return out;
|
|
985
|
+
if (group.length > 0 && isConfigRuleFinding(group[0])) return DEFAULT_CONFIG_MANAGEMENT_NIST_TAGS;
|
|
986
|
+
return DEFAULT_STATIC_ANALYSIS_NIST_TAGS;
|
|
987
|
+
}
|
|
988
|
+
function isConfigRuleFinding(f) {
|
|
989
|
+
return f.ProductFields?.["RelatedAWSResources:0/type"] === "AWS::Config::ConfigRule";
|
|
985
990
|
}
|
|
986
991
|
function configRuleNist(f) {
|
|
987
|
-
if (f
|
|
992
|
+
if (!isConfigRuleFinding(f)) return [];
|
|
988
993
|
const name = f.ProductFields?.["RelatedAWSResources:0/name"];
|
|
989
994
|
if (!name) return [];
|
|
990
995
|
return getAwsConfigNistControlsBySubstring(name);
|
|
@@ -1056,13 +1061,30 @@ function vulnerabilitySummary(f) {
|
|
|
1056
1061
|
return parts.join("; ");
|
|
1057
1062
|
}).join("\n");
|
|
1058
1063
|
}
|
|
1059
|
-
/** Summarizes the installed vs patched package for a Trivy CVE finding. */
|
|
1060
1064
|
function trivyMessage(f) {
|
|
1061
1065
|
const o = f.Resources?.[0]?.Details?.Other;
|
|
1062
|
-
if (!o
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
+
if (!o) return "";
|
|
1067
|
+
if (o["CVE ID"]) {
|
|
1068
|
+
const patched = o["Patched Package"];
|
|
1069
|
+
const patchMsg = patched ? `The package has been patched since version(s): ${patched}.` : "There is no patched version of the package.";
|
|
1070
|
+
return `For package ${o["PkgName"] ?? ""}, the current version that is installed is ${o["Installed Package"] ?? ""}. ${patchMsg}`;
|
|
1071
|
+
}
|
|
1072
|
+
if (o["Message"]) {
|
|
1073
|
+
const loc = trivyLocation(o);
|
|
1074
|
+
return loc ? `${o["Message"]} (${loc})` : o["Message"];
|
|
1075
|
+
}
|
|
1076
|
+
if (o["Filename"]) return `Secret detected in ${o["Filename"]}.`;
|
|
1077
|
+
return "";
|
|
1078
|
+
}
|
|
1079
|
+
function trivyLocation(o) {
|
|
1080
|
+
const file = o["Filename"] ?? "";
|
|
1081
|
+
if (!file) return "";
|
|
1082
|
+
const sl = o["StartLine"];
|
|
1083
|
+
if (!sl || sl === "0") return file;
|
|
1084
|
+
let loc = `${file}:${sl}`;
|
|
1085
|
+
const el = o["EndLine"];
|
|
1086
|
+
if (el && el !== "0" && el !== sl) loc += `-${el}`;
|
|
1087
|
+
return loc;
|
|
1066
1088
|
}
|
|
1067
1089
|
function buildRequirement$17(id, group) {
|
|
1068
1090
|
const primary = group[0];
|
|
@@ -1076,7 +1098,7 @@ function buildRequirement$17(id, group) {
|
|
|
1076
1098
|
label: "fix",
|
|
1077
1099
|
data: fix
|
|
1078
1100
|
});
|
|
1079
|
-
const nist = nistTags(group);
|
|
1101
|
+
const nist = nistTags$1(group);
|
|
1080
1102
|
const tags = nist.length > 0 ? buildNistCciTags(nist, nistToCci(nist)) : {};
|
|
1081
1103
|
const results = group.map(buildResult$2);
|
|
1082
1104
|
const req = createRequirement(id, primary.Title ?? "", descriptions, impact, results, { tags });
|
|
@@ -1235,7 +1257,7 @@ function convertResultGroup(ruleId, rule, sarifResults) {
|
|
|
1235
1257
|
const sourceLocation = firstResult.locations && firstResult.locations.length > 0 ? extractSourceLocation$1(firstResult.locations[0]) : void 0;
|
|
1236
1258
|
const results = [];
|
|
1237
1259
|
for (const sr of sarifResults) results.push(...convertSarifResultToHDFResults(sr));
|
|
1238
|
-
const descriptions = buildDescriptions$
|
|
1260
|
+
const descriptions = buildDescriptions$2(description, rule, firstResult);
|
|
1239
1261
|
const options = { tags: buildTags$3(firstResult, rule, ruleLevel, cweIds, nistControls, cciControls) };
|
|
1240
1262
|
if (sourceLocation) options.sourceLocation = sourceLocation;
|
|
1241
1263
|
const req = createRequirement(ruleId, title, descriptions, impact, results, options);
|
|
@@ -1412,7 +1434,7 @@ function extractBacktrace(codeFlows) {
|
|
|
1412
1434
|
}
|
|
1413
1435
|
return backtrace;
|
|
1414
1436
|
}
|
|
1415
|
-
function buildDescriptions$
|
|
1437
|
+
function buildDescriptions$2(defaultDesc, rule, result) {
|
|
1416
1438
|
const descriptions = [createDescription("default", defaultDesc)];
|
|
1417
1439
|
if (rule) {
|
|
1418
1440
|
if (rule.fullDescription?.text) descriptions.push(createDescription("rationale", rule.fullDescription.text));
|
|
@@ -3004,7 +3026,7 @@ function extractCwe(raw) {
|
|
|
3004
3026
|
const out = raw.filter((c) => CWE_ID_PATTERN.test(c));
|
|
3005
3027
|
return out.length === 0 ? void 0 : out;
|
|
3006
3028
|
}
|
|
3007
|
-
function buildEpss$
|
|
3029
|
+
function buildEpss$2(entries) {
|
|
3008
3030
|
if (!entries || entries.length === 0) return void 0;
|
|
3009
3031
|
const e = entries[0];
|
|
3010
3032
|
if (!e.date) return void 0;
|
|
@@ -3077,7 +3099,7 @@ function convertMatchToRequirement(match, isIgnored) {
|
|
|
3077
3099
|
requirement.affectedPackages = buildAffectedPackages(match);
|
|
3078
3100
|
const cwe = extractCwe(vuln.cwe);
|
|
3079
3101
|
if (cwe) requirement.cwe = cwe;
|
|
3080
|
-
const epss = buildEpss$
|
|
3102
|
+
const epss = buildEpss$2(vuln.epss);
|
|
3081
3103
|
if (epss) requirement.epss = epss;
|
|
3082
3104
|
const kev = buildKev(vuln.kev);
|
|
3083
3105
|
if (kev) requirement.kev = kev;
|
|
@@ -3117,6 +3139,189 @@ async function convertGrypeToHdf(input, converterVersion = "1.0.0") {
|
|
|
3117
3139
|
});
|
|
3118
3140
|
}
|
|
3119
3141
|
//#endregion
|
|
3142
|
+
//#region converters/defectdojo-to-hdf/typescript/converter.ts
|
|
3143
|
+
function deriveStatus(f) {
|
|
3144
|
+
if (f.out_of_scope) return ResultStatus.NotApplicable;
|
|
3145
|
+
if (f.false_p) return ResultStatus.Failed;
|
|
3146
|
+
if (f.risk_accepted) return ResultStatus.Failed;
|
|
3147
|
+
if (f.is_mitigated) return ResultStatus.Passed;
|
|
3148
|
+
if (f.under_review) return ResultStatus.NotReviewed;
|
|
3149
|
+
return ResultStatus.Failed;
|
|
3150
|
+
}
|
|
3151
|
+
function triageTags(f) {
|
|
3152
|
+
return {
|
|
3153
|
+
"defectdojo/active": f.active ?? false,
|
|
3154
|
+
"defectdojo/verified": f.verified ?? false,
|
|
3155
|
+
"defectdojo/false_p": f.false_p ?? false,
|
|
3156
|
+
"defectdojo/is_mitigated": f.is_mitigated ?? false,
|
|
3157
|
+
"defectdojo/risk_accepted": f.risk_accepted ?? false,
|
|
3158
|
+
"defectdojo/out_of_scope": f.out_of_scope ?? false,
|
|
3159
|
+
"defectdojo/under_review": f.under_review ?? false
|
|
3160
|
+
};
|
|
3161
|
+
}
|
|
3162
|
+
function riskAcceptanceOwner(ar) {
|
|
3163
|
+
if (ar.owner_email) return {
|
|
3164
|
+
type: IdentityType.Email,
|
|
3165
|
+
identifier: ar.owner_email
|
|
3166
|
+
};
|
|
3167
|
+
if (ar.owner_username) return {
|
|
3168
|
+
type: IdentityType.Username,
|
|
3169
|
+
identifier: ar.owner_username
|
|
3170
|
+
};
|
|
3171
|
+
if (ar.owner !== void 0 && ar.owner !== null && `${ar.owner}` !== "") return {
|
|
3172
|
+
type: IdentityType.Simple,
|
|
3173
|
+
identifier: `defectdojo-user-${ar.owner}`
|
|
3174
|
+
};
|
|
3175
|
+
return {
|
|
3176
|
+
type: IdentityType.Simple,
|
|
3177
|
+
identifier: "defectdojo-risk-acceptance-owner"
|
|
3178
|
+
};
|
|
3179
|
+
}
|
|
3180
|
+
function buildWaiverOverride(ar) {
|
|
3181
|
+
let reason = ar.decision_details || ar.name || "";
|
|
3182
|
+
if (!reason) reason = "Risk accepted in DefectDojo";
|
|
3183
|
+
const appliedAt = (ar.created ? parseTimestamp(ar.created) : null) ?? /* @__PURE__ */ new Date();
|
|
3184
|
+
const oneYearOut = /* @__PURE__ */ new Date();
|
|
3185
|
+
oneYearOut.setTime(appliedAt.getTime());
|
|
3186
|
+
oneYearOut.setFullYear(oneYearOut.getFullYear() + 1);
|
|
3187
|
+
const expiresAt = (ar.expiration_date ? parseTimestamp(ar.expiration_date) : null) ?? oneYearOut;
|
|
3188
|
+
return {
|
|
3189
|
+
type: OverrideType.Waiver,
|
|
3190
|
+
status: ResultStatus.Passed,
|
|
3191
|
+
reason,
|
|
3192
|
+
appliedBy: riskAcceptanceOwner(ar),
|
|
3193
|
+
appliedAt,
|
|
3194
|
+
expiresAt
|
|
3195
|
+
};
|
|
3196
|
+
}
|
|
3197
|
+
function findingId(f) {
|
|
3198
|
+
return f.unique_id_from_tool || f.vuln_id_from_tool || `DefectDojo-Finding-${f.id}`;
|
|
3199
|
+
}
|
|
3200
|
+
function cveList(f) {
|
|
3201
|
+
return (f.vulnerability_ids ?? []).map((v) => v.vulnerability_id).filter(Boolean);
|
|
3202
|
+
}
|
|
3203
|
+
function cvssBand(score) {
|
|
3204
|
+
switch (cvssScoreToSeverity(score)) {
|
|
3205
|
+
case "critical": return CVSSSeverity.Critical;
|
|
3206
|
+
case "high": return CVSSSeverity.High;
|
|
3207
|
+
case "medium": return CVSSSeverity.Medium;
|
|
3208
|
+
case "low": return CVSSSeverity.Low;
|
|
3209
|
+
default: return CVSSSeverity.None;
|
|
3210
|
+
}
|
|
3211
|
+
}
|
|
3212
|
+
function buildCvss$1(f) {
|
|
3213
|
+
const out = [];
|
|
3214
|
+
const add = (version, vector, score) => {
|
|
3215
|
+
if ((score === void 0 || score === null) && !vector) return;
|
|
3216
|
+
const entry = { version };
|
|
3217
|
+
if (score !== void 0 && score !== null) {
|
|
3218
|
+
entry.baseScore = score;
|
|
3219
|
+
entry.baseSeverity = cvssBand(score);
|
|
3220
|
+
}
|
|
3221
|
+
if (vector) entry.baseVector = vector;
|
|
3222
|
+
out.push(entry);
|
|
3223
|
+
};
|
|
3224
|
+
add(Version.The31, f.cvssv3, f.cvssv3_score);
|
|
3225
|
+
add(Version.The40, f.cvssv4, f.cvssv4_score);
|
|
3226
|
+
return out;
|
|
3227
|
+
}
|
|
3228
|
+
function buildEpss$1(f) {
|
|
3229
|
+
if (f.epss_score === void 0 || f.epss_score === null || !f.date) return void 0;
|
|
3230
|
+
return {
|
|
3231
|
+
score: f.epss_score,
|
|
3232
|
+
percentile: f.epss_percentile ?? 0,
|
|
3233
|
+
date: f.date
|
|
3234
|
+
};
|
|
3235
|
+
}
|
|
3236
|
+
function nistTags(f) {
|
|
3237
|
+
return f.cwe && f.cwe > 0 ? mapCWEToNIST([`CWE-${f.cwe}`], DEFAULT_STATIC_ANALYSIS_NIST_TAGS) : DEFAULT_STATIC_ANALYSIS_NIST_TAGS;
|
|
3238
|
+
}
|
|
3239
|
+
function buildDescriptions$1(f) {
|
|
3240
|
+
const descs = [{
|
|
3241
|
+
label: "default",
|
|
3242
|
+
data: f.description || f.title || "No description provided."
|
|
3243
|
+
}];
|
|
3244
|
+
if (f.mitigation) descs.push({
|
|
3245
|
+
label: "fix",
|
|
3246
|
+
data: f.mitigation
|
|
3247
|
+
});
|
|
3248
|
+
if (f.impact) descs.push({
|
|
3249
|
+
label: "impact",
|
|
3250
|
+
data: f.impact
|
|
3251
|
+
});
|
|
3252
|
+
return descs;
|
|
3253
|
+
}
|
|
3254
|
+
function codeDesc(f) {
|
|
3255
|
+
const parts = [f.title];
|
|
3256
|
+
if (f.component_name) parts.push(`Component: ${f.component_name}${f.component_version ? "@" + f.component_version : ""}`);
|
|
3257
|
+
if (f.file_path) parts.push(`Location: ${f.file_path}${f.line !== void 0 && f.line !== null ? ":" + f.line : ""}`);
|
|
3258
|
+
const cves = cveList(f);
|
|
3259
|
+
if (cves.length > 0) parts.push(`CVE: ${cves.join(", ")}`);
|
|
3260
|
+
return parts.join(" | ");
|
|
3261
|
+
}
|
|
3262
|
+
function convertFinding(f) {
|
|
3263
|
+
const nist = nistTags(f);
|
|
3264
|
+
const tags = buildNistCciTags(nist, nistToCci(nist), triageTags(f));
|
|
3265
|
+
const result = {
|
|
3266
|
+
status: deriveStatus(f),
|
|
3267
|
+
codeDesc: codeDesc(f),
|
|
3268
|
+
startTime: (f.date ? parseTimestamp(f.date) : null) ?? /* @__PURE__ */ new Date()
|
|
3269
|
+
};
|
|
3270
|
+
const req = {
|
|
3271
|
+
id: findingId(f),
|
|
3272
|
+
impact: severityToImpact(f.severity),
|
|
3273
|
+
results: [result],
|
|
3274
|
+
tags,
|
|
3275
|
+
descriptions: buildDescriptions$1(f)
|
|
3276
|
+
};
|
|
3277
|
+
const controlType = deriveControlTypeFromTags(nist);
|
|
3278
|
+
if (controlType !== void 0) req.controlType = controlType;
|
|
3279
|
+
const cvss = buildCvss$1(f);
|
|
3280
|
+
if (cvss.length > 0) req.cvss = cvss;
|
|
3281
|
+
const epss = buildEpss$1(f);
|
|
3282
|
+
if (epss) req.epss = epss;
|
|
3283
|
+
if (f.cwe && f.cwe > 0) req.cwe = [`CWE-${f.cwe}`];
|
|
3284
|
+
const firstRisk = f.accepted_risks?.[0];
|
|
3285
|
+
if (f.risk_accepted && firstRisk) {
|
|
3286
|
+
req.statusOverrides = [buildWaiverOverride(firstRisk)];
|
|
3287
|
+
req.effectiveStatus = ResultStatus.Passed;
|
|
3288
|
+
req.disposition = OverrideType.Waiver;
|
|
3289
|
+
tags["defectdojo/decision"] = firstRisk.decision ?? "";
|
|
3290
|
+
}
|
|
3291
|
+
return req;
|
|
3292
|
+
}
|
|
3293
|
+
function scannerName(f) {
|
|
3294
|
+
return f.related_fields?.test?.test_type?.name || "DefectDojo";
|
|
3295
|
+
}
|
|
3296
|
+
async function convertDefectDojoToHdf(input, converterVersion = "0.1.0") {
|
|
3297
|
+
validateInputSize(input, "defectdojo");
|
|
3298
|
+
const resultsChecksum = await inputChecksum(input);
|
|
3299
|
+
const parsed = parseJSON(input);
|
|
3300
|
+
const findings = Array.isArray(parsed) ? parsed : parsed.results ?? [];
|
|
3301
|
+
const order = [];
|
|
3302
|
+
const byScanner = /* @__PURE__ */ new Map();
|
|
3303
|
+
for (const f of findings) {
|
|
3304
|
+
const name = scannerName(f);
|
|
3305
|
+
if (!byScanner.has(name)) {
|
|
3306
|
+
order.push(name);
|
|
3307
|
+
byScanner.set(name, []);
|
|
3308
|
+
}
|
|
3309
|
+
byScanner.get(name).push(convertFinding(f));
|
|
3310
|
+
}
|
|
3311
|
+
const baselines = order.map((name) => {
|
|
3312
|
+
const baseline = createMinimalBaseline(`DefectDojo: ${name}`, byScanner.get(name), { resultsChecksum });
|
|
3313
|
+
baseline.title = name;
|
|
3314
|
+
return baseline;
|
|
3315
|
+
});
|
|
3316
|
+
if (baselines.length === 0) baselines.push(createMinimalBaseline("DefectDojo", [buildNoFindingsRequirement("defectdojo-no-findings", "DefectDojo reported zero findings.", /* @__PURE__ */ new Date())], { resultsChecksum }));
|
|
3317
|
+
return buildHdfResults({
|
|
3318
|
+
generatorName: "defectdojo-to-hdf",
|
|
3319
|
+
converterVersion,
|
|
3320
|
+
toolName: "DefectDojo",
|
|
3321
|
+
baselines
|
|
3322
|
+
});
|
|
3323
|
+
}
|
|
3324
|
+
//#endregion
|
|
3120
3325
|
//#region converters/nessus-to-hdf/typescript/converter.ts
|
|
3121
3326
|
const CVE_SOURCE_RE = /^CVE-\d{4}-\d{4,}$/;
|
|
3122
3327
|
const CWE_PATTERN = /CWE[- ]?(\d+)/gi;
|
|
@@ -3844,6 +4049,18 @@ function checkRevisionAlignment(rules) {
|
|
|
3844
4049
|
if (isNistStrict()) throw new Error(`aws-config: ${detail}\nre-run with a matching revision, or disable strict mode to convert with the gaps`);
|
|
3845
4050
|
console.warn(`WARNING: ${detail}`);
|
|
3846
4051
|
}
|
|
4052
|
+
function buildFixText(rule) {
|
|
4053
|
+
const r = rule.Remediation;
|
|
4054
|
+
if (!r || !r.TargetId) return "";
|
|
4055
|
+
const trigger = r.Automatic ? "automatically on non-compliance" : "on demand";
|
|
4056
|
+
const doc = r.TargetVersion ? `${r.TargetId} (version ${r.TargetVersion})` : r.TargetId;
|
|
4057
|
+
return `Remediate via ${remediationTargetLabel(r.TargetType)} ${doc}, applied ${trigger}.`;
|
|
4058
|
+
}
|
|
4059
|
+
function remediationTargetLabel(targetType) {
|
|
4060
|
+
if (targetType === "SSM_DOCUMENT") return "SSM Automation document";
|
|
4061
|
+
if (!targetType) return "automation document";
|
|
4062
|
+
return `${targetType} document`;
|
|
4063
|
+
}
|
|
3847
4064
|
function buildCheckText(rule) {
|
|
3848
4065
|
const parts = [`ARN: ${rule.ConfigRuleArn || "N/A"}`, `Source Identifier: ${rule.Source.SourceIdentifier || "N/A"}`];
|
|
3849
4066
|
if (rule.InputParameters && rule.InputParameters !== "{}") {
|
|
@@ -3881,7 +4098,7 @@ function buildResult(r) {
|
|
|
3881
4098
|
* returned zero in-scope resources. The HDF schema requires `results` to have
|
|
3882
4099
|
* minItems >= 1; this honestly signals to auditors that the rule's check ran
|
|
3883
4100
|
* but had no scope in this account/region rather than vacuously claiming
|
|
3884
|
-
* "passed".
|
|
4101
|
+
* "passed".
|
|
3885
4102
|
*/
|
|
3886
4103
|
function buildNotApplicableResult(rule) {
|
|
3887
4104
|
const codeDesc = `AWS Config rule ${rule.ConfigRuleName} evaluated zero in-scope resources in this account/region.`;
|
|
@@ -3891,8 +4108,9 @@ function buildNotApplicableResult(rule) {
|
|
|
3891
4108
|
});
|
|
3892
4109
|
}
|
|
3893
4110
|
function buildRequirement$15(rule) {
|
|
3894
|
-
const
|
|
3895
|
-
const
|
|
4111
|
+
const rawNist = buildNistTags$3(rule.Source.SourceIdentifier, rule.ConfigRuleName);
|
|
4112
|
+
const nist = rawNist.length > 0 ? rawNist : DEFAULT_CONFIG_MANAGEMENT_NIST_TAGS;
|
|
4113
|
+
const tags = { nist };
|
|
3896
4114
|
const descriptions = [{
|
|
3897
4115
|
label: "default",
|
|
3898
4116
|
data: rule.Description
|
|
@@ -3900,6 +4118,11 @@ function buildRequirement$15(rule) {
|
|
|
3900
4118
|
label: "check",
|
|
3901
4119
|
data: buildCheckText(rule)
|
|
3902
4120
|
}];
|
|
4121
|
+
const fix = buildFixText(rule);
|
|
4122
|
+
if (fix) descriptions.push({
|
|
4123
|
+
label: "fix",
|
|
4124
|
+
data: fix
|
|
4125
|
+
});
|
|
3903
4126
|
const title = `${getAccountId(rule.ConfigRuleArn)} - ${rule.ConfigRuleName}`;
|
|
3904
4127
|
const results = rule.EvaluationResults.length > 0 ? rule.EvaluationResults.map(buildResult) : [buildNotApplicableResult(rule)];
|
|
3905
4128
|
const req = createRequirement(rule.ConfigRuleId, title, descriptions, .5, results, {
|
|
@@ -6814,9 +7037,8 @@ function buildRequirement$12(reqID, findings) {
|
|
|
6814
7037
|
* @returns HDF JSON string
|
|
6815
7038
|
*/
|
|
6816
7039
|
async function convertTrufflehogToHdf(input, converterVersion = "1.0.0") {
|
|
6817
|
-
if (!input || input.trim().length === 0) throw new Error("trufflehog: empty input");
|
|
6818
7040
|
validateInputSize(input, "trufflehog");
|
|
6819
|
-
const findings = parseFindings(input);
|
|
7041
|
+
const findings = !input || input.trim().length === 0 ? [] : parseFindings(input);
|
|
6820
7042
|
const resultsChecksum = await inputChecksum(input);
|
|
6821
7043
|
const limitedFindings = limitArrayWithWarning(findings, "finding");
|
|
6822
7044
|
const groups = groupFindings(limitedFindings);
|
|
@@ -6849,6 +7071,140 @@ async function convertTrufflehogToHdf(input, converterVersion = "1.0.0") {
|
|
|
6849
7071
|
return serializeHdf(hdf);
|
|
6850
7072
|
}
|
|
6851
7073
|
//#endregion
|
|
7074
|
+
//#region converters/hipcheck-to-hdf/typescript/converter.ts
|
|
7075
|
+
/** "owner/name" when both are present, else whichever is non-empty (never a
|
|
7076
|
+
* bare "owner/" or "/name"). */
|
|
7077
|
+
function repoIdent(r) {
|
|
7078
|
+
const owner = r.repo_owner ?? "";
|
|
7079
|
+
const name = r.repo_name ?? "";
|
|
7080
|
+
if (owner && name) return `${owner}/${name}`;
|
|
7081
|
+
return name || owner;
|
|
7082
|
+
}
|
|
7083
|
+
/** Build NIST/CCI tags for an analysis name via the hipcheck mapping. */
|
|
7084
|
+
function analysisTags(name) {
|
|
7085
|
+
const nist = getHipcheckNistControls(name);
|
|
7086
|
+
if (nist.length === 0) return {
|
|
7087
|
+
tags: buildNistCciTags([], []),
|
|
7088
|
+
nist: []
|
|
7089
|
+
};
|
|
7090
|
+
return {
|
|
7091
|
+
tags: buildNistCciTags(nist, nistToCci(nist)),
|
|
7092
|
+
nist
|
|
7093
|
+
};
|
|
7094
|
+
}
|
|
7095
|
+
function applyClassification(req, nist) {
|
|
7096
|
+
const controlType = deriveControlTypeFromTags(nist);
|
|
7097
|
+
if (controlType !== void 0) req.controlType = controlType;
|
|
7098
|
+
req.verificationMethod = VerificationMethodEnum.Automated;
|
|
7099
|
+
}
|
|
7100
|
+
function buildAnalysisRequirement(a, status, startTime) {
|
|
7101
|
+
const { tags, nist } = analysisTags(a.name);
|
|
7102
|
+
const message = a.message ?? "";
|
|
7103
|
+
const descriptions = [{
|
|
7104
|
+
label: "default",
|
|
7105
|
+
data: message
|
|
7106
|
+
}];
|
|
7107
|
+
if (a.policy_expr) descriptions.push({
|
|
7108
|
+
label: "check",
|
|
7109
|
+
data: a.policy_expr
|
|
7110
|
+
});
|
|
7111
|
+
let resultMessage = message;
|
|
7112
|
+
if (a.concerns && a.concerns.length > 0) resultMessage = `${message}\nConcerns:\n- ${a.concerns.join("\n- ")}`;
|
|
7113
|
+
const result = {
|
|
7114
|
+
status,
|
|
7115
|
+
codeDesc: a.policy_expr ?? "",
|
|
7116
|
+
message: resultMessage,
|
|
7117
|
+
startTime
|
|
7118
|
+
};
|
|
7119
|
+
const req = createRequirement(a.name, a.name, descriptions, .5, [result], { tags });
|
|
7120
|
+
applyClassification(req, nist);
|
|
7121
|
+
return req;
|
|
7122
|
+
}
|
|
7123
|
+
function buildErroredRequirement(e, startTime) {
|
|
7124
|
+
const { tags, nist } = analysisTags(e.name);
|
|
7125
|
+
const msg = flattenError(e.error);
|
|
7126
|
+
const result = {
|
|
7127
|
+
status: ResultStatus.Error,
|
|
7128
|
+
codeDesc: "",
|
|
7129
|
+
message: msg,
|
|
7130
|
+
startTime
|
|
7131
|
+
};
|
|
7132
|
+
const req = createRequirement(e.name, e.name, [{
|
|
7133
|
+
label: "default",
|
|
7134
|
+
data: msg
|
|
7135
|
+
}], .5, [result], { tags });
|
|
7136
|
+
applyClassification(req, nist);
|
|
7137
|
+
return req;
|
|
7138
|
+
}
|
|
7139
|
+
/** Render Hipcheck's recursive error chain as "msg: source: ...". */
|
|
7140
|
+
function flattenError(e) {
|
|
7141
|
+
const parts = [];
|
|
7142
|
+
for (let cur = e; cur; cur = cur.source) if (cur.msg) parts.push(cur.msg);
|
|
7143
|
+
return parts.length > 0 ? parts.join(": ") : "unknown error";
|
|
7144
|
+
}
|
|
7145
|
+
/** Render a risk score without trailing zeros (0.42, 0.33, 0), matching Go. */
|
|
7146
|
+
function formatScore(f) {
|
|
7147
|
+
return String(f);
|
|
7148
|
+
}
|
|
7149
|
+
/** Render the overall recommendation as baseline summary prose. */
|
|
7150
|
+
function buildSummary$1(rec) {
|
|
7151
|
+
const base = `Hipcheck recommendation: ${rec.kind ?? ""} (risk score ${formatScore(rec.risk_score ?? 0)}, policy '${rec.risk_policy ?? ""}').`;
|
|
7152
|
+
if ((rec.kind ?? "").toLowerCase() !== "investigate") return base;
|
|
7153
|
+
const suffix = investigateReason(rec.reason);
|
|
7154
|
+
return suffix ? `${base} ${suffix}` : base;
|
|
7155
|
+
}
|
|
7156
|
+
/** Decode the polymorphic `reason` into a sentence, or "". */
|
|
7157
|
+
function investigateReason(reason) {
|
|
7158
|
+
if (reason === null || reason === void 0) return "";
|
|
7159
|
+
if (typeof reason === "string") {
|
|
7160
|
+
if (reason === "Policy") return "Investigation triggered because the risk score exceeded the policy threshold.";
|
|
7161
|
+
return `Investigation reason: ${reason}.`;
|
|
7162
|
+
}
|
|
7163
|
+
if (typeof reason === "object") {
|
|
7164
|
+
const failed = reason.FailedAnalyses;
|
|
7165
|
+
if (Array.isArray(failed) && failed.length > 0) return `Investigation forced by failed analyses: ${failed.join(", ")}.`;
|
|
7166
|
+
}
|
|
7167
|
+
return "";
|
|
7168
|
+
}
|
|
7169
|
+
/**
|
|
7170
|
+
* Converts a MITRE Hipcheck `hc check --format json` report to HDF Results.
|
|
7171
|
+
*
|
|
7172
|
+
* @param input - Hipcheck JSON report string
|
|
7173
|
+
* @returns HDF JSON string
|
|
7174
|
+
*/
|
|
7175
|
+
async function convertHipcheckToHdf(input, converterVersion = "1.0.0") {
|
|
7176
|
+
validateInputSize(input, "hipcheck");
|
|
7177
|
+
if (!input || input.trim().length === 0) throw new Error("hipcheck: empty input");
|
|
7178
|
+
const report = parseJSON(input);
|
|
7179
|
+
if (!report.hipcheck_version && !report.repo_name) throw new Error("hipcheck: input does not look like a Hipcheck report");
|
|
7180
|
+
const startTime = (report.analyzed_at ? parseTimestamp(report.analyzed_at) : void 0) ?? /* @__PURE__ */ new Date();
|
|
7181
|
+
const requirements = [];
|
|
7182
|
+
for (const a of report.passing ?? []) requirements.push(buildAnalysisRequirement(a, ResultStatus.Passed, startTime));
|
|
7183
|
+
for (const a of report.failing ?? []) requirements.push(buildAnalysisRequirement(a, ResultStatus.Failed, startTime));
|
|
7184
|
+
for (const e of report.errored ?? []) requirements.push(buildErroredRequirement(e, startTime));
|
|
7185
|
+
if (requirements.length === 0) requirements.push(buildNoFindingsRequirement("hipcheck-no-findings", `Hipcheck analyzed ${repoIdent(report)} and reported zero analyses.`, startTime));
|
|
7186
|
+
const summary = buildSummary$1(report.recommendation ?? {});
|
|
7187
|
+
const baseline = createMinimalBaseline("Hipcheck Scan", requirements, {
|
|
7188
|
+
title: `Hipcheck analysis of ${repoIdent(report)} @ ${report.repo_head ?? ""}`,
|
|
7189
|
+
summary,
|
|
7190
|
+
resultsChecksum: await inputChecksum(input)
|
|
7191
|
+
});
|
|
7192
|
+
const ident = repoIdent(report);
|
|
7193
|
+
return buildHdfResults({
|
|
7194
|
+
generatorName: "hipcheck-to-hdf",
|
|
7195
|
+
converterVersion,
|
|
7196
|
+
toolName: "Hipcheck",
|
|
7197
|
+
toolFormat: "JSON",
|
|
7198
|
+
toolVersion: report.hipcheck_version,
|
|
7199
|
+
baselines: [baseline],
|
|
7200
|
+
components: ident ? [{
|
|
7201
|
+
name: ident,
|
|
7202
|
+
type: TargetType.Repository
|
|
7203
|
+
}] : void 0,
|
|
7204
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
7205
|
+
});
|
|
7206
|
+
}
|
|
7207
|
+
//#endregion
|
|
6852
7208
|
//#region converters/burpsuite-to-hdf/typescript/converter.ts
|
|
6853
7209
|
const IMPACT_MAPPING$5 = {
|
|
6854
7210
|
"high": .7,
|
|
@@ -12715,6 +13071,6 @@ function substituteParams(text, overrides) {
|
|
|
12715
13071
|
return result;
|
|
12716
13072
|
}
|
|
12717
13073
|
//#endregion
|
|
12718
|
-
export { convertAsffToHdf, convertAwsConfigToHdf, convertBurpsuiteToHdf, convertCheckovToHdf, convertCklToHdf, convertCklbToHdf, convertConveyorToHdf, convertCsafVexToHdf, convertCyclonedxToHdf, convertCyclonedxVexToHdf, convertDbprotectToHdf, convertDeptrackToHdf, convertFortifyToHdf, convertGitlabToHdf, convertGosecToHdf, convertGrypeToHdf, convertHdfToAsff, convertHdfToCkl, convertHdfToCklb, convertHdfToCsafVex, convertHdfToCsv, convertHdfToCyclonedxVex, convertHdfToEcs, convertHdfToOcsf, convertHdfToOpenVex, convertHdfToOscalPoam, convertHdfToOscalSar, convertHdfToSplunk, convertHdfToXccdf, convertHdfToXml, convertIonchannelToHdf, convertJfrogXrayToHdf, convertJunitToHdf, convertMsftDefenderCloudToHdf, convertMsftDefenderDevopsToHdf, convertMsftDefenderEndpointToHdf, convertMsftSecureScoreToHdf, convertNessusToHdf, convertNetsparkerToHdf, convertNeuvectorToHdf, convertNiktoToHdf, convertOpenVexToHdf, convertOscalCatalogToHdf, convertOscalComponentToHdf, convertOscalPoamToHdf, convertOscalProfileToHdf, convertOscalSapToHdf, convertOscalSarToHdf, convertOscalSspToHdf, convertPrismaToHdf, convertSarifToHdf, convertScoutsuiteToHdf, convertSnykToHdf, convertSonarqubeToHdf, convertSplunkToHdf, convertTrufflehogToHdf, convertTwistlockToHdf, convertV1ToV2, convertVeracodeToHdf, convertXccdfResultsToHdf, convertZapToHdf, detectOscalDocumentType, isHDFV1 };
|
|
13074
|
+
export { convertAsffToHdf, convertAwsConfigToHdf, convertBurpsuiteToHdf, convertCheckovToHdf, convertCklToHdf, convertCklbToHdf, convertConveyorToHdf, convertCsafVexToHdf, convertCyclonedxToHdf, convertCyclonedxVexToHdf, convertDbprotectToHdf, convertDefectDojoToHdf, convertDeptrackToHdf, convertFortifyToHdf, convertGitlabToHdf, convertGosecToHdf, convertGrypeToHdf, convertHdfToAsff, convertHdfToCkl, convertHdfToCklb, convertHdfToCsafVex, convertHdfToCsv, convertHdfToCyclonedxVex, convertHdfToEcs, convertHdfToOcsf, convertHdfToOpenVex, convertHdfToOscalPoam, convertHdfToOscalSar, convertHdfToSplunk, convertHdfToXccdf, convertHdfToXml, convertHipcheckToHdf, convertIonchannelToHdf, convertJfrogXrayToHdf, convertJunitToHdf, convertMsftDefenderCloudToHdf, convertMsftDefenderDevopsToHdf, convertMsftDefenderEndpointToHdf, convertMsftSecureScoreToHdf, convertNessusToHdf, convertNetsparkerToHdf, convertNeuvectorToHdf, convertNiktoToHdf, convertOpenVexToHdf, convertOscalCatalogToHdf, convertOscalComponentToHdf, convertOscalPoamToHdf, convertOscalProfileToHdf, convertOscalSapToHdf, convertOscalSarToHdf, convertOscalSspToHdf, convertPrismaToHdf, convertSarifToHdf, convertScoutsuiteToHdf, convertSnykToHdf, convertSonarqubeToHdf, convertSplunkToHdf, convertTrufflehogToHdf, convertTwistlockToHdf, convertV1ToV2, convertVeracodeToHdf, convertXccdfResultsToHdf, convertZapToHdf, detectOscalDocumentType, isHDFV1 };
|
|
12719
13075
|
|
|
12720
13076
|
//# sourceMappingURL=index.js.map
|