macwarden 0.0.0-stage → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/LICENSE +21 -0
  3. package/README.md +185 -2
  4. package/SECURITY.md +104 -0
  5. package/dist/bin.js +15 -0
  6. package/dist/cancellation.js +1 -0
  7. package/dist/caveat-address.js +1 -0
  8. package/dist/cli.js +1 -0
  9. package/dist/command-result.js +1 -0
  10. package/dist/commands/attenuate.js +1 -0
  11. package/dist/commands/bake/allocate.js +1 -0
  12. package/dist/commands/bake/index.js +1 -0
  13. package/dist/commands/bake/write-out.js +1 -0
  14. package/dist/commands/handlers.js +1 -0
  15. package/dist/commands/inspect.js +1 -0
  16. package/dist/commands/inventory.js +1 -0
  17. package/dist/commands/recommend.js +1 -0
  18. package/dist/commands/respond.js +1 -0
  19. package/dist/commands/revoke.js +1 -0
  20. package/dist/commands/rotate.js +1 -0
  21. package/dist/commands/scan.js +1 -0
  22. package/dist/commands/watch.js +1 -0
  23. package/dist/credential-recognition.js +1 -0
  24. package/dist/decode/index.js +1 -0
  25. package/dist/decode/recognition.js +1 -0
  26. package/dist/environment.js +1 -0
  27. package/dist/errors.js +1 -0
  28. package/dist/grade/index.js +1 -0
  29. package/dist/grade/lnd-permissions.json +508 -0
  30. package/dist/grouped-runs.js +1 -0
  31. package/dist/input/index.js +1 -0
  32. package/dist/input/lndconnect.js +1 -0
  33. package/dist/lnd/grpc.js +1 -0
  34. package/dist/lnd/index.js +1 -0
  35. package/dist/lnd/middleware-proto.js +1 -0
  36. package/dist/online.js +1 -0
  37. package/dist/output/index.js +1 -0
  38. package/dist/output/scan-formats.js +1 -0
  39. package/dist/process-error-context.js +1 -0
  40. package/dist/protected-path.js +1 -0
  41. package/dist/registry/index.js +1 -0
  42. package/dist/registry/process-domain.js +1 -0
  43. package/dist/report/access-review.js +1 -0
  44. package/dist/runtime.js +13107 -0
  45. package/dist/scan/agent-configs.js +1 -0
  46. package/dist/scan/git-history.js +1 -0
  47. package/dist/scan/ignore.js +1 -0
  48. package/dist/scan/index.js +1 -0
  49. package/dist/scan/mcp-context.js +1 -0
  50. package/dist/scan/nwc-match.js +1 -0
  51. package/dist/scan/patterns.js +1 -0
  52. package/dist/scan/redact.js +1 -0
  53. package/dist/secret-capability.js +1 -0
  54. package/dist/secret.js +1 -0
  55. package/dist/version.js +1 -0
  56. package/dist/watch/alert-throttle.js +1 -0
  57. package/dist/watch/alert.js +1 -0
  58. package/dist/watch/canary.js +1 -0
  59. package/dist/watch/output-queue.js +1 -0
  60. package/dist/watch/usage.js +1 -0
  61. package/package.json +69 -4
  62. package/rules/gitleaks.toml +30 -0
  63. package/rules/trufflehog.yaml +27 -0
  64. package/schemas/output/attenuate.schema.json +437 -0
  65. package/schemas/output/bake.schema.json +338 -0
  66. package/schemas/output/inspect.schema.json +172 -0
  67. package/schemas/output/inventory.schema.json +895 -0
  68. package/schemas/output/registry-entry.schema.json +28 -0
  69. package/schemas/output/respond.schema.json +620 -0
  70. package/schemas/output/revoke.schema.json +368 -0
  71. package/schemas/output/rotate.schema.json +381 -0
  72. package/schemas/output/scan.schema.json +270 -0
