@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,101 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/Portll/cobolwork/schema/cobolwork.baseline.schema.json",
4
+ "title": "cobolwork baseline file",
5
+ "description": "cobolwork.baseline.json: judgements over findings, matched by fingerprint. lib/baseline.mjs reads it and refuses an entry that does not validate.",
6
+ "type": "object",
7
+ "required": [
8
+ "entries"
9
+ ],
10
+ "patternProperties": {
11
+ "^_": {}
12
+ },
13
+ "properties": {
14
+ "$schema": {
15
+ "type": "string"
16
+ },
17
+ "version": {
18
+ "type": "integer",
19
+ "minimum": 0,
20
+ "maximum": 1,
21
+ "description": "The baseline version. A file without one is read as version 0, which holds the same entries as version 1."
22
+ },
23
+ "entries": {
24
+ "type": "array",
25
+ "items": {
26
+ "$ref": "#/$defs/entry"
27
+ }
28
+ }
29
+ },
30
+ "$defs": {
31
+ "entry": {
32
+ "type": "object",
33
+ "required": [
34
+ "fingerprint",
35
+ "rule",
36
+ "action",
37
+ "reason",
38
+ "who",
39
+ "at"
40
+ ],
41
+ "properties": {
42
+ "fingerprint": {
43
+ "type": "string",
44
+ "pattern": "^[0-9a-f]{32}$"
45
+ },
46
+ "rule": {
47
+ "type": "string",
48
+ "minLength": 1
49
+ },
50
+ "path": {
51
+ "type": "string",
52
+ "description": "Where the finding was when the entry was written; not used to match it."
53
+ },
54
+ "action": {
55
+ "enum": [
56
+ "accept",
57
+ "false-positive",
58
+ "wont-fix",
59
+ "incorrect-scan-result",
60
+ "note",
61
+ "resolved"
62
+ ],
63
+ "description": "The first four suppress the finding until expires."
64
+ },
65
+ "reason": {
66
+ "type": "string",
67
+ "minLength": 1
68
+ },
69
+ "who": {
70
+ "type": "string",
71
+ "minLength": 1
72
+ },
73
+ "at": {
74
+ "type": "string",
75
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}(T[0-9]{2}:[0-9]{2}(:[0-9]{2}(\\.[0-9]+)?)?(Z|[+-][0-9]{2}:?[0-9]{2})?)?$"
76
+ },
77
+ "expires": {
78
+ "type": [
79
+ "string",
80
+ "null"
81
+ ],
82
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}(T[0-9]{2}:[0-9]{2}(:[0-9]{2}(\\.[0-9]+)?)?(Z|[+-][0-9]{2}:?[0-9]{2})?)?$",
83
+ "description": "Required for an action that suppresses."
84
+ },
85
+ "defect": {
86
+ "type": "object",
87
+ "required": [
88
+ "detail"
89
+ ],
90
+ "properties": {
91
+ "detail": {
92
+ "type": "string",
93
+ "minLength": 1
94
+ }
95
+ },
96
+ "description": "What the scanner got wrong, for incorrect-scan-result."
97
+ }
98
+ }
99
+ }
100
+ }
101
+ }
@@ -108,6 +108,13 @@
108
108
  "always"
109
109
  ],
110
110
  "description": "When every program a change edits, or whose copybooks it edits, needs an ironwork equivalence statement passed to build --equivalence: never, only when a commit in the change names a code assistant or bot as author, committer or co-author (machineAuthored), or always. The stricter of the floor and the repository applies. Default never."
111
+ },
112
+ "interface": {
113
+ "enum": [
114
+ "warn",
115
+ "tier"
116
+ ],
117
+ "description": "How an abend found by fuzzing a subprogram at its interface is gated, when no caller run shows a caller passes the input that gave it: warn never blocks on it, tier gates it by its tier as any other finding. The stricter of the floor and the repository applies. Default warn. cobolwork before 0.5.62 refuses this key."
111
118
  }
112
119
  },
