@mitre/hdf-converters 3.4.2 → 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 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
@@ -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;E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;;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"}
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;;;;;;;;;;;;;;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BAA6B;;;;;;;;;;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
- return out.length > 0 ? out : DEFAULT_STATIC_ANALYSIS_NIST_TAGS;
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.ProductFields?.["RelatedAWSResources:0/type"] !== "AWS::Config::ConfigRule") return [];
992
+ if (!isConfigRuleFinding(f)) return [];
988
993
  const name = f.ProductFields?.["RelatedAWSResources:0/name"];
989
994
  if (!name) return [];
990
995
  return getAwsConfigNistControlsBySubstring(name);
@@ -1093,7 +1098,7 @@ function buildRequirement$17(id, group) {
1093
1098
  label: "fix",
1094
1099
  data: fix
1095
1100
  });
1096
- const nist = nistTags(group);
1101
+ const nist = nistTags$1(group);
1097
1102
  const tags = nist.length > 0 ? buildNistCciTags(nist, nistToCci(nist)) : {};
1098
1103
  const results = group.map(buildResult$2);
1099
1104
  const req = createRequirement(id, primary.Title ?? "", descriptions, impact, results, { tags });
@@ -1252,7 +1257,7 @@ function convertResultGroup(ruleId, rule, sarifResults) {
1252
1257
  const sourceLocation = firstResult.locations && firstResult.locations.length > 0 ? extractSourceLocation$1(firstResult.locations[0]) : void 0;
1253
1258
  const results = [];
1254
1259
  for (const sr of sarifResults) results.push(...convertSarifResultToHDFResults(sr));
1255
- const descriptions = buildDescriptions$1(description, rule, firstResult);
1260
+ const descriptions = buildDescriptions$2(description, rule, firstResult);
1256
1261
  const options = { tags: buildTags$3(firstResult, rule, ruleLevel, cweIds, nistControls, cciControls) };
1257
1262
  if (sourceLocation) options.sourceLocation = sourceLocation;
1258
1263
  const req = createRequirement(ruleId, title, descriptions, impact, results, options);
@@ -1429,7 +1434,7 @@ function extractBacktrace(codeFlows) {
1429
1434
  }
1430
1435
  return backtrace;
1431
1436
  }
1432
- function buildDescriptions$1(defaultDesc, rule, result) {
1437
+ function buildDescriptions$2(defaultDesc, rule, result) {
1433
1438
  const descriptions = [createDescription("default", defaultDesc)];
1434
1439
  if (rule) {
1435
1440
  if (rule.fullDescription?.text) descriptions.push(createDescription("rationale", rule.fullDescription.text));
@@ -3021,7 +3026,7 @@ function extractCwe(raw) {
3021
3026
  const out = raw.filter((c) => CWE_ID_PATTERN.test(c));
3022
3027
  return out.length === 0 ? void 0 : out;
3023
3028
  }
3024
- function buildEpss$1(entries) {
3029
+ function buildEpss$2(entries) {
3025
3030
  if (!entries || entries.length === 0) return void 0;
3026
3031
  const e = entries[0];
3027
3032
  if (!e.date) return void 0;
@@ -3094,7 +3099,7 @@ function convertMatchToRequirement(match, isIgnored) {
3094
3099
  requirement.affectedPackages = buildAffectedPackages(match);
3095
3100
  const cwe = extractCwe(vuln.cwe);
3096
3101
  if (cwe) requirement.cwe = cwe;
3097
- const epss = buildEpss$1(vuln.epss);
3102
+ const epss = buildEpss$2(vuln.epss);
3098
3103
  if (epss) requirement.epss = epss;
3099
3104
  const kev = buildKev(vuln.kev);
3100
3105
  if (kev) requirement.kev = kev;
@@ -3134,6 +3139,189 @@ async function convertGrypeToHdf(input, converterVersion = "1.0.0") {
3134
3139
  });
3135
3140
  }
3136
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
3137
3325
  //#region converters/nessus-to-hdf/typescript/converter.ts
3138
3326
  const CVE_SOURCE_RE = /^CVE-\d{4}-\d{4,}$/;
3139
3327
  const CWE_PATTERN = /CWE[- ]?(\d+)/gi;
@@ -3920,8 +4108,9 @@ function buildNotApplicableResult(rule) {
3920
4108
  });
3921
4109
  }
3922
4110
  function buildRequirement$15(rule) {
3923
- const nist = buildNistTags$3(rule.Source.SourceIdentifier, rule.ConfigRuleName);
3924
- const tags = nist.length > 0 ? { nist } : {};
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 };
3925
4114
  const descriptions = [{
3926
4115
  label: "default",
3927
4116
  data: rule.Description
@@ -6882,6 +7071,140 @@ async function convertTrufflehogToHdf(input, converterVersion = "1.0.0") {
6882
7071
  return serializeHdf(hdf);
6883
7072
  }
6884
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
6885
7208
  //#region converters/burpsuite-to-hdf/typescript/converter.ts
6886
7209
  const IMPACT_MAPPING$5 = {
6887
7210
  "high": .7,
@@ -12748,6 +13071,6 @@ function substituteParams(text, overrides) {
12748
13071
  return result;
12749
13072
  }
12750
13073
  //#endregion
12751
- 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 };
12752
13075
 
12753
13076
  //# sourceMappingURL=index.js.map