@mitre/hdf-schema 2.0.0

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 (65) hide show
  1. package/LICENSE.md +55 -0
  2. package/README.md +143 -0
  3. package/dist/go/go.mod +4 -0
  4. package/dist/go/hdf.go +2224 -0
  5. package/dist/helpers.d.ts +77 -0
  6. package/dist/helpers.js +242 -0
  7. package/dist/index.d.ts +62 -0
  8. package/dist/index.js +37 -0
  9. package/dist/python/hdf_amendments.py +695 -0
  10. package/dist/python/hdf_baseline.py +782 -0
  11. package/dist/python/hdf_comparison.py +1771 -0
  12. package/dist/python/hdf_evidence_package.py +593 -0
  13. package/dist/python/hdf_plan.py +363 -0
  14. package/dist/python/hdf_results.py +2163 -0
  15. package/dist/python/hdf_system.py +904 -0
  16. package/dist/schemas/hdf-amendments.schema.json +1562 -0
  17. package/dist/schemas/hdf-baseline.schema.json +1787 -0
  18. package/dist/schemas/hdf-comparison.schema.json +3730 -0
  19. package/dist/schemas/hdf-evidence-package.schema.json +1738 -0
  20. package/dist/schemas/hdf-plan.schema.json +1821 -0
  21. package/dist/schemas/hdf-results.schema.json +2810 -0
  22. package/dist/schemas/hdf-system.schema.json +2512 -0
  23. package/dist/ts/hdf-amendments.d.ts +446 -0
  24. package/dist/ts/hdf-amendments.js +77 -0
  25. package/dist/ts/hdf-amendments.ts +457 -0
  26. package/dist/ts/hdf-baseline.d.ts +472 -0
  27. package/dist/ts/hdf-baseline.js +58 -0
  28. package/dist/ts/hdf-baseline.ts +483 -0
  29. package/dist/ts/hdf-comparison.d.ts +1185 -0
  30. package/dist/ts/hdf-comparison.js +216 -0
  31. package/dist/ts/hdf-comparison.ts +1210 -0
  32. package/dist/ts/hdf-evidence-package.d.ts +348 -0
  33. package/dist/ts/hdf-evidence-package.js +39 -0
  34. package/dist/ts/hdf-evidence-package.ts +356 -0
  35. package/dist/ts/hdf-plan.d.ts +204 -0
  36. package/dist/ts/hdf-plan.js +23 -0
  37. package/dist/ts/hdf-plan.ts +205 -0
  38. package/dist/ts/hdf-results.d.ts +1457 -0
  39. package/dist/ts/hdf-results.js +174 -0
  40. package/dist/ts/hdf-results.ts +1481 -0
  41. package/dist/ts/hdf-system.d.ts +609 -0
  42. package/dist/ts/hdf-system.js +102 -0
  43. package/dist/ts/hdf-system.ts +617 -0
  44. package/package.json +98 -0
  45. package/src/schemas/hdf-amendments.schema.json +97 -0
  46. package/src/schemas/hdf-baseline.schema.json +190 -0
  47. package/src/schemas/hdf-comparison.schema.json +107 -0
  48. package/src/schemas/hdf-evidence-package.schema.json +227 -0
  49. package/src/schemas/hdf-plan.schema.json +92 -0
  50. package/src/schemas/hdf-results.schema.json +304 -0
  51. package/src/schemas/hdf-system.schema.json +136 -0
  52. package/src/schemas/primitives/amendments.schema.json +155 -0
  53. package/src/schemas/primitives/common.schema.json +814 -0
  54. package/src/schemas/primitives/comparison.schema.json +809 -0
  55. package/src/schemas/primitives/component.schema.json +518 -0
  56. package/src/schemas/primitives/data-flow.schema.json +158 -0
  57. package/src/schemas/primitives/extensions.schema.json +342 -0
  58. package/src/schemas/primitives/parameter.schema.json +128 -0
  59. package/src/schemas/primitives/plan.schema.json +128 -0
  60. package/src/schemas/primitives/platform.schema.json +32 -0
  61. package/src/schemas/primitives/result.schema.json +133 -0
  62. package/src/schemas/primitives/runner.schema.json +83 -0
  63. package/src/schemas/primitives/statistics.schema.json +71 -0
  64. package/src/schemas/primitives/system.schema.json +132 -0
  65. package/src/schemas/primitives/target.schema.json +523 -0
