macwarden 1.0.1 → 1.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 (67) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +20 -6
  3. package/dist/bin.js +7 -1
  4. package/dist/bounded-file.js +1 -0
  5. package/dist/cancellation.js +1 -1
  6. package/dist/caveat-address.js +1 -1
  7. package/dist/cli.js +1 -1
  8. package/dist/commands/attenuate.js +1 -1
  9. package/dist/commands/bake/allocate.js +1 -1
  10. package/dist/commands/bake/index.js +1 -1
  11. package/dist/commands/bake/write-out.js +1 -1
  12. package/dist/commands/handlers.js +1 -1
  13. package/dist/commands/inspect.js +1 -1
  14. package/dist/commands/inventory.js +1 -1
  15. package/dist/commands/recommend.js +1 -1
  16. package/dist/commands/respond.js +1 -1
  17. package/dist/commands/revoke.js +1 -1
  18. package/dist/commands/rotate.js +1 -1
  19. package/dist/commands/scan.js +1 -1
  20. package/dist/commands/verify.js +1 -0
  21. package/dist/commands/watch.js +1 -1
  22. package/dist/credential-recognition.js +1 -1
  23. package/dist/decode/index.js +1 -1
  24. package/dist/decode/recognition.js +1 -1
  25. package/dist/environment.js +1 -1
  26. package/dist/errors.js +1 -1
  27. package/dist/grade/index.js +1 -1
  28. package/dist/grouped-runs.js +1 -1
  29. package/dist/input/index.js +1 -1
  30. package/dist/input/lndconnect.js +1 -1
  31. package/dist/lnd/grpc.js +1 -1
  32. package/dist/lnd/index.js +1 -1
  33. package/dist/lnd/middleware-proto.js +1 -1
  34. package/dist/lnd/tls-identity.js +1 -0
  35. package/dist/online.js +1 -1
  36. package/dist/output/index.js +1 -1
  37. package/dist/output/scan-formats.js +1 -1
  38. package/dist/process-error-context.js +1 -1
  39. package/dist/protected-path.js +1 -1
  40. package/dist/registry/index.js +1 -1
  41. package/dist/registry/process-domain.js +1 -1
  42. package/dist/report/access-review.js +1 -1
  43. package/dist/runtime.js +1784 -617
  44. package/dist/scan/agent-configs.js +1 -1
  45. package/dist/scan/git-history.js +1 -1
  46. package/dist/scan/ignore.js +1 -1
  47. package/dist/scan/index.js +1 -1
  48. package/dist/scan/mcp-context.js +1 -1
  49. package/dist/scan/nwc-match.js +1 -1
  50. package/dist/scan/patterns.js +1 -1
  51. package/dist/scan/redact.js +1 -1
  52. package/dist/secret.js +1 -1
  53. package/dist/version.js +1 -1
  54. package/dist/watch/alert-throttle.js +1 -1
  55. package/dist/watch/alert.js +1 -1
  56. package/dist/watch/canary.js +1 -1
  57. package/dist/watch/output-queue.js +1 -1
  58. package/dist/watch/usage.js +1 -1
  59. package/package.json +2 -2
  60. package/schemas/output/attenuate.schema.json +2 -0
  61. package/schemas/output/inspect.schema.json +2 -0
  62. package/schemas/output/inventory.schema.json +35 -1
  63. package/schemas/output/recommend.schema.json +471 -0
  64. package/schemas/output/scan.schema.json +2 -0
  65. package/schemas/output/verify.schema.json +552 -0
  66. package/schemas/output/watch-event.schema.json +232 -0
  67. package/schemas/output/watch.schema.json +377 -0
