@mitre/hdf-fixtures 3.6.0 → 3.7.0-rc.1
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/LICENSE.md +55 -0
- package/README.md +4 -3
- package/dist/index.d.ts +11 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
- package/results/duplicate-baselines.json +4673 -0
- package/results/merge-grype.json +1888 -0
- package/results/merge-zap.json +2932 -0
- package/inspec/three-layer-rhel7.json +0 -47551
package/LICENSE.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# License
|
|
2
|
+
|
|
3
|
+
Copyright © 2025 The MITRE Corporation.
|
|
4
|
+
|
|
5
|
+
Approved for Public Release; Distribution Unlimited. Case Number 18-3678.
|
|
6
|
+
|
|
7
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
8
|
+
not use this file except in compliance with the License. You may obtain a
|
|
9
|
+
copy of the License at
|
|
10
|
+
|
|
11
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
15
|
+
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
16
|
+
License for the specific language governing permissions and limitations
|
|
17
|
+
under the License.
|
|
18
|
+
|
|
19
|
+
## Redistribution Terms
|
|
20
|
+
|
|
21
|
+
Redistribution and use in source and binary forms, with or without
|
|
22
|
+
modification, are permitted provided that the following conditions are
|
|
23
|
+
met:
|
|
24
|
+
|
|
25
|
+
- Redistributions of source code must retain the above copyright/digital
|
|
26
|
+
rights legend, this list of conditions and the following Notice.
|
|
27
|
+
- Redistributions in binary form must reproduce the above
|
|
28
|
+
copyright/digital rights legend, this list of conditions and the
|
|
29
|
+
following Notice in the documentation and/or other materials provided
|
|
30
|
+
with the distribution.
|
|
31
|
+
- Neither the name of The MITRE Corporation nor the names of its contributors
|
|
32
|
+
may be used to endorse or promote products derived from this software
|
|
33
|
+
without specific prior written permission.
|
|
34
|
+
|
|
35
|
+
## Notice
|
|
36
|
+
|
|
37
|
+
The MITRE Corporation grants permission to reproduce, distribute, modify, and
|
|
38
|
+
otherwise use this software to the extent permitted by the licensed terms
|
|
39
|
+
provided in the LICENSE file included with this project.
|
|
40
|
+
|
|
41
|
+
This software was produced by The MITRE Corporation for the U.S. Government
|
|
42
|
+
under contract. As such the U.S. Government has certain use and data
|
|
43
|
+
rights in this software. No use other than those granted to the U.S.
|
|
44
|
+
Government, or to those acting on behalf of the U.S. Government, under
|
|
45
|
+
these contract arrangements is authorized without the express written
|
|
46
|
+
permission of The MITRE Corporation.
|
|
47
|
+
|
|
48
|
+
Some files in this codebase were generated by generative AI, under the
|
|
49
|
+
direction and review of The MITRE Corporation employees, for the purpose of
|
|
50
|
+
development efficiency. All AI-generated code functionality was validated
|
|
51
|
+
by standard quality and assurance testing.
|
|
52
|
+
|
|
53
|
+
For further information, please contact The MITRE Corporation,
|
|
54
|
+
Contracts Management Office, 7515 Colshire Drive, McLean, VA 22102-7539,
|
|
55
|
+
(703) 983-6000.
|
package/README.md
CHANGED
|
@@ -45,8 +45,7 @@ them via the materialize-to-tmp-file helper in `converter_test.go`).
|
|
|
45
45
|
|
|
46
46
|
## Fixture provenance
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
CLAUDE.md's fixture-integrity rule).
|
|
48
|
+
Fixtures here are **real tool output**, or a schema-valid document derived from one, never invented data — a converter tested against invented data proves nothing about real data. The one hand-authored file, `results/minimal.json`, exists to be the smallest schema-valid HDF Results document and is validated as such; it asserts nothing about any tool's output shape.
|
|
50
49
|
|
|
51
50
|
### `results/` — HDF Results docs
|
|
52
51
|
|
|
@@ -54,6 +53,9 @@ CLAUDE.md's fixture-integrity rule).
|
|
|
54
53
|
|------|--------|-----------|
|
|
55
54
|
| `inspec-multilayered.json` | InSpec runner, multi-overlay scan | hdf-extension-graph TS + Go tests + hdf-parsers parser parity test. The bug-exhibiting fixture for `hdf-libs-2nm0` — bare timestamps that broke parsers before #83/#828d landed. Moved from `hdf-extension-graph/test/fixtures/multilayered-inspec.json`. |
|
|
56
55
|
| `minimal.json` | Hand-crafted minimal valid HDF Results doc | hdf-to-xml converter (TS + Go) + hdf-parsers integration test + hdf-validators integration test. The smallest schema-valid HDF Results document — single baseline, one passing requirement. Moved from `hdf-converters/converters/hdf-to-xml/fixtures/input/minimal.json`. |
|
|
56
|
+
| `duplicate-baselines.json` | Prisma Cloud HDF results (`prisma-to-hdf`) — 16 baselines, 94 requirements, repeated (name, id) keys. Constructed for merge/correlation testing, PR #362. | hdf-engine TS + Go (filter/query index-uniqueness) + hdf-cli MCP tools (inspect/aggregate/compliance). Moved from `hdf-engine/testdata/duplicate-baselines.json` and `hdf-cli/internal/mcp/tools/testdata/duplicate-baselines.json`. |
|
|
57
|
+
| `merge-grype.json` | Grype HDF results (`grype-to-hdf`, Grype 0.79.3) — one baseline, duplicate requirement ids. Constructed for merge/correlation testing, PR #362. | hdf-engine TS + Go (merge parity) + hdf-cli MCP tools (query correlation, multi-source). Moved from `hdf-engine/testdata/merge-grype.json` and `hdf-cli/internal/mcp/tools/testdata/grype-duplicate-ids.json`. |
|
|
58
|
+
| `merge-zap.json` | OWASP ZAP HDF results (`zap-to-hdf`, ZAP 2.7.0) — four baselines/components, no ids. Constructed for merge/correlation testing, PR #362. | hdf-engine TS + Go (merge parity) + hdf-cli MCP tools (inspect, sources, query multi-source) + hdf-cli MCP evals (sources validation). Moved from `hdf-engine/testdata/merge-zap.json` and `hdf-cli/internal/mcp/tools/testdata/zap-webgoat.json`. |
|
|
57
59
|
|
|
58
60
|
### `baseline/` — HDF Baseline docs
|
|
59
61
|
|
|
@@ -81,7 +83,6 @@ runner config.
|
|
|
81
83
|
| `container-scan.json` | Generic container scan, `-05:00` offset | same |
|
|
82
84
|
| `three-layer-overlay.json` | Three-layer overlay chain, `+00:00` offset | same |
|
|
83
85
|
| `wrapper.json` | InSpec wrapper-profile structure | legacyhdf-to-hdf converter (TS + Go) + hdf-parsers flatten integration test |
|
|
84
|
-
| `three-layer-rhel7.json` | Three-layer RHEL7 overlay (was `Three_Layer_RHEL7_Overlay_Example.json`) | hdf-parsers flatten integration test. Moved from `hdf-schema/test/fixtures/`. |
|
|
85
86
|
|
|
86
87
|
## Validation gate
|
|
87
88
|
|
package/dist/index.d.ts
CHANGED
|
@@ -3,28 +3,33 @@ interface FixtureRef {
|
|
|
3
3
|
path: string;
|
|
4
4
|
read: () => string;
|
|
5
5
|
}
|
|
6
|
-
declare const results: {
|
|
6
|
+
export declare const results: {
|
|
7
7
|
readonly inspecMultilayered: FixtureRef;
|
|
8
8
|
readonly minimal: FixtureRef;
|
|
9
|
+
readonly duplicateBaselines: FixtureRef;
|
|
10
|
+
readonly mergeGrype: FixtureRef;
|
|
11
|
+
readonly mergeZap: FixtureRef;
|
|
9
12
|
};
|
|
10
|
-
declare const baseline: {
|
|
13
|
+
export declare const baseline: {
|
|
11
14
|
readonly win2022Stig: FixtureRef;
|
|
12
15
|
};
|
|
13
|
-
declare const amendments: {
|
|
16
|
+
export declare const amendments: {
|
|
14
17
|
readonly uc01Fixed: FixtureRef;
|
|
15
18
|
readonly multiCve: FixtureRef;
|
|
16
19
|
};
|
|
17
|
-
declare const inspec: {
|
|
20
|
+
export declare const inspec: {
|
|
18
21
|
readonly ubi9Scan: FixtureRef;
|
|
19
22
|
readonly containerScan: FixtureRef;
|
|
20
23
|
readonly threeLayerOverlay: FixtureRef;
|
|
21
|
-
readonly threeLayerRhel7: FixtureRef;
|
|
22
24
|
readonly wrapper: FixtureRef;
|
|
23
25
|
};
|
|
24
|
-
declare const all: {
|
|
26
|
+
export declare const all: {
|
|
25
27
|
readonly results: {
|
|
26
28
|
readonly inspecMultilayered: FixtureRef;
|
|
27
29
|
readonly minimal: FixtureRef;
|
|
30
|
+
readonly duplicateBaselines: FixtureRef;
|
|
31
|
+
readonly mergeGrype: FixtureRef;
|
|
32
|
+
readonly mergeZap: FixtureRef;
|
|
28
33
|
};
|
|
29
34
|
readonly baseline: {
|
|
30
35
|
readonly win2022Stig: FixtureRef;
|
|
@@ -37,10 +42,8 @@ declare const all: {
|
|
|
37
42
|
readonly ubi9Scan: FixtureRef;
|
|
38
43
|
readonly containerScan: FixtureRef;
|
|
39
44
|
readonly threeLayerOverlay: FixtureRef;
|
|
40
|
-
readonly threeLayerRhel7: FixtureRef;
|
|
41
45
|
readonly wrapper: FixtureRef;
|
|
42
46
|
};
|
|
43
47
|
};
|
|
44
48
|
//#endregion
|
|
45
|
-
export { all, amendments, baseline, inspec, results };
|
|
46
49
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":";UA0BU;EACR;EACA;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":";UA0BU;EACR;EACA;;qBAYW;;;;;;;qBASA;wBAAA;;qBAKA;sBAAA;qBAAA;;qBAQA;;;;;;qBAOA"}
|
package/dist/index.js
CHANGED
|
@@ -13,7 +13,10 @@ function fixture(category, name) {
|
|
|
13
13
|
}
|
|
14
14
|
const results = {
|
|
15
15
|
inspecMultilayered: fixture("results", "inspec-multilayered.json"),
|
|
16
|
-
minimal: fixture("results", "minimal.json")
|
|
16
|
+
minimal: fixture("results", "minimal.json"),
|
|
17
|
+
duplicateBaselines: fixture("results", "duplicate-baselines.json"),
|
|
18
|
+
mergeGrype: fixture("results", "merge-grype.json"),
|
|
19
|
+
mergeZap: fixture("results", "merge-zap.json")
|
|
17
20
|
};
|
|
18
21
|
const baseline = { win2022Stig: fixture("baseline", "win2022-stig.json") };
|
|
19
22
|
const amendments = {
|
|
@@ -24,7 +27,6 @@ const inspec = {
|
|
|
24
27
|
ubi9Scan: fixture("inspec", "ubi9-scan.json"),
|
|
25
28
|
containerScan: fixture("inspec", "container-scan.json"),
|
|
26
29
|
threeLayerOverlay: fixture("inspec", "three-layer-overlay.json"),
|
|
27
|
-
threeLayerRhel7: fixture("inspec", "three-layer-rhel7.json"),
|
|
28
30
|
wrapper: fixture("inspec", "wrapper.json")
|
|
29
31
|
};
|
|
30
32
|
const all = {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["// @mitre/hdf-fixtures — shared real-world HDF reference data for cross-package\n// consumers (parsers, validators, hdf-extension-graph). Each entry exposes the\n// on-disk path AND a read() helper. Both Go and TS test code reach the same\n// physical files via the parallel APIs (this module + ../fixtures.go).\n//\n// Boundary rule (per bead hdf-libs-e95o): converter fixtures stay with the\n// converter as its tested contract; files here are wild-data references for\n// cross-cutting tests. Inclusion requires the fixture is actually consumed\n// by more than one workspace package — not just \"might be useful someday.\"\n//\n// Layout: top-level directories are by HDF document type (`results/`,\n// `baseline/`, `amendments/`) plus `inspec/` for InSpec runner output (non-HDF;\n// kept for cross-language parser parity tests verifying both languages\n// reject non-HDF inputs the same way).\n//\n// Provenance for every fixture is documented in ../README.md.\nimport { readFileSync } from 'node:fs';\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\n// Compute paths relative to the package root, not the dist/ output dir, so\n// fixtures resolve correctly both in dev (running tsx) and after bundling.\nconst PACKAGE_ROOT = path.resolve(__dirname, '..');\n\ninterface FixtureRef {\n path: string;\n read: () => string;\n}\n\nfunction fixture(category: string, name: string): FixtureRef {\n const filePath = path.join(PACKAGE_ROOT, category, name);\n return {\n path: filePath,\n read: () => readFileSync(filePath, 'utf-8'),\n };\n}\n\n// HDF Results documents.\nexport const results = {\n inspecMultilayered: fixture('results', 'inspec-multilayered.json'),\n minimal: fixture('results', 'minimal.json'),\n} as const;\n\n// HDF Baseline documents.\nexport const baseline = {\n win2022Stig: fixture('baseline', 'win2022-stig.json'),\n} as const;\n\n// HDF Amendments documents.\nexport const amendments = {\n uc01Fixed: fixture('amendments', 'uc-01-fixed-amendments.json'),\n multiCve: fixture('amendments', 'multi-cve-amendments.json'),\n} as const;\n\n// InSpec runner output — NOT HDF. Kept here for cross-language parser\n// parity tests that verify both Go and TS parsers reject non-HDF inputs the\n// same way, and for the legacyhdf-to-hdf converter (its tests load these too).\nexport const inspec = {\n ubi9Scan: fixture('inspec', 'ubi9-scan.json'),\n containerScan: fixture('inspec', 'container-scan.json'),\n threeLayerOverlay: fixture('inspec', 'three-layer-overlay.json'),\n
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["// @mitre/hdf-fixtures — shared real-world HDF reference data for cross-package\n// consumers (parsers, validators, hdf-extension-graph). Each entry exposes the\n// on-disk path AND a read() helper. Both Go and TS test code reach the same\n// physical files via the parallel APIs (this module + ../fixtures.go).\n//\n// Boundary rule (per bead hdf-libs-e95o): converter fixtures stay with the\n// converter as its tested contract; files here are wild-data references for\n// cross-cutting tests. Inclusion requires the fixture is actually consumed\n// by more than one workspace package — not just \"might be useful someday.\"\n//\n// Layout: top-level directories are by HDF document type (`results/`,\n// `baseline/`, `amendments/`) plus `inspec/` for InSpec runner output (non-HDF;\n// kept for cross-language parser parity tests verifying both languages\n// reject non-HDF inputs the same way).\n//\n// Provenance for every fixture is documented in ../README.md.\nimport { readFileSync } from 'node:fs';\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\n// Compute paths relative to the package root, not the dist/ output dir, so\n// fixtures resolve correctly both in dev (running tsx) and after bundling.\nconst PACKAGE_ROOT = path.resolve(__dirname, '..');\n\ninterface FixtureRef {\n path: string;\n read: () => string;\n}\n\nfunction fixture(category: string, name: string): FixtureRef {\n const filePath = path.join(PACKAGE_ROOT, category, name);\n return {\n path: filePath,\n read: () => readFileSync(filePath, 'utf-8'),\n };\n}\n\n// HDF Results documents.\nexport const results = {\n inspecMultilayered: fixture('results', 'inspec-multilayered.json'),\n minimal: fixture('results', 'minimal.json'),\n duplicateBaselines: fixture('results', 'duplicate-baselines.json'),\n mergeGrype: fixture('results', 'merge-grype.json'),\n mergeZap: fixture('results', 'merge-zap.json'),\n} as const;\n\n// HDF Baseline documents.\nexport const baseline = {\n win2022Stig: fixture('baseline', 'win2022-stig.json'),\n} as const;\n\n// HDF Amendments documents.\nexport const amendments = {\n uc01Fixed: fixture('amendments', 'uc-01-fixed-amendments.json'),\n multiCve: fixture('amendments', 'multi-cve-amendments.json'),\n} as const;\n\n// InSpec runner output — NOT HDF. Kept here for cross-language parser\n// parity tests that verify both Go and TS parsers reject non-HDF inputs the\n// same way, and for the legacyhdf-to-hdf converter (its tests load these too).\nexport const inspec = {\n ubi9Scan: fixture('inspec', 'ubi9-scan.json'),\n containerScan: fixture('inspec', 'container-scan.json'),\n threeLayerOverlay: fixture('inspec', 'three-layer-overlay.json'),\n wrapper: fixture('inspec', 'wrapper.json'),\n} as const;\n\nexport const all = {\n results,\n baseline,\n amendments,\n inspec,\n} as const;\n"],"mappings":";;;;AAoBA,MAAM,YAAY,KAAK,QAAQ,cAAc,YAAY,GAAG,CAAC;AAI7D,MAAM,eAAe,KAAK,QAAQ,WAAW,IAAI;AAOjD,SAAS,QAAQ,UAAkB,MAA0B;CAC3D,MAAM,WAAW,KAAK,KAAK,cAAc,UAAU,IAAI;CACvD,OAAO;EACL,MAAM;EACN,YAAY,aAAa,UAAU,OAAO;CAC5C;AACF;AAGA,MAAa,UAAU;CACrB,oBAAoB,QAAQ,WAAW,0BAA0B;CACjE,SAAS,QAAQ,WAAW,cAAc;CAC1C,oBAAoB,QAAQ,WAAW,0BAA0B;CACjE,YAAY,QAAQ,WAAW,kBAAkB;CACjD,UAAU,QAAQ,WAAW,gBAAgB;AAC/C;AAGA,MAAa,WAAW,EACtB,aAAa,QAAQ,YAAY,mBAAmB,EACtD;AAGA,MAAa,aAAa;CACxB,WAAW,QAAQ,cAAc,6BAA6B;CAC9D,UAAU,QAAQ,cAAc,2BAA2B;AAC7D;AAKA,MAAa,SAAS;CACpB,UAAU,QAAQ,UAAU,gBAAgB;CAC5C,eAAe,QAAQ,UAAU,qBAAqB;CACtD,mBAAmB,QAAQ,UAAU,0BAA0B;CAC/D,SAAS,QAAQ,UAAU,cAAc;AAC3C;AAEA,MAAa,MAAM;CACjB;CACA;CACA;CACA;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mitre/hdf-fixtures",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0-rc.1",
|
|
4
4
|
"description": "Shared real-world HDF reference fixtures for cross-package consumers (parsers, validators, extension-graph)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -17,15 +17,6 @@
|
|
|
17
17
|
"baseline",
|
|
18
18
|
"inspec"
|
|
19
19
|
],
|
|
20
|
-
"scripts": {
|
|
21
|
-
"build": "tsdown",
|
|
22
|
-
"clean": "rimraf dist",
|
|
23
|
-
"test": "echo 'No TypeScript tests in hdf-fixtures (Go gate runs via test:go)' && exit 0",
|
|
24
|
-
"test:ts": "echo 'No TypeScript tests in hdf-fixtures (Go gate runs via test:go)' && exit 0",
|
|
25
|
-
"type-check": "tsc --noEmit",
|
|
26
|
-
"lint": "eslint src",
|
|
27
|
-
"test:go": "go test ./..."
|
|
28
|
-
},
|
|
29
20
|
"repository": {
|
|
30
21
|
"type": "git",
|
|
31
22
|
"url": "https://github.com/mitre/hdf-libs.git",
|
|
@@ -35,5 +26,14 @@
|
|
|
35
26
|
"license": "Apache-2.0",
|
|
36
27
|
"engines": {
|
|
37
28
|
"node": ">=22.0.0"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "tsdown",
|
|
32
|
+
"clean": "rimraf dist",
|
|
33
|
+
"test": "echo 'No TypeScript tests in hdf-fixtures (Go gate runs via test:go)' && exit 0",
|
|
34
|
+
"test:ts": "echo 'No TypeScript tests in hdf-fixtures (Go gate runs via test:go)' && exit 0",
|
|
35
|
+
"type-check": "tsc --noEmit",
|
|
36
|
+
"lint": "eslint src",
|
|
37
|
+
"test:go": "go test ./..."
|
|
38
38
|
}
|
|
39
|
-
}
|
|
39
|
+
}
|