@mitre/hdf-schema 3.4.3 → 3.5.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.
package/dist/go/hdf.go CHANGED
@@ -21,6 +21,9 @@
21
21
  //
22
22
  // hDFEvidencePackage, err := UnmarshalHDFEvidencePackage(bytes)
23
23
  // bytes, err = hDFEvidencePackage.Marshal()
24
+ //
25
+ // hDFRequirementChangeEvent, err := UnmarshalHDFRequirementChangeEvent(bytes)
26
+ // bytes, err = hDFRequirementChangeEvent.Marshal()
24
27
 
25
28
  package hdf
26
29
 
@@ -100,41 +103,59 @@ func (r *HDFEvidencePackage) Marshal() ([]byte, error) {
100
103
  return json.Marshal(r)
101
104
  }
102
105
 
106
+ func UnmarshalHDFRequirementChangeEvent(data []byte) (HDFRequirementChangeEvent, error) {
107
+ var r HDFRequirementChangeEvent
108
+ err := json.Unmarshal(data, &r)
109
+ return r, err
110
+ }
111
+
112
+ func (r *HDFRequirementChangeEvent) Marshal() ([]byte, error) {
113
+ return json.Marshal(r)
114
+ }
115
+
103
116
  // The top level value containing all assessment results.
104
117
  type HDFResults struct {
105
- // Information on the baselines that were evaluated, including findings.
106
- Baselines []EvaluatedBaseline `json:"baselines"`
107
- // The components that were assessed. Each component describes a system element (host,
108
- // container, cloud resource, application, etc.) with optional identity, SBOM, and external
109
- // references.
110
- Components []Component `json:"components,omitempty"`
111
- // Reserved for tool-specific data not defined in the HDF standard. Use this to preserve
112
- // original tool output, auxiliary data, or custom metadata.
113
- Extensions map[string]interface{} `json:"extensions,omitempty"`
114
- // Information about the tool that generated this file.
115
- Generator *Generator `json:"generator,omitempty"`
116
- // Unique identifier for this assessment run.
117
- ID *string `json:"id,omitempty"`
118
- // Cryptographic integrity information for verifying this file.
119
- Integrity *Integrity `json:"integrity,omitempty"`
120
- // Reference to an hdf-plan document describing the assessment plan that produced these
121
- // results. May be a relative path, absolute URI, or fragment identifier.
122
- PlanRef *string `json:"planRef,omitempty"`
123
- // Optional reference to automated remediation resources (Ansible playbooks, Terraform
124
- // scripts, etc.) for fixing failing requirements found in this assessment.
125
- Remediation *Remediation `json:"remediation,omitempty"`
126
- // Information about the test execution environment where the security tool was run.
127
- // Distinct from targets (what is being tested).
128
- Runner *Runner `json:"runner,omitempty"`
129
- // Statistics for the assessment run, including duration and result counts.
130
- Statistics *Statistics `json:"statistics,omitempty"`
131
- // Reference to an hdf-system document describing the system under assessment. May be a
132
- // relative path, absolute URI, or fragment identifier.
133
- SystemRef *string `json:"systemRef,omitempty"`
134
- // When this assessment was executed.
135
- Timestamp *time.Time `json:"timestamp,omitempty"`
136
- // The security tool that produced the assessment data in this file.
137
- Tool *Tool `json:"tool,omitempty"`
118
+ // Information on the baselines that were evaluated, including findings.
119
+ Baselines []EvaluatedBaseline `json:"baselines"`
120
+ // The components that were assessed. Each component describes a system element (host,
121
+ // container, cloud resource, application, etc.) with optional identity, SBOM, and external
122
+ // references.
123
+ Components []Component `json:"components,omitempty"`
124
+ // Present ONLY on reconciled result sets: lineage recording the seed snapshot and event
125
+ // watermark this document was reassembled from (ADR-0005). Documents produced directly by a
126
+ // scan omit this field. When present, generator names the reconciling tool.
127
+ Derivation *Derivation `json:"derivation,omitempty"`
128
+ // Reserved for tool-specific data not defined in the HDF standard. Use this to preserve
129
+ // original tool output, auxiliary data, or custom metadata.
130
+ Extensions map[string]interface{} `json:"extensions,omitempty"`
131
+ // Optional references to external artifacts (CTI/STIX, BOMs, advisories, runbooks, or any
132
+ // URI-addressable artifact) relevant to this assessment as a whole. Inert context; see
133
+ // External_Reference.
134
+ ExternalReferences []ExternalReference `json:"externalReferences,omitempty"`
135
+ // Information about the tool that generated this file.
136
+ Generator *Generator `json:"generator,omitempty"`
137
+ // Unique identifier for this assessment run.
138
+ ID *string `json:"id,omitempty"`
139
+ // Cryptographic integrity information for verifying this file.
140
+ Integrity *Integrity `json:"integrity,omitempty"`
141
+ // Reference to an hdf-plan document describing the assessment plan that produced these
142
+ // results. May be a relative path, absolute URI, or fragment identifier.
143
+ PlanRef *string `json:"planRef,omitempty"`
144
+ // Optional reference to automated remediation resources (Ansible playbooks, Terraform
145
+ // scripts, etc.) for fixing failing requirements found in this assessment.
146
+ Remediation *Remediation `json:"remediation,omitempty"`
147
+ // Information about the test execution environment where the security tool was run.
148
+ // Distinct from targets (what is being tested).
149
+ Runner *Runner `json:"runner,omitempty"`
150
+ // Statistics for the assessment run, including duration and result counts.
151
+ Statistics *Statistics `json:"statistics,omitempty"`
152
+ // Reference to an hdf-system document describing the system under assessment. May be a
153
+ // relative path, absolute URI, or fragment identifier.
154
+ SystemRef *string `json:"systemRef,omitempty"`
155
+ // When this assessment was executed.
156
+ Timestamp *time.Time `json:"timestamp,omitempty"`
157
+ // The security tool that produced the assessment data in this file.
158
+ Tool *Tool `json:"tool,omitempty"`
138
159
  }
139
160
 
140
161
  // Information on a baseline that was evaluated, including any findings.
