@portll/cobolwork 0.6.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 (140) hide show
  1. package/README.md +49 -18
  2. package/STABILITY.md +76 -0
  3. package/bin/cobolwork.mjs +30 -7
  4. package/lib/bms.mjs +21 -7
  5. package/lib/build.mjs +108 -53
  6. package/lib/capabilities.mjs +9 -10
  7. package/lib/cics-commands.mjs +501 -9
  8. package/lib/compliance.mjs +11 -0
  9. package/lib/consequence.mjs +13 -0
  10. package/lib/control-workers.mjs +161 -0
  11. package/lib/control.mjs +52 -3
  12. package/lib/dataflow.mjs +176 -125
  13. package/lib/db2/cursor.mjs +15 -0
  14. package/lib/db2/read.mjs +170 -0
  15. package/lib/db2/rules.mjs +77 -0
  16. package/lib/db2/stmt/alter.mjs +473 -0
  17. package/lib/db2/stmt/grant.mjs +125 -0
  18. package/lib/db2/stmt/index.mjs +141 -0
  19. package/lib/db2/stmt/misc.mjs +325 -0
  20. package/lib/db2/stmt/routine.mjs +564 -0
  21. package/lib/db2/stmt/storage.mjs +146 -0
  22. package/lib/db2/stmt/table.mjs +540 -0
  23. package/lib/db2/stmt/view.mjs +146 -0
  24. package/lib/diff.mjs +17 -5
  25. package/lib/evidence/cli.mjs +14 -3
  26. package/lib/evidence/record.mjs +1 -1
  27. package/lib/evidence/store.mjs +44 -31
  28. package/lib/exec-reading.mjs +51 -0
  29. package/lib/execution.mjs +3 -2
  30. package/lib/explain.mjs +2 -0
  31. package/lib/exploitability.mjs +11 -2
  32. package/lib/hlasm/asm/data.mjs +13 -1
  33. package/lib/hlasm/asm/sections.mjs +3 -1
  34. package/lib/hlasm/instr.mjs +25 -0
  35. package/lib/hlasm/macro/authorization.mjs +24 -4
  36. package/lib/hlasm/macro/datasets.mjs +30 -17
  37. package/lib/hlasm/macro/io.mjs +68 -45
  38. package/lib/hlasm/macro/le.mjs +2 -2
  39. package/lib/hlasm/macro/operator.mjs +32 -21
  40. package/lib/hlasm/macro/program.mjs +126 -84
  41. package/lib/hlasm/macro/recovery.mjs +10 -5
  42. package/lib/hlasm/macro/storage.mjs +64 -14
  43. package/lib/hlasm/macro/structured.mjs +1 -1
  44. package/lib/hlasm/model.mjs +35 -10
  45. package/lib/hlasm/mvs38.mjs +47 -0
  46. package/lib/hlasm/operands.mjs +10 -0
  47. package/lib/hlasm/optable.mjs +61 -0
  48. package/lib/hlasm/read.mjs +22 -8
  49. package/lib/hlasm.mjs +44 -7
  50. package/lib/ims/dli.mjs +37 -0
  51. package/lib/ims/macro/dbd.mjs +299 -0
  52. package/lib/ims/macro/psb.mjs +286 -0
  53. package/lib/ims/model.mjs +149 -0
  54. package/lib/ims/operands.mjs +23 -0
  55. package/lib/ims/read.mjs +37 -0
  56. package/lib/ims/rules.mjs +135 -0
  57. package/lib/ironwork.mjs +17 -13
  58. package/lib/kernel/pds-archive.mjs +256 -0
  59. package/lib/kernel/registry.mjs +14 -8
  60. package/lib/kernel/shared-pass.mjs +34 -9
  61. package/lib/kernel/source-tree.mjs +104 -36
  62. package/lib/kernel/version-key.mjs +17 -0
  63. package/lib/layout.mjs +26 -31
  64. package/lib/parser.mjs +136 -17
  65. package/lib/pli/cursor.mjs +15 -0
  66. package/lib/pli/expr.mjs +101 -0
  67. package/lib/pli/include.mjs +82 -0
  68. package/lib/pli/layout.mjs +125 -0
  69. package/lib/pli/lex.mjs +198 -0
  70. package/lib/pli/program.mjs +280 -0
  71. package/lib/pli/rules/based.mjs +95 -0
  72. package/lib/pli/rules/conditions.mjs +68 -0
  73. package/lib/pli/rules/entry.mjs +130 -0
  74. package/lib/pli/rules/index.mjs +24 -0
  75. package/lib/pli/rules/preprocessor.mjs +55 -0
  76. package/lib/pli/statements.mjs +130 -0
  77. package/lib/pli/stmt/alloc.mjs +45 -0
  78. package/lib/pli/stmt/assignment.mjs +56 -0
  79. package/lib/pli/stmt/call.mjs +104 -0
  80. package/lib/pli/stmt/conditions.mjs +94 -0
  81. package/lib/pli/stmt/control.mjs +219 -0
  82. package/lib/pli/stmt/declare.mjs +149 -0
  83. package/lib/pli/stmt/exec.mjs +55 -0
  84. package/lib/pli/stmt/io.mjs +239 -0
  85. package/lib/pli/stmt/misc.mjs +4 -0
  86. package/lib/pli/stmt/preprocessor.mjs +242 -0
  87. package/lib/pli/stmt/procedure.mjs +258 -0
  88. package/lib/pli/stmt/stream.mjs +283 -0
  89. package/lib/pli/storage.mjs +129 -0
  90. package/lib/precompile-check.mjs +124 -0
  91. package/lib/precompile-cics.mjs +7 -3
  92. package/lib/reach.mjs +11 -2
  93. package/lib/revision.json +1 -1
  94. package/lib/sarif.mjs +41 -3
  95. package/lib/scan.mjs +7 -1
  96. package/lib/sets/abend.mjs +16 -6
  97. package/lib/sets/cics.mjs +15 -35
  98. package/lib/sets/compile.mjs +41 -15
  99. package/lib/sets/crypto.mjs +5 -3
  100. package/lib/sets/ddl.mjs +36 -0
  101. package/lib/sets/flow.mjs +18 -1
  102. package/lib/sets/hidden.mjs +5 -3
  103. package/lib/sets/hlasm.mjs +72 -12
  104. package/lib/sets/ims.mjs +139 -0
  105. package/lib/sets/log.mjs +6 -6
  106. package/lib/sets/opaque.mjs +27 -7
  107. package/lib/sets/pli.mjs +40 -0
  108. package/lib/sets/recon.mjs +5 -3
  109. package/lib/sets/secrets.mjs +5 -3
  110. package/lib/sets/semantics.mjs +3 -0
  111. package/lib/sets/web.mjs +36 -22
  112. package/lib/site.mjs +10 -0
  113. package/lib/sources.mjs +80 -20
  114. package/lib/statement-cursor.mjs +67 -0
  115. package/lib/verify.mjs +3 -2
  116. package/lib/version.mjs +6 -0
  117. package/package.json +3 -2
  118. package/rules/compliance-cobit2019.json +432 -1
  119. package/rules/compliance-dora.json +414 -1
  120. package/rules/compliance-ffiec.json +414 -1
  121. package/rules/compliance-nist80053.json +466 -1
  122. package/rules/hlasm-optables.json +8024 -0
  123. package/schema/cobolwork-baseline.schema.json +36 -0
  124. package/schema/cobolwork-build-provenance.schema.json +187 -0
  125. package/schema/cobolwork-build.schema.json +382 -0
  126. package/schema/cobolwork-capabilities.schema.json +239 -0
  127. package/schema/cobolwork-diff.schema.json +217 -0
  128. package/schema/cobolwork-evidence.schema.json +161 -0
  129. package/schema/cobolwork-execution.schema.json +53 -0
  130. package/schema/cobolwork-explain.schema.json +360 -0
  131. package/schema/cobolwork-finding.schema.json +465 -0
  132. package/schema/cobolwork-flow.schema.json +465 -0
  133. package/schema/cobolwork-gate.schema.json +211 -0
  134. package/schema/cobolwork-inventory.schema.json +206 -0
  135. package/schema/cobolwork-parse.schema.json +105 -0
  136. package/schema/cobolwork-reach.schema.json +74 -0
  137. package/schema/cobolwork-report.schema.json +559 -0
  138. package/schema/cobolwork-witness.schema.json +107 -0
  139. package/schema/cobolwork.baseline.schema.json +101 -0
  140. 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
+ }
@@ -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
+ }