@portll/cobolwork 0.5.0 → 0.7.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 (163) hide show
  1. package/README.md +89 -26
  2. package/STABILITY.md +76 -0
  3. package/bin/cobolwork.mjs +56 -14
  4. package/lib/baseline.mjs +9 -0
  5. package/lib/bms.mjs +21 -7
  6. package/lib/build.mjs +133 -53
  7. package/lib/capabilities.mjs +13 -11
  8. package/lib/cics-commands.mjs +501 -9
  9. package/lib/compliance.mjs +11 -0
  10. package/lib/consequence.mjs +17 -0
  11. package/lib/control-reuse.mjs +113 -0
  12. package/lib/control-workers.mjs +161 -0
  13. package/lib/control.mjs +77 -4
  14. package/lib/dataflow.mjs +402 -152
  15. package/lib/db2/cursor.mjs +15 -0
  16. package/lib/db2/read.mjs +170 -0
  17. package/lib/db2/rules.mjs +77 -0
  18. package/lib/db2/stmt/alter.mjs +473 -0
  19. package/lib/db2/stmt/grant.mjs +125 -0
  20. package/lib/db2/stmt/index.mjs +141 -0
  21. package/lib/db2/stmt/misc.mjs +325 -0
  22. package/lib/db2/stmt/routine.mjs +564 -0
  23. package/lib/db2/stmt/storage.mjs +146 -0
  24. package/lib/db2/stmt/table.mjs +540 -0
  25. package/lib/db2/stmt/view.mjs +146 -0
  26. package/lib/diff.mjs +17 -5
  27. package/lib/equivalence.mjs +44 -5
  28. package/lib/evidence/cli.mjs +26 -7
  29. package/lib/evidence/record.mjs +16 -6
  30. package/lib/evidence/seal.mjs +17 -0
  31. package/lib/evidence/store.mjs +44 -15
  32. package/lib/evidence/timestamp.mjs +83 -0
  33. package/lib/evidence/verify.mjs +120 -42
  34. package/lib/exec-reading.mjs +51 -0
  35. package/lib/execution.mjs +3 -2
  36. package/lib/explain.mjs +2 -0
  37. package/lib/exploitability.mjs +11 -2
  38. package/lib/hlasm/asm/data.mjs +128 -0
  39. package/lib/hlasm/asm/listing.mjs +43 -0
  40. package/lib/hlasm/asm/output.mjs +45 -0
  41. package/lib/hlasm/asm/sections.mjs +161 -0
  42. package/lib/hlasm/asm/symbols.mjs +78 -0
  43. package/lib/hlasm/exec.mjs +27 -0
  44. package/lib/hlasm/expr.mjs +167 -0
  45. package/lib/hlasm/instr.mjs +73 -0
  46. package/lib/hlasm/locate.mjs +333 -0
  47. package/lib/hlasm/macro/authorization.mjs +146 -0
  48. package/lib/hlasm/macro/datasets.mjs +107 -0
  49. package/lib/hlasm/macro/io.mjs +162 -0
  50. package/lib/hlasm/macro/le.mjs +53 -0
  51. package/lib/hlasm/macro/linkage.mjs +143 -0
  52. package/lib/hlasm/macro/operator.mjs +77 -0
  53. package/lib/hlasm/macro/program.mjs +184 -0
  54. package/lib/hlasm/macro/recovery.mjs +85 -0
  55. package/lib/hlasm/macro/storage.mjs +167 -0
  56. package/lib/hlasm/macro/structured.mjs +131 -0
  57. package/lib/hlasm/model.mjs +97 -0
  58. package/lib/hlasm/mvs38.mjs +47 -0
  59. package/lib/hlasm/operands.mjs +59 -0
  60. package/lib/hlasm/optable.mjs +61 -0
  61. package/lib/hlasm/read.mjs +130 -0
  62. package/lib/hlasm.mjs +44 -7
  63. package/lib/ims/dli.mjs +37 -0
  64. package/lib/ims/macro/dbd.mjs +299 -0
  65. package/lib/ims/macro/psb.mjs +286 -0
  66. package/lib/ims/model.mjs +149 -0
  67. package/lib/ims/operands.mjs +23 -0
  68. package/lib/ims/read.mjs +37 -0
  69. package/lib/ims/rules.mjs +135 -0
  70. package/lib/inventory.mjs +10 -7
  71. package/lib/ironwork-ids.mjs +24 -0
  72. package/lib/ironwork.mjs +20 -13
  73. package/lib/kernel/pds-archive.mjs +256 -0
  74. package/lib/kernel/registry.mjs +32 -23
  75. package/lib/kernel/shared-pass.mjs +163 -0
  76. package/lib/kernel/source-tree.mjs +104 -36
  77. package/lib/kernel/version-key.mjs +17 -0
  78. package/lib/layout.mjs +26 -31
  79. package/lib/options.mjs +26 -4
  80. package/lib/parser.mjs +136 -17
  81. package/lib/pli/cursor.mjs +15 -0
  82. package/lib/pli/expr.mjs +101 -0
  83. package/lib/pli/include.mjs +82 -0
  84. package/lib/pli/layout.mjs +125 -0
  85. package/lib/pli/lex.mjs +198 -0
  86. package/lib/pli/program.mjs +280 -0
  87. package/lib/pli/rules/based.mjs +95 -0
  88. package/lib/pli/rules/conditions.mjs +68 -0
  89. package/lib/pli/rules/entry.mjs +130 -0
  90. package/lib/pli/rules/index.mjs +24 -0
  91. package/lib/pli/rules/preprocessor.mjs +55 -0
  92. package/lib/pli/statements.mjs +130 -0
  93. package/lib/pli/stmt/alloc.mjs +45 -0
  94. package/lib/pli/stmt/assignment.mjs +56 -0
  95. package/lib/pli/stmt/call.mjs +104 -0
  96. package/lib/pli/stmt/conditions.mjs +94 -0
  97. package/lib/pli/stmt/control.mjs +219 -0
  98. package/lib/pli/stmt/declare.mjs +149 -0
  99. package/lib/pli/stmt/exec.mjs +55 -0
  100. package/lib/pli/stmt/io.mjs +239 -0
  101. package/lib/pli/stmt/misc.mjs +4 -0
  102. package/lib/pli/stmt/preprocessor.mjs +242 -0
  103. package/lib/pli/stmt/procedure.mjs +258 -0
  104. package/lib/pli/stmt/stream.mjs +283 -0
  105. package/lib/pli/storage.mjs +129 -0
  106. package/lib/policy.mjs +6 -0
  107. package/lib/precompile-check.mjs +124 -0
  108. package/lib/precompile-cics.mjs +8 -4
  109. package/lib/reach.mjs +11 -2
  110. package/lib/revision.json +1 -1
  111. package/lib/sarif.mjs +44 -3
  112. package/lib/scan.mjs +28 -12
  113. package/lib/sets/abend.mjs +82 -8
  114. package/lib/sets/build.mjs +43 -37
  115. package/lib/sets/cics.mjs +20 -38
  116. package/lib/sets/compile.mjs +46 -18
  117. package/lib/sets/copybook.mjs +5 -3
  118. package/lib/sets/crypto.mjs +5 -3
  119. package/lib/sets/ddl.mjs +36 -0
  120. package/lib/sets/flow.mjs +32 -8
  121. package/lib/sets/hidden.mjs +5 -3
  122. package/lib/sets/hlasm.mjs +124 -8
  123. package/lib/sets/ims.mjs +139 -0
  124. package/lib/sets/log.mjs +11 -9
  125. package/lib/sets/opaque.mjs +27 -7
  126. package/lib/sets/pli.mjs +40 -0
  127. package/lib/sets/priv.mjs +5 -3
  128. package/lib/sets/recon.mjs +5 -3
  129. package/lib/sets/secrets.mjs +112 -0
  130. package/lib/sets/semantics.mjs +8 -3
  131. package/lib/sets/web.mjs +39 -23
  132. package/lib/site.mjs +10 -0
  133. package/lib/sources.mjs +80 -20
  134. package/lib/statement-cursor.mjs +67 -0
  135. package/lib/verify.mjs +3 -2
  136. package/lib/version.mjs +6 -0
  137. package/package.json +3 -2
  138. package/rules/compliance-cobit2019.json +520 -5
  139. package/rules/compliance-dora.json +509 -5
  140. package/rules/compliance-ffiec.json +505 -1
  141. package/rules/compliance-nist80053.json +557 -1
  142. package/rules/gitleaks-mainframe.toml +46 -15
  143. package/rules/hlasm-instructions.json +2396 -0
  144. package/rules/hlasm-optables.json +8024 -0
  145. package/schema/cobolwork-baseline.schema.json +36 -0
  146. package/schema/cobolwork-build-provenance.schema.json +187 -0
  147. package/schema/cobolwork-build.schema.json +382 -0
  148. package/schema/cobolwork-capabilities.schema.json +239 -0
  149. package/schema/cobolwork-diff.schema.json +217 -0
  150. package/schema/cobolwork-evidence.schema.json +161 -0
  151. package/schema/cobolwork-execution.schema.json +53 -0
  152. package/schema/cobolwork-explain.schema.json +360 -0
  153. package/schema/cobolwork-finding.schema.json +465 -0
  154. package/schema/cobolwork-flow.schema.json +465 -0
  155. package/schema/cobolwork-gate.schema.json +211 -0
  156. package/schema/cobolwork-inventory.schema.json +206 -0
  157. package/schema/cobolwork-parse.schema.json +105 -0
  158. package/schema/cobolwork-reach.schema.json +74 -0
  159. package/schema/cobolwork-report.schema.json +559 -0
  160. package/schema/cobolwork-witness.schema.json +107 -0
  161. package/schema/cobolwork.baseline.schema.json +101 -0
  162. package/schema/cobolwork.policy.schema.json +7 -0
  163. package/schema/cobolwork.site.schema.json +116 -0
