@mitre/hdf-schema 3.0.1 → 3.1.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.
Files changed (47) hide show
  1. package/LICENSE.md +55 -0
  2. package/README.md +83 -40
  3. package/dist/go/hdf.go +148 -104
  4. package/dist/index.d.ts +26 -1
  5. package/dist/index.js +26 -1
  6. package/dist/schemas/hdf-amendments.schema.json +178 -53
  7. package/dist/schemas/hdf-baseline.schema.json +181 -56
  8. package/dist/schemas/hdf-comparison.schema.json +523 -108
  9. package/dist/schemas/hdf-evidence-package.schema.json +175 -50
  10. package/dist/schemas/hdf-plan.schema.json +181 -56
  11. package/dist/schemas/hdf-results.schema.json +502 -87
  12. package/dist/schemas/hdf-system.schema.json +190 -65
  13. package/dist/ts/hdf-amendments.d.ts +43 -15
  14. package/dist/ts/hdf-amendments.js +18 -7
  15. package/dist/ts/hdf-amendments.ts +44 -15
  16. package/dist/ts/hdf-results.d.ts +91 -37
  17. package/dist/ts/hdf-results.js +40 -20
  18. package/dist/ts/hdf-results.ts +91 -36
  19. package/package.json +44 -45
  20. package/dist/python/hdf_amendments.py +0 -695
  21. package/dist/python/hdf_baseline.py +0 -782
  22. package/dist/python/hdf_comparison.py +0 -1771
  23. package/dist/python/hdf_evidence_package.py +0 -593
  24. package/dist/python/hdf_plan.py +0 -363
  25. package/dist/python/hdf_results.py +0 -2163
  26. package/dist/python/hdf_system.py +0 -904
  27. package/src/schemas/hdf-amendments.schema.json +0 -97
  28. package/src/schemas/hdf-baseline.schema.json +0 -190
  29. package/src/schemas/hdf-comparison.schema.json +0 -107
  30. package/src/schemas/hdf-evidence-package.schema.json +0 -227
  31. package/src/schemas/hdf-plan.schema.json +0 -92
  32. package/src/schemas/hdf-results.schema.json +0 -304
  33. package/src/schemas/hdf-system.schema.json +0 -136
  34. package/src/schemas/primitives/amendments.schema.json +0 -155
  35. package/src/schemas/primitives/common.schema.json +0 -814
  36. package/src/schemas/primitives/comparison.schema.json +0 -809
  37. package/src/schemas/primitives/component.schema.json +0 -518
  38. package/src/schemas/primitives/data-flow.schema.json +0 -158
  39. package/src/schemas/primitives/extensions.schema.json +0 -342
  40. package/src/schemas/primitives/parameter.schema.json +0 -128
  41. package/src/schemas/primitives/plan.schema.json +0 -128
  42. package/src/schemas/primitives/platform.schema.json +0 -32
  43. package/src/schemas/primitives/result.schema.json +0 -133
  44. package/src/schemas/primitives/runner.schema.json +0 -83
  45. package/src/schemas/primitives/statistics.schema.json +0 -71
  46. package/src/schemas/primitives/system.schema.json +0 -132
  47. package/src/schemas/primitives/target.schema.json +0 -523
