@openauditmodel/cli 0.1.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 (134) hide show
  1. package/LICENSE +215 -0
  2. package/README.md +647 -0
  3. package/dist/conformance/src/cli.d.ts +20 -0
  4. package/dist/conformance/src/cli.js +560 -0
  5. package/dist/conformance/src/cli.js.map +1 -0
  6. package/dist/conformance/src/format-errors.d.ts +20 -0
  7. package/dist/conformance/src/format-errors.js +116 -0
  8. package/dist/conformance/src/format-errors.js.map +1 -0
  9. package/dist/conformance/src/integrity/canonicalize.d.ts +25 -0
  10. package/dist/conformance/src/integrity/canonicalize.js +100 -0
  11. package/dist/conformance/src/integrity/canonicalize.js.map +1 -0
  12. package/dist/conformance/src/integrity/digest.d.ts +54 -0
  13. package/dist/conformance/src/integrity/digest.js +126 -0
  14. package/dist/conformance/src/integrity/digest.js.map +1 -0
  15. package/dist/conformance/src/integrity/types.d.ts +86 -0
  16. package/dist/conformance/src/integrity/types.js +36 -0
  17. package/dist/conformance/src/integrity/types.js.map +1 -0
  18. package/dist/conformance/src/integrity/verify-chain.d.ts +23 -0
  19. package/dist/conformance/src/integrity/verify-chain.js +235 -0
  20. package/dist/conformance/src/integrity/verify-chain.js.map +1 -0
  21. package/dist/conformance/src/integrity/verify-event.d.ts +29 -0
  22. package/dist/conformance/src/integrity/verify-event.js +140 -0
  23. package/dist/conformance/src/integrity/verify-event.js.map +1 -0
  24. package/dist/conformance/src/privacy/entropy.d.ts +14 -0
  25. package/dist/conformance/src/privacy/entropy.js +86 -0
  26. package/dist/conformance/src/privacy/entropy.js.map +1 -0
  27. package/dist/conformance/src/privacy/field-names.d.ts +36 -0
  28. package/dist/conformance/src/privacy/field-names.js +121 -0
  29. package/dist/conformance/src/privacy/field-names.js.map +1 -0
  30. package/dist/conformance/src/privacy/lint-event.d.ts +18 -0
  31. package/dist/conformance/src/privacy/lint-event.js +272 -0
  32. package/dist/conformance/src/privacy/lint-event.js.map +1 -0
  33. package/dist/conformance/src/privacy/rules.d.ts +44 -0
  34. package/dist/conformance/src/privacy/rules.js +161 -0
  35. package/dist/conformance/src/privacy/rules.js.map +1 -0
  36. package/dist/conformance/src/privacy/safe-formats.d.ts +32 -0
  37. package/dist/conformance/src/privacy/safe-formats.js +118 -0
  38. package/dist/conformance/src/privacy/safe-formats.js.map +1 -0
  39. package/dist/conformance/src/privacy/size-analysis.d.ts +36 -0
  40. package/dist/conformance/src/privacy/size-analysis.js +87 -0
  41. package/dist/conformance/src/privacy/size-analysis.js.map +1 -0
  42. package/dist/conformance/src/privacy/token-patterns.d.ts +24 -0
  43. package/dist/conformance/src/privacy/token-patterns.js +126 -0
  44. package/dist/conformance/src/privacy/token-patterns.js.map +1 -0
  45. package/dist/conformance/src/privacy/traverse.d.ts +33 -0
  46. package/dist/conformance/src/privacy/traverse.js +61 -0
  47. package/dist/conformance/src/privacy/traverse.js.map +1 -0
  48. package/dist/conformance/src/privacy/types.d.ts +58 -0
  49. package/dist/conformance/src/privacy/types.js +32 -0
  50. package/dist/conformance/src/privacy/types.js.map +1 -0
  51. package/dist/conformance/src/privacy/url-analysis.d.ts +40 -0
  52. package/dist/conformance/src/privacy/url-analysis.js +148 -0
  53. package/dist/conformance/src/privacy/url-analysis.js.map +1 -0
  54. package/dist/conformance/src/profiles/check-profile.d.ts +22 -0
  55. package/dist/conformance/src/profiles/check-profile.js +72 -0
  56. package/dist/conformance/src/profiles/check-profile.js.map +1 -0
  57. package/dist/conformance/src/profiles/evaluate-rule.d.ts +27 -0
  58. package/dist/conformance/src/profiles/evaluate-rule.js +87 -0
  59. package/dist/conformance/src/profiles/evaluate-rule.js.map +1 -0
  60. package/dist/conformance/src/profiles/load-profile.d.ts +30 -0
  61. package/dist/conformance/src/profiles/load-profile.js +95 -0
  62. package/dist/conformance/src/profiles/load-profile.js.map +1 -0
  63. package/dist/conformance/src/profiles/resolve-pointer.d.ts +44 -0
  64. package/dist/conformance/src/profiles/resolve-pointer.js +123 -0
  65. package/dist/conformance/src/profiles/resolve-pointer.js.map +1 -0
  66. package/dist/conformance/src/profiles/select-rules.d.ts +13 -0
  67. package/dist/conformance/src/profiles/select-rules.js +42 -0
  68. package/dist/conformance/src/profiles/select-rules.js.map +1 -0
  69. package/dist/conformance/src/profiles/types.d.ts +101 -0
  70. package/dist/conformance/src/profiles/types.js +31 -0
  71. package/dist/conformance/src/profiles/types.js.map +1 -0
  72. package/dist/conformance/src/profiles/validate-profile-definition.d.ts +12 -0
  73. package/dist/conformance/src/profiles/validate-profile-definition.js +47 -0
  74. package/dist/conformance/src/profiles/validate-profile-definition.js.map +1 -0
  75. package/dist/conformance/src/sources.d.ts +53 -0
  76. package/dist/conformance/src/sources.js +153 -0
  77. package/dist/conformance/src/sources.js.map +1 -0
  78. package/dist/conformance/src/validate-core.d.ts +30 -0
  79. package/dist/conformance/src/validate-core.js +62 -0
  80. package/dist/conformance/src/validate-core.js.map +1 -0
  81. package/dist/conformance/src/validate.d.ts +34 -0
  82. package/dist/conformance/src/validate.js +62 -0
  83. package/dist/conformance/src/validate.js.map +1 -0
  84. package/dist/conformance/src/validator-interface.d.ts +35 -0
  85. package/dist/conformance/src/validator-interface.js +19 -0
  86. package/dist/conformance/src/validator-interface.js.map +1 -0
  87. package/package.json +85 -0
  88. package/profiles/README.md +201 -0
  89. package/profiles/api-and-integration-management/README.md +271 -0
  90. package/profiles/api-and-integration-management/profile.json +258 -0
  91. package/profiles/backup-and-recovery/README.md +318 -0
  92. package/profiles/backup-and-recovery/profile.json +178 -0
  93. package/profiles/customer-and-account-management/README.md +340 -0
  94. package/profiles/customer-and-account-management/profile.json +237 -0
  95. package/profiles/deployment-and-change-management/README.md +359 -0
  96. package/profiles/deployment-and-change-management/profile.json +298 -0
  97. package/profiles/document-management/README.md +120 -0
  98. package/profiles/document-management/profile.json +170 -0
  99. package/profiles/financial-transaction-management/README.md +339 -0
  100. package/profiles/financial-transaction-management/profile.json +247 -0
  101. package/profiles/identity-and-access-management/README.md +112 -0
  102. package/profiles/identity-and-access-management/profile.json +120 -0
  103. package/profiles/incident-management/README.md +338 -0
  104. package/profiles/incident-management/profile.json +256 -0
  105. package/profiles/message-broker-management/README.md +344 -0
  106. package/profiles/message-broker-management/profile.json +399 -0
  107. package/profiles/profile-definition.schema.json +213 -0
  108. package/profiles/secrets-and-key-management/README.md +331 -0
  109. package/profiles/secrets-and-key-management/profile.json +219 -0
  110. package/schemas/v0.1/audit-event.schema.json +911 -0
  111. package/semantic-conventions/README.md +52 -0
  112. package/semantic-conventions/authentication.md +111 -0
  113. package/semantic-conventions/configuration-and-change.md +122 -0
  114. package/semantic-conventions/correlation-and-tracing.md +387 -0
  115. package/semantic-conventions/data-access.md +115 -0
  116. package/semantic-conventions/event-naming.md +114 -0
  117. package/semantic-conventions/identity-and-access.md +112 -0
  118. package/semantic-conventions/privileged-operations.md +110 -0
  119. package/semantic-conventions/workflow-and-approval.md +109 -0
  120. package/specification/actor-model.md +135 -0
  121. package/specification/approval-and-delegation.md +150 -0
  122. package/specification/authentication.md +116 -0
  123. package/specification/authorization.md +117 -0
  124. package/specification/change-model.md +134 -0
  125. package/specification/delivery.md +136 -0
  126. package/specification/design-principles.md +137 -0
  127. package/specification/event-model.md +387 -0
  128. package/specification/evidence-model.md +109 -0
  129. package/specification/extension-model.md +159 -0
  130. package/specification/integrity.md +314 -0
  131. package/specification/overview.md +172 -0
  132. package/specification/privacy.md +386 -0
  133. package/specification/resource-model.md +116 -0
  134. package/specification/terminology.md +135 -0