@@ -0,0 +1,28 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "Credential-free registry entry",
4
+ "type": "object",
5
+ "required": ["nodePubkey", "label", "rootKeyId", "permissions", "caveats", "grade", "fingerprint", "outPath", "createdAt", "verified", "status", "revokedAt", "revokeEvidence", "replaces", "replacedBy"],
6
+ "additionalProperties": false,
7
+ "properties": {
8
+ "nodePubkey": {"type": "string", "pattern": "^0[23][0-9a-fA-F]{64}$"},
9
+ "label": {"type": ["string", "null"], "pattern": "^[A-Za-z][A-Za-z0-9._-]{0,63}$"},
10
+ "rootKeyId": {"type": "string", "pattern": "^(0|[1-9][0-9]*)$"},
11
+ "permissions": {"type": "array", "items": {"type": "string"}},
12
+ "caveats": {"type": "array", "items": {"type": "object"}},
13
+ "grade": {"enum": ["ADMIN", "SPEND", "OPERATE", "RECEIVE", "READ", "UNASSESSED"]},
14
+ "fingerprint": {"type": ["string", "null"], "pattern": "^fp:[0-9a-f]{16}$"},
15
+ "outPath": {"type": ["string", "null"]},
16
+ "createdAt": {"type": "string"},
17
+ "verified": {"type": "boolean"},
18
+ "status": {"enum": ["active", "revoked"]},
19
+ "revokedAt": {"type": ["string", "null"]},
20
+ "revokeEvidence": {"enum": ["rejected", "by-id-only", null]},
21
+ "replaces": {"type": ["string", "null"], "pattern": "^(0|[1-9][0-9]*)$"},
22
+ "replacedBy": {"type": ["string", "null"], "pattern": "^(0|[1-9][0-9]*)$"}
23
+ },
24
+ "allOf": [{
25
+ "if": {"properties": {"fingerprint": {"type": "null"}}},
26
+ "then": {"properties": {"verified": {"const": false}, "outPath": {"type": "null"}}}
27
+ }]
28
+ }
@@ -0,0 +1,620 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/ZilverZtream/macwarden/blob/main/schemas/output/respond.schema.json",
4
+ "title": "macwarden respond --json output",
5
+ "description": "Normative source: SPEC.md, Commands > 10. respond. A batch with failed items still has ok: true; its exit code is the batch code.",
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": "respond"
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
+ "respondItem": {
289
+ "type": "object",
290
+ "additionalProperties": false,
291
+ "required": [
292
+ "label",
293
+ "rootKeyId",
294
+ "grade",
295
+ "action",
296
+ "status",
297
+ "replacementRootKeyId",
298
+ "outPath",
299
+ "note",
300
+ "error",
301
+ "proof"
302
+ ],
303
+ "properties": {
304
+ "label": {
305
+ "type": [
306
+ "string",
307
+ "null"
308
+ ]
309
+ },
310
+ "rootKeyId": {
311
+ "$ref": "#/$defs/rootKeyId"
312
+ },
313
+ "grade": {
314
+ "$ref": "#/$defs/grade"
315
+ },
316
+ "action": {
317
+ "enum": [
318
+ "stage",
319
+ "finish",
320
+ "repair",
321
+ "manual"
322
+ ]
323
+ },
324
+ "status": {
325
+ "enum": [
326
+ "planned",
327
+ "staged",
328
+ "finished",
329
+ "failed",
330
+ "staged-earlier",
331
+ "not-staged",
332
+ "finished-earlier",
333
+ "not-run",
334
+ "manual"
335
+ ]
336
+ },
337
+ "replacementRootKeyId": {
338
+ "oneOf": [
339
+ {
340
+ "type": "null"
341
+ },
342
+ {
343
+ "$ref": "#/$defs/rootKeyId"
344
+ }
345
+ ]
346
+ },
347
+ "replacementFingerprint": {
348
+ "type": [
349
+ "string",
350
+ "null"
351
+ ],
352
+ "pattern": "^fp:[0-9a-f]{16}$"
353
+ },
354
+ "outPath": {
355
+ "type": [
356
+ "string",
357
+ "null"
358
+ ]
359
+ },
360
+ "note": {
361
+ "type": [
362
+ "string",
363
+ "null"
364
+ ]
365
+ },
366
+ "error": {
367
+ "oneOf": [
368
+ {
369
+ "type": "null"
370
+ },
371
+ {
372
+ "$ref": "#/$defs/error"
373
+ }
374
+ ]
375
+ },
376
+ "proof": {
377
+ "oneOf": [
378
+ {
379
+ "type": "null"
380
+ },
381
+ {
382
+ "type": "object",
383
+ "additionalProperties": false,
384
+ "required": [
385
+ "evidence"
386
+ ],
387
+ "properties": {
388
+ "evidence": {
389
+ "enum": [
390
+ "rejected",
391
+ "by-id-only"
392
+ ]
393
+ },
394
+ "oldRootKeyIdAbsent": {
395
+ "type": [
396
+ "boolean",
397
+ "null"
398
+ ]
399
+ },
400
+ "oldCredential": {
401
+ "enum": [
402
+ "accepted",
403
+ "rejected",
404
+ "error",
405
+ "not-tested"
406
+ ]
407
+ },
408
+ "newCredential": {
409
+ "enum": [
410
+ "accepted",
411
+ "rejected",
412
+ "error",
413
+ "not-tested"
414
+ ]
415
+ },
416
+ "proven": {
417
+ "type": "boolean"
418
+ },
419
+ "strength": {
420
+ "enum": [
421
+ "credential-rejected",
422
+ "root-key-id-absent"
423
+ ]
424
+ },
425
+ "scope": {
426
+ "const": "this-credential"
427
+ }
428
+ }
429
+ }
430
+ ]
431
+ }
432
+ }
433
+ },
434
+ "result": {
435
+ "type": "object",
436
+ "additionalProperties": false,
437
+ "required": [
438
+ "mode",
439
+ "dryRun",
440
+ "node",
441
+ "rootKey0",
442
+ "own",
443
+ "unknown",
444
+ "revokedButPresent",
445
+ "bakingRisk",
446
+ "outDir",
447
+ "items",
448
+ "unproven"
449
+ ],
450
+ "properties": {
451
+ "mode": {
452
+ "enum": [
453
+ "stage",
454
+ "finish"
455
+ ]
456
+ },
457
+ "dryRun": {
458
+ "type": "boolean"
459
+ },
460
+ "node": {
461
+ "type": "object",
462
+ "additionalProperties": false,
463
+ "required": [
464
+ "pubkey",
465
+ "alias",
466
+ "network"
467
+ ],
468
+ "properties": {
469
+ "pubkey": {
470
+ "type": "string",
471
+ "pattern": "^0[23][0-9a-fA-F]{64}$"
472
+ },
473
+ "alias": {
474
+ "type": "string"
475
+ },
476
+ "network": {
477
+ "type": "string"
478
+ }
479
+ }
480
+ },
481
+ "rootKey0": {
482
+ "type": "object",
483
+ "additionalProperties": false,
484
+ "required": [
485
+ "present",
486
+ "ownOnRootKey0",
487
+ "guidance"
488
+ ],
489
+ "properties": {
490
+ "present": {
491
+ "type": "boolean"
492
+ },
493
+ "ownOnRootKey0": {
494
+ "type": "boolean"
495
+ },
496
+ "guidance": {
497
+ "type": "array",
498
+ "items": {
499
+ "type": "string",
500
+ "minLength": 1
501
+ }
502
+ }
503
+ }
504
+ },
505
+ "own": {
506
+ "type": "object",
507
+ "additionalProperties": false,
508
+ "required": [
509
+ "rootKeyId"
510
+ ],
511
+ "properties": {
512
+ "rootKeyId": {
513
+ "$ref": "#/$defs/rootKeyId"
514
+ }
515
+ }
516
+ },
517
+ "unknown": {
518
+ "type": "object",
519
+ "additionalProperties": false,
520
+ "required": [
521
+ "rootKeyIds",
522
+ "guidance"
523
+ ],
524
+ "properties": {
525
+ "rootKeyIds": {
526
+ "type": "array",
527
+ "items": {
528
+ "$ref": "#/$defs/rootKeyId"
529
+ }
530
+ },
531
+ "guidance": {
532
+ "type": "string"
533
+ }
534
+ }
535
+ },
536
+ "revokedButPresent": {
537
+ "type": "object",
538
+ "additionalProperties": false,
539
+ "required": [
540
+ "rootKeyIds",
541
+ "guidance"
542
+ ],
543
+ "properties": {
544
+ "rootKeyIds": {
545
+ "type": "array",
546
+ "items": {
547
+ "$ref": "#/$defs/rootKeyId"
548
+ }
549
+ },
550
+ "guidance": {
551
+ "type": "string"
552
+ }
553
+ }
554
+ },
555
+ "bakingRisk": {
556
+ "type": "object",
557
+ "additionalProperties": false,
558
+ "required": [
559
+ "rootKeyIds",
560
+ "guidance"
561
+ ],
562
+ "properties": {
563
+ "rootKeyIds": {
564
+ "type": "array",
565
+ "items": {
566
+ "$ref": "#/$defs/rootKeyId"
567
+ }
568
+ },
569
+ "guidance": {
570
+ "type": "array",
571
+ "items": {
572
+ "type": "string",
573
+ "minLength": 1
574
+ }
575
+ }
576
+ }
577
+ },
578
+ "outDir": {
579
+ "type": [
580
+ "string",
581
+ "null"
582
+ ]
583
+ },
584
+ "items": {
585
+ "type": "array",
586
+ "items": {
587
+ "$ref": "#/$defs/respondItem"
588
+ }
589
+ },
590
+ "unproven": {
591
+ "type": "array",
592
+ "items": {
593
+ "type": "object",
594
+ "additionalProperties": false,
595
+ "required": [
596
+ "label",
597
+ "rootKeyId",
598
+ "reason"
599
+ ],
600
+ "properties": {
601
+ "label": {
602
+ "type": [
603
+ "string",
604
+ "null"
605
+ ]
606
+ },
607
+ "rootKeyId": {
608
+ "$ref": "#/$defs/rootKeyId"
609
+ },
610
+ "reason": {
611
+ "type": "string",
612
+ "minLength": 1
613
+ }
614
+ }
615
+ }
616
+ }
617
+ }
618
+ }
619
+ }
620
+ }