@@ -0,0 +1,446 @@
1
+ /**
2
+ * Waivers, attestations, exceptions, and POA&Ms that modify requirement compliance status.
3
+ * Amendments are standalone documents that can be applied to results via merge operations.
4
+ */
5
+ export interface HdfAmendments {
6
+ /**
7
+ * Unique identifier for this amendments document. Useful for cross-referencing when
8
+ * multiple amendment documents target the same results.
9
+ */
10
+ amendmentId?: string;
11
+ /**
12
+ * Default identity of who created this amendments document. Individual overrides may
13
+ * specify their own appliedBy.
14
+ */
15
+ appliedBy?: Identity;
16
+ /**
17
+ * Identity of the authorizing official who approved these amendments.
18
+ */
19
+ approvedBy?: Identity;
20
+ /**
21
+ * Description of the amendments' purpose and scope.
22
+ */
23
+ description?: string;
24
+ /**
25
+ * Information about the tool that generated this document.
26
+ */
27
+ generator?: Generator;
28
+ /**
29
+ * Cryptographic integrity information for verifying this amendments document has not been
30
+ * tampered with.
31
+ */
32
+ integrity?: Integrity;
33
+ /**
34
+ * Optional key-value labels for grouping and querying amendments.
35
+ */
36
+ labels?: {
37
+ [key: string]: string;
38
+ };
39
+ /**
40
+ * Human-readable name for this amendments document. Example: 'Portal Q1 2026 Waivers'.
41
+ */
42
+ name: string;
43
+ /**
44
+ * The set of amendments (waivers, attestations, exceptions, POA&Ms).
45
+ */
46
+ overrides: StandaloneOverride[];
47
+ /**
48
+ * Document-level digital signature covering all amendments.
49
+ */
50
+ signature?: Signature;
51
+ /**
52
+ * URI to the hdf-system document these amendments apply to.
53
+ */
54
+ systemRef?: string;
55
+ /**
56
+ * Version of this amendments document.
57
+ */
58
+ version?: string;
59
+ [property: string]: any;
60
+ }
61
+ /**
62
+ * Default identity of who created this amendments document. Individual overrides may
63
+ * specify their own appliedBy.
64
+ *
65
+ * Represents an identity that performed an action, such as capturing evidence or applying
66
+ * an override.
67
+ *
68
+ * Identity of the authorizing official who approved these amendments.
69
+ *
70
+ * Identity of who applied this amendment.
71
+ *
72
+ * Identity of who or what captured this evidence.
73
+ *
74
+ * Identity of who completed this milestone.
75
+ *
76
+ * The identity that created this signature.
77
+ */
78
+ export interface Identity {
79
+ /**
80
+ * Optional description of the identity or identity system, particularly useful when type is
81
+ * 'other'.
82
+ */
83
+ description?: string;
84
+ /**
85
+ * The identifier value. Example: 'user@example.com', 'jdoe', 'automated-scanner-01'.
86
+ */
87
+ identifier: string;
88
+ /**
89
+ * The type of identifier. Use 'email' for email addresses, 'username' for user accounts,
90
+ * 'system' for automated systems, 'simple' for basic string identifiers without additional
91
+ * classification, or 'other' for custom identity systems.
92
+ */
93
+ type: AppliedByType;
94
+ [property: string]: any;
95
+ }
96
+ /**
97
+ * The type of identifier. Use 'email' for email addresses, 'username' for user accounts,
98
+ * 'system' for automated systems, 'simple' for basic string identifiers without additional
99
+ * classification, or 'other' for custom identity systems.
100
+ */
101
+ export declare enum AppliedByType {
102
+ Email = "email",
103
+ Other = "other",
104
+ Simple = "simple",
105
+ System = "system",
106
+ Username = "username"
107
+ }
108
+ /**
109
+ * Information about the tool that generated this document.
110
+ *
111
+ * Information about the tool that generated this HDF file.
112
+ */
113
+ export interface Generator {
114
+ /**
115
+ * The name of the software that produced this HDF file. Example: 'gosec-to-hdf'.
116
+ */
117
+ name: string;
118
+ /**
119
+ * The version of the tool. Example: '5.22.3'.
120
+ */
121
+ version: string;
122
+ [property: string]: any;
123
+ }
124
+ /**
125
+ * Cryptographic integrity information for verifying this amendments document has not been
126
+ * tampered with.
127
+ *
128
+ * Cryptographic integrity information for verifying the HDF file has not been tampered
129
+ * with. If algorithm is provided, checksum must also be provided, and vice versa.
130
+ */
131
+ export interface Integrity {
132
+ /**
133
+ * The hash algorithm used for the checksum.
134
+ */
135
+ algorithm?: HashAlgorithm;
136
+ /**
137
+ * The checksum value.
138
+ */
139
+ checksum?: string;
140
+ /**
141
+ * Optional cryptographic signature.
142
+ */
143
+ signature?: string;
144
+ /**
145
+ * Identifier of who signed this file.
146
+ */
147
+ signedBy?: string;
148
+ [property: string]: any;
149
+ }
150
+ /**
151
+ * The hash algorithm used for the checksum.
152
+ *
153
+ * Supported cryptographic hash algorithms for checksums and integrity verification.
154
+ */
155
+ export declare enum HashAlgorithm {
156
+ Sha256 = "sha256",
157
+ Sha384 = "sha384",
158
+ Sha512 = "sha512"
159
+ }
160
+ /**
161
+ * A standalone amendment that modifies a requirement's compliance status. Extends the
162
+ * inline Status_Override concept with requirementId and baselineRef for use outside of
163
+ * results documents.
164
+ */
165
+ export interface StandaloneOverride {
166
+ /**
167
+ * When this amendment was applied. ISO 8601 format.
168
+ */
169
+ appliedAt: Date;
170
+ /**
171
+ * Identity of who applied this amendment.
172
+ */
173
+ appliedBy: Identity;
174
+ /**
175
+ * Name of the baseline containing the requirement. Required when the system has multiple
176
+ * baselines with potentially overlapping requirement IDs.
177
+ */
178
+ baselineRef?: string;
179
+ /**
180
+ * componentId of the component this amendment is scoped to. When set, the amendment only
181
+ * applies to the specified component. When omitted, the amendment applies system-wide.
182
+ */
183
+ componentRef?: string;
184
+ /**
185
+ * Supporting evidence (screenshots, logs, URLs, documents).
186
+ */
187
+ evidence?: Evidence[];
188
+ /**
189
+ * When this amendment expires and must be reviewed. No permanent amendments. ISO 8601
190
+ * format.
191
+ */
192
+ expiresAt: Date;
193
+ /**
194
+ * componentId of the local component that provides this control. Set when the provider is
195
+ * in the same system. Omit for external or cross-system providers; the reason field
196
+ * explains the source. Primarily used with type 'inherited'.
197
+ */
198
+ inheritedFrom?: string;
199
+ /**
200
+ * Remediation milestones (primarily for POA&M type amendments).
201
+ */
202
+ milestones?: Milestone[];
203
+ /**
204
+ * Checksum of the prior amendment in the chain. Creates a tamper-evident linked list. Null
205
+ * for the first amendment.
206
+ */
207
+ previousChecksum?: Checksum;
208
+ /**
209
+ * Justification for this amendment.
210
+ */
211
+ reason: string;
212
+ /**
213
+ * The ID of the requirement being amended. Must match a requirement ID in the referenced
214
+ * baseline.
215
+ */
216
+ requirementId: string;
217
+ /**
218
+ * Digital signature for non-repudiation.
219
+ */
220
+ signature?: Signature;
221
+ /**
222
+ * The new status this amendment sets. For POA&Ms, this is the current status (POA&Ms track
223
+ * work, they don't change status).
224
+ */
225
+ status: ResultStatus;
226
+ /**
227
+ * The type of amendment.
228
+ */
229
+ type: OverrideType;
230
+ [property: string]: any;
231
+ }
232
+ /**
233
+ * Supporting evidence for a finding or override, such as screenshots, code samples, log
234
+ * excerpts, or URLs.
235
+ */
236
+ export interface Evidence {
237
+ /**
238
+ * Timestamp when this evidence was captured. ISO 8601 format.
239
+ */
240
+ capturedAt?: Date;
241
+ /**
242
+ * Identity of who or what captured this evidence.
243
+ */
244
+ capturedBy?: Identity;
245
+ /**
246
+ * The evidence content. For screenshots/files: base64-encoded data or URL. For code/logs:
247
+ * the raw text. For URLs: the URL string.
248
+ */
249
+ data: string;
250
+ /**
251
+ * Human-readable description of what this evidence shows.
252
+ */
253
+ description?: string;
254
+ /**
255
+ * Encoding used for the data. Example: 'base64', 'utf-8'.
256
+ */
257
+ encoding?: string;
258
+ /**
259
+ * MIME type of the evidence. Example: 'image/png', 'text/plain', 'application/json'.
260
+ */
261
+ mimeType?: string;
262
+ /**
263
+ * Size of the evidence data in bytes.
264
+ */
265
+ size?: number;
266
+ /**
267
+ * The type of evidence being provided.
268
+ */
269
+ type: EvidenceType;
270
+ [property: string]: any;
271
+ }
272
+ /**
273
+ * The type of evidence being provided.
274
+ */
275
+ export declare enum EvidenceType {
276
+ Code = "code",
277
+ File = "file",
278
+ Log = "log",
279
+ Other = "other",
280
+ Screenshot = "screenshot",
281
+ URL = "url"
282
+ }
283
+ /**
284
+ * A milestone or task within a POA&M remediation plan.
285
+ */
286
+ export interface Milestone {
287
+ /**
288
+ * Actual completion timestamp. ISO 8601 format.
289
+ */
290
+ completedAt?: Date;
291
+ /**
292
+ * Identity of who completed this milestone.
293
+ */
294
+ completedBy?: Identity;
295
+ /**
296
+ * Description of this milestone or task.
297
+ */
298
+ description: string;
299
+ /**
300
+ * Estimated completion date. ISO 8601 format.
301
+ */
302
+ estimatedCompletion: Date;
303
+ /**
304
+ * Current status of this milestone.
305
+ */
306
+ status: Status;
307
+ [property: string]: any;
308
+ }
309
+ /**
310
+ * Current status of this milestone.
311
+ */
312
+ export declare enum Status {
313
+ Completed = "completed",
314
+ InProgress = "inProgress",
315
+ Pending = "pending"
316
+ }
317
+ /**
318
+ * Checksum of the prior amendment in the chain. Creates a tamper-evident linked list. Null
319
+ * for the first amendment.
320
+ *
321
+ * Cryptographic checksum for baseline integrity verification.
322
+ */
323
+ export interface Checksum {
324
+ /**
325
+ * The hash algorithm used for the checksum.
326
+ */
327
+ algorithm: HashAlgorithm;
328
+ /**
329
+ * The checksum value.
330
+ */
331
+ value: string;
332
+ [property: string]: any;
333
+ }
334
+ /**
335
+ * Digital signature for non-repudiation.
336
+ *
337
+ * A digital signature following W3C Data Integrity Proofs pattern. Supports hardware
338
+ * security tokens (PKCS#11/PKCS#12), Yubikeys, GPG keys, passkeys, and other cryptographic
339
+ * signing methods via JWK, PEM, or Base58 key formats.
340
+ *
341
+ * Document-level digital signature covering all amendments.
342
+ */
343
+ export interface Signature {
344
+ /**
345
+ * Challenge value from the verifier, used in challenge-response authentication.
346
+ */
347
+ challenge?: string;
348
+ /**
349
+ * When the signature was created. ISO 8601 format.
350
+ */
351
+ created: Date;
352
+ /**
353
+ * The identity that created this signature.
354
+ */
355
+ creator: Identity;
356
+ /**
357
+ * Domain restriction for the signature, prevents cross-domain replay attacks.
358
+ */
359
+ domain?: string;
360
+ /**
361
+ * Random value to prevent replay attacks.
362
+ */
363
+ nonce?: string;
364
+ /**
365
+ * The purpose of this signature. Example: 'attestation', 'authentication',
366
+ * 'assertionMethod'.
367
+ */
368
+ proofPurpose: string;
369
+ /**
370
+ * The base64-encoded or base58-encoded signature value.
371
+ */
372
+ signatureValue: string;
373
+ /**
374
+ * The signature suite type. Example: 'JsonWebSignature2020', 'RsaSignature2018',
375
+ * 'Ed25519Signature2020'.
376
+ */
377
+ type: string;
378
+ /**
379
+ * The verification method containing the public key for signature verification.
380
+ */
381
+ verificationMethod: VerificationMethod;
382
+ [property: string]: any;
383
+ }
384
+ /**
385
+ * The verification method containing the public key for signature verification.
386
+ *
387
+ * Verification method containing the public key needed to verify a digital signature.
388
+ * Supports multiple key formats including JWK (for RSA, EC), PEM, and Base58.
389
+ */
390
+ export interface VerificationMethod {
391
+ /**
392
+ * The entity that controls this verification method. Can be a DID, URI, or other identifier.
393
+ */
394
+ controller: string;
395
+ /**
396
+ * Public key in Base58 format, commonly used with Ed25519 keys.
397
+ */
398
+ publicKeyBase58?: string;
399
+ /**
400
+ * Public key in JSON Web Key format.
401
+ */
402
+ publicKeyJwk?: {
403
+ [key: string]: any;
404
+ };
405
+ /**
406
+ * Public key in PEM format. Example: '-----BEGIN PUBLIC KEY-----...-----END PUBLIC
407
+ * KEY-----'.
408
+ */
409
+ publicKeyPem?: string;
410
+ /**
411
+ * The type of verification method. Example: 'JsonWebKey2020', 'RsaVerificationKey2018',
412
+ * 'Ed25519VerificationKey2020'.
413
+ */
414
+ type: string;
415
+ [property: string]: any;
416
+ }
417
+ /**
418
+ * The new status this amendment sets. For POA&Ms, this is the current status (POA&Ms track
419
+ * work, they don't change status).
420
+ *
421
+ * The status of an individual test result. 'notApplicable' indicates the requirement does
422
+ * not apply to the target. 'notReviewed' indicates the requirement was not assessed (e.g.,
423
+ * requires manual verification).
424
+ */
425
+ export declare enum ResultStatus {
426
+ Error = "error",
427
+ Failed = "failed",
428
+ NotApplicable = "notApplicable",
429
+ NotReviewed = "notReviewed",
430
+ Passed = "passed"
431
+ }
432
+ /**
433
+ * The type of amendment.
434
+ *
435
+ * The type of amendment. 'waiver': risk accepted (AO). 'attestation': manually verified
436
+ * (assessor). 'exception': not applicable (system owner + AO). 'poam': remediation tracked
437
+ * (no status change). 'inherited': control provided by another component or system
438
+ * (overrides to notApplicable/passed).
439
+ */
440
+ export declare enum OverrideType {
441
+ Attestation = "attestation",
442
+ Exception = "exception",
443
+ Inherited = "inherited",
444
+ Poam = "poam",
445
+ Waiver = "waiver"
446
+ }
@@ -0,0 +1,77 @@
1
+ /**
2
+ * The type of identifier. Use 'email' for email addresses, 'username' for user accounts,
3
+ * 'system' for automated systems, 'simple' for basic string identifiers without additional
4
+ * classification, or 'other' for custom identity systems.
5
+ */
6
+ export var AppliedByType;
7
+ (function (AppliedByType) {
8
+ AppliedByType["Email"] = "email";
9
+ AppliedByType["Other"] = "other";
10
+ AppliedByType["Simple"] = "simple";
11
+ AppliedByType["System"] = "system";
12
+ AppliedByType["Username"] = "username";
13
+ })(AppliedByType || (AppliedByType = {}));
14
+ /**
15
+ * The hash algorithm used for the checksum.
16
+ *
17
+ * Supported cryptographic hash algorithms for checksums and integrity verification.
18
+ */
19
+ export var HashAlgorithm;
20
+ (function (HashAlgorithm) {
21
+ HashAlgorithm["Sha256"] = "sha256";
22
+ HashAlgorithm["Sha384"] = "sha384";
23
+ HashAlgorithm["Sha512"] = "sha512";
24
+ })(HashAlgorithm || (HashAlgorithm = {}));
25
+ /**
26
+ * The type of evidence being provided.
27
+ */
28
+ export var EvidenceType;
29
+ (function (EvidenceType) {
30
+ EvidenceType["Code"] = "code";
31
+ EvidenceType["File"] = "file";
32
+ EvidenceType["Log"] = "log";
33
+ EvidenceType["Other"] = "other";
34
+ EvidenceType["Screenshot"] = "screenshot";
35
+ EvidenceType["URL"] = "url";
36
+ })(EvidenceType || (EvidenceType = {}));
37
+ /**
38
+ * Current status of this milestone.
39
+ */
40
+ export var Status;
41
+ (function (Status) {
42
+ Status["Completed"] = "completed";
43
+ Status["InProgress"] = "inProgress";
44
+ Status["Pending"] = "pending";
45
+ })(Status || (Status = {}));
46
+ /**
47
+ * The new status this amendment sets. For POA&Ms, this is the current status (POA&Ms track
48
+ * work, they don't change status).
49
+ *
50
+ * The status of an individual test result. 'notApplicable' indicates the requirement does
51
+ * not apply to the target. 'notReviewed' indicates the requirement was not assessed (e.g.,
52
+ * requires manual verification).
53
+ */
54
+ export var ResultStatus;
55
+ (function (ResultStatus) {
56
+ ResultStatus["Error"] = "error";
57
+ ResultStatus["Failed"] = "failed";
58
+ ResultStatus["NotApplicable"] = "notApplicable";
59
+ ResultStatus["NotReviewed"] = "notReviewed";
60
+ ResultStatus["Passed"] = "passed";
61
+ })(ResultStatus || (ResultStatus = {}));
62
+ /**
63
+ * The type of amendment.
64
+ *
65
+ * The type of amendment. 'waiver': risk accepted (AO). 'attestation': manually verified
66
+ * (assessor). 'exception': not applicable (system owner + AO). 'poam': remediation tracked
67
+ * (no status change). 'inherited': control provided by another component or system
68
+ * (overrides to notApplicable/passed).
69
+ */
70
+ export var OverrideType;
71
+ (function (OverrideType) {
72
+ OverrideType["Attestation"] = "attestation";
73
+ OverrideType["Exception"] = "exception";
74
+ OverrideType["Inherited"] = "inherited";
75
+ OverrideType["Poam"] = "poam";
76
+ OverrideType["Waiver"] = "waiver";
77
+ })(OverrideType || (OverrideType = {}));