@@ -0,0 +1,911 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://openauditmodel.org/schemas/audit-event/0.1/schema.json",
4
+ "title": "OpenAuditModel Audit Event Schema",
5
+ "description": "Canonical machine-verifiable structure of an OpenAuditModel audit event. Version 0.1 is experimental. Core objects reject unknown properties: domain-specific data belongs in `metadata`, `extensions`, `attributes`, or in an OpenAuditModel profile.",
6
+ "$comment": "Normative reference: specification/event-model.md. Patterns in this schema deliberately avoid look-around and back-references so that they remain portable across ECMA-262, RE2 and PCRE regular expression engines.",
7
+ "type": "object",
8
+ "additionalProperties": false,
9
+ "required": ["specVersion", "id", "time", "event", "actor", "resource", "application"],
10
+ "properties": {
11
+ "specVersion": {
12
+ "$comment": "Constant in v0.1. The compatibility strategy for later versions is defined in specification/overview.md.",
13
+ "description": "OpenAuditModel specification version this event conforms to.",
14
+ "const": "0.1"
15
+ },
16
+ "id": {
17
+ "description": "Globally unique, idempotent identifier of this audit event. No identifier technology is mandated; UUIDv4, UUIDv7 or ULID are RECOMMENDED. Receivers MAY use this value to deduplicate redelivered events.",
18
+ "$ref": "#/$defs/identifier",
19
+ "examples": ["018f1b5c-6d2a-7c3e-9a1b-4f5e6d7c8b9a", "01JAV3M5S4K9QF7N2W8XG6ZTQD"]
20
+ },
21
+ "time": {
22
+ "description": "When the audited operation occurred, as observed by the producing application. UTC is RECOMMENDED.",
23
+ "$ref": "#/$defs/timestamp"
24
+ },
25
+ "observedTime": {
26
+ "description": "When a collector, exporter, gateway or receiving system observed this event. MUST NOT be assumed equal to `time`.",
27
+ "$ref": "#/$defs/timestamp"
28
+ },
29
+ "sequence": {
30
+ "description": "Producer-assigned monotonically increasing ordinal used to order events that share a timestamp. Ordering is only meaningful within a single producer, partition or integrity chain.",
31
+ "type": "integer",
32
+ "minimum": 0
33
+ },
34
+ "event": { "$ref": "#/$defs/eventDescriptor" },
35
+ "actor": {
36
+ "description": "Principal that technically performed the operation.",
37
+ "$ref": "#/$defs/principal"
38
+ },
39
+ "subject": {
40
+ "description": "Principal on whose behalf the actor performed the operation. This is NOT the audited target; the audited target is `resource`.",
41
+ "$ref": "#/$defs/principal"
42
+ },
43
+ "delegation": { "$ref": "#/$defs/delegation" },
44
+ "resource": {
45
+ "description": "Primary resource the audited operation acted upon.",
46
+ "$ref": "#/$defs/resourceReference"
47
+ },
48
+ "relatedResources": {
49
+ "description": "Additional resources affected by, or required to interpret, the same operation.",
50
+ "type": "array",
51
+ "minItems": 1,
52
+ "maxItems": 64,
53
+ "items": { "$ref": "#/$defs/resourceReference" }
54
+ },
55
+ "application": { "$ref": "#/$defs/application" },
56
+ "organization": { "$ref": "#/$defs/organization" },
57
+ "authentication": { "$ref": "#/$defs/authentication" },
58
+ "authorization": { "$ref": "#/$defs/authorization" },
59
+ "approval": { "$ref": "#/$defs/approval" },
60
+ "request": { "$ref": "#/$defs/request" },
61
+ "change": { "$ref": "#/$defs/change" },
62
+ "reason": { "$ref": "#/$defs/reason" },
63
+ "evidence": {
64
+ "description": "References to material supporting this event. Evidence is referenced, never embedded.",
65
+ "type": "array",
66
+ "minItems": 1,
67
+ "maxItems": 64,
68
+ "items": { "$ref": "#/$defs/evidenceItem" }
69
+ },
70
+ "integrity": { "$ref": "#/$defs/integrity" },
71
+ "privacy": { "$ref": "#/$defs/privacy" },
72
+ "controlCategories": {
73
+ "description": "Regulation-neutral control categories this event contributes evidence to. Regulation, framework and jurisdiction identifiers MUST NOT appear here; they belong to external mapping artifacts.",
74
+ "type": "array",
75
+ "minItems": 1,
76
+ "maxItems": 32,
77
+ "uniqueItems": true,
78
+ "items": { "$ref": "#/$defs/token" },
79
+ "examples": [
80
+ ["privileged-access", "change-approval"],
81
+ ["external-data-sharing", "data-access-logging"]
82
+ ]
83
+ },
84
+ "tags": {
85
+ "description": "Producer-defined labels for filtering and routing. Tags carry no normative meaning.",
86
+ "type": "array",
87
+ "minItems": 1,
88
+ "maxItems": 32,
89
+ "uniqueItems": true,
90
+ "items": { "$ref": "#/$defs/tag" }
91
+ },
92
+ "metadata": {
93
+ "description": "Domain-specific audit interpretation data that has no core representation. Values SHOULD be small and structured. MUST NOT contain secrets, large payloads or duplicate copies of core fields.",
94
+ "$ref": "#/$defs/jsonObject"
95
+ },
96
+ "extensions": {
97
+ "description": "Vendor-specific or domain-specific additions. Every key MUST be a reverse-domain namespaced name of at least three dot-separated segments. Extensions MUST NOT weaken required core fields or redefine the meaning of core fields.",
98
+ "type": "object",
99
+ "propertyNames": { "$ref": "#/$defs/extensionKey" },
100
+ "additionalProperties": { "$ref": "#/$defs/jsonValue" },
101
+ "examples": [{ "com.example.identity.directory.id": "directory-1" }]
102
+ }
103
+ },
104
+ "allOf": [
105
+ {
106
+ "$comment": "Delegation types that act for another principal require that principal to be identified. `service-chain` describes transport-level chaining and does not by itself imply a subject.",
107
+ "if": {
108
+ "type": "object",
109
+ "required": ["delegation"],
110
+ "properties": {
111
+ "delegation": {
112
+ "type": "object",
113
+ "required": ["type"],
114
+ "properties": {
115
+ "type": { "enum": ["impersonation", "on-behalf-of", "delegated"] }
116
+ }
117
+ }
118
+ }
119
+ },
120
+ "then": { "required": ["subject"] }
121
+ }
122
+ ],
123
+ "$defs": {
124
+ "jsonValue": {
125
+ "title": "JSON value",
126
+ "description": "Any JSON value: string, number, integer, boolean, null, array or object.",
127
+ "anyOf": [
128
+ { "type": ["string", "number", "boolean", "null"] },
129
+ { "type": "array", "items": { "$ref": "#/$defs/jsonValue" } },
130
+ { "type": "object", "additionalProperties": { "$ref": "#/$defs/jsonValue" } }
131
+ ]
132
+ },
133
+ "jsonObject": {
134
+ "title": "JSON object",
135
+ "description": "A JSON object whose values may be any JSON value.",
136
+ "type": "object",
137
+ "additionalProperties": { "$ref": "#/$defs/jsonValue" }
138
+ },
139
+ "identifier": {
140
+ "title": "Identifier",
141
+ "description": "Opaque, stable identifier. Leading and trailing whitespace are not permitted and the value MUST NOT be empty.",
142
+ "type": "string",
143
+ "minLength": 1,
144
+ "maxLength": 256,
145
+ "pattern": "^\\S(.*\\S)?$"
146
+ },
147
+ "shortIdentifier": {
148
+ "title": "Short identifier",
149
+ "type": "string",
150
+ "minLength": 1,
151
+ "maxLength": 128,
152
+ "pattern": "^\\S(.*\\S)?$"
153
+ },
154
+ "token": {
155
+ "title": "Vocabulary token",
156
+ "description": "Lower-case, hyphen-separated vocabulary term. Used for open vocabularies whose recommended values are listed in the semantic conventions.",
157
+ "type": "string",
158
+ "minLength": 1,
159
+ "maxLength": 64,
160
+ "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
161
+ },
162
+ "tag": {
163
+ "title": "Tag",
164
+ "type": "string",
165
+ "minLength": 1,
166
+ "maxLength": 64,
167
+ "pattern": "^[a-z0-9][a-z0-9._:-]*$"
168
+ },
169
+ "eventName": {
170
+ "title": "Event name",
171
+ "description": "Hierarchical lower-case event name in the form domain.resource.action. At least two segments are REQUIRED. Segments may contain hyphenated words such as `offset-reset`. Event names MUST NOT contain product, company or jurisdiction names.",
172
+ "type": "string",
173
+ "minLength": 3,
174
+ "maxLength": 256,
175
+ "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*(\\.[a-z][a-z0-9]*(-[a-z0-9]+)*)+$",
176
+ "examples": [
177
+ "authentication.login",
178
+ "identity.role.assign",
179
+ "document.share.create",
180
+ "configuration.setting.update",
181
+ "queue.consumer.offset-reset"
182
+ ]
183
+ },
184
+ "extensionKey": {
185
+ "title": "Extension key",
186
+ "description": "Reverse-domain namespaced extension key with at least three dot-separated lower-case segments, for example `com.example.workflow.stage`.",
187
+ "type": "string",
188
+ "minLength": 5,
189
+ "maxLength": 256,
190
+ "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*(\\.[a-z][a-z0-9]*(-[a-z0-9]+)*){2,}$"
191
+ },
192
+ "timestamp": {
193
+ "title": "Timestamp",
194
+ "description": "RFC 3339 compatible date-time string. UTC is RECOMMENDED.",
195
+ "type": "string",
196
+ "format": "date-time",
197
+ "minLength": 20,
198
+ "maxLength": 64,
199
+ "examples": ["2026-03-14T09:24:31.412Z"]
200
+ },
201
+ "text": {
202
+ "title": "Human readable text",
203
+ "description": "Short human readable text. MUST NOT contain secrets, credentials, tokens or unnecessary personal data.",
204
+ "type": "string",
205
+ "minLength": 1,
206
+ "maxLength": 1024
207
+ },
208
+ "algorithmIdentifier": {
209
+ "title": "Algorithm identifier",
210
+ "description": "Cryptographic algorithm identifier. The vocabulary is intentionally open so that new algorithms may be adopted without a specification change.",
211
+ "type": "string",
212
+ "minLength": 1,
213
+ "maxLength": 64,
214
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9+._-]*$"
215
+ },
216
+ "digest": {
217
+ "title": "Digest",
218
+ "description": "Encoded hash or signature value produced by another system or layer, such as an evidence digest or a signature. Hexadecimal, base64 and base64url encodings are accepted, because the value is often echoed from the system that produced it. Digests that OpenAuditModel itself verifies use `hexDigest` instead.",
219
+ "type": "string",
220
+ "minLength": 16,
221
+ "maxLength": 1024,
222
+ "pattern": "^[A-Za-z0-9+/=_-]+$"
223
+ },
224
+ "hexDigest": {
225
+ "title": "Verifiable digest",
226
+ "description": "Digest that OpenAuditModel tooling recalculates and compares, encoded as lower-case hexadecimal with an even number of digits. A single encoding is mandated because a digest that could be hexadecimal or base64 cannot be compared without guessing. See specification/integrity.md §5.",
227
+ "type": "string",
228
+ "minLength": 32,
229
+ "maxLength": 256,
230
+ "pattern": "^([0-9a-f]{2}){16,128}$"
231
+ },
232
+ "traceId": {
233
+ "title": "Trace identifier",
234
+ "description": "W3C Trace Context trace-id: 32 lower-case hexadecimal characters. The all-zero value is invalid.",
235
+ "type": "string",
236
+ "pattern": "^[0-9a-f]{32}$",
237
+ "not": { "const": "00000000000000000000000000000000" }
238
+ },
239
+ "spanId": {
240
+ "title": "Span identifier",
241
+ "description": "W3C Trace Context parent-id: 16 lower-case hexadecimal characters. The all-zero value is invalid.",
242
+ "type": "string",
243
+ "pattern": "^[0-9a-f]{16}$",
244
+ "not": { "const": "0000000000000000" }
245
+ },
246
+
247
+ "eventDescriptor": {
248
+ "title": "Event descriptor",
249
+ "description": "What happened and how it ended.",
250
+ "type": "object",
251
+ "additionalProperties": false,
252
+ "required": ["name", "category", "outcome"],
253
+ "properties": {
254
+ "name": { "$ref": "#/$defs/eventName" },
255
+ "category": {
256
+ "description": "Coarse grouping of the event name. Open vocabulary; recommended values are listed in semantic-conventions/event-naming.md.",
257
+ "$ref": "#/$defs/token",
258
+ "examples": ["authentication", "identity", "data-access", "configuration", "workflow"]
259
+ },
260
+ "type": {
261
+ "description": "Optional activity classifier that is independent of the domain, such as the coarse operation performed.",
262
+ "$ref": "#/$defs/token",
263
+ "examples": ["create", "read", "update", "delete", "execute", "approve", "share"]
264
+ },
265
+ "outcome": {
266
+ "description": "Result of the audited operation. `partial` describes an operation that succeeded for some targets and failed for others.",
267
+ "enum": ["success", "failure", "partial", "unknown"]
268
+ },
269
+ "severity": {
270
+ "description": "Audit significance of the event, not the severity of a software fault.",
271
+ "enum": ["debug", "info", "low", "medium", "high", "critical"]
272
+ },
273
+ "summary": {
274
+ "description": "Short human readable description. Machine consumers MUST NOT parse this field.",
275
+ "$ref": "#/$defs/text"
276
+ },
277
+ "error": { "$ref": "#/$defs/errorDescriptor" }
278
+ },
279
+ "allOf": [
280
+ {
281
+ "$comment": "A failed operation carries a sanitized error descriptor so that failures remain analyzable without free-text parsing.",
282
+ "if": {
283
+ "type": "object",
284
+ "required": ["outcome"],
285
+ "properties": { "outcome": { "const": "failure" } }
286
+ },
287
+ "then": { "required": ["error"] }
288
+ }
289
+ ]
290
+ },
291
+
292
+ "errorDescriptor": {
293
+ "title": "Error descriptor",
294
+ "description": "Sanitized description of why an operation failed. MUST NOT contain secrets, tokens, credentials, personal data, full payloads, or internal stack traces unless explicitly permitted by policy.",
295
+ "type": "object",
296
+ "additionalProperties": false,
297
+ "required": ["code"],
298
+ "properties": {
299
+ "code": {
300
+ "description": "Stable, machine-readable failure code defined by the producing application.",
301
+ "$ref": "#/$defs/shortIdentifier",
302
+ "examples": ["invalid-credentials", "permission-denied", "quota-exceeded"]
303
+ },
304
+ "type": {
305
+ "description": "Coarse failure classification.",
306
+ "$ref": "#/$defs/token",
307
+ "examples": ["validation", "authorization", "conflict", "timeout", "dependency"]
308
+ },
309
+ "message": {
310
+ "description": "Sanitized human readable failure message.",
311
+ "$ref": "#/$defs/text"
312
+ },
313
+ "retryable": {
314
+ "description": "Whether the same operation may reasonably succeed if retried.",
315
+ "type": "boolean"
316
+ }
317
+ }
318
+ },
319
+
320
+ "principal": {
321
+ "title": "Principal",
322
+ "description": "An actor or a subject. Stable identifiers are sufficient; personally identifiable display names are never required.",
323
+ "type": "object",
324
+ "additionalProperties": false,
325
+ "required": ["type", "id"],
326
+ "properties": {
327
+ "type": {
328
+ "description": "Kind of principal. A principal that does not fit a core type SHOULD use the closest core type and describe the detail in `attributes`.",
329
+ "enum": ["user", "service", "system", "admin", "external", "unknown"]
330
+ },
331
+ "id": {
332
+ "description": "Stable identifier of the principal within its issuing authority. SHOULD NOT be an email address or another direct personal identifier when a stable opaque identifier exists.",
333
+ "$ref": "#/$defs/identifier"
334
+ },
335
+ "displayName": {
336
+ "description": "OPTIONAL human readable name. Personal data; include only when required by the audit purpose.",
337
+ "$ref": "#/$defs/shortIdentifier"
338
+ },
339
+ "tenantId": {
340
+ "description": "Tenant the principal belongs to, when the application is multi-tenant.",
341
+ "$ref": "#/$defs/identifier"
342
+ },
343
+ "organizationId": {
344
+ "description": "Organization the principal belongs to.",
345
+ "$ref": "#/$defs/identifier"
346
+ },
347
+ "roles": {
348
+ "description": "Roles held by the principal that are relevant to this operation. This is not a complete role inventory.",
349
+ "type": "array",
350
+ "minItems": 1,
351
+ "maxItems": 64,
352
+ "uniqueItems": true,
353
+ "items": { "$ref": "#/$defs/shortIdentifier" }
354
+ },
355
+ "attributes": {
356
+ "description": "Additional producer-defined principal attributes. MUST NOT contain credentials or unnecessary personal data.",
357
+ "$ref": "#/$defs/jsonObject"
358
+ }
359
+ }
360
+ },
361
+
362
+ "delegation": {
363
+ "title": "Delegation",
364
+ "description": "How authority to perform the operation was transferred from the subject to the actor.",
365
+ "type": "object",
366
+ "additionalProperties": false,
367
+ "required": ["type"],
368
+ "properties": {
369
+ "type": {
370
+ "description": "`impersonation`: the actor assumed the subject's identity. `on-behalf-of`: the actor acted for the subject with its own identity. `delegated`: authority was granted in advance. `service-chain`: the operation traversed intermediate services.",
371
+ "enum": ["impersonation", "on-behalf-of", "delegated", "service-chain"]
372
+ },
373
+ "reason": {
374
+ "description": "Why delegation was used.",
375
+ "$ref": "#/$defs/text"
376
+ },
377
+ "reference": {
378
+ "description": "Identifier of the grant, ticket or session that authorized the delegation.",
379
+ "$ref": "#/$defs/identifier"
380
+ },
381
+ "approvedBy": {
382
+ "description": "Principal that approved the delegation, when delegation required approval.",
383
+ "$ref": "#/$defs/principal"
384
+ }
385
+ }
386
+ },
387
+
388
+ "resourceReference": {
389
+ "title": "Resource",
390
+ "description": "A resource the operation acted upon. Resource types are an open vocabulary and MUST NOT be enumerated in the core schema.",
391
+ "type": "object",
392
+ "additionalProperties": false,
393
+ "required": ["type", "id"],
394
+ "properties": {
395
+ "type": {
396
+ "description": "Kind of resource. Open vocabulary.",
397
+ "$ref": "#/$defs/token",
398
+ "examples": ["user", "role", "document", "incident", "configuration", "consumer-group"]
399
+ },
400
+ "id": {
401
+ "description": "Stable identifier of the resource within the producing application.",
402
+ "$ref": "#/$defs/identifier"
403
+ },
404
+ "name": {
405
+ "description": "OPTIONAL human readable resource name. May itself be sensitive.",
406
+ "$ref": "#/$defs/shortIdentifier"
407
+ },
408
+ "parentId": {
409
+ "description": "Identifier of the containing resource, such as a folder, project or cluster.",
410
+ "$ref": "#/$defs/identifier"
411
+ },
412
+ "classification": {
413
+ "description": "Data classification of the resource. Open vocabulary because classification schemes are organization-defined. Recommended values: public, internal, confidential, restricted, secret, unknown.",
414
+ "$ref": "#/$defs/token"
415
+ },
416
+ "ownerId": {
417
+ "description": "Identifier of the owning principal or team.",
418
+ "$ref": "#/$defs/identifier"
419
+ },
420
+ "tenantId": {
421
+ "description": "Tenant the resource belongs to.",
422
+ "$ref": "#/$defs/identifier"
423
+ },
424
+ "attributes": {
425
+ "description": "Additional producer-defined resource attributes. MUST NOT contain resource contents.",
426
+ "$ref": "#/$defs/jsonObject"
427
+ }
428
+ }
429
+ },
430
+
431
+ "application": {
432
+ "title": "Application context",
433
+ "description": "The application that produced the event. This MUST describe the producer, not a collector, forwarder or storage backend.",
434
+ "type": "object",
435
+ "additionalProperties": false,
436
+ "required": ["name", "environment"],
437
+ "properties": {
438
+ "name": {
439
+ "description": "Stable name of the producing application. Lower-case hyphenated names are RECOMMENDED.",
440
+ "$ref": "#/$defs/shortIdentifier"
441
+ },
442
+ "environment": {
443
+ "description": "Deployment environment. Open vocabulary. Recommended values: local, development, test, staging, production, disaster-recovery, unknown.",
444
+ "$ref": "#/$defs/token"
445
+ },
446
+ "version": {
447
+ "description": "Version of the producing application.",
448
+ "$ref": "#/$defs/shortIdentifier"
449
+ },
450
+ "instance": {
451
+ "description": "Identifier of the specific running instance, such as a pod, host or process.",
452
+ "$ref": "#/$defs/identifier"
453
+ },
454
+ "service": {
455
+ "description": "Service within the application that produced the event.",
456
+ "$ref": "#/$defs/shortIdentifier"
457
+ },
458
+ "component": {
459
+ "description": "Component or module within the service.",
460
+ "$ref": "#/$defs/shortIdentifier"
461
+ },
462
+ "region": {
463
+ "description": "Deployment region identifier as defined by the operator.",
464
+ "$ref": "#/$defs/shortIdentifier"
465
+ },
466
+ "zone": {
467
+ "description": "Deployment zone identifier as defined by the operator.",
468
+ "$ref": "#/$defs/shortIdentifier"
469
+ },
470
+ "deploymentId": {
471
+ "description": "Identifier of the deployment or release the instance is running.",
472
+ "$ref": "#/$defs/identifier"
473
+ }
474
+ }
475
+ },
476
+
477
+ "organization": {
478
+ "title": "Organization context",
479
+ "description": "OPTIONAL organizational placement of the operation. Not every application is multi-tenant, so this object is never required.",
480
+ "type": "object",
481
+ "additionalProperties": false,
482
+ "minProperties": 1,
483
+ "properties": {
484
+ "tenantId": { "$ref": "#/$defs/identifier" },
485
+ "organizationId": { "$ref": "#/$defs/identifier" },
486
+ "departmentId": { "$ref": "#/$defs/identifier" },
487
+ "workspaceId": { "$ref": "#/$defs/identifier" },
488
+ "businessUnitId": { "$ref": "#/$defs/identifier" }
489
+ }
490
+ },
491
+
492
+ "authentication": {
493
+ "title": "Authentication context",
494
+ "description": "How the actor was authenticated. Absence of this object means authentication context is not available or not applicable; it does NOT mean the actor was anonymous.",
495
+ "type": "object",
496
+ "additionalProperties": false,
497
+ "minProperties": 1,
498
+ "properties": {
499
+ "method": {
500
+ "description": "Authentication method used.",
501
+ "enum": [
502
+ "password",
503
+ "mfa",
504
+ "oidc",
505
+ "saml",
506
+ "certificate",
507
+ "api-key",
508
+ "service-account",
509
+ "session",
510
+ "anonymous",
511
+ "other",
512
+ "unknown"
513
+ ]
514
+ },
515
+ "provider": {
516
+ "description": "Identity provider that performed authentication.",
517
+ "$ref": "#/$defs/shortIdentifier"
518
+ },
519
+ "mfa": {
520
+ "description": "Whether multi-factor authentication was satisfied for the session behind this operation.",
521
+ "type": "boolean"
522
+ },
523
+ "assuranceLevel": {
524
+ "description": "Producer-defined authentication assurance level. Values are application-defined; mapping to an external assurance framework is out of scope for the core specification.",
525
+ "$ref": "#/$defs/token"
526
+ },
527
+ "sessionId": {
528
+ "description": "Session correlation identifier. MUST NOT be a usable session token or cookie value.",
529
+ "$ref": "#/$defs/identifier"
530
+ },
531
+ "authenticatedAt": {
532
+ "description": "When the session behind this operation was authenticated.",
533
+ "$ref": "#/$defs/timestamp"
534
+ }
535
+ }
536
+ },
537
+
538
+ "authorization": {
539
+ "title": "Authorization context",
540
+ "description": "The authorization decision that permitted or denied the operation. OpenAuditModel records decisions; it is not an authorization engine.",
541
+ "type": "object",
542
+ "additionalProperties": false,
543
+ "required": ["decision"],
544
+ "properties": {
545
+ "decision": {
546
+ "description": "Outcome of the authorization evaluation.",
547
+ "enum": ["allow", "deny", "not-applicable", "unknown"]
548
+ },
549
+ "engine": {
550
+ "description": "Component that produced the decision. No specific engine is required or implied.",
551
+ "$ref": "#/$defs/shortIdentifier"
552
+ },
553
+ "policy": {
554
+ "description": "Identifier of the policy that produced the decision.",
555
+ "$ref": "#/$defs/shortIdentifier"
556
+ },
557
+ "policyVersion": {
558
+ "description": "Version of the policy that produced the decision.",
559
+ "$ref": "#/$defs/shortIdentifier"
560
+ },
561
+ "reason": {
562
+ "description": "Sanitized explanation of the decision.",
563
+ "$ref": "#/$defs/text"
564
+ },
565
+ "permissions": {
566
+ "description": "Permissions that were evaluated or required for the operation.",
567
+ "type": "array",
568
+ "minItems": 1,
569
+ "maxItems": 64,
570
+ "uniqueItems": true,
571
+ "items": { "$ref": "#/$defs/shortIdentifier" }
572
+ }
573
+ }
574
+ },
575
+
576
+ "approval": {
577
+ "title": "Approval context",
578
+ "description": "Human or workflow approval associated with the operation. Approval is distinct from authorization: authorization is a policy evaluation, approval is a decision by one or more principals.",
579
+ "type": "object",
580
+ "additionalProperties": false,
581
+ "minProperties": 1,
582
+ "properties": {
583
+ "status": {
584
+ "description": "State of the approval at the time of the event.",
585
+ "enum": ["not-required", "pending", "approved", "rejected", "expired", "unknown"]
586
+ },
587
+ "workflowId": {
588
+ "description": "Identifier of the approval workflow definition or instance.",
589
+ "$ref": "#/$defs/identifier"
590
+ },
591
+ "requestId": {
592
+ "description": "Identifier of the approval request.",
593
+ "$ref": "#/$defs/identifier"
594
+ },
595
+ "requiredApprovals": {
596
+ "description": "Number of approvals required by policy.",
597
+ "type": "integer",
598
+ "minimum": 0
599
+ },
600
+ "receivedApprovals": {
601
+ "description": "Number of approvals received at the time of the event.",
602
+ "type": "integer",
603
+ "minimum": 0
604
+ },
605
+ "approvers": {
606
+ "description": "Principals that approved the operation.",
607
+ "type": "array",
608
+ "minItems": 1,
609
+ "maxItems": 64,
610
+ "items": { "$ref": "#/$defs/principal" }
611
+ },
612
+ "approvedAt": {
613
+ "description": "When the approval reached its current status.",
614
+ "$ref": "#/$defs/timestamp"
615
+ }
616
+ }
617
+ },
618
+
619
+ "request": {
620
+ "title": "Request and correlation context",
621
+ "description": "How the operation was requested and how it correlates with other telemetry.",
622
+ "type": "object",
623
+ "additionalProperties": false,
624
+ "minProperties": 1,
625
+ "properties": {
626
+ "requestId": {
627
+ "description": "Identifier of the request that triggered the operation.",
628
+ "$ref": "#/$defs/identifier"
629
+ },
630
+ "correlationId": {
631
+ "description": "Identifier correlating a set of related requests or operations.",
632
+ "$ref": "#/$defs/identifier"
633
+ },
634
+ "traceId": { "$ref": "#/$defs/traceId" },
635
+ "spanId": { "$ref": "#/$defs/spanId" },
636
+ "ipAddress": {
637
+ "description": "Network address the request originated from. Personal data in most jurisdictions; record only when the audit purpose requires it.",
638
+ "type": "string",
639
+ "anyOf": [{ "format": "ipv4" }, { "format": "ipv6" }]
640
+ },
641
+ "forwardedFor": {
642
+ "description": "Ordered list of proxy-reported client addresses. Structured deliberately so that raw forwarding headers are not copied verbatim.",
643
+ "type": "array",
644
+ "minItems": 1,
645
+ "maxItems": 16,
646
+ "items": {
647
+ "type": "string",
648
+ "anyOf": [{ "format": "ipv4" }, { "format": "ipv6" }]
649
+ }
650
+ },
651
+ "userAgent": {
652
+ "description": "Client user agent string, truncated by the producer when necessary.",
653
+ "type": "string",
654
+ "minLength": 1,
655
+ "maxLength": 512
656
+ },
657
+ "protocol": {
658
+ "description": "Application protocol used for the request. Open vocabulary.",
659
+ "$ref": "#/$defs/token",
660
+ "examples": ["http", "https", "grpc", "amqp", "mqtt", "ssh"]
661
+ },
662
+ "method": {
663
+ "description": "Protocol-level operation, such as an HTTP method or an RPC verb.",
664
+ "type": "string",
665
+ "minLength": 1,
666
+ "maxLength": 32,
667
+ "pattern": "^[A-Za-z][A-Za-z0-9_.-]*$"
668
+ },
669
+ "route": {
670
+ "description": "Route template rather than a resolved URL. Query strings and fragments are rejected so that identifiers and search terms are not captured incidentally.",
671
+ "type": "string",
672
+ "minLength": 1,
673
+ "maxLength": 512,
674
+ "pattern": "^[^\\s?#]+$",
675
+ "examples": ["/users/{userId}/roles"]
676
+ }
677
+ }
678
+ },
679
+
680
+ "change": {
681
+ "title": "Change context",
682
+ "description": "What the operation changed. Complete before and after states are never required: changed fields, sanitized state, hashes or references are all acceptable.",
683
+ "type": "object",
684
+ "additionalProperties": false,
685
+ "minProperties": 1,
686
+ "properties": {
687
+ "type": {
688
+ "description": "Kind of change performed.",
689
+ "enum": ["create", "update", "delete", "restore", "move", "execute", "none", "other"]
690
+ },
691
+ "changedFields": {
692
+ "description": "Paths of the fields that changed. Field paths alone are often sufficient and avoid recording values.",
693
+ "type": "array",
694
+ "minItems": 1,
695
+ "maxItems": 128,
696
+ "uniqueItems": true,
697
+ "items": { "$ref": "#/$defs/shortIdentifier" }
698
+ },
699
+ "before": {
700
+ "description": "Sanitized prior state or the subset of it that changed. MUST NOT contain full database records, credentials or sensitive payloads.",
701
+ "$ref": "#/$defs/jsonValue"
702
+ },
703
+ "after": {
704
+ "description": "Sanitized resulting state or the subset of it that changed. MUST NOT contain full database records, credentials or sensitive payloads.",
705
+ "$ref": "#/$defs/jsonValue"
706
+ },
707
+ "beforeHash": {
708
+ "description": "Digest of the prior state, for verification without disclosure.",
709
+ "$ref": "#/$defs/digest"
710
+ },
711
+ "afterHash": {
712
+ "description": "Digest of the resulting state, for verification without disclosure.",
713
+ "$ref": "#/$defs/digest"
714
+ },
715
+ "ticketId": {
716
+ "description": "Change or service ticket associated with the change.",
717
+ "$ref": "#/$defs/identifier"
718
+ },
719
+ "incidentId": {
720
+ "description": "Incident associated with the change.",
721
+ "$ref": "#/$defs/identifier"
722
+ },
723
+ "deploymentId": {
724
+ "description": "Deployment or release associated with the change.",
725
+ "$ref": "#/$defs/identifier"
726
+ }
727
+ }
728
+ },
729
+
730
+ "reason": {
731
+ "title": "Reason",
732
+ "description": "Why the operation was performed. This is a business justification and MUST NOT be confused with a technical error message.",
733
+ "type": "object",
734
+ "additionalProperties": false,
735
+ "minProperties": 1,
736
+ "properties": {
737
+ "code": {
738
+ "description": "Machine-readable justification code from a producer-defined vocabulary.",
739
+ "$ref": "#/$defs/token",
740
+ "examples": ["customer-support-request", "emergency-access", "scheduled-maintenance"]
741
+ },
742
+ "text": {
743
+ "description": "Human readable justification.",
744
+ "$ref": "#/$defs/text"
745
+ },
746
+ "reference": {
747
+ "description": "Identifier or locator of the record that justifies the operation, such as a ticket or case.",
748
+ "$ref": "#/$defs/identifier"
749
+ }
750
+ }
751
+ },
752
+
753
+ "evidenceItem": {
754
+ "title": "Evidence reference",
755
+ "description": "A reference to supporting material. OpenAuditModel does not define evidence storage. References MUST be access-controlled and MUST NOT embed credentials.",
756
+ "type": "object",
757
+ "additionalProperties": false,
758
+ "required": ["type", "reference"],
759
+ "properties": {
760
+ "type": {
761
+ "description": "Kind of evidence being referenced.",
762
+ "enum": [
763
+ "document",
764
+ "log",
765
+ "metric",
766
+ "trace",
767
+ "screenshot",
768
+ "ticket",
769
+ "approval",
770
+ "signature",
771
+ "external-record",
772
+ "other"
773
+ ]
774
+ },
775
+ "reference": {
776
+ "description": "Locator or identifier of the evidence in its own system. MUST NOT contain credentials, tokens or signed access parameters.",
777
+ "type": "string",
778
+ "minLength": 1,
779
+ "maxLength": 2048,
780
+ "pattern": "^\\S(.*\\S)?$"
781
+ },
782
+ "hash": {
783
+ "description": "Digest of the referenced evidence, allowing later verification that it was not altered.",
784
+ "$ref": "#/$defs/digest"
785
+ },
786
+ "contentType": {
787
+ "description": "Media type of the referenced evidence.",
788
+ "type": "string",
789
+ "minLength": 3,
790
+ "maxLength": 128,
791
+ "pattern": "^[a-z]+/[a-zA-Z0-9!#$&^_.+-]+$"
792
+ },
793
+ "createdAt": {
794
+ "description": "When the evidence was created.",
795
+ "$ref": "#/$defs/timestamp"
796
+ },
797
+ "retentionUntil": {
798
+ "description": "When the evidence may be disposed of, according to the owning system.",
799
+ "$ref": "#/$defs/timestamp"
800
+ },
801
+ "legalHold": {
802
+ "description": "Whether the evidence is currently under a hold that suspends disposal.",
803
+ "type": "boolean"
804
+ }
805
+ }
806
+ },
807
+
808
+ "privacy": {
809
+ "title": "Privacy context",
810
+ "description": "How this event relates to personal data. Regulation-specific fields MUST NOT be added here; regulatory interpretation belongs to external mapping artifacts.",
811
+ "type": "object",
812
+ "additionalProperties": false,
813
+ "minProperties": 1,
814
+ "properties": {
815
+ "containsPersonalData": {
816
+ "description": "Whether the event as serialized contains personal data.",
817
+ "type": "boolean"
818
+ },
819
+ "dataCategories": {
820
+ "description": "Categories of personal data present. Open vocabulary; recommended values are listed in specification/privacy.md.",
821
+ "type": "array",
822
+ "minItems": 1,
823
+ "maxItems": 32,
824
+ "uniqueItems": true,
825
+ "items": { "$ref": "#/$defs/token" },
826
+ "examples": [["identifier", "contact"]]
827
+ },
828
+ "processing": {
829
+ "description": "How personal data was handled when the event was produced.",
830
+ "enum": ["include", "mask", "hash", "drop", "encrypt", "reference"]
831
+ },
832
+ "minimized": {
833
+ "description": "Whether the producer applied data minimization to this event.",
834
+ "type": "boolean"
835
+ },
836
+ "retentionClass": {
837
+ "description": "Producer-defined retention class governing this event.",
838
+ "$ref": "#/$defs/token"
839
+ },
840
+ "purpose": {
841
+ "description": "Purpose for which the event is recorded.",
842
+ "$ref": "#/$defs/token",
843
+ "examples": ["security-audit", "operational-audit", "access-transparency"]
844
+ }
845
+ }
846
+ },
847
+
848
+ "integrity": {
849
+ "title": "Integrity context",
850
+ "description": "Tamper-evidence material for this event. Integrity metadata makes alteration detectable; it does not make events immutable, prevent deletion, or replace write-once storage.",
851
+ "type": "object",
852
+ "additionalProperties": false,
853
+ "minProperties": 1,
854
+ "dependentRequired": {
855
+ "hash": ["hashAlgorithm", "canonicalization"],
856
+ "previousHash": ["hashAlgorithm"]
857
+ },
858
+ "properties": {
859
+ "canonicalization": {
860
+ "description": "Canonicalization applied before hashing. `RFC8785`, the JSON Canonicalization Scheme, is the identifier the OpenAuditModel verifier implements. REQUIRED when `hash` is present: a digest whose canonicalization is unknown cannot be recalculated.",
861
+ "$ref": "#/$defs/algorithmIdentifier",
862
+ "examples": ["RFC8785"]
863
+ },
864
+ "hashAlgorithm": {
865
+ "description": "Algorithm used to produce `hash` and `previousHash`. Open vocabulary, matched case-sensitively; the v0.1 verifier implements SHA-256, SHA-384 and SHA-512. Acceptance by this schema is not a claim of verifier support.",
866
+ "$ref": "#/$defs/algorithmIdentifier",
867
+ "examples": ["SHA-256", "SHA-384", "SHA-512"]
868
+ },
869
+ "hash": {
870
+ "description": "Digest of the canonicalized event, calculated over the event with `/integrity/hash` and `/integrity/signature` removed. See specification/integrity.md §4.",
871
+ "$ref": "#/$defs/hexDigest"
872
+ },
873
+ "previousHash": {
874
+ "description": "Digest of the preceding event in the same chain, forming a tamper-evident sequence. Every event in one chain MUST use the same `hashAlgorithm` and `canonicalization`.",
875
+ "$ref": "#/$defs/hexDigest"
876
+ },
877
+ "chainId": {
878
+ "description": "Identifier of the chain this event belongs to. Chains may be per instance, per partition or per batch; a single global chain is NOT required.",
879
+ "$ref": "#/$defs/identifier"
880
+ },
881
+ "batchId": {
882
+ "description": "Identifier of the batch this event was sealed with.",
883
+ "$ref": "#/$defs/identifier"
884
+ },
885
+ "signature": { "$ref": "#/$defs/signature" }
886
+ }
887
+ },
888
+
889
+ "signature": {
890
+ "title": "Signature",
891
+ "description": "Digital signature over the canonicalized event. A signature does not by itself create legal evidentiary status, and key management is outside the core specification.",
892
+ "type": "object",
893
+ "additionalProperties": false,
894
+ "required": ["algorithm", "value"],
895
+ "properties": {
896
+ "algorithm": {
897
+ "description": "Signature algorithm. Open vocabulary; recommended values include Ed25519, ECDSA-P256-SHA256 and RSA-PSS-SHA256.",
898
+ "$ref": "#/$defs/algorithmIdentifier"
899
+ },
900
+ "value": {
901
+ "description": "Encoded signature value.",
902
+ "$ref": "#/$defs/digest"
903
+ },
904
+ "keyId": {
905
+ "description": "Identifier of the verification key. MUST NOT contain key material.",
906
+ "$ref": "#/$defs/identifier"
907
+ }
908
+ }
909
+ }
910
+ }
911
+ }