113
120
  "$defs": {
@@ -0,0 +1,116 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/Portll/cobolwork/schema/cobolwork.site.schema.json",
4
+ "title": "cobolwork site file",
5
+ "description": "cobolwork.site.json: the facts about an estate that no repository holds. lib/site.mjs reads it; a key it does not read is reported under summary.siteWarnings, and a key opening with an underscore is a note for people.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "patternProperties": {
9
+ "^_": {}
10
+ },
11
+ "properties": {
12
+ "$schema": {
13
+ "type": "string"
14
+ },
15
+ "version": {
16
+ "description": "The site file version. A file without one is read as version 0, which holds the same keys as version 1.",
17
+ "type": "integer",
18
+ "minimum": 0,
19
+ "maximum": 1
20
+ },
21
+ "productionQualifiers": {
22
+ "$ref": "#/$defs/names",
23
+ "description": "Dataset qualifiers that name production data, matched as whole leading components."
24
+ },
25
+ "productionJobPaths": {
26
+ "$ref": "#/$defs/names",
27
+ "description": "Paths of jobs allowed to touch production."
28
+ },
29
+ "nonProductionJobPaths": {
30
+ "$ref": "#/$defs/names",
31
+ "description": "Paths of jobs that are not production jobs."
32
+ },
33
+ "systemNames": {
34
+ "$ref": "#/$defs/names",
35
+ "description": "Names of production systems, which the recon rules look for in source."
36
+ },
37
+ "vendorPacks": {
38
+ "$ref": "#/$defs/names",
39
+ "description": "Vendor rule packs to load, by name."
40
+ },
41
+ "allowUnvalidatedPacks": {
42
+ "type": "boolean",
43
+ "description": "Load a vendor pack that has not been validated."
44
+ },
45
+ "runtimeVersions": {
46
+ "type": "object",
47
+ "description": "The version of each runtime the estate runs, by product, so an advisory against it can be matched.",
48
+ "additionalProperties": {
49
+ "type": [
50
+ "string",
51
+ "number"
52
+ ]
53
+ }
54
+ },
55
+ "internalReaderDds": {
56
+ "$ref": "#/$defs/names",
57
+ "description": "DDs in the CICS region's JCL that are SYSOUT=(class,INTRDR)."
58
+ },
59
+ "internalReaderQueues": {
60
+ "$ref": "#/$defs/names",
61
+ "description": "Transient-data queues that reach the internal reader."
62
+ },
63
+ "compilerOptions": {
64
+ "$ref": "#/$defs/names",
65
+ "description": "The estate's default compiler options, as its compile procedure sets them."
66
+ },
67
+ "apfLibraries": {
68
+ "$ref": "#/$defs/names",
69
+ "description": "APF-authorised libraries."
70
+ },
71
+ "restrictedDatasets": {
72
+ "$ref": "#/$defs/names",
73
+ "description": "Dataset prefixes only a privileged user may read."
74
+ },
75
+ "surrogateUsers": {
76
+ "$ref": "#/$defs/names",
77
+ "description": "Users a job may legitimately run as."
78
+ },
79
+ "superuserIds": {
80
+ "$ref": "#/$defs/names",
81
+ "description": "Ids privileged in UNIX System Services: UID 0, or a holder of BPX.SUPERUSER."
82
+ },
83
+ "openTransactions": {
84
+ "$ref": "#/$defs/names",
85
+ "description": "Transactions any user can start. A COBOLWORK_REACH extract overrides it."
86
+ },
87
+ "restrictedTransactions": {
88
+ "$ref": "#/$defs/names",
89
+ "description": "Transactions a control restricts. A COBOLWORK_REACH extract overrides it."
90
+ },
91
+ "openJobs": {
92
+ "$ref": "#/$defs/names",
93
+ "description": "Jobs any user can submit. A COBOLWORK_REACH extract overrides it."
94
+ },
95
+ "restrictedJobs": {
96
+ "$ref": "#/$defs/names",
97
+ "description": "Jobs a control restricts. A COBOLWORK_REACH extract overrides it."
98
+ },
99
+ "privilegedTransactions": {
100
+ "$ref": "#/$defs/names",
101
+ "description": "Transactions that run with elevated authority. A COBOLWORK_REACH extract overrides it."
102
+ },
103
+ "privilegedJobs": {
104
+ "$ref": "#/$defs/names",
105
+ "description": "Jobs that run with elevated authority. A COBOLWORK_REACH extract overrides it."
106
+ }
107
+ },
108
+ "$defs": {
109
+ "names": {
110
+ "type": "array",
111
+ "items": {
112
+ "type": "string"
113
+ }
114
+ }
115
+ }
116
+ }