@@ -1,133 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://mitre.github.io/hdf-libs/schemas/primitives/result/v3.0.0",
4
- "title": "HDF Result Primitives",
5
- "description": "Types for representing assessment results and statuses.",
6
- "$defs": {
7
- "Result_Status": {
8
- "type": "string",
9
- "enum": [
10
- "passed",
11
- "failed",
12
- "notApplicable",
13
- "notReviewed",
14
- "error"
15
- ],
16
- "description": "The status of an individual test result. 'notApplicable' indicates the requirement does not apply to the target. 'notReviewed' indicates the requirement was not assessed (e.g., requires manual verification).",
17
- "title": "Result Status"
18
- },
19
- "Requirement_Result": {
20
- "type": "object",
21
- "unevaluatedProperties": false,
22
- "required": [
23
- "status",
24
- "codeDesc",
25
- "startTime"
26
- ],
27
- "properties": {
28
- "status": {
29
- "$ref": "#/$defs/Result_Status",
30
- "description": "The status of this test within the requirement. Example: 'failed'."
31
- },
32
- "codeDesc": {
33
- "type": "string",
34
- "description": "A description of this test. Example: 'limits.conf * is expected to include [\"hard\", \"maxlogins\", \"10\"]'."
35
- },
36
- "runTime": {
37
- "type": "number",
38
- "minimum": 0,
39
- "description": "The execution time in seconds for the test."
40
- },
41
- "startTime": {
42
- "type": "string",
43
- "format": "date-time",
44
- "description": "The time at which the test started."
45
- },
46
- "resource": {
47
- "type": "string",
48
- "description": "The resource used in the test. Example: 'file', 'command', 'service'."
49
- },
50
- "resourceId": {
51
- "type": "string",
52
- "description": "The unique identifier of the resource. Example: '/etc/passwd'."
53
- },
54
- "message": {
55
- "type": "string",
56
- "description": "An explanation of the test result. Typically provided for failed tests, errors, or to explain why a test was not applicable or not reviewed."
57
- },
58
- "exception": {
59
- "type": "string",
60
- "description": "The type of exception if an exception was thrown."
61
- },
62
- "backtrace": {
63
- "type": "array",
64
- "items": {
65
- "type": "string"
66
- },
67
- "description": "The stacktrace/backtrace of the exception if one occurred."
68
- }
69
- },
70
- "examples": [
71
- {
72
- "status": "passed",
73
- "codeDesc": "File /etc/ssh/sshd_config content is expected to match /Protocol\\s+2/",
74
- "startTime": "2025-06-15T10:30:00Z",
75
- "runTime": 0.015
76
- },
77
- {
78
- "status": "failed",
79
- "codeDesc": "Service 'telnet' is expected not to be enabled",
80
- "startTime": "2025-06-15T10:30:01Z",
81
- "runTime": 0.008,
82
- "message": "expected that 'Service telnet' is not enabled"
83
- },
84
- {
85
- "status": "error",
86
- "codeDesc": "File /etc/audit/auditd.conf content is expected to include 'max_log_file'",
87
- "startTime": "2025-06-15T10:30:02Z",
88
- "exception": "Errno::ENOENT",
89
- "backtrace": [
90
- "/opt/inspec/lib/resources/file.rb:42:in 'read'",
91
- "/opt/inspec/lib/resources/file.rb:15:in 'content'"
92
- ]
93
- }
94
- ],
95
- "description": "A test within a requirement and its results and findings such as how long it took to run.",
96
- "title": "Requirement Result"
97
- },
98
- "Requirement_Description": {
99
- "type": "object",
100
- "unevaluatedProperties": false,
101
- "required": [
102
- "label",
103
- "data"
104
- ],
105
- "properties": {
106
- "label": {
107
- "type": "string",
108
- "description": "The type of description. Examples: 'fix', 'check', 'rationale'."
109
- },
110
- "data": {
111
- "type": "string",
112
- "description": "The text of the description."
113
- }
114
- },
115
- "examples": [
116
- {
117
- "label": "default",
118
- "data": "Verify the SSH daemon is configured to only use FIPS-validated key exchange algorithms."
119
- },
120
- {
121
- "label": "check",
122
- "data": "Run 'sshd -T | grep kexalgorithms' and verify only FIPS-compliant algorithms are listed."
123
- },
124
- {
125
- "label": "fix",
126
- "data": "Add 'KexAlgorithms ecdh-sha2-nistp256,ecdh-sha2-nistp384' to /etc/ssh/sshd_config and restart sshd."
127
- }
128
- ],
129
- "description": "A labeled description for a requirement, such as fix text or check instructions.",
130
- "title": "Requirement Description"
131
- }
132
- }
133
- }
@@ -1,83 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://mitre.github.io/hdf-libs/schemas/primitives/runner/v3.0.0",
4
- "title": "HDF Runner Primitive",
5
- "description": "Information about the test execution environment where the security tool/scanner was executed.",
6
- "$defs": {
7
- "Runner": {
8
- "type": "object",
9
- "unevaluatedProperties": false,
10
- "required": ["name"],
11
- "properties": {
12
- "name": {
13
- "type": "string",
14
- "description": "The name of the runner environment. Examples: 'ubuntu', 'macos', 'windows', 'docker', 'kubernetes-pod', 'manual'."
15
- },
16
- "release": {
17
- "type": "string",
18
- "description": "The version/release of the operating system or runtime. Example: '20.04', '13.2', '11'."
19
- },
20
- "architecture": {
21
- "type": "string",
22
- "description": "The CPU architecture of the runner system. Example: 'x86_64', 'arm64', 'aarch64'."
23
- },
24
- "hostname": {
25
- "type": "string",
26
- "description": "The hostname of the runner system. Example: 'ci-runner-01', 'jenkins-agent-03', 'k8s-node-worker-03'."
27
- },
28
- "containerImage": {
29
- "type": "string",
30
- "description": "The container image used for the test execution. Example: 'inspec/inspec:latest', 'ghcr.io/my-org/scanner:v2.1.0'. Useful for CI/CD pipelines where tests run in containers."
31
- },
32
- "containerId": {
33
- "type": "string",
34
- "description": "The container instance identifier. Example: 'a1b2c3d4e5f6', 'security-scan-job-xyz123'. Can be a Docker container ID, Kubernetes pod name, or other container runtime identifier."
35
- },
36
- "operator": {
37
- "$ref": "https://mitre.github.io/hdf-libs/schemas/primitives/common/v3.0.0#/$defs/Identity",
38
- "description": "The identity of the person or system responsible for executing the test. This could be a human auditor manually completing a checklist, an automated CI/CD system, or a security tool. Optional field to support both automated and manual HDF generation."
39
- }
40
- },
41
- "examples": [
42
- {
43
- "name": "docker",
44
- "release": "20.04",
45
- "architecture": "x86_64",
46
- "hostname": "github-runner-prod-01",
47
- "containerImage": "ghcr.io/inspec/inspec:5.22.3",
48
- "containerId": "security-scan-job-a1b2c3d4",
49
- "operator": {
50
- "identifier": "github-actions",
51
- "type": "system",
52
- "description": "Automated CI/CD pipeline"
53
- }
54
- },
55
- {
56
- "name": "kubernetes-pod",
57
- "release": "1.28.4",
58
- "architecture": "arm64",
59
- "hostname": "k8s-worker-node-05",
60
- "containerImage": "gcr.io/my-org/security-scanner:v3.2.1",
61
- "containerId": "compliance-scan-pod-xyz789",
62
- "operator": {
63
- "identifier": "security-automation@example.com",
64
- "type": "email"
65
- }
66
- },
67
- {
68
- "name": "manual",
69
- "release": "macOS 14.2",
70
- "architecture": "arm64",
71
- "hostname": "auditor-mbp-02",
72
- "operator": {
73
- "identifier": "jane.smith",
74
- "type": "username",
75
- "description": "Senior Security Auditor - Manual Assessment"
76
- }
77
- }
78
- ],
79
- "description": "Information about the test execution environment. This is distinct from the target being scanned - the runner is where the security tool executes, while targets are what is being assessed.",
80
- "title": "Runner"
81
- }
82
- }
83
- }
@@ -1,71 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://mitre.github.io/hdf-libs/schemas/primitives/statistics/v3.0.0",
4
- "title": "HDF Statistics Primitives",
5
- "description": "Statistics types for tracking assessment run metrics.",
6
- "$defs": {
7
- "Statistic_Block": {
8
- "type": "object",
9
- "unevaluatedProperties": false,
10
- "required": [
11
- "total"
12
- ],
13
- "properties": {
14
- "total": {
15
- "type": "integer",
16
- "minimum": 0,
17
- "description": "The total count. Example: the total number of requirements in a given category for a run."
18
- }
19
- },
20
- "description": "Statistics for a given item, such as the total count.",
21
- "title": "Statistic Block"
22
- },
23
- "Statistic_Hash": {
24
- "type": "object",
25
- "unevaluatedProperties": false,
26
- "required": [],
27
- "properties": {
28
- "passed": {
29
- "$ref": "#/$defs/Statistic_Block",
30
- "description": "Statistics for requirements that passed."
31
- },
32
- "failed": {
33
- "$ref": "#/$defs/Statistic_Block",
34
- "description": "Statistics for requirements that failed."
35
- },
36
- "notApplicable": {
37
- "$ref": "#/$defs/Statistic_Block",
38
- "description": "Statistics for requirements that are not applicable to the target."
39
- },
40
- "notReviewed": {
41
- "$ref": "#/$defs/Statistic_Block",
42
- "description": "Statistics for requirements that were not reviewed (manual check required)."
43
- },
44
- "error": {
45
- "$ref": "#/$defs/Statistic_Block",
46
- "description": "Statistics for requirements that encountered an error during assessment."
47
- }
48
- },
49
- "description": "Statistics for requirement results, grouped by status.",
50
- "title": "Statistic Hash"
51
- },
52
- "Statistics": {
53
- "type": "object",
54
- "unevaluatedProperties": false,
55
- "required": [],
56
- "properties": {
57
- "duration": {
58
- "type": "number",
59
- "minimum": 0,
60
- "description": "How long (in seconds) this assessment run took."
61
- },
62
- "requirements": {
63
- "$ref": "#/$defs/Statistic_Hash",
64
- "description": "Breakdowns of requirement statistics by result status."
65
- }
66
- },
67
- "description": "Statistics for the assessment run(s) such as duration and result counts.",
68
- "title": "Statistics"
69
- }
70
- }
71
- }
@@ -1,132 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://mitre.github.io/hdf-libs/schemas/primitives/system/v3.0.0",
4
- "title": "HDF System Primitives",
5
- "description": "Types for describing system architecture, authorization boundaries, and components.",
6
- "$defs": {
7
- "Authorization_Status": {
8
- "type": "string",
9
- "enum": [
10
- "authorized",
11
- "denied",
12
- "pendingAuthorization",
13
- "conditionallyAuthorized",
14
- "notYetRequested",
15
- "revoked"
16
- ],
17
- "description": "Authorization to Operate (ATO) status for the system.",
18
- "title": "Authorization Status"
19
- },
20
- "Categorization_Level": {
21
- "type": "string",
22
- "enum": [
23
- "low",
24
- "moderate",
25
- "high"
26
- ],
27
- "description": "FIPS 199 security categorization level (impact level).",
28
- "title": "Categorization Level"
29
- },
30
- "Input_Override": {
31
- "type": "object",
32
- "unevaluatedProperties": false,
33
- "required": [
34
- "inputName",
35
- "value"
36
- ],
37
- "properties": {
38
- "baselineRef": {
39
- "type": "string",
40
- "description": "Name of the baseline this override applies to. If omitted, applies to all baselines that define this input."
41
- },
42
- "inputName": {
43
- "type": "string",
44
- "description": "Name of the input being overridden. Must match an Input.name in the referenced baseline."
45
- },
46
- "value": {
47
- "description": "The overridden value. Should match the type of the original input."
48
- },
49
- "justification": {
50
- "type": "string",
51
- "description": "Rationale for why this override is needed."
52
- },
53
- "approvedBy": {
54
- "$ref": "https://mitre.github.io/hdf-libs/schemas/primitives/common/v3.0.0#/$defs/Identity",
55
- "description": "Identity of the person or system that approved this override."
56
- }
57
- },
58
- "description": "An override of a baseline input value for a specific component. Enables system-specific tailoring of baseline parameters.",
59
- "title": "Input Override"
60
- },
61
- "Target_Selector": {
62
- "type": "object",
63
- "additionalProperties": {
64
- "type": "string"
65
- },
66
- "description": "A label selector that matches targets by label key-value pairs. All specified labels must match (AND logic). Example: { \"labels.component\": \"WebTier\" } matches targets with labels.component = \"WebTier\".",
67
- "title": "Target Selector"
68
- },
69
- "Control_Designation": {
70
- "type": "object",
71
- "unevaluatedProperties": false,
72
- "required": [
73
- "controlId",
74
- "designation",
75
- "description"
76
- ],
77
- "properties": {
78
- "controlId": {
79
- "type": "string",
80
- "description": "The control identifier (e.g., 'SC-7', 'AC-2 (1)'). Must match a NIST tag in a baseline requirement's tags."
81
- },
82
- "designation": {
83
- "type": "string",
84
- "enum": [
85
- "common",
86
- "system-specific",
87
- "hybrid"
88
- ],
89
- "description": "NIST SP 800-53 control designation. 'common': fully provided by another component or system. 'system-specific': implemented by the inheriting component(s) only. 'hybrid': shared responsibility between provider and inheritor."
90
- },
91
- "providedBy": {
92
- "type": "string",
93
- "format": "uuid",
94
- "description": "componentId of a local component that provides this control. Omit when the provider is an external system."
95
- },
96
- "systemRef": {
97
- "type": "string",
98
- "format": "uri-reference",
99
- "description": "Reference to another hdf-system document whose component provides this control. Use when the provider is in a different system. Omit when the provider is local."
100
- },
101
- "inheritedBy": {
102
- "type": "array",
103
- "items": {
104
- "type": "string",
105
- "format": "uuid"
106
- },
107
- "description": "componentIds that inherit this control. If omitted, all components in the system inherit it."
108
- },
109
- "description": {
110
- "type": "string",
111
- "description": "Justification for this designation — who provides the control, why it's inherited, and any relevant authorization references."
112
- }
113
- },
114
- "examples": [
115
- {
116
- "controlId": "IA-2",
117
- "designation": "common",
118
- "providedBy": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
119
- "inheritedBy": ["11111111-2222-3333-4444-555555555555"],
120
- "description": "User identification and authentication provided by Keycloak SSO via SAML 2.0."
121
- },
122
- {
123
- "controlId": "PE-2",
124
- "designation": "common",
125
- "description": "Physical access authorizations provided by AWS GovCloud per FedRAMP High authorization."
126
- }
127
- ],
128
- "description": "Declares a control's designation within a system — whether it is common (provided by another component or system), system-specific (implemented locally), or hybrid (shared responsibility). Maps to NIST SP 800-53 Appendix C control designations and OSCAL SSP by-component provided/inherited semantics.",
129
- "title": "Control Designation"
130
- }
131
- }
132
- }