@@ -175,6 +196,10 @@ type EvaluatedBaseline struct {
175
196
  Copyright *string `json:"copyright,omitempty"`
176
197
  // The email address or other contact information of the copyright holder(s).
177
198
  CopyrightEmail *string `json:"copyrightEmail,omitempty"`
199
+ // Optional references to external artifacts relevant to this baseline (CTI/STIX,
200
+ // advisories, source catalogs, or any URI-addressable artifact). Travels with the baseline
201
+ // definition. Inert context; see External_Reference.
202
+ ExternalReferences []ExternalReference `json:"externalReferences,omitempty"`
178
203
  // Optional key-value labels for flexible grouping. Well-known keys: system, component,
179
204
  // environment, region, team. Values must be strings.
180
205
  Labels map[string]string `json:"labels,omitempty"`
@@ -217,6 +242,88 @@ type Dependency struct {
217
242
  URL *string `json:"url,omitempty"`
218
243
  }
219
244
 
245
+ // A generalized reference to any external artifact by identity and/or location, modeled on the STIX
246
+ // 2.1 `external_references` common property. Purpose-agnostic: cite a CVE, an ATT&CK technique, a
247
+ // STIX bundle/object, a BOM, a runbook, or any vendor artifact — including kinds with no dedicated
248
+ // HDF reference category. `sourceName` names the system; `externalId` cites by id within that
249
+ // system; `href` locates it. `sourceName` + `externalId` is equivalently a URN
250
+ // (`urn:<sourceName>:<externalId>`, RFC 8141), so the by-identity and by-location forms stay
251
+ // interconvertible. A reference is inert context: it overrides nothing, so it carries only
252
+ // lightweight optional `addedBy`/`addedAt` attribution, never override machinery.
253
+ type ExternalReference struct {
254
+ // When this reference was attached (RFC 3339 / trimmed-UTC per HDF timestamp convention).
255
+ AddedAt *time.Time `json:"addedAt,omitempty"`
256
+ // Who attached this reference. Lightweight, flat attribution — a reference overrides
257
+ // nothing, so it has no chaining/superseding/disposition.
258
+ AddedBy *Identity `json:"addedBy,omitempty"`
259
+ // Integrity hash of the referenced artifact. Reuses the HDF `Checksum` primitive (not STIX
260
+ // `hashes`). Meaningful only with a retrievable `href`.
261
+ Checksum *Checksum `json:"checksum,omitempty"`
262
+ // Human-readable description of what is referenced. Satisfies the at-least-one rule on its
263
+ // own when neither id nor href is available.
264
+ Description *string `json:"description,omitempty"`
265
+ // Optional lossless embedded copy of the referenced artifact — the raw STIX object, EPSS
266
+ // record, advisory, or annotation payload — preserved verbatim. Composes with
267
+ // `href`/`externalId` (which point at the artifact) and `checksum` (which ties the copy to
268
+ // the source): a single entry can both point and embed. HDF stays payload-agnostic — the
269
+ // content is carried untouched, never normalized into HDF fields — so this does not
270
+ // duplicate the source ontology (e.g. STIX rides here unchanged).
271
+ Document map[string]interface{} `json:"document,omitempty"`
272
+ // Identifier of the artifact within `sourceName` (e.g., 'CVE-2021-44228' for source 'cve',
273
+ // 'T1059' for 'mitre-att&ck'). Cite by id without needing a URL. Together with `sourceName`
274
+ // this is a URN.
275
+ ExternalID *string `json:"externalId,omitempty"`
276
+ // Location of the artifact. `uri-reference` (not `uri`) so a bare internal
277
+ // `#fragment`/`#uuid` reference is expressible alongside absolute URLs.
278
+ // `checksum`/`mediaType` apply only to a retrievable `href`.
279
+ Href *string `json:"href,omitempty"`
280
+ // Open token classifying the referenced/embedded payload, turning a bare reference into an
281
+ // enrichment envelope. Deliberately open (like `sourceName`/`rel`), not a closed enum.
282
+ // Documented starter vocabulary: 'threat-intel' (STIX/CTI object), 'annotation' (human
283
+ // triage note), 'exploitation' (EPSS/KEV signal carried as context), 'advisory'
284
+ // (vendor/security advisory). Use the `x-` prefix for custom kinds.
285
+ Kind *string `json:"kind,omitempty"`
286
+ // IANA media type of the referenced artifact when retrievable (RFC 6838), e.g.,
287
+ // 'application/json'. Meaningful only with `href`.
288
+ MediaType *string `json:"mediaType,omitempty"`
289
+ // Open relationship token describing how this reference relates to the referencing object.
290
+ // Deliberately open (cf. OSCAL `rel` allow-other, RFC 8288 extension relations). Documented
291
+ // starter vocabulary: 'reference' (generic), 'definition' (defines the concept), 'evidence'
292
+ // (supporting evidence), 'investigate' (a live pivot to investigate), 'canonical' (the
293
+ // authoritative source).
294
+ Rel *string `json:"rel,omitempty"`
295
+ // Name of the external system/source being referenced (e.g., 'cve', 'mitre-att&ck', 'stix',
296
+ // 'taxii', or any vendor label). Open string — not a closed enum. Use the `x-` prefix
297
+ // convention for custom/experimental sources, mirroring `bomType`.
298
+ SourceName string `json:"sourceName"`
299
+ }
300
+
301
+ // Represents an identity that performed an action, such as capturing evidence or applying an
302
+ // override.
303
+ type Identity struct {
304
+ // Optional description of the identity or identity system, particularly useful when type is
305
+ // 'other'.
306
+ Description *string `json:"description,omitempty"`
307
+ // The identifier value. Example: 'user@example.com', 'jdoe', 'automated-scanner-01'.
308
+ Identifier string `json:"identifier"`
309
+ // The type of identifier. Use 'email' for email addresses, 'username' for user accounts,
310
+ // 'system' for deterministic non-interactive automation (CI jobs, cron, scanners), 'agent'
311
+ // for an AI/LLM agent acting with autonomy — kept distinct from 'system' so auditors can
312
+ // apply AI-specific scrutiny (e.g. 'an LLM proposed this' vs a deterministic job) and
313
+ // satisfy AI-source disclosure under frameworks like the EU AI Act and NIST AI RMF,
314
+ // 'simple' for basic string identifiers without additional classification, or 'other' for
315
+ // custom identity systems.
316
+ Type IdentityType `json:"type"`
317
+ }
318
+
319
+ // Cryptographic checksum for baseline integrity verification.
320
+ type Checksum struct {
321
+ // The hash algorithm used for the checksum.
322
+ Algorithm HashAlgorithm `json:"algorithm"`
323
+ // The checksum value.
324
+ Value string `json:"value"`
325
+ }
326
+
220
327
  // Describes a group of requirements, such as those defined in a single file.
221
328
  type RequirementGroup struct {
222
329
  // The unique identifier for the group. Example: the relative path to the file specifying
@@ -277,14 +384,6 @@ type Integrity struct {
277
384
  SignedBy *string `json:"signedBy,omitempty"`
278
385
  }
279
386
 
280
- // Cryptographic checksum for baseline integrity verification.
281
- type Checksum struct {
282
- // The hash algorithm used for the checksum.
283
- Algorithm HashAlgorithm `json:"algorithm"`
284
- // The checksum value.
285
- Value string `json:"value"`
286
- }
287
-
288
387
  // A requirement that has been evaluated, including any findings.
289
388
  type EvaluatedRequirement struct {
290
389
  // Packages affected by this vulnerability finding. Vulnerability-finding-scoped — see
@@ -309,6 +408,14 @@ type EvaluatedRequirement struct {
309
408
  // riskAdjustment) or what remediation is being tracked (poam). Absent when no overrides or
310
409
  // POAMs apply.
311
410
  Disposition *OverrideType `json:"disposition,omitempty"`
411
+ // Checksum of this requirement's resolved effective posture, for per-control change
412
+ // detection in continuous monitoring. sha256 over the canonical JSON object with keys
413
+ // status, impact, disposition (in that order), holding the resolved effective status,
414
+ // resolved effective impact, and governing override type (null when nothing governs), with
415
+ // override expiry anchored to the document timestamp. Flips exactly when the operative
416
+ // status, impact, or disposition changes; stable under all other churn (result details,
417
+ // timestamps, tags). Optional; stamped by tooling (hdf convert, hdf amend apply).
418
+ EffectiveChecksum *Checksum `json:"effectiveChecksum,omitempty"`
312
419
  // The current effective impact score (0.0–1.0) after applying the most recent non-expired
313
420
  // override with an impact field. Absent when no impact overrides apply; consumers should
314
421
  // use the requirement's impact field in that case.
@@ -368,6 +475,11 @@ type EvaluatedRequirement struct {
368
475
  // AT, IR, MA families). Optional: when omitted, consumers may infer heuristically from
369
476
  // family/id but should not assume a default.
370
477
  ControlType *ControlType `json:"controlType,omitempty"`
478
+ // Optional references to external artifacts relevant to this requirement (CTI/STIX
479
+ // correlation, advisories, control/definition sources, or any URI-addressable artifact).
480
+ // Applies to both baseline requirement definitions and evaluated requirements. Inert
481
+ // context; see External_Reference.
482
+ ExternalReferences []ExternalReference `json:"externalReferences,omitempty"`
371
483
  // The set of references to external documents.
372
484
  Refs []Reference `json:"refs,omitempty"`
373
485
  // The title - is nullable.
@@ -514,24 +626,6 @@ type Evidence struct {
514
626
  Type EvidenceType `json:"type"`
515
627
  }
516
628
 
517
- // Represents an identity that performed an action, such as capturing evidence or applying an
518
- // override.
519
- type Identity struct {
520
- // Optional description of the identity or identity system, particularly useful when type is
521
- // 'other'.
522
- Description *string `json:"description,omitempty"`
523
- // The identifier value. Example: 'user@example.com', 'jdoe', 'automated-scanner-01'.
524
- Identifier string `json:"identifier"`
525
- // The type of identifier. Use 'email' for email addresses, 'username' for user accounts,
526
- // 'system' for deterministic non-interactive automation (CI jobs, cron, scanners), 'agent'
527
- // for an AI/LLM agent acting with autonomy — kept distinct from 'system' so auditors can
528
- // apply AI-specific scrutiny (e.g. 'an LLM proposed this' vs a deterministic job) and
529
- // satisfy AI-source disclosure under frameworks like the EU AI Act and NIST AI RMF,
530
- // 'simple' for basic string identifiers without additional classification, or 'other' for
531
- // custom identity systems.
532
- Type IdentityType `json:"type"`
533
- }
534
-
535
629
  // CISA Known Exploited Vulnerabilities (KEV) catalog status. When inKev=true, dateAdded and
536
630
  // dueDate carry the federal patching deadline.
537
631
  type Kev struct {
@@ -561,8 +655,11 @@ type PoamElement struct {
561
655
  // Supporting evidence for this POA&M, such as documentation of compensating controls or
562
656
  // mitigation implementation.
563
657
  Evidence []Evidence `json:"evidence,omitempty"`
564
- // Optional expiration date for this POA&M requiring review/renewal. ISO 8601 format.
565
- ExpiresAt *time.Time `json:"expiresAt,omitempty"`
658
+ // Required deadline for this POA&M. A POA&M is a time-boxed acceptance of an open finding;
659
+ // without a deadline it lets a failing requirement duck remediation indefinitely. Source a
660
+ // real date (e.g. a remediation target or vendor-fix date) — never a wall-clock default.
661
+ // ISO 8601 format.
662
+ ExpiresAt time.Time `json:"expiresAt"`
566
663
  // Detailed explanation of the plan, including what actions will be taken.
567
664
  Explanation string `json:"explanation"`
568
665
  // Optional array of milestones tracking progress toward completion.
@@ -679,44 +776,49 @@ type SourceLocation struct {
679
776
  // status or impact must be set. Overrides change the effectiveStatus or impact of the requirement.
680
777
  // All overrides must have an expiration date to enforce periodic review.
681
778
  type StatusOverride struct {
682
- // Timestamp when this override was applied. ISO 8601 format.
683
- AppliedAt time.Time `json:"appliedAt"`
684
- // Identity of who applied this override. For simple cases, use type 'simple' with just an
685
- // identifier.
686
- AppliedBy Identity `json:"appliedBy"`
687
- // Structured CVSS scoring data backing this override. Captures the rubric (which
688
- // Environmental/Threat metrics the consumer modified, the recomputed score) used to justify
689
- // a riskAdjustment. For other override types this is optional context.
690
- Cvss *Cvss `json:"cvss,omitempty"`
691
- // Supporting evidence for this override, such as screenshots demonstrating manual
692
- // verification for attestations.
693
- Evidence []Evidence `json:"evidence,omitempty"`
694
- // Timestamp when this override expires and must be reviewed/renewed. REQUIRED - no
695
- // permanent overrides allowed. ISO 8601 format.
696
- ExpiresAt time.Time `json:"expiresAt"`
697
- // Override to the requirement's impact score. At least one of status or impact must be set.
698
- Impact *ImpactOverride `json:"impact,omitempty"`
699
- // Structured controlled-vocabulary classification for why this override applies.
700
- // Complements (does not replace) the free-text 'reason' field. Most useful on falsePositive
701
- // and attestation overrides where the structured category enables filtering and lossless
702
- // round-trip with VEX / OSCAL / FedRAMP DR. See the Justification primitive for the
703
- // precedent vocabulary and rationale.
704
- Justification *Justification `json:"justification,omitempty"`
705
- // SHA-256 checksum of the previous amendment in chronological order. Creates a
706
- // tamper-evident chain of amendments (similar to blockchain). Null for the first amendment
707
- // on a requirement.
708
- PreviousChecksum *Checksum `json:"previousChecksum,omitempty"`
709
- // Explanation for why this override was applied.
710
- Reason string `json:"reason"`
711
- // Optional digital signature for enhanced trust and non-repudiation. Supports hardware
712
- // security tokens (PKCS#11/PKCS#12), Yubikeys, GPG keys, passkeys, and other signing
713
- // methods.
714
- Signature *Signature `json:"signature,omitempty"`
715
- // The new status this override sets for the requirement. Optional when only impact is being
716
- // overridden.
717
- Status *ResultStatus `json:"status,omitempty"`
718
- // The type of override applied to this requirement.
719
- Type OverrideType `json:"type"`
779
+ // Timestamp when this override was applied. ISO 8601 format.
780
+ AppliedAt time.Time `json:"appliedAt"`
781
+ // Identity of who applied this override. For simple cases, use type 'simple' with just an
782
+ // identifier.
783
+ AppliedBy Identity `json:"appliedBy"`
784
+ // Structured CVSS scoring data backing this override. Captures the rubric (which
785
+ // Environmental/Threat metrics the consumer modified, the recomputed score) used to justify
786
+ // a riskAdjustment. For other override types this is optional context.
787
+ Cvss *Cvss `json:"cvss,omitempty"`
788
+ // Supporting evidence for this override, such as screenshots demonstrating manual
789
+ // verification for attestations.
790
+ Evidence []Evidence `json:"evidence,omitempty"`
791
+ // Timestamp when this override expires and must be reviewed/renewed. REQUIRED - no
792
+ // permanent overrides allowed. ISO 8601 format.
793
+ ExpiresAt time.Time `json:"expiresAt"`
794
+ // Optional references to the external artifacts behind this override (e.g. the STIX
795
+ // bundle/object or CTI feed motivating an E:A riskAdjustment). Inert context distinct from
796
+ // `evidence`; see External_Reference. Symmetric with Standalone_Override.externalReferences
797
+ // for the inline (results-embedded) override carrier.
798
+ ExternalReferences []ExternalReference `json:"externalReferences,omitempty"`
799
+ // Override to the requirement's impact score. At least one of status or impact must be set.
800
+ Impact *ImpactOverride `json:"impact,omitempty"`
801
+ // Structured controlled-vocabulary classification for why this override applies.
802
+ // Complements (does not replace) the free-text 'reason' field. Most useful on falsePositive
803
+ // and attestation overrides where the structured category enables filtering and lossless
804
+ // round-trip with VEX / OSCAL / FedRAMP DR. See the Justification primitive for the
805
+ // precedent vocabulary and rationale.
806
+ Justification *Justification `json:"justification,omitempty"`
807
+ // SHA-256 checksum of the previous amendment in chronological order. Creates a
808
+ // tamper-evident chain of amendments (similar to blockchain). Null for the first amendment
809
+ // on a requirement.
810
+ PreviousChecksum *Checksum `json:"previousChecksum,omitempty"`
811
+ // Explanation for why this override was applied.
812
+ Reason string `json:"reason"`
813
+ // Optional digital signature for enhanced trust and non-repudiation. Supports hardware
814
+ // security tokens (PKCS#11/PKCS#12), Yubikeys, GPG keys, passkeys, and other signing
815
+ // methods.
816
+ Signature *Signature `json:"signature,omitempty"`
817
+ // The new status this override sets for the requirement. Optional when only impact is being
818
+ // overridden.
819
+ Status *ResultStatus `json:"status,omitempty"`
820
+ // The type of override applied to this requirement.
821
+ Type OverrideType `json:"type"`
720
822
  }
721
823
 
722
824
  // An override to the requirement's impact score. The prior impact is the original result value or
@@ -1072,6 +1174,37 @@ type InputOverride struct {
1072
1174
  Value interface{} `json:"value"`
1073
1175
  }
1074
1176
 
1177
+ // Derived-document lineage for a reconciled result set (an hdf-results produced by
1178
+ // applyChangeEvents rather than a scanner). Records exactly which seed and event horizon the
1179
+ // document represents so it can never masquerade as primary scan evidence. Conceptually PROV
1180
+ // qualified derivation: derived entity, used entity (seed), activity (event application),
1181
+ // generation time (asOf).
1182
+ type Derivation struct {
1183
+ // The posture-as-of time of this reconciled view (RFC 3339, trimmed UTC) — the analog of
1184
+ // PROV's generatedAtTime.
1185
+ AsOf time.Time `json:"asOf"`
1186
+ // Number of change events applied to the seed to produce this document.
1187
+ EventsApplied int64 `json:"eventsApplied"`
1188
+ // The authoritative snapshot this document was reassembled from, pinned by content.
1189
+ Seed Seed `json:"seed"`
1190
+ // URI of the event-stream producer context whose events were applied (matches the events'
1191
+ // envelope source).
1192
+ Source string `json:"source"`
1193
+ // The event watermark: the highest per-key sequence number applied. Downstream precedence
1194
+ // rule: a full-scan document supersedes the reconciled view as of its scan time; between
1195
+ // scans, the reconciled document with the highest throughSequence is the current posture.
1196
+ ThroughSequence int64 `json:"throughSequence"`
1197
+ }
1198
+
1199
+ // The authoritative snapshot this document was reassembled from, pinned by content.
1200
+ type Seed struct {
1201
+ // Checksum of the seed snapshot, REQUIRED: the derivation pins an immutable snapshot by
1202
+ // content, not just location.
1203
+ Checksum Checksum `json:"checksum"`
1204
+ // URI to the seed snapshot document (relative path or absolute URL).
1205
+ URI string `json:"uri"`
1206
+ }
1207
+
1075
1208
  // Information about the tool that generated this HDF file.
1076
1209
  type Generator struct {
1077
1210
  // The name of the software that produced this HDF file. Example: 'gosec-to-hdf'.
@@ -1157,59 +1290,67 @@ type StatisticBlock struct {
1157
1290
  // The security tool that produced the assessment data represented in this HDF file. Aligns with
1158
1291
  // SARIF, OSCAL, and CycloneDX terminology.
1159
1292
  type Tool struct {
1160
- // The file format, if it is a recognized named format shared by multiple tools. Examples:
1161
- // 'SARIF', 'XCCDF'. Omit for tool-specific formats where the tool name already implies the
1162
- // format (Nessus XML, gosec JSON).
1163
- Format *string `json:"format,omitempty"`
1164
- // The name of the security tool that produced the data. Examples: 'gosec', 'Semgrep',
1165
- // 'OpenSCAP', 'AWS Config', 'Nessus'. Omit if the tool cannot be identified.
1166
- Name *string `json:"name,omitempty"`
1167
- // Version of the source tool, if available in the tool's output. Example: '5.22.3'.
1168
- Version *string `json:"version,omitempty"`
1293
+ // The named format of the source data, when it follows a recognized format specification
1294
+ // with its own identity: an interchange format emitted by many tools ('SARIF', 'XCCDF',
1295
+ // 'OSCAL') or one of several named output formats a single tool produces ('FVDL',
1296
+ // 'exec-json', 'FPF'). Never a serialization structure — 'JSON', 'XML', and 'CSV' are
1297
+ // encodings, not formats. Omit for a tool's native output: an absent format means the
1298
+ // tool's own shape, and data arriving as a named format is converted by that format's
1299
+ // converter, which sets this field alongside the producing tool's name.
1300
+ Format *string `json:"format,omitempty"`
1301
+ // The name of the security tool that produced the data. Examples: 'gosec', 'Semgrep',
1302
+ // 'OpenSCAP', 'AWS Config', 'Nessus'. Omit if the tool cannot be identified.
1303
+ Name *string `json:"name,omitempty"`
1304
+ // Version of the source tool, if available in the tool's output. Example: '5.22.3'.
1305
+ Version *string `json:"version,omitempty"`
1169
1306
  }
1170
1307
 
1171
1308
  // Information on the set of requirements that can be assessed, including baseline metadata and
1172
1309
  // requirement definitions.
1173
1310
  type HDFBaseline struct {
1174
- // The set of dependencies this baseline depends on.
1175
- Depends []Dependency `json:"depends,omitempty"`
1176
- // The tool that generated this file.
1177
- Generator *Generator `json:"generator,omitempty"`
1178
- // A set of descriptions for the requirement groups.
1179
- Groups []RequirementGroup `json:"groups,omitempty"`
1180
- // The input(s) or attribute(s) to be used in the run.
1181
- Inputs []Input `json:"inputs,omitempty"`
1182
- // Cryptographic integrity information for verifying this baseline has not been tampered
1183
- // with.
1184
- Integrity *Integrity `json:"integrity,omitempty"`
1185
- // Optional reference to automated remediation resources (Ansible playbooks, Terraform
1186
- // scripts, etc.) for implementing the security controls defined in this baseline.
1187
- Remediation *Remediation `json:"remediation,omitempty"`
1188
- // The set of requirements - contains no findings as the assessment has not yet occurred.
1189
- Requirements []BaselineRequirement `json:"requirements"`
1190
- // The name - must be unique.
1191
- Name string `json:"name"`
1192
- // The copyright holder(s).
1193
- Copyright *string `json:"copyright,omitempty"`
1194
- // The email address or other contact information of the copyright holder(s).
1195
- CopyrightEmail *string `json:"copyrightEmail,omitempty"`
1196
- // Optional key-value labels for flexible grouping. Well-known keys: system, component,
1197
- // environment, region, team. Values must be strings.
1198
- Labels map[string]string `json:"labels,omitempty"`
1199
- // The copyright license. Example: 'Apache-2.0'.
1200
- License *string `json:"license,omitempty"`
1201
- // The maintainer(s).
1202
- Maintainer *string `json:"maintainer,omitempty"`
1203
- // The status. Example: 'loaded'.
1204
- Status *string `json:"status,omitempty"`
1205
- // The summary. Example: the Security Technical Implementation Guide (STIG) header.
1206
- Summary *string `json:"summary,omitempty"`
1207
- // The set of supported platform targets.
1208
- Supports []SupportedPlatform `json:"supports,omitempty"`
1209
- // The title - should be human readable.
1210
- Title *string `json:"title,omitempty"`
1211
- // The version of the baseline.
1212
- Version *string `json:"version,omitempty"`
1311
+ // The set of dependencies this baseline depends on.
1312
+ Depends []Dependency `json:"depends,omitempty"`
1313
+ // The tool that generated this file.
1314
+ Generator *Generator `json:"generator,omitempty"`
1315
+ // A set of descriptions for the requirement groups.
1316
+ Groups []RequirementGroup `json:"groups,omitempty"`
1317
+ // The input(s) or attribute(s) to be used in the run.
1318
+ Inputs []Input `json:"inputs,omitempty"`
1319
+ // Cryptographic integrity information for verifying this baseline has not been tampered
1320
+ // with.
1321
+ Integrity *Integrity `json:"integrity,omitempty"`
1322
+ // Optional reference to automated remediation resources (Ansible playbooks, Terraform
1323
+ // scripts, etc.) for implementing the security controls defined in this baseline.
1324
+ Remediation *Remediation `json:"remediation,omitempty"`
1325
+ // The set of requirements - contains no findings as the assessment has not yet occurred.
1326
+ Requirements []BaselineRequirement `json:"requirements"`
1327
+ // The name - must be unique.
1328
+ Name string `json:"name"`
1329
+ // The copyright holder(s).
1330
+ Copyright *string `json:"copyright,omitempty"`
1331
+ // The email address or other contact information of the copyright holder(s).
1332
+ CopyrightEmail *string `json:"copyrightEmail,omitempty"`
1333
+ // Optional references to external artifacts relevant to this baseline (CTI/STIX,
1334
+ // advisories, source catalogs, or any URI-addressable artifact). Travels with the baseline
1335
+ // definition. Inert context; see External_Reference.
1336
+ ExternalReferences []ExternalReference `json:"externalReferences,omitempty"`
1337
+ // Optional key-value labels for flexible grouping. Well-known keys: system, component,
1338
+ // environment, region, team. Values must be strings.
1339
+ Labels map[string]string `json:"labels,omitempty"`
1340
+ // The copyright license. Example: 'Apache-2.0'.
1341
+ License *string `json:"license,omitempty"`
1342
+ // The maintainer(s).
1343
+ Maintainer *string `json:"maintainer,omitempty"`
1344
+ // The status. Example: 'loaded'.
1345
+ Status *string `json:"status,omitempty"`
1346
+ // The summary. Example: the Security Technical Implementation Guide (STIG) header.
1347
+ Summary *string `json:"summary,omitempty"`
1348
+ // The set of supported platform targets.
1349
+ Supports []SupportedPlatform `json:"supports,omitempty"`
1350
+ // The title - should be human readable.
1351
+ Title *string `json:"title,omitempty"`
1352
+ // The version of the baseline.
1353
+ Version *string `json:"version,omitempty"`
1213
1354
  }
1214
1355
 
1215
1356
  // A requirement definition without assessment results.
@@ -1246,6 +1387,11 @@ type BaselineRequirement struct {
1246
1387
  // AT, IR, MA families). Optional: when omitted, consumers may infer heuristically from
1247
1388
  // family/id but should not assume a default.
1248
1389
  ControlType *ControlType `json:"controlType,omitempty"`
1390
+ // Optional references to external artifacts relevant to this requirement (CTI/STIX
1391
+ // correlation, advisories, control/definition sources, or any URI-addressable artifact).
1392
+ // Applies to both baseline requirement definitions and evaluated requirements. Inert
1393
+ // context; see External_Reference.
1394
+ ExternalReferences []ExternalReference `json:"externalReferences,omitempty"`
1249
1395
  // The set of references to external documents.
1250
1396
  Refs []Reference `json:"refs,omitempty"`
1251
1397
  // The explicit location of the requirement within the source code.
@@ -1278,6 +1424,9 @@ type HDFComparison struct {
1278
1424
  Drift []RequirementDiff `json:"drift,omitempty"`
1279
1425
  // Reserved for tool-specific data not defined in the HDF standard.
1280
1426
  Extensions map[string]interface{} `json:"extensions,omitempty"`
1427
+ // Optional references to external artifacts relevant to this comparison (CTI/STIX,
1428
+ // advisories, or any URI-addressable artifact). Inert context; see External_Reference.
1429
+ ExternalReferences []ExternalReference `json:"externalReferences,omitempty"`
1281
1430
  // Schema version for this comparison format.
1282
1431
  FormatVersion FormatVersion `json:"formatVersion"`
1283
1432
  // Information about the tool that generated this comparison.
@@ -1613,6 +1762,10 @@ type HDFSystem struct {
1613
1762
  DataFlows []DataFlow `json:"dataFlows,omitempty"`
1614
1763
  // Description of the system's purpose and mission.
1615
1764
  Description *string `json:"description,omitempty"`
1765
+ // Optional references to external artifacts describing this system's threat environment or
1766
+ // context (CTI/STIX, BOMs, advisories, or any URI-addressable artifact). Inert context; see
1767
+ // External_Reference.
1768
+ ExternalReferences []ExternalReference `json:"externalReferences,omitempty"`
1616
1769
  // Information about the tool that generated this system document.
1617
1770
  Generator *Generator `json:"generator,omitempty"`
1618
1771
  // System identifier from an authoritative source. Example: eMASS system ID, FedRAMP package
@@ -1692,31 +1845,35 @@ type DataFlow struct {
1692
1845
  // Defines an assessment plan — what baselines to run against which targets, with resolved inputs
1693
1846
  // and scheduling. Maps to OSCAL Assessment Plan.
1694
1847
  type HDFPlan struct {
1695
- // The assessments to perform. Each assessment pairs a baseline with targets and resolved
1696
- // inputs.
1697
- Assessments []Assessment `json:"assessments"`
1698
- // Description of the plan's purpose and scope.
1699
- Description *string `json:"description,omitempty"`
1700
- // Information about the tool that generated this plan.
1701
- Generator *Generator `json:"generator,omitempty"`
1702
- // Cryptographic integrity information for verifying this plan document has not been
1703
- // tampered with.
1704
- Integrity *Integrity `json:"integrity,omitempty"`
1705
- // Optional key-value labels for grouping and querying plans.
1706
- Labels map[string]string `json:"labels,omitempty"`
1707
- // Human-readable plan name. Example: 'Portal Monthly Assessment'.
1708
- Name string `json:"name"`
1709
- // Unique identifier for this plan. Optional in casual use, expected in production
1710
- // documents. Auto-generated if omitted during creation.
1711
- PlanID *string `json:"planId,omitempty"`
1712
- // Optional scheduling configuration for recurring assessments.
1713
- Schedule *Schedule `json:"schedule,omitempty"`
1714
- // URI to the hdf-system document this plan targets. Example: 'portal-prod.hdf-system.json'.
1715
- SystemRef *string `json:"systemRef,omitempty"`
1716
- // The type of assessment plan.
1717
- Type *PlanType `json:"type,omitempty"`
1718
- // Version of this plan document.
1719
- Version *string `json:"version,omitempty"`
1848
+ // The assessments to perform. Each assessment pairs a baseline with targets and resolved
1849
+ // inputs.
1850
+ Assessments []Assessment `json:"assessments"`
1851
+ // Description of the plan's purpose and scope.
1852
+ Description *string `json:"description,omitempty"`
1853
+ // Optional references to external artifacts relevant to this assessment plan (CTI/STIX,
1854
+ // advisories, methodology docs, or any URI-addressable artifact). Inert context; see
1855
+ // External_Reference.
1856
+ ExternalReferences []ExternalReference `json:"externalReferences,omitempty"`
1857
+ // Information about the tool that generated this plan.
1858
+ Generator *Generator `json:"generator,omitempty"`
1859
+ // Cryptographic integrity information for verifying this plan document has not been
1860
+ // tampered with.
1861
+ Integrity *Integrity `json:"integrity,omitempty"`
1862
+ // Optional key-value labels for grouping and querying plans.
1863
+ Labels map[string]string `json:"labels,omitempty"`
1864
+ // Human-readable plan name. Example: 'Portal Monthly Assessment'.
1865
+ Name string `json:"name"`
1866
+ // Unique identifier for this plan. Optional in casual use, expected in production
1867
+ // documents. Auto-generated if omitted during creation.
1868
+ PlanID *string `json:"planId,omitempty"`
1869
+ // Optional scheduling configuration for recurring assessments.
1870
+ Schedule *Schedule `json:"schedule,omitempty"`
1871
+ // URI to the hdf-system document this plan targets. Example: 'portal-prod.hdf-system.json'.
1872
+ SystemRef *string `json:"systemRef,omitempty"`
1873
+ // The type of assessment plan.
1874
+ Type *PlanType `json:"type,omitempty"`
1875
+ // Version of this plan document.
1876
+ Version *string `json:"version,omitempty"`
1720
1877
  }
1721
1878
 
1722
1879
  // A single assessment within a plan — defines which baseline to run against which targets with what
@@ -1809,61 +1966,65 @@ type HDFAmendments struct {
1809
1966
  // 800-37 RMF — risk response (accept/mitigate/transfer) is a separate step from control assessment
1810
1967
  // status (https://csrc.nist.gov/pubs/sp/800/37/r2/final).
1811
1968
  type StandaloneOverride struct {
1812
- // Software packages this amendment is scoped to, distinct from componentRef (which scopes
1813
- // to an HDF-internal Component by UUID). Use when the source amendment format references
1814
- // packages by purl/cpe/name+version — e.g., VEX `affects[]` / `products[]`, OSCAL POA&M
1815
- // `subjects[]`, FedRAMP component-aware amendments. Symmetric with
1816
- // Evaluated_Requirement.affectedPackages, which scopes findings to the same package
1817
- // vocabulary. When omitted, the amendment applies system-wide (or only to componentRef when
1818
- // that is set).
1819
- AffectedPackages []AffectedPackage `json:"affectedPackages,omitempty"`
1820
- // When this amendment was applied. ISO 8601 format.
1821
- AppliedAt time.Time `json:"appliedAt"`
1822
- // Identity of who applied this amendment.
1823
- AppliedBy Identity `json:"appliedBy"`
1824
- // Name of the baseline containing the requirement. Required when the system has multiple
1825
- // baselines with potentially overlapping requirement IDs.
1826
- BaselineRef *string `json:"baselineRef,omitempty"`
1827
- // componentId of the component this amendment is scoped to. When set, the amendment only
1828
- // applies to the specified component. When omitted, the amendment applies system-wide.
1829
- ComponentRef *string `json:"componentRef,omitempty"`
1830
- // Structured CVSS scoring data backing this override. Captures the rubric (which
1831
- // Environmental/Threat metrics the consumer modified, the recomputed score) used to justify
1832
- // a riskAdjustment. For other override types this is optional context.
1833
- Cvss *Cvss `json:"cvss,omitempty"`
1834
- // Supporting evidence (screenshots, logs, URLs, documents).
1835
- Evidence []Evidence `json:"evidence,omitempty"`
1836
- // When this amendment expires and must be reviewed. No permanent amendments. ISO 8601
1837
- // format.
1838
- ExpiresAt time.Time `json:"expiresAt"`
1839
- // Override to the requirement's impact score. At least one of status or impact must be set.
1840
- Impact *ImpactOverride `json:"impact,omitempty"`
1841
- // componentId of the local component that provides this control. Set when the provider is
1842
- // in the same system. Omit for external or cross-system providers; the reason field
1843
- // explains the source. Primarily used with type 'inherited'.
1844
- InheritedFrom *string `json:"inheritedFrom,omitempty"`
1845
- // Structured controlled-vocabulary classification for why this override applies.
1846
- // Complements (does not replace) the free-text 'reason' field. Most useful on falsePositive
1847
- // and attestation overrides where the structured category enables filtering and lossless
1848
- // round-trip with VEX / OSCAL / FedRAMP DR. See the Justification primitive for the
1849
- // precedent vocabulary and rationale.
1850
- Justification *Justification `json:"justification,omitempty"`
1851
- // Remediation milestones (primarily for POA&M type amendments).
1852
- Milestones []Milestone `json:"milestones,omitempty"`
1853
- // Checksum of the prior amendment in the chain. Creates a tamper-evident linked list. Null
1854
- // for the first amendment.
1855
- PreviousChecksum *Checksum `json:"previousChecksum,omitempty"`
1856
- // Justification for this amendment.
1857
- Reason string `json:"reason"`
1858
- // The ID of the requirement being amended. Must match a requirement ID in the referenced
1859
- // baseline.
1860
- RequirementID string `json:"requirementId"`
1861
- // Digital signature for non-repudiation.
1862
- Signature *Signature `json:"signature,omitempty"`
1863
- // The new status this amendment sets. Optional when only impact is being overridden.
1864
- Status *ResultStatus `json:"status,omitempty"`
1865
- // The type of amendment.
1866
- Type OverrideType `json:"type"`
1969
+ // Software packages this amendment is scoped to, distinct from componentRef (which scopes
1970
+ // to an HDF-internal Component by UUID). Use when the source amendment format references
1971
+ // packages by purl/cpe/name+version — e.g., VEX `affects[]` / `products[]`, OSCAL POA&M
1972
+ // `subjects[]`, FedRAMP component-aware amendments. Symmetric with
1973
+ // Evaluated_Requirement.affectedPackages, which scopes findings to the same package
1974
+ // vocabulary. When omitted, the amendment applies system-wide (or only to componentRef when
1975
+ // that is set).
1976
+ AffectedPackages []AffectedPackage `json:"affectedPackages,omitempty"`
1977
+ // When this amendment was applied. ISO 8601 format.
1978
+ AppliedAt time.Time `json:"appliedAt"`
1979
+ // Identity of who applied this amendment.
1980
+ AppliedBy Identity `json:"appliedBy"`
1981
+ // Name of the baseline containing the requirement. Required when the system has multiple
1982
+ // baselines with potentially overlapping requirement IDs.
1983
+ BaselineRef *string `json:"baselineRef,omitempty"`
1984
+ // componentId of the component this amendment is scoped to. When set, the amendment only
1985
+ // applies to the specified component. When omitted, the amendment applies system-wide.
1986
+ ComponentRef *string `json:"componentRef,omitempty"`
1987
+ // Structured CVSS scoring data backing this override. Captures the rubric (which
1988
+ // Environmental/Threat metrics the consumer modified, the recomputed score) used to justify
1989
+ // a riskAdjustment. For other override types this is optional context.
1990
+ Cvss *Cvss `json:"cvss,omitempty"`
1991
+ // Supporting evidence (screenshots, logs, URLs, documents).
1992
+ Evidence []Evidence `json:"evidence,omitempty"`
1993
+ // When this amendment expires and must be reviewed. No permanent amendments. ISO 8601
1994
+ // format.
1995
+ ExpiresAt time.Time `json:"expiresAt"`
1996
+ // Optional references to the external artifacts behind this override (e.g. the STIX
1997
+ // bundle/object, advisory, or CTI feed that motivated it). Inert context distinct from
1998
+ // `evidence`; see External_Reference.
1999
+ ExternalReferences []ExternalReference `json:"externalReferences,omitempty"`
2000
+ // Override to the requirement's impact score. At least one of status or impact must be set.
2001
+ Impact *ImpactOverride `json:"impact,omitempty"`
2002
+ // componentId of the local component that provides this control. Set when the provider is
2003
+ // in the same system. Omit for external or cross-system providers; the reason field
2004
+ // explains the source. Primarily used with type 'inherited'.
2005
+ InheritedFrom *string `json:"inheritedFrom,omitempty"`
2006
+ // Structured controlled-vocabulary classification for why this override applies.
2007
+ // Complements (does not replace) the free-text 'reason' field. Most useful on falsePositive
2008
+ // and attestation overrides where the structured category enables filtering and lossless
2009
+ // round-trip with VEX / OSCAL / FedRAMP DR. See the Justification primitive for the
2010
+ // precedent vocabulary and rationale.
2011
+ Justification *Justification `json:"justification,omitempty"`
2012
+ // Remediation milestones (primarily for POA&M type amendments).
2013
+ Milestones []Milestone `json:"milestones,omitempty"`
2014
+ // Checksum of the prior amendment in the chain. Creates a tamper-evident linked list. Null
2015
+ // for the first amendment.
2016
+ PreviousChecksum *Checksum `json:"previousChecksum,omitempty"`
2017
+ // Justification for this amendment.
2018
+ Reason string `json:"reason"`
2019
+ // The ID of the requirement being amended. Must match a requirement ID in the referenced
2020
+ // baseline.
2021
+ RequirementID string `json:"requirementId"`
2022
+ // Digital signature for non-repudiation.
2023
+ Signature *Signature `json:"signature,omitempty"`
2024
+ // The new status this amendment sets. Optional when only impact is being overridden.
2025
+ Status *ResultStatus `json:"status,omitempty"`
2026
+ // The type of amendment.
2027
+ Type OverrideType `json:"type"`
1867
2028
  }
1868
2029
 
1869
2030
  // Bundles references to all HDF documents for audit, authorization, and compliance review. Each
@@ -1880,6 +2041,10 @@ type HDFEvidencePackage struct {
1880
2041
  // inside HDF. Logs in ECS/OCSF/etc. are legitimate accreditation evidence; HDF indexes them
1881
2042
  // here rather than transcoding them.
1882
2043
  ExternalEvidence []ExternalEvidenceReference `json:"externalEvidence,omitempty"`
2044
+ // Optional references to external artifacts relevant to this evidence package (CTI/STIX,
2045
+ // BOMs, advisories, or any URI-addressable artifact) beyond the document references it
2046
+ // already carries. Inert context; see External_Reference.
2047
+ ExternalReferences []ExternalReference `json:"externalReferences,omitempty"`
1883
2048
  // Information about the tool that generated this document.
1884
2049
  Generator *Generator `json:"generator,omitempty"`
1885
2050
  // Cryptographic integrity information for verifying this evidence package has not been
@@ -1994,6 +2159,99 @@ type ExternalEvidenceTimeRange struct {
1994
2159
  Start *time.Time `json:"start,omitempty"`
1995
2160
  }
1996
2161
 
2162
+ // A single continuous-monitoring wire event: one requirement's effective posture changed on one
2163
+ // system component. The streaming increment of a systemDrift hdf-comparison — events fold into
2164
+ // comparisons and reassemble into hdf-results, they never mutate documents in place. One event per
2165
+ // wire document (NDJSON-friendly). The envelope (identity, ordering, hash chain) is the shared
2166
+ // Change_Event_Envelope primitive; the payload carries the producer-computable change state, a thin
2167
+ // before projection, and the full after requirement (the evidence a responder opens the event for).
2168
+ // Design: ADR-0005.
2169
+ type HDFRequirementChangeEvent struct {
2170
+ // The full requirement as evaluated after the change — required and non-null for every
2171
+ // state except absent (null there: the requirement left the assessment scope). Full content
2172
+ // is load-bearing twice over: reassembly parity (applyChangeEvents cannot reproduce changed
2173
+ // result content from a projection) and triage (the failing results[] ARE the 'why' a
2174
+ // responder opens the event for).
2175
+ After interface{} `json:"after"`
2176
+ // Thin projection of the prior effective posture, for at-a-glance alerting without a
2177
+ // state-store lookup. Null exactly when state is new (no prior posture exists). The full
2178
+ // prior state is recoverable from the consumer's materialized state; the envelope's
2179
+ // priorChecksum covers the integrity of that recovery.
2180
+ Before interface{} `json:"before"`
2181
+ // Why the state changed. An overrideExpired flip is a different triage than resultChanged:
2182
+ // the control did not get worse, a waiver lapsed.
2183
+ ChangeReasons []EventChangeReason `json:"changeReasons,omitempty"`
2184
+ // Canonical requirement identifier — the same identity as Requirement_Diff.id and the
2185
+ // requirement's id in hdf-results. Together with the envelope's (systemRef, componentId)
2186
+ // this forms the durable entity key. A requirement renumbering is emitted as absent + new
2187
+ // under the two keys, never an in-place key change; batch comparison reconciles renames via
2188
+ // its oldId/newId matching.
2189
+ RequirementID string `json:"requirementId"`
2190
+ // The producer-computable subset of Requirement_State: new | absent | updated | fixed |
2191
+ // regressed. fixed and regressed carry the direction SARIF's baselineState lacks; project
2192
+ // down to SARIF's closed 4 values for external interop.
2193
+ State EventRequirementState `json:"state"`
2194
+ // componentId of the system component this event concerns.
2195
+ ComponentID string `json:"componentId"`
2196
+ // Identity of this event occurrence, unique per source. (source, eventId) is the
2197
+ // deduplication key: consumers may treat events with identical source and eventId as
2198
+ // duplicates. UUIDv7 (time-ordered) is recommended but not required.
2199
+ EventID string `json:"eventId"`
2200
+ // The effectiveChecksum of the entity state this event supersedes, forming a per-key hash
2201
+ // chain: a mismatch or gap against stored state is detectable, letting a consumer mark the
2202
+ // key unverified instead of serving stale posture. Null at chain start (no prior state,
2203
+ // e.g. a new entity or the first event after a seed). The chain provides tamper/gap
2204
+ // evidence given a trusted head; completeness is anchored out-of-band by periodic
2205
+ // re-centering rescans.
2206
+ PriorChecksum interface{} `json:"priorChecksum"`
2207
+ // The versioned schema $id this event validates against, so events self-describe on
2208
+ // heterogeneous streams. Recommended on every wire event.
2209
+ SchemaRef *string `json:"schemaRef,omitempty"`
2210
+ // Monotonically increasing sequence number per entity key. The ONLY ordering authority for
2211
+ // folding: consumers keep the greatest sequence per key regardless of arrival order or
2212
+ // timestamp. Deliberately per-entity-key (event-sourcing aggregate-version practice) rather
2213
+ // than per-source.
2214
+ Sequence int64 `json:"sequence"`
2215
+ // URI identifying the producer context that emitted this event (for example, a scanner
2216
+ // instance and profile). eventId uniqueness and sequence numbering are scoped per source.
2217
+ Source string `json:"source"`
2218
+ // URI to the hdf-system document (authorization boundary) this event applies to. Resolves
2219
+ // to the latest version of the evolving system document.
2220
+ SystemRef string `json:"systemRef"`
2221
+ // Occurrence time of the observed change (RFC 3339, trimmed UTC). Display and audit
2222
+ // metadata only — NEVER an ordering key; ordering is sequence's job.
2223
+ Timestamp time.Time `json:"timestamp"`
2224
+ }
2225
+
2226
+ // The type of identifier. Use 'email' for email addresses, 'username' for user accounts,
2227
+ // 'system' for deterministic non-interactive automation (CI jobs, cron, scanners), 'agent'
2228
+ // for an AI/LLM agent acting with autonomy — kept distinct from 'system' so auditors can
2229
+ // apply AI-specific scrutiny (e.g. 'an LLM proposed this' vs a deterministic job) and
2230
+ // satisfy AI-source disclosure under frameworks like the EU AI Act and NIST AI RMF,
2231
+ // 'simple' for basic string identifiers without additional classification, or 'other' for
2232
+ // custom identity systems.
2233
+ type IdentityType string
2234
+
2235
+ const (
2236
+ Agent IdentityType = "agent"
2237
+ Email IdentityType = "email"
2238
+ IdentityTypeOther IdentityType = "other"
2239
+ IdentityTypeSystem IdentityType = "system"
2240
+ Simple IdentityType = "simple"
2241
+ Username IdentityType = "username"
2242
+ )
2243
+
2244
+ // Supported cryptographic hash algorithms for checksums and integrity verification. blake3 covers
2245
+ // container-image and other artifact digests that use it.
2246
+ type HashAlgorithm string
2247
+
2248
+ const (
2249
+ Blake3 HashAlgorithm = "blake3"
2250
+ Sha256 HashAlgorithm = "sha256"
2251
+ Sha384 HashAlgorithm = "sha384"
2252
+ Sha512 HashAlgorithm = "sha512"
2253
+ )
2254
+
1997
2255
  // Comparison operator for evaluating the input value against observed values. Numeric:
1998
2256
  // eq/ne/lt/le/gt/ge. String: eq/ne/contains/matches. Collection: in/notIn.
1999
2257
  type ComparisonOperator string
@@ -2023,17 +2281,6 @@ const (
2023
2281
  String InputType = "String"
2024
2282
  )
2025
2283
 
2026
- // Supported cryptographic hash algorithms for checksums and integrity verification. blake3 covers
2027
- // container-image and other artifact digests that use it.
2028
- type HashAlgorithm string
2029
-
2030
- const (
2031
- Blake3 HashAlgorithm = "blake3"
2032
- Sha256 HashAlgorithm = "sha256"
2033
- Sha384 HashAlgorithm = "sha384"
2034
- Sha512 HashAlgorithm = "sha512"
2035
- )
2036
-
2037
2284
  // The packaging ecosystem the package belongs to. Use 'generic' for hardware, firmware, or
2038
2285
  // anything outside the listed language/OS package managers.
2039
2286
  type Ecosystem string
@@ -2143,24 +2390,6 @@ const (
2143
2390
  Passed ResultStatus = "passed"
2144
2391
  )
2145
2392
 
2146
- // The type of identifier. Use 'email' for email addresses, 'username' for user accounts,
2147
- // 'system' for deterministic non-interactive automation (CI jobs, cron, scanners), 'agent'
2148
- // for an AI/LLM agent acting with autonomy — kept distinct from 'system' so auditors can
2149
- // apply AI-specific scrutiny (e.g. 'an LLM proposed this' vs a deterministic job) and
2150
- // satisfy AI-source disclosure under frameworks like the EU AI Act and NIST AI RMF,
2151
- // 'simple' for basic string identifiers without additional classification, or 'other' for
2152
- // custom identity systems.
2153
- type IdentityType string
2154
-
2155
- const (
2156
- Agent IdentityType = "agent"
2157
- Email IdentityType = "email"
2158
- IdentityTypeOther IdentityType = "other"
2159
- IdentityTypeSystem IdentityType = "system"
2160
- Simple IdentityType = "simple"
2161
- Username IdentityType = "username"
2162
- )
2163
-
2164
2393
  // The type of evidence being provided.
2165
2394
  type EvidenceType string
2166
2395
 
@@ -2352,22 +2581,27 @@ const (
2352
2581
  Replace Op = "replace"
2353
2582
  )
2354
2583
 
2355
- // The reason a requirement's state changed between sources.
2584
+ // The reason a requirement's state changed between sources. 'dispositionChanged' = the governing
2585
+ // override type differs between the sources (e.g. a waiver replaced a riskAdjustment);
2586
+ // 'effectiveImpactChanged' = the post-override impact score differs while the base impact may be
2587
+ // unchanged.
2356
2588
  type ChangeReason string
2357
2589
 
2358
2590
  const (
2359
- BaselineUpgraded ChangeReason = "baselineUpgraded"
2360
- ConfigChanged ChangeReason = "configChanged"
2361
- ControlMapped ChangeReason = "controlMapped"
2362
- ImpactChanged ChangeReason = "impactChanged"
2363
- MetadataChanged ChangeReason = "metadataChanged"
2364
- OverrideAdded ChangeReason = "overrideAdded"
2365
- OverrideExpired ChangeReason = "overrideExpired"
2366
- OverrideModified ChangeReason = "overrideModified"
2367
- OverrideRemoved ChangeReason = "overrideRemoved"
2368
- ResultChanged ChangeReason = "resultChanged"
2369
- ScannerChanged ChangeReason = "scannerChanged"
2370
- TargetChanged ChangeReason = "targetChanged"
2591
+ BaselineUpgraded ChangeReason = "baselineUpgraded"
2592
+ ChangeReasonConfigChanged ChangeReason = "configChanged"
2593
+ ChangeReasonImpactChanged ChangeReason = "impactChanged"
2594
+ ChangeReasonOverrideAdded ChangeReason = "overrideAdded"
2595
+ ChangeReasonOverrideExpired ChangeReason = "overrideExpired"
2596
+ ChangeReasonOverrideModified ChangeReason = "overrideModified"
2597
+ ChangeReasonOverrideRemoved ChangeReason = "overrideRemoved"
2598
+ ChangeReasonResultChanged ChangeReason = "resultChanged"
2599
+ ControlMapped ChangeReason = "controlMapped"
2600
+ DispositionChanged ChangeReason = "dispositionChanged"
2601
+ EffectiveImpactChanged ChangeReason = "effectiveImpactChanged"
2602
+ MetadataChanged ChangeReason = "metadataChanged"
2603
+ ScannerChanged ChangeReason = "scannerChanged"
2604
+ TargetChanged ChangeReason = "targetChanged"
2371
2605
  )
2372
2606
 
2373
2607
  // How a conflict between multiple scanner results was resolved.
@@ -2401,12 +2635,12 @@ const (
2401
2635
  type RequirementState string
2402
2636
 
2403
2637
  const (
2404
- Fixed RequirementState = "fixed"
2405
2638
  Moved RequirementState = "moved"
2406
- Regressed RequirementState = "regressed"
2407
2639
  RequirementStateAbsent RequirementState = "absent"
2640
+ RequirementStateFixed RequirementState = "fixed"
2408
2641
  RequirementStateMerged RequirementState = "merged"
2409
2642
  RequirementStateNew RequirementState = "new"
2643
+ RequirementStateRegressed RequirementState = "regressed"
2410
2644
  RequirementStateUnchanged RequirementState = "unchanged"
2411
2645
  RequirementStateUpdated RequirementState = "updated"
2412
2646
  Split RequirementState = "split"
@@ -2518,6 +2752,36 @@ const (
2518
2752
  HdfSystem ContentType = "hdf-system"
2519
2753
  )
2520
2754
 
2755
+ // The producer-computable subset of the comparison vocabulary's Change_Reason, value-identical with
2756
+ // the parent enum (test-enforced). Batch-only reasons (baselineUpgraded, controlMapped,
2757
+ // scannerChanged, targetChanged, metadataChanged) require cross-corpus context and are excluded.
2758
+ type EventChangeReason string
2759
+
2760
+ const (
2761
+ EventChangeReasonConfigChanged EventChangeReason = "configChanged"
2762
+ EventChangeReasonImpactChanged EventChangeReason = "impactChanged"
2763
+ EventChangeReasonOverrideAdded EventChangeReason = "overrideAdded"
2764
+ EventChangeReasonOverrideExpired EventChangeReason = "overrideExpired"
2765
+ EventChangeReasonOverrideModified EventChangeReason = "overrideModified"
2766
+ EventChangeReasonOverrideRemoved EventChangeReason = "overrideRemoved"
2767
+ EventChangeReasonResultChanged EventChangeReason = "resultChanged"
2768
+ )
2769
+
2770
+ // The producer-computable subset of the comparison vocabulary's Requirement_State. Kept
2771
+ // value-identical with the parent enum (test-enforced): the batch-only states (moved, split,
2772
+ // merged) are outputs of cross-document identity resolution a per-key producer cannot compute.
2773
+ // Declared as a distinct named type (rather than a $ref intersection) so generated Go/TS types keep
2774
+ // stable, distinct enum names.
2775
+ type EventRequirementState string
2776
+
2777
+ const (
2778
+ EventRequirementStateAbsent EventRequirementState = "absent"
2779
+ EventRequirementStateFixed EventRequirementState = "fixed"
2780
+ EventRequirementStateNew EventRequirementState = "new"
2781
+ EventRequirementStateRegressed EventRequirementState = "regressed"
2782
+ EventRequirementStateUpdated EventRequirementState = "updated"
2783
+ )
2784
+
2521
2785
  type Ref struct {
2522
2786
  AnythingMapArray []map[string]interface{}
2523
2787
  String *string