@@ -0,0 +1,465 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/Portll/cobolwork/schema/cobolwork-finding.schema.json",
4
+ "title": "cobolwork finding",
5
+ "description": "One finding, as the scan, flow and diff reports carry it, and a checked route under checked. README.md describes each key. A rule set may add a key in a minor release; a reader ignores keys it does not know.",
6
+ "type": "object",
7
+ "required": [
8
+ "rule",
9
+ "path",
10
+ "line",
11
+ "detail",
12
+ "sev",
13
+ "evidence"
14
+ ],
15
+ "properties": {
16
+ "rule": {
17
+ "type": "string",
18
+ "description": "The rule id."
19
+ },
20
+ "path": {
21
+ "type": "string",
22
+ "description": "The file, relative to the scanned root."
23
+ },
24
+ "line": {
25
+ "type": "integer",
26
+ "minimum": 0,
27
+ "description": "The line; 1 where the finding is about a whole file or program."
28
+ },
29
+ "detail": {
30
+ "type": "string"
31
+ },
32
+ "sev": {
33
+ "enum": [
34
+ "info",
35
+ "low",
36
+ "med",
37
+ "high",
38
+ "crit"
39
+ ]
40
+ },
41
+ "guardedFrom": {
42
+ "enum": [
43
+ "info",
44
+ "low",
45
+ "med",
46
+ "high",
47
+ "crit"
48
+ ],
49
+ "description": "The severity the rule declares, where a check below it lowered this one."
50
+ },
51
+ "cwe": {
52
+ "type": [
53
+ "string",
54
+ "null"
55
+ ],
56
+ "pattern": "^CWE-[0-9]+$"
57
+ },
58
+ "evidence": {
59
+ "enum": [
60
+ "path",
61
+ "construct",
62
+ "tampering",
63
+ "advisory",
64
+ "exposure",
65
+ "change",
66
+ "execution",
67
+ "coverage",
68
+ "context"
69
+ ],
70
+ "description": "What the tool established: README.md, Findings and Claim Severity."
71
+ },
72
+ "fingerprint": {
73
+ "type": "string",
74
+ "pattern": "^[0-9a-f]{32}$",
75
+ "description": "The finding's identity across runs, cobolwork/v1."
76
+ },
77
+ "program": {
78
+ "type": [
79
+ "string",
80
+ "null"
81
+ ]
82
+ },
83
+ "step": {
84
+ "type": "string",
85
+ "description": "The job step, for a JCL finding."
86
+ },
87
+ "name": {
88
+ "type": "string"
89
+ },
90
+ "names": {
91
+ "type": "array"
92
+ },
93
+ "crossProgram": {
94
+ "type": "boolean"
95
+ },
96
+ "hops": {
97
+ "type": "integer",
98
+ "minimum": 0
99
+ },
100
+ "sources": {
101
+ "type": "integer",
102
+ "minimum": 0,
103
+ "description": "How many sources reach the sink."
104
+ },
105
+ "trace": {
106
+ "type": "array",
107
+ "description": "The route from source to sink, one step per data item.",
108
+ "items": {
109
+ "type": "object",
110
+ "properties": {
111
+ "program": {
112
+ "type": [
113
+ "string",
114
+ "null"
115
+ ]
116
+ },
117
+ "item": {
118
+ "type": "string"
119
+ },
120
+ "file": {
121
+ "type": "string"
122
+ },
123
+ "via": {
124
+ "type": "string"
125
+ },
126
+ "dir": {
127
+ "type": "string"
128
+ }
129
+ }
130
+ }
131
+ },
132
+ "related": {
133
+ "type": "array",
134
+ "items": {
135
+ "$ref": "#/$defs/location"
136
+ }
137
+ },
138
+ "routes": {
139
+ "type": "object",
140
+ "description": "With --all-routes: every route from each source to the sink.",
141
+ "properties": {
142
+ "sources": {
143
+ "type": "array"
144
+ },
145
+ "statements": {
146
+ "type": "array"
147
+ },
148
+ "complete": {
149
+ "type": "boolean"
150
+ },
151
+ "unplaced": {
152
+ "type": "array"
153
+ }
154
+ }
155
+ },
156
+ "guard": {
157
+ "type": "object",
158
+ "description": "The check that guards the route.",
159
+ "properties": {
160
+ "program": {
161
+ "type": [
162
+ "string",
163
+ "null"
164
+ ]
165
+ },
166
+ "item": {
167
+ "type": "string"
168
+ },
169
+ "file": {
170
+ "type": "string"
171
+ },
172
+ "line": {
173
+ "type": [
174
+ "integer",
175
+ "null"
176
+ ]
177
+ },
178
+ "stops": {
179
+ "type": "boolean"
180
+ }
181
+ }
182
+ },
183
+ "checkElsewhere": {
184
+ "type": "object",
185
+ "description": "A check on the item that does not run before the use.",
186
+ "properties": {
187
+ "program": {
188
+ "type": [
189
+ "string",
190
+ "null"
191
+ ]
192
+ },
193
+ "item": {
194
+ "type": "string"
195
+ },
196
+ "file": {
197
+ "type": "string"
198
+ },
199
+ "line": {
200
+ "type": [
201
+ "integer",
202
+ "null"
203
+ ]
204
+ }
205
+ }
206
+ },
207
+ "startedBy": {
208
+ "type": "array",
209
+ "description": "The jobs and transactions that start the program.",
210
+ "items": {
211
+ "type": "object",
212
+ "properties": {
213
+ "job": {
214
+ "type": "string"
215
+ },
216
+ "step": {
217
+ "type": "string"
218
+ },
219
+ "file": {
220
+ "type": "string"
221
+ },
222
+ "line": {
223
+ "type": [
224
+ "integer",
225
+ "null"
226
+ ]
227
+ },
228
+ "transaction": {
229
+ "type": "string"
230
+ }
231
+ }
232
+ }
233
+ },
234
+ "startedByMore": {
235
+ "type": "integer",
236
+ "minimum": 0,
237
+ "description": "Entries that start the program beyond those listed."
238
+ },
239
+ "screen": {
240
+ "type": "object",
241
+ "description": "The BMS field a terminal input came from.",
242
+ "properties": {
243
+ "item": {
244
+ "type": "string"
245
+ },
246
+ "field": {
247
+ "type": "string"
248
+ },
249
+ "map": {
250
+ "type": "string"
251
+ },
252
+ "mapset": {
253
+ "type": "string"
254
+ },
255
+ "marks": {
256
+ "type": "array",
257
+ "items": {
258
+ "type": "string"
259
+ }
260
+ },
261
+ "declared": {
262
+ "type": "boolean"
263
+ }
264
+ }
265
+ },
266
+ "reach": {
267
+ "enum": [
268
+ "open",
269
+ "restricted",
270
+ "undeclared"
271
+ ],
272
+ "description": "Who can drive the finding, from the estate's facts."
273
+ },
274
+ "effect": {
275
+ "enum": [
276
+ "privileged"
277
+ ],
278
+ "description": "What driving it runs as, where the estate says the entry runs privileged."
279
+ },
280
+ "exploitability": {
281
+ "type": "object",
282
+ "required": [
283
+ "verdict"
284
+ ],
285
+ "properties": {
286
+ "verdict": {
287
+ "enum": [
288
+ "confirmed",
289
+ "exploitable",
290
+ "attacker-driven",
291
+ "restricted",
292
+ "mitigated",
293
+ "upstream",
294
+ "refuted"
295
+ ]
296
+ },
297
+ "drivenBy": {
298
+ "type": "string"
299
+ },
300
+ "because": {
301
+ "type": "array",
302
+ "items": {
303
+ "type": "string"
304
+ }
305
+ },
306
+ "unknown": {
307
+ "type": "string"
308
+ },
309
+ "fixAt": {
310
+ "type": "object"
311
+ }
312
+ }
313
+ },
314
+ "executed": {
315
+ "type": "object",
316
+ "description": "Whether the estate's runs entered the finding's paragraph.",
317
+ "properties": {
318
+ "paragraph": {
319
+ "type": "string"
320
+ },
321
+ "entered": {
322
+ "type": "integer",
323
+ "minimum": 0
324
+ }
325
+ }
326
+ },
327
+ "suppressed": {
328
+ "type": "object",
329
+ "description": "The baseline entry that suppresses it, on a finding under suppressed."
330
+ },
331
+ "abend": {
332
+ "type": "object",
333
+ "description": "An abend a fuzz run kept: its code, message, whether OPTIMIZE(2) gave it too, and whether the input came through the program's entry or its interface.",
334
+ "properties": {
335
+ "code": {
336
+ "type": "string"
337
+ },
338
+ "message": {
339
+ "type": "string"
340
+ },
341
+ "optimized": {
342
+ "type": "boolean"
343
+ },
344
+ "inputFrom": {
345
+ "enum": [
346
+ "entry",
347
+ "interface"
348
+ ]
349
+ },
350
+ "callers": {
351
+ "type": "array"
352
+ }
353
+ }
354
+ },
355
+ "input": {
356
+ "type": "array",
357
+ "description": "The input that caused an abend."
358
+ },
359
+ "run": {
360
+ "type": "object",
361
+ "description": "The fuzz run and journal that kept the abend.",
362
+ "properties": {
363
+ "dir": {
364
+ "type": "string"
365
+ },
366
+ "journal": {
367
+ "type": "string"
368
+ }
369
+ }
370
+ },
371
+ "ssrange": {
372
+ "type": "boolean"
373
+ },
374
+ "arguments": {
375
+ "type": "array",
376
+ "description": "Each CALL argument whose size differs from the parameter it is passed to.",
377
+ "items": {
378
+ "type": "object",
379
+ "properties": {
380
+ "position": {
381
+ "type": "integer",
382
+ "minimum": 0
383
+ },
384
+ "argument": {
385
+ "type": "string"
386
+ },
387
+ "argumentBytes": {
388
+ "type": [
389
+ "integer",
390
+ "null"
391
+ ]
392
+ },
393
+ "bytesToEndOfRecord": {
394
+ "type": [
395
+ "integer",
396
+ "null"
397
+ ]
398
+ },
399
+ "parameter": {
400
+ "type": "string"
401
+ },
402
+ "parameterBytes": {
403
+ "type": [
404
+ "integer",
405
+ "null"
406
+ ]
407
+ }
408
+ }
409
+ }
410
+ },
411
+ "alsoUses": {
412
+ "type": "integer",
413
+ "minimum": 0
414
+ },
415
+ "unreached": {
416
+ "type": "boolean"
417
+ },
418
+ "impact": {
419
+ "type": "string",
420
+ "description": "What the finding lets someone do, where the finding carries its own."
421
+ },
422
+ "remedy": {
423
+ "type": "string",
424
+ "description": "The standard fix, where the finding carries its own."
425
+ }
426
+ },
427
+ "$defs": {
428
+ "location": {
429
+ "type": "object",
430
+ "description": "A source location the finding relates to, or an advisory it rests on, by id and url.",
431
+ "properties": {
432
+ "path": {
433
+ "type": "string"
434
+ },
435
+ "line": {
436
+ "type": [
437
+ "integer",
438
+ "null"
439
+ ]
440
+ },
441
+ "detail": {
442
+ "type": "string"
443
+ },
444
+ "id": {
445
+ "type": "string"
446
+ },
447
+ "url": {
448
+ "type": "string"
449
+ }
450
+ },
451
+ "anyOf": [
452
+ {
453
+ "required": [
454
+ "path"
455
+ ]
456
+ },
457
+ {
458
+ "required": [
459
+ "id"
460
+ ]
461
+ }
462
+ ]
463
+ }
464
+ }
465
+ }