@@ -0,0 +1,232 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/ZilverZtream/macwarden/blob/main/schemas/output/watch-event.schema.json",
4
+ "title": "macwarden watch --json event line",
5
+ "description": "Normative source: SPEC.md, Output and Commands > 8. watch. With --json, watch prints one of these objects per line while it runs, then its final document (watch.schema.json, the only line with a \"command\" field) as the last line.",
6
+ "oneOf": [
7
+ {
8
+ "type": "object",
9
+ "additionalProperties": false,
10
+ "required": [
11
+ "schema",
12
+ "event",
13
+ "time",
14
+ "method",
15
+ "rootKeyId",
16
+ "credential",
17
+ "label"
18
+ ],
19
+ "properties": {
20
+ "schema": {
21
+ "const": 1
22
+ },
23
+ "time": {
24
+ "type": "string",
25
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
26
+ },
27
+ "event": {
28
+ "enum": [
29
+ "call",
30
+ "error"
31
+ ]
32
+ },
33
+ "method": {
34
+ "type": "string"
35
+ },
36
+ "rootKeyId": {
37
+ "oneOf": [
38
+ {
39
+ "$ref": "#/$defs/rootKeyId"
40
+ },
41
+ {
42
+ "const": "none"
43
+ }
44
+ ]
45
+ },
46
+ "credential": {
47
+ "type": "string",
48
+ "pattern": "^id:([0-9a-f]{16}|none|undecodable)$"
49
+ },
50
+ "label": {
51
+ "type": [
52
+ "string",
53
+ "null"
54
+ ]
55
+ }
56
+ }
57
+ },
58
+ {
59
+ "type": "object",
60
+ "additionalProperties": false,
61
+ "required": [
62
+ "schema",
63
+ "event",
64
+ "time",
65
+ "method",
66
+ "rootKeyId",
67
+ "credential",
68
+ "label",
69
+ "denied"
70
+ ],
71
+ "properties": {
72
+ "schema": {
73
+ "const": 1
74
+ },
75
+ "time": {
76
+ "type": "string",
77
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
78
+ },
79
+ "event": {
80
+ "const": "canary"
81
+ },
82
+ "method": {
83
+ "type": "string"
84
+ },
85
+ "rootKeyId": {
86
+ "oneOf": [
87
+ {
88
+ "$ref": "#/$defs/rootKeyId"
89
+ },
90
+ {
91
+ "const": "none"
92
+ }
93
+ ]
94
+ },
95
+ "credential": {
96
+ "type": "string",
97
+ "pattern": "^id:([0-9a-f]{16}|none|undecodable)$"
98
+ },
99
+ "label": {
100
+ "type": [
101
+ "string",
102
+ "null"
103
+ ]
104
+ },
105
+ "denied": {
106
+ "const": true
107
+ },
108
+ "repeats": {
109
+ "type": "integer",
110
+ "minimum": 1
111
+ }
112
+ }
113
+ },
114
+ {
115
+ "type": "object",
116
+ "additionalProperties": false,
117
+ "required": [
118
+ "schema",
119
+ "event",
120
+ "time",
121
+ "status",
122
+ "canaries",
123
+ "readOnly"
124
+ ],
125
+ "properties": {
126
+ "schema": {
127
+ "const": 1
128
+ },
129
+ "time": {
130
+ "type": "string",
131
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
132
+ },
133
+ "event": {
134
+ "const": "status"
135
+ },
136
+ "status": {
137
+ "enum": [
138
+ "registered",
139
+ "reconnecting"
140
+ ]
141
+ },
142
+ "canaries": {
143
+ "type": "integer",
144
+ "minimum": 0
145
+ },
146
+ "readOnly": {
147
+ "const": true
148
+ }
149
+ }
150
+ },
151
+ {
152
+ "type": "object",
153
+ "additionalProperties": false,
154
+ "required": [
155
+ "schema",
156
+ "event",
157
+ "time",
158
+ "status",
159
+ "dropped"
160
+ ],
161
+ "properties": {
162
+ "schema": {
163
+ "const": 1
164
+ },
165
+ "time": {
166
+ "type": "string",
167
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
168
+ },
169
+ "event": {
170
+ "const": "status"
171
+ },
172
+ "status": {
173
+ "const": "output-dropped"
174
+ },
175
+ "dropped": {
176
+ "type": "integer",
177
+ "minimum": 1
178
+ }
179
+ }
180
+ },
181
+ {
182
+ "type": "object",
183
+ "additionalProperties": false,
184
+ "required": [
185
+ "schema",
186
+ "event",
187
+ "time",
188
+ "status",
189
+ "rootKeyId",
190
+ "label"
191
+ ],
192
+ "properties": {
193
+ "schema": {
194
+ "const": 1
195
+ },
196
+ "time": {
197
+ "type": "string",
198
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
199
+ },
200
+ "event": {
201
+ "const": "status"
202
+ },
203
+ "status": {
204
+ "const": "alert-failed"
205
+ },
206
+ "rootKeyId": {
207
+ "oneOf": [
208
+ {
209
+ "$ref": "#/$defs/rootKeyId"
210
+ },
211
+ {
212
+ "const": "none"
213
+ }
214
+ ]
215
+ },
216
+ "label": {
217
+ "type": [
218
+ "string",
219
+ "null"
220
+ ]
221
+ }
222
+ }
223
+ }
224
+ ],
225
+ "$defs": {
226
+ "rootKeyId": {
227
+ "type": "string",
228
+ "pattern": "^(0|[1-9][0-9]{0,19})$",
229
+ "description": "uint64 as a canonical decimal string (range up to 18446744073709551615 is enforced by the decoder)."
230
+ }
231
+ }
232
+ }
@@ -0,0 +1,377 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/ZilverZtream/macwarden/blob/main/schemas/output/watch.schema.json",
4
+ "title": "macwarden watch --json final document",
5
+ "description": "Normative source: SPEC.md, Commands > 8. watch. The last line of watch --json; the event lines before it follow watch-event.schema.json.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schema",
10
+ "command",
11
+ "ok",
12
+ "warnings",
13
+ "result",
14
+ "error"
15
+ ],
16
+ "properties": {
17
+ "schema": {
18
+ "const": 1
19
+ },
20
+ "command": {
21
+ "const": "watch"
22
+ },
23
+ "ok": {
24
+ "type": "boolean"
25
+ },
26
+ "warnings": {
27
+ "type": "array",
28
+ "items": {
29
+ "$ref": "#/$defs/warning"
30
+ }
31
+ },
32
+ "result": {
33
+ "oneOf": [
34
+ {
35
+ "type": "null"
36
+ },
37
+ {
38
+ "$ref": "#/$defs/result"
39
+ }
40
+ ]
41
+ },
42
+ "error": {
43
+ "oneOf": [
44
+ {
45
+ "type": "null"
46
+ },
47
+ {
48
+ "$ref": "#/$defs/error"
49
+ }
50
+ ]
51
+ }
52
+ },
53
+ "allOf": [
54
+ {
55
+ "if": {
56
+ "properties": {
57
+ "ok": {
58
+ "const": true
59
+ }
60
+ },
61
+ "required": [
62
+ "ok"
63
+ ]
64
+ },
65
+ "then": {
66
+ "properties": {
67
+ "result": {
68
+ "$ref": "#/$defs/result"
69
+ },
70
+ "error": {
71
+ "type": "null"
72
+ }
73
+ }
74
+ },
75
+ "else": {
76
+ "properties": {
77
+ "result": {
78
+ "type": "null"
79
+ },
80
+ "error": {
81
+ "$ref": "#/$defs/error"
82
+ }
83
+ }
84
+ }
85
+ }
86
+ ],
87
+ "$defs": {
88
+ "error": {
89
+ "type": "object",
90
+ "additionalProperties": false,
91
+ "required": [
92
+ "code",
93
+ "step",
94
+ "message"
95
+ ],
96
+ "properties": {
97
+ "code": {
98
+ "type": "integer",
99
+ "minimum": 1,
100
+ "maximum": 8
101
+ },
102
+ "step": {
103
+ "type": [
104
+ "string",
105
+ "null"
106
+ ],
107
+ "minLength": 1
108
+ },
109
+ "message": {
110
+ "type": "string",
111
+ "minLength": 1
112
+ }
113
+ }
114
+ },
115
+ "warning": {
116
+ "oneOf": [
117
+ {
118
+ "type": "string",
119
+ "minLength": 1
120
+ },
121
+ {
122
+ "type": "object",
123
+ "additionalProperties": false,
124
+ "required": [
125
+ "code",
126
+ "message"
127
+ ],
128
+ "properties": {
129
+ "code": {
130
+ "type": "string",
131
+ "minLength": 1
132
+ },
133
+ "message": {
134
+ "type": "string"
135
+ }
136
+ }
137
+ }
138
+ ]
139
+ },
140
+ "rootKeyId": {
141
+ "type": "string",
142
+ "pattern": "^(0|[1-9][0-9]{0,19})$",
143
+ "description": "uint64 as a canonical decimal string (range up to 18446744073709551615 is enforced by the decoder)."
144
+ },
145
+ "grade": {
146
+ "enum": [
147
+ "ADMIN",
148
+ "SPEND",
149
+ "OPERATE",
150
+ "RECEIVE",
151
+ "READ",
152
+ "UNASSESSED"
153
+ ]
154
+ },
155
+ "registryEntry": {
156
+ "type": "object",
157
+ "required": [
158
+ "nodePubkey",
159
+ "label",
160
+ "rootKeyId",
161
+ "permissions",
162
+ "caveats",
163
+ "grade",
164
+ "fingerprint",
165
+ "outPath",
166
+ "createdAt",
167
+ "verified",
168
+ "status",
169
+ "revokedAt",
170
+ "revokeEvidence",
171
+ "replaces",
172
+ "replacedBy"
173
+ ],
174
+ "additionalProperties": false,
175
+ "properties": {
176
+ "nodePubkey": {
177
+ "type": "string",
178
+ "pattern": "^0[23][0-9a-fA-F]{64}$"
179
+ },
180
+ "label": {
181
+ "type": [
182
+ "string",
183
+ "null"
184
+ ],
185
+ "pattern": "^[A-Za-z][A-Za-z0-9._-]{0,63}$"
186
+ },
187
+ "rootKeyId": {
188
+ "type": "string",
189
+ "pattern": "^(0|[1-9][0-9]*)$"
190
+ },
191
+ "permissions": {
192
+ "type": "array",
193
+ "items": {
194
+ "type": "string"
195
+ }
196
+ },
197
+ "caveats": {
198
+ "type": "array",
199
+ "items": {
200
+ "type": "object"
201
+ }
202
+ },
203
+ "grade": {
204
+ "enum": [
205
+ "ADMIN",
206
+ "SPEND",
207
+ "OPERATE",
208
+ "RECEIVE",
209
+ "READ",
210
+ "UNASSESSED"
211
+ ]
212
+ },
213
+ "fingerprint": {
214
+ "type": [
215
+ "string",
216
+ "null"
217
+ ],
218
+ "pattern": "^fp:[0-9a-f]{16}$"
219
+ },
220
+ "outPath": {
221
+ "type": [
222
+ "string",
223
+ "null"
224
+ ]
225
+ },
226
+ "createdAt": {
227
+ "type": "string"
228
+ },
229
+ "verified": {
230
+ "type": "boolean"
231
+ },
232
+ "status": {
233
+ "enum": [
234
+ "active",
235
+ "revoked"
236
+ ]
237
+ },
238
+ "revokedAt": {
239
+ "type": [
240
+ "string",
241
+ "null"
242
+ ]
243
+ },
244
+ "revokeEvidence": {
245
+ "enum": [
246
+ "rejected",
247
+ "by-id-only",
248
+ null
249
+ ]
250
+ },
251
+ "replaces": {
252
+ "type": [
253
+ "string",
254
+ "null"
255
+ ],
256
+ "pattern": "^(0|[1-9][0-9]*)$"
257
+ },
258
+ "replacedBy": {
259
+ "type": [
260
+ "string",
261
+ "null"
262
+ ],
263
+ "pattern": "^(0|[1-9][0-9]*)$"
264
+ }
265
+ },
266
+ "allOf": [
267
+ {
268
+ "if": {
269
+ "properties": {
270
+ "fingerprint": {
271
+ "type": "null"
272
+ }
273
+ }
274
+ },
275
+ "then": {
276
+ "properties": {
277
+ "verified": {
278
+ "const": false
279
+ },
280
+ "outPath": {
281
+ "type": "null"
282
+ }
283
+ }
284
+ }
285
+ }
286
+ ]
287
+ },
288
+ "result": {
289
+ "type": "object",
290
+ "additionalProperties": false,
291
+ "required": [
292
+ "node",
293
+ "startedAt",
294
+ "endedAt",
295
+ "calls",
296
+ "errors",
297
+ "credentials",
298
+ "canaryAlerts",
299
+ "canaryUses",
300
+ "alertFailures",
301
+ "reconnects",
302
+ "canaries",
303
+ "droppedUsageRecords",
304
+ "evictedUsageRecords",
305
+ "droppedAttributions",
306
+ "droppedEvents",
307
+ "usageFile"
308
+ ],
309
+ "properties": {
310
+ "node": {
311
+ "type": "string",
312
+ "pattern": "^0[23][0-9a-fA-F]{64}$"
313
+ },
314
+ "startedAt": {
315
+ "type": "string",
316
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
317
+ },
318
+ "endedAt": {
319
+ "type": "string",
320
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
321
+ },
322
+ "calls": {
323
+ "type": "integer",
324
+ "minimum": 0
325
+ },
326
+ "errors": {
327
+ "type": "integer",
328
+ "minimum": 0
329
+ },
330
+ "credentials": {
331
+ "type": "integer",
332
+ "minimum": 0
333
+ },
334
+ "canaryAlerts": {
335
+ "type": "integer",
336
+ "minimum": 0
337
+ },
338
+ "canaryUses": {
339
+ "type": "integer",
340
+ "minimum": 0
341
+ },
342
+ "alertFailures": {
343
+ "type": "integer",
344
+ "minimum": 0
345
+ },
346
+ "reconnects": {
347
+ "type": "integer",
348
+ "minimum": 0
349
+ },
350
+ "canaries": {
351
+ "type": "integer",
352
+ "minimum": 0
353
+ },
354
+ "droppedUsageRecords": {
355
+ "type": "integer",
356
+ "minimum": 0
357
+ },
358
+ "evictedUsageRecords": {
359
+ "type": "integer",
360
+ "minimum": 0
361
+ },
362
+ "droppedAttributions": {
363
+ "type": "integer",
364
+ "minimum": 0
365
+ },
366
+ "droppedEvents": {
367
+ "type": "integer",
368
+ "minimum": 0
369
+ },
370
+ "usageFile": {
371
+ "type": "string",
372
+ "minLength": 1
373
+ }
374
+ }
375
+ }
376
+ }
377
+ }