@portll/cobolwork 0.3.0 → 0.5.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.
- package/README.md +35 -9
- package/bin/cobolwork.mjs +7 -1
- package/lib/bms.mjs +8 -0
- package/lib/capabilities.mjs +2 -2
- package/lib/cics-commands.mjs +308 -42
- package/lib/consequence.mjs +19 -0
- package/lib/constants.mjs +60 -0
- package/lib/control.mjs +61 -17
- package/lib/csd.mjs +6 -1
- package/lib/dataflow.mjs +107 -27
- package/lib/explain.mjs +31 -5
- package/lib/exploitability.mjs +49 -4
- package/lib/gate.mjs +31 -9
- package/lib/hlasm.mjs +79 -0
- package/lib/kernel/findings.mjs +2 -0
- package/lib/kernel/registry.mjs +6 -0
- package/lib/kernel/source-tree.mjs +1 -0
- package/lib/options.mjs +6 -2
- package/lib/packs.mjs +4 -0
- package/lib/parser.mjs +67 -12
- package/lib/precompile-cics.mjs +9 -3
- package/lib/precompile.mjs +3 -2
- package/lib/revision.json +1 -1
- package/lib/sarif.mjs +3 -2
- package/lib/scan.mjs +2 -1
- package/lib/sets/abend.mjs +186 -0
- package/lib/sets/compile.mjs +2 -1
- package/lib/sets/crypto.mjs +110 -0
- package/lib/sets/flow.mjs +18 -0
- package/lib/sets/hidden.mjs +1 -1
- package/lib/sets/hlasm.mjs +121 -0
- package/lib/sets/jcl.mjs +16 -1
- package/lib/sets/recon.mjs +1 -0
- package/lib/sets/web.mjs +99 -4
- package/lib/sources.mjs +12 -2
- package/lib/utilities.mjs +2 -0
- package/lib/verify.mjs +2 -1
- package/lib/words.mjs +377 -17
- package/package.json +1 -1
- package/rules/compliance-cobit2019.json +180 -0
- package/rules/compliance-dora.json +195 -0
- package/rules/compliance-ffiec.json +195 -0
- package/rules/compliance-nist80053.json +195 -0
- package/rules/gitleaks-mainframe.toml +24 -10
- package/rules/hlasm-operations.json +451 -0
- package/rules/icsf-services.json +1178 -0
package/README.md
CHANGED
|
@@ -63,6 +63,13 @@ request and writes SARIF for code scanning: [docs/github-action.md](docs/github-
|
|
|
63
63
|
| JCL | credentials and security commands in in-stream data, destructive statements, `DLM=` tricks, FTP in cleartext or sending production data, production data touched by a test job |
|
|
64
64
|
| The source | names nothing declares (code that cannot compile), shadowed copybooks, payloads hidden in columns 73-80 or aimed at AI readers |
|
|
65
65
|
| The estate | production names outside production jobs, routable addresses, compiler and runtime versions with published advisories |
|
|
66
|
+
| Assembler | a switch to key zero or supervisor state, an instruction run through `EX`, cross-memory calls, the security product called directly, and the CSECT or ENTRY a COBOL `CALL` or a job step reaches |
|
|
67
|
+
| Cryptography | a single-length DES key, an MD5 or SHA-1 hash, or a fixed initialization vector asked of ICSF, read from IBM's parameter lists; an outbound CICS connection asking for HTTP |
|
|
68
|
+
|
|
69
|
+
HLASM is read, not assembled: its statements are read from the cards and its operations looked up
|
|
70
|
+
in a table that cites the IBM manual for each (`rules/hlasm-operations.json`). Macros are not
|
|
71
|
+
expanded and conditional assembly is not evaluated, so an operation a site macro issues is seen
|
|
72
|
+
where the macro is defined, and not where it is used.
|
|
66
73
|
|
|
67
74
|
[docs/rule-sets.md](docs/rule-sets.md) describes each in full, with what it deliberately leaves out.
|
|
68
75
|
Vendor packs for CA ACF2 and Top Secret, Control-M and Connect:Direct load only for estates that
|
|
@@ -101,8 +108,20 @@ here can be checked.
|
|
|
101
108
|
}
|
|
102
109
|
```
|
|
103
110
|
|
|
104
|
-
`crossProgram` marks a path that left the file it started in.
|
|
105
|
-
|
|
111
|
+
`crossProgram` marks a path that left the file it started in. A value a CALL writes back through a
|
|
112
|
+
parameter returns only to the call it came in through: in another caller's CALL the parameter is
|
|
113
|
+
that caller's storage. A value the subprogram keeps in its own storage can reach any later caller.
|
|
114
|
+
Findings carry no source text, so a report can be stored and passed on without carrying the code
|
|
115
|
+
with it.
|
|
116
|
+
|
|
117
|
+
`trace` is one route, the shortest, and sources that reach one sink are merged into one finding,
|
|
118
|
+
counted in `sources`. With `--all-routes`, `scan` and `flow` give each path finding `routes`: every
|
|
119
|
+
source, and every statement on any route from one of them to the sink, by verb, file and line.
|
|
120
|
+
`complete` is false where the walk stopped at its budget or a step has no statement the engine can
|
|
121
|
+
place. It leaves out no statement on a route the engine follows, and may name one no route takes:
|
|
122
|
+
what a reader needs before saying a run covered every route (`docs/spec/reach.md` §9.8). Routes
|
|
123
|
+
through what the engine does not read, such as an unparsed program or a caller written in another
|
|
124
|
+
language, are not in it.
|
|
106
125
|
|
|
107
126
|
`fingerprint` is what the finding is, rather than where it is printed today: the rule, the program
|
|
108
127
|
and the paragraph or section it sits in (the job, step and DD for JCL), and the flagged statement's
|
|
@@ -113,7 +132,7 @@ that only their position tells apart share one, and `summary.identity.shared` co
|
|
|
113
132
|
### Findings and Claim Severity
|
|
114
133
|
|
|
115
134
|
Severity says how urgent a finding is. `evidence` says what the tool actually established, which
|
|
116
|
-
decides who acts on it. Every rule declares one of
|
|
135
|
+
decides who acts on it. Every rule declares one of nine finding types:
|
|
117
136
|
|
|
118
137
|
| `evidence` | What the finding claims | Who acts |
|
|
119
138
|
|---|---|---|
|
|
@@ -123,6 +142,7 @@ decides who acts on it. Every rule declares one of eight finding types:
|
|
|
123
142
|
| `advisory` | a pinned compiler or runtime matches a published advisory | whoever owns the build |
|
|
124
143
|
| `exposure` | information about the estate is written into source | the owner |
|
|
125
144
|
| `change` | a change moves an interface or adds a call target (`diff` only) | the reviewer of that change |
|
|
145
|
+
| `execution` | a run of the program on a recorded input ended this way, and the run's verified journal is the record | the program's owner |
|
|
126
146
|
| `coverage` | the analysis stopped following here | nobody's code; read more, or accept the limit |
|
|
127
147
|
| `context` | describes the estate (an entry point, a product in use) | nobody; it asserts no defect |
|
|
128
148
|
|
|
@@ -160,8 +180,9 @@ declares its transaction open:
|
|
|
160
180
|
],
|
|
161
181
|
"unknown": "whether it reproduces: a test on a system the estate owns, under its own authorisation, is the only confirmation",
|
|
162
182
|
"fixAt": {
|
|
163
|
-
"program": "INQUIRY", "path": "INQUIRY.cbl", "line":
|
|
164
|
-
"
|
|
183
|
+
"program": "INQUIRY", "path": "INQUIRY.cbl", "line": 11, "item": "WS-ACCT",
|
|
184
|
+
"builtInto": { "item": "WS-STMT", "path": "INQUIRY.cbl", "line": 13 },
|
|
185
|
+
"test": "before the STRING at INQUIRY.cbl:11 that builds WS-STMT, on every route to it, test WS-ACCT against a list of the values allowed (...), or WS-ACCT IS NUMERIC where it is a number, and let only a value that passes reach it; a static statement with host variables needs no test"
|
|
165
186
|
}
|
|
166
187
|
}
|
|
167
188
|
```
|
|
@@ -192,6 +213,11 @@ tests. A finding inside a paragraph they cover carries `executed`, the paragraph
|
|
|
192
213
|
runs entered it, and `summary.byExecution` counts the findings in paragraphs entered and never
|
|
193
214
|
entered ([docs/spec/evidence.md](docs/spec/evidence.md) §13.5).
|
|
194
215
|
|
|
216
|
+
`COBOLWORK_ABENDS` names fuzz runs ironwork's harness wrote. Each abend an input caused becomes a
|
|
217
|
+
finding at the line it happened, with the input and the run's journal, once that journal verifies:
|
|
218
|
+
`input-causes-abend-s0c7`, `-s0c4`, `-subscript-range`, or `input-causes-abend` for any other code
|
|
219
|
+
([docs/spec/evidence.md](docs/spec/evidence.md) §13.6).
|
|
220
|
+
|
|
195
221
|
### What each finding lets someone do, and the fix
|
|
196
222
|
|
|
197
223
|
A defect finding carries two more facts, the same for every finding of its rule: what someone can do
|
|
@@ -349,10 +375,10 @@ and to a COBIT 2019 practice by identifier alone:
|
|
|
349
375
|
|
|
350
376
|
| File | Instrument | Rules mapped |
|
|
351
377
|
|---|---|---|
|
|
352
|
-
| `rules/compliance-dora.json` | Regulation (EU) 2022/2554 (DORA) |
|
|
353
|
-
| `rules/compliance-ffiec.json` | FFIEC IT Examination Handbook |
|
|
354
|
-
| `rules/compliance-nist80053.json` | NIST SP 800-53 Rev. 5.2.0 |
|
|
355
|
-
| `rules/compliance-cobit2019.json` | COBIT 2019 (ISACA), identifiers only |
|
|
378
|
+
| `rules/compliance-dora.json` | Regulation (EU) 2022/2554 (DORA) | 207 |
|
|
379
|
+
| `rules/compliance-ffiec.json` | FFIEC IT Examination Handbook | 205, and 2 recorded as unmapped |
|
|
380
|
+
| `rules/compliance-nist80053.json` | NIST SP 800-53 Rev. 5.2.0 | 205, and 2 recorded as unmapped |
|
|
381
|
+
| `rules/compliance-cobit2019.json` | COBIT 2019 (ISACA), identifiers only | 205, and 2 recorded as unmapped |
|
|
356
382
|
|
|
357
383
|
A COBIT 2019 row names the objective or practice and gives this project's own rationale; no ISACA
|
|
358
384
|
text is reproduced, so reading what a practice says needs a copy of the framework. The practice is
|
package/bin/cobolwork.mjs
CHANGED
|
@@ -80,6 +80,7 @@ Options
|
|
|
80
80
|
--rules-path gitleaks print the path of the mainframe credential rules and exit
|
|
81
81
|
--quiet summary only
|
|
82
82
|
--full-trace list every hop of a data flow path, not its two ends
|
|
83
|
+
--all-routes give each data flow finding every statement on any route from its sources (scan, flow)
|
|
83
84
|
--base <ref> diff: the git revision to compare against
|
|
84
85
|
--head <ref> diff: the revision under review (default: the working tree)
|
|
85
86
|
--baseline <file> judgements to apply; without it, ${BASELINE_FILE} in the scanned tree
|
|
@@ -145,6 +146,7 @@ function parseArgs(argv) {
|
|
|
145
146
|
else if (a === '--rules-path') opts.rulesPath = argv[++i] || 'gitleaks';
|
|
146
147
|
else if (a === '--quiet') opts.quiet = true;
|
|
147
148
|
else if (a === '--full-trace') opts.fullTrace = true;
|
|
149
|
+
else if (a === '--all-routes') opts.allRoutes = true;
|
|
148
150
|
else if (a === '--base') opts.base = value();
|
|
149
151
|
else if (a === '--head') opts.head = value();
|
|
150
152
|
else if (a === '--baseline') opts.baseline = value();
|
|
@@ -250,6 +252,10 @@ if (opts.fullTrace && opts._.length && !TRACE_COMMANDS.includes(opts._[0])) {
|
|
|
250
252
|
`);
|
|
251
253
|
process.exit(2);
|
|
252
254
|
}
|
|
255
|
+
if (opts.allRoutes && opts._.length && !['scan', 'flow'].includes(opts._[0])) {
|
|
256
|
+
process.stderr.write(`cobolwork: --all-routes is for scan and flow\n`);
|
|
257
|
+
process.exit(2);
|
|
258
|
+
}
|
|
253
259
|
const ADVISORY_COMMANDS = ['scan', 'baseline', 'tui', 'explain', 'build'];
|
|
254
260
|
if (opts.advisoryFeeds && opts._.length && !ADVISORY_COMMANDS.includes(opts._[0])) {
|
|
255
261
|
process.stderr.write(`cobolwork: ${opts._[0]} reads no advisories; ${ADVISORY_COMMANDS.join(', ')} do\n`);
|
|
@@ -340,7 +346,7 @@ try {
|
|
|
340
346
|
} else if (command === 'evidence') {
|
|
341
347
|
process.exitCode = evidenceCommand(target, opts, { toolVersion: VERSION, write: (s) => process.stdout.write(s) });
|
|
342
348
|
} else if (command === 'scan' || command === 'flow') {
|
|
343
|
-
const flowOpts = { repos, fullTrace: opts.fullTrace === true, systemDirs };
|
|
349
|
+
const flowOpts = { repos, fullTrace: opts.fullTrace === true, allRoutes: opts.allRoutes === true, systemDirs };
|
|
344
350
|
// The site file sits beside the members and is not one of them, so it is named rather than found.
|
|
345
351
|
const site = resolve(root, SITE_FILE);
|
|
346
352
|
const pds = opts.pdsExport ? pdsExportTree(root, { systemDirs }) : null;
|
package/lib/bms.mjs
CHANGED
|
@@ -55,6 +55,13 @@ const sublist = (v) => {
|
|
|
55
55
|
return (inner ? splitOperands(inner[1]) : [v]).map((x) => x.trim()).filter(Boolean);
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
+
// L'NAME is NAME's length, and T', S', I', K', N', D' and O' its other attributes: the quote after the
|
|
59
|
+
// letter opens no string when the letter starts a term and a symbol follows. CL8'TEXT' and D'1.5'
|
|
60
|
+
// are constants, and their quotes do open one.
|
|
61
|
+
// https://www.ibm.com/docs/en/hla-and-tf/1.6.0?topic=instructions-data-attributes
|
|
62
|
+
const attributeReference = (text, i) => /[LTSIKNDO]/i.test(text[i - 1] || '')
|
|
63
|
+
&& !/[A-Z0-9$#@_]/i.test(text[i - 2] || '') && /[A-Z$#@_&]/i.test(text[i + 1] || '');
|
|
64
|
+
|
|
58
65
|
// Folds physical lines into statements. A map continues a statement in two ways, often both in one
|
|
59
66
|
// file. An operand that fills the line to column 71 carries on in column 16 of the next line, which
|
|
60
67
|
// is how a long INITIAL literal is split. A comma followed by a blank ends the line's operands and
|
|
@@ -78,6 +85,7 @@ export function foldStatements(src) {
|
|
|
78
85
|
for (let i = from; i < text.length; i++) {
|
|
79
86
|
const c = text[i];
|
|
80
87
|
if (o.quoted) { o.st.field += c; if (c === "'") o.quoted = false; continue; }
|
|
88
|
+
if (c === "'" && attributeReference(text, i)) { o.st.field += c; continue; }
|
|
81
89
|
if (c === "'") { o.quoted = true; o.st.field += c; continue; }
|
|
82
90
|
if (c === ' ' || c === '\t') {
|
|
83
91
|
o.reading = o.st.field.endsWith(',');
|
package/lib/capabilities.mjs
CHANGED
|
@@ -17,8 +17,8 @@ export const CAPABILITIES_SCHEMA_VERSION = 1;
|
|
|
17
17
|
|
|
18
18
|
// Each command, what it takes and what it writes.
|
|
19
19
|
export const COMMANDS = {
|
|
20
|
-
scan: { args: ['<path>'], options: ['--format', '--out', '--repos', '--only', '--quiet', '--full-trace', '--baseline', '--no-baseline', '--advisories', '--copylib', '--pds-export', '--evidence'], documents: ['cobolwork', 'sarif'] },
|
|
21
|
-
flow: { args: ['<path>'], options: ['--out', '--repos', '--quiet', '--full-trace', '--baseline', '--no-baseline', '--copylib', '--evidence'], documents: ['cobolwork-flow'] },
|
|
20
|
+
scan: { args: ['<path>'], options: ['--format', '--out', '--repos', '--only', '--quiet', '--full-trace', '--all-routes', '--baseline', '--no-baseline', '--advisories', '--copylib', '--pds-export', '--evidence'], documents: ['cobolwork', 'sarif'] },
|
|
21
|
+
flow: { args: ['<path>'], options: ['--out', '--repos', '--quiet', '--full-trace', '--all-routes', '--baseline', '--no-baseline', '--copylib', '--evidence'], documents: ['cobolwork-flow'] },
|
|
22
22
|
inventory: { args: ['<path>'], options: ['--out', '--quiet', '--copylib', '--evidence'], documents: ['cobolwork-inventory'] },
|
|
23
23
|
parse: { args: ['<file>'], options: ['--out'], documents: ['cobolwork-parse'] },
|
|
24
24
|
sbom: { args: ['<path>'], options: ['--name', '--out', '--quiet', '--copylib', '--evidence'], documents: ['cyclonedx'] },
|
package/lib/cics-commands.mjs
CHANGED
|
@@ -11,72 +11,338 @@
|
|
|
11
11
|
// defaults to, named from another option's argument (defaults).
|
|
12
12
|
export const CICS_COMMANDS = {
|
|
13
13
|
"ABEND": {"options":{"ABCODE":"sends"}},
|
|
14
|
-
"ADDRESS": {
|
|
14
|
+
"ADDRESS": {
|
|
15
|
+
"options": {
|
|
16
|
+
"ACEE": "receives", "COMMAREA": "receives", "CWA": "receives", "EIB": "receives",
|
|
17
|
+
"TCTUA": "receives", "TWA": "receives",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
15
20
|
"ADDRESS SET": {"identify":["SET"],"options":{"SET":"receives","USING":"sends"}},
|
|
16
21
|
"ASKTIME": {"options":{"ABSTIME":"receives"}},
|
|
17
|
-
"ASSIGN": {
|
|
22
|
+
"ASSIGN": {
|
|
23
|
+
"options": {
|
|
24
|
+
"ABCODE": "receives", "MAPLINE": "receives", "ABDUMP": "receives", "MAPWIDTH": "receives",
|
|
25
|
+
"ABOFFSET": "receives", "MICROVERSION": "receives", "ABPROGRAM": "receives",
|
|
26
|
+
"MINORVERSION": "receives", "ACTIVITY": "receives", "MSRCONTROL": "receives",
|
|
27
|
+
"ACTIVITYID": "receives", "NATLANGINUSE": "receives", "ALTSCRNHT": "receives",
|
|
28
|
+
"NETNAME": "receives", "ALTSCRNWD": "receives", "NEXTTRANSID": "receives", "APLKYBD": "receives",
|
|
29
|
+
"NUMTAB": "receives", "APLTEXT": "receives", "OPCLASS": "receives", "APPLICATION": "receives",
|
|
30
|
+
"OPERATION": "receives", "APPLID": "receives", "OPERKEYS": "receives", "ASRAINTRPT": "receives",
|
|
31
|
+
"OPID": "receives", "ASRAKEY": "receives", "OPSECURITY": "receives", "ASRAPSW": "receives",
|
|
32
|
+
"ORGABCODE": "receives", "ASRAPSW16": "receives", "OUTLINE": "receives", "ASRAREGS": "receives",
|
|
33
|
+
"PAGENUM": "receives", "ASRAREGS64": "receives", "PARTNPAGE": "receives", "ASRASPC": "receives",
|
|
34
|
+
"PARTNS": "receives", "ASRASTG": "receives", "PARTNSET": "receives", "BRIDGE": "receives",
|
|
35
|
+
"PLATFORM": "receives", "BTRANS": "receives", "PRINSYSID": "receives", "CHANNEL": "receives",
|
|
36
|
+
"PROCESS": "receives", "CMDSEC": "receives", "PROCESSTYPE": "receives", "COLOR": "receives",
|
|
37
|
+
"PROGRAM": "receives", "CWALENG": "receives", "PS": "receives", "DEFSCRNHT": "receives",
|
|
38
|
+
"QNAME": "receives", "DEFSCRNWD": "receives", "RESSEC": "receives", "DELIMITER": "receives",
|
|
39
|
+
"RESTART": "receives", "DESTCOUNT": "receives", "RETURNPROG": "receives", "DESTID": "receives",
|
|
40
|
+
"SCRNHT": "receives", "DESTIDLENG": "receives", "SCRNWD": "receives", "DSSCS": "receives",
|
|
41
|
+
"SIGDATA": "receives", "DS3270": "receives", "SOSI": "receives", "ERRORMSG": "receives",
|
|
42
|
+
"STARTCODE": "receives", "ERRORMSGLEN": "receives", "STATIONID": "receives",
|
|
43
|
+
"EWASUPP": "receives", "SYSID": "receives", "EXTDS": "receives", "TASKPRIORITY": "receives",
|
|
44
|
+
"FACILITY": "receives", "TCTUALENG": "receives", "FCI": "receives", "TELLERID": "receives",
|
|
45
|
+
"GCHARS": "receives", "TERMCODE": "receives", "GCODES": "receives", "TERMPRIORITY": "receives",
|
|
46
|
+
"GMMI": "receives", "TEXTKYBD": "receives", "HILIGHT": "receives", "TEXTPRINT": "receives",
|
|
47
|
+
"INITPARM": "receives", "TRANPRIORITY": "receives", "INITPARMLEN": "receives",
|
|
48
|
+
"TWALENG": "receives", "INPARTN": "receives", "UNATTEND": "receives", "INPUTMSGLEN": "receives",
|
|
49
|
+
"USERID": "receives", "INVOKINGPROG": "receives", "USERNAME": "receives", "KATAKANA": "receives",
|
|
50
|
+
"USERPRIORITY": "receives", "LANGINUSE": "receives", "VALIDATION": "receives",
|
|
51
|
+
"LDCMNEM": "receives", "LDCNUM": "receives", "LINKLEVEL": "receives", "MAJORVERSION": "receives",
|
|
52
|
+
"MAPCOLUMN": "receives", "MAPHEIGHT": "receives",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
18
55
|
"BIF DEEDIT": {"identify":["DEEDIT"],"options":{"FIELD":"both","LENGTH":"sends"}},
|
|
19
56
|
"CANCEL": {"options":{"REQID":"sends","SYSID":"sends","TRANSID":"sends"}},
|
|
20
|
-
"DEFINE COUNTER": {
|
|
21
|
-
|
|
22
|
-
|
|
57
|
+
"DEFINE COUNTER": {
|
|
58
|
+
"identify": ["COUNTER","DCOUNTER"],
|
|
59
|
+
"options": {
|
|
60
|
+
"COUNTER": "sends", "POOL": "sends", "VALUE": "sends", "MINIMUM": "sends", "MAXIMUM": "sends",
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
"DELAY": {
|
|
64
|
+
"options": {
|
|
65
|
+
"INTERVAL": "sends", "TIME": "sends", "REQID": "sends", "HOURS": "sends", "MINUTES": "sends",
|
|
66
|
+
"SECONDS": "sends", "MILLISECS": "sends",
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
"DELETE": {
|
|
70
|
+
"options": {
|
|
71
|
+
"FILE": "sends", "TOKEN": "sends", "RIDFLD": "sends", "KEYLENGTH": "sends", "NUMREC": "receives",
|
|
72
|
+
"SYSID": "sends",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
23
75
|
"DELETE CONTAINER": {"identify":["CONTAINER"],"options":{"CONTAINER":"sends","CHANNEL":"sends"}},
|
|
24
|
-
"DELETE COUNTER": {
|
|
76
|
+
"DELETE COUNTER": {
|
|
77
|
+
"identify": ["COUNTER","DCOUNTER"],
|
|
78
|
+
"options": {
|
|
79
|
+
"COUNTER": "sends", "POOL": "sends",
|
|
80
|
+
},
|
|
81
|
+
},
|
|
25
82
|
"DELETEQ TD": {"identify":["TD"],"options":{"QUEUE":"sends","SYSID":"sends"}},
|
|
26
|
-
"DELETEQ TS": {
|
|
83
|
+
"DELETEQ TS": {
|
|
84
|
+
"identify": ["TS"],
|
|
85
|
+
"default": true,
|
|
86
|
+
"options": {
|
|
87
|
+
"QUEUE": "sends", "QNAME": "sends", "SYSID": "sends",
|
|
88
|
+
},
|
|
89
|
+
},
|
|
27
90
|
"DEQ": {"options":{"RESOURCE":"sends","LENGTH":"sends","MAXLIFETIME":"sends"}},
|
|
28
|
-
"DUMP TRANSACTION": {
|
|
91
|
+
"DUMP TRANSACTION": {
|
|
92
|
+
"identify": ["TRANSACTION"],
|
|
93
|
+
"options": {
|
|
94
|
+
"DUMPCODE": "sends", "FROM": "sends", "LENGTH": "sends", "FLENGTH": "sends",
|
|
95
|
+
"SEGMENTLIST": "sends", "LENGTHLIST": "sends", "NUMSEGMENTS": "sends", "DUMPID": "receives",
|
|
96
|
+
},
|
|
97
|
+
},
|
|
29
98
|
"ENDBR": {"options":{"FILE":"sends","REQID":"sends","SYSID":"sends"}},
|
|
30
99
|
"ENQ": {"options":{"RESOURCE":"sends","LENGTH":"sends","MAXLIFETIME":"sends"}},
|
|
31
|
-
"ENTER TRACENUM": {
|
|
32
|
-
|
|
100
|
+
"ENTER TRACENUM": {
|
|
101
|
+
"identify": ["TRACENUM"],
|
|
102
|
+
"options": {
|
|
103
|
+
"TRACENUM": "sends", "FROM": "sends", "RESOURCE": "sends", "FROMLENGTH": "sends",
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
"FORMATTIME": {
|
|
107
|
+
"options": {
|
|
108
|
+
"DATESTRING": "receives", "ABSTIME": "sends", "DATE": "receives", "FULLDATE": "receives",
|
|
109
|
+
"DATEFORM": "receives", "DATESEP": "sends", "DAYCOUNT": "receives", "STRINGZONE": "sends",
|
|
110
|
+
"DAYOFMONTH": "receives", "DAYOFWEEK": "receives", "DDMMYY": "receives", "DDMMYYYY": "receives",
|
|
111
|
+
"MILLISECONDS": "receives", "MMDDYY": "receives", "MMDDYYYY": "receives",
|
|
112
|
+
"MONTHOFYEAR": "receives", "STRINGFORMAT": "sends", "TIME": "receives", "YEAR": "receives",
|
|
113
|
+
"YYDDD": "receives", "TIMESEP": "sends", "YYDDMM": "receives", "YYMMDD": "receives",
|
|
114
|
+
"YYYYDDD": "receives", "YYYYDDMM": "receives", "YYYYMMDD": "receives",
|
|
115
|
+
},
|
|
116
|
+
},
|
|
33
117
|
"FREEMAIN": {"options":{"DATA":"sends","DATAPOINTER":"sends"}},
|
|
34
|
-
"GET CONTAINER": {
|
|
35
|
-
|
|
118
|
+
"GET CONTAINER": {
|
|
119
|
+
"identify": ["CONTAINER"],
|
|
120
|
+
"options": {
|
|
121
|
+
"CONTAINER": "sends", "CHANNEL": "sends", "INTO": "receives", "FLENGTH": "both",
|
|
122
|
+
"SET": "receives", "BYTEOFFSET": "sends", "INTOCCSID": "sends", "INTOCODEPAGE": "sends",
|
|
123
|
+
"CONVERTST": "sends", "CCSID": "receives",
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
"GET COUNTER": {
|
|
127
|
+
"identify": ["COUNTER","DCOUNTER"],
|
|
128
|
+
"options": {
|
|
129
|
+
"COUNTER": "sends", "VALUE": "receives", "POOL": "sends", "INCREMENT": "sends",
|
|
130
|
+
"COMPAREMIN": "sends", "COMPAREMAX": "sends",
|
|
131
|
+
},
|
|
132
|
+
},
|
|
36
133
|
"GETMAIN": {"options":{"SET":"receives","FLENGTH":"sends","LENGTH":"sends","INITIMG":"sends"}},
|
|
37
134
|
"HANDLE ABEND": {"identify":["ABEND"],"options":{"PROGRAM":"sends","LABEL":"label"}},
|
|
38
135
|
"HANDLE AID": {"identify":["AID"],"anyOption":"label","options":{}},
|
|
39
136
|
"HANDLE CONDITION": {"identify":["CONDITION"],"anyOption":"label","options":{}},
|
|
40
137
|
"IGNORE CONDITION": {"identify":["CONDITION"],"anyOption":"none","options":{}},
|
|
41
|
-
"LINK": {
|
|
42
|
-
|
|
138
|
+
"LINK": {
|
|
139
|
+
"options": {
|
|
140
|
+
"PROGRAM": "sends", "COMMAREA": "both", "CHANNEL": "sends", "LENGTH": "sends",
|
|
141
|
+
"DATALENGTH": "sends", "INPUTMSG": "sends", "INPUTMSGLEN": "sends", "SYSID": "sends",
|
|
142
|
+
"TRANSID": "sends",
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
"LOAD": {
|
|
146
|
+
"options": {
|
|
147
|
+
"PROGRAM": "sends", "SET": "receives", "LENGTH": "receives", "FLENGTH": "receives",
|
|
148
|
+
"ENTRY": "receives",
|
|
149
|
+
},
|
|
150
|
+
},
|
|
43
151
|
"POP HANDLE": {"identify":["HANDLE"],"options":{}},
|
|
44
152
|
"PURGE MESSAGE": {"identify":["MESSAGE"],"options":{}},
|
|
45
153
|
"PUSH HANDLE": {"identify":["HANDLE"],"options":{}},
|
|
46
|
-
"PUT CONTAINER": {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
|
|
154
|
+
"PUT CONTAINER": {
|
|
155
|
+
"identify": ["CONTAINER"],
|
|
156
|
+
"options": {
|
|
157
|
+
"CONTAINER": "sends", "FROM": "sends", "CHANNEL": "sends", "FLENGTH": "sends",
|
|
158
|
+
"DATATYPE": "sends", "FROMCCSID": "sends", "FROMCODEPAGE": "sends",
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
"QUERY COUNTER": {
|
|
162
|
+
"identify": ["COUNTER","DCOUNTER"],
|
|
163
|
+
"options": {
|
|
164
|
+
"COUNTER": "sends", "POOL": "sends", "VALUE": "receives", "MINIMUM": "receives",
|
|
165
|
+
"MAXIMUM": "receives",
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
"READ": {
|
|
169
|
+
"options": {
|
|
170
|
+
"FILE": "sends", "INTO": "receives", "SET": "receives", "TOKEN": "receives", "RIDFLD": "both",
|
|
171
|
+
"KEYLENGTH": "sends", "SYSID": "sends", "LENGTH": "both",
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
"READNEXT": {
|
|
175
|
+
"options": {
|
|
176
|
+
"FILE": "sends", "INTO": "receives", "SET": "receives", "TOKEN": "receives", "RIDFLD": "both",
|
|
177
|
+
"KEYLENGTH": "sends", "REQID": "sends", "SYSID": "sends", "LENGTH": "both",
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
"READPREV": {
|
|
181
|
+
"options": {
|
|
182
|
+
"FILE": "sends", "INTO": "receives", "SET": "receives", "TOKEN": "receives", "RIDFLD": "both",
|
|
183
|
+
"KEYLENGTH": "sends", "REQID": "sends", "LENGTH": "both", "SYSID": "sends",
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
"READQ TD": {
|
|
187
|
+
"identify": ["TD"],
|
|
188
|
+
"options": {
|
|
189
|
+
"QUEUE": "sends", "INTO": "receives", "SET": "receives", "LENGTH": "both", "SYSID": "sends",
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
"READQ TS": {
|
|
193
|
+
"identify": ["TS"],
|
|
194
|
+
"default": true,
|
|
195
|
+
"options": {
|
|
196
|
+
"QUEUE": "sends", "QNAME": "sends", "INTO": "receives", "SET": "receives", "LENGTH": "both",
|
|
197
|
+
"NUMITEMS": "receives", "ITEM": "sends", "SYSID": "sends",
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
"RECEIVE": {
|
|
201
|
+
"options": {
|
|
202
|
+
"INTO": "receives", "SET": "receives", "LENGTH": "both", "FLENGTH": "both", "MAXLENGTH": "sends",
|
|
203
|
+
"MAXFLENGTH": "sends",
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
"RECEIVE MAP": {
|
|
207
|
+
"identify": ["MAP"],
|
|
208
|
+
"options": {
|
|
209
|
+
"MAP": "sends", "MAPSET": "sends", "INTO": "receives", "SET": "receives", "FROM": "sends",
|
|
210
|
+
"LENGTH": "sends", "INPARTN": "sends",
|
|
211
|
+
},
|
|
212
|
+
"defaults": {"INTO":{"name":"MAP","suffix":"I","unless":["SET"]}},
|
|
213
|
+
},
|
|
55
214
|
"RELEASE": {"options":{"PROGRAM":"sends"}},
|
|
56
|
-
"RESETBR": {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
215
|
+
"RESETBR": {
|
|
216
|
+
"options": {
|
|
217
|
+
"FILE": "sends", "RIDFLD": "sends", "KEYLENGTH": "sends", "REQID": "sends", "SYSID": "sends",
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
"RETRIEVE": {
|
|
221
|
+
"options": {
|
|
222
|
+
"INTO": "receives", "SET": "receives", "LENGTH": "both", "RTRANSID": "receives",
|
|
223
|
+
"RTERMID": "receives", "QUEUE": "receives",
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
"RETURN": {
|
|
227
|
+
"options": {
|
|
228
|
+
"TRANSID": "sends", "COMMAREA": "sends", "LENGTH": "sends", "CHANNEL": "sends",
|
|
229
|
+
"INPUTMSG": "sends", "INPUTMSGLEN": "sends",
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
"REWIND COUNTER": {
|
|
233
|
+
"identify": ["COUNTER","DCOUNTER"],
|
|
234
|
+
"options": {
|
|
235
|
+
"COUNTER": "sends", "POOL": "sends", "INCREMENT": "sends",
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
"REWRITE": {
|
|
239
|
+
"options": {
|
|
240
|
+
"FILE": "sends", "FROM": "sends", "TOKEN": "sends", "SYSID": "sends", "LENGTH": "sends",
|
|
241
|
+
},
|
|
242
|
+
},
|
|
61
243
|
"SEND": {"options":{"FROM":"sends","LENGTH":"sends","FLENGTH":"sends"}},
|
|
62
|
-
"SEND CONTROL": {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
244
|
+
"SEND CONTROL": {
|
|
245
|
+
"identify": ["CONTROL"],
|
|
246
|
+
"options": {
|
|
247
|
+
"CURSOR": "sends", "MSR": "sends", "OUTPARTN": "sends", "ACTPARTN": "sends", "LDC": "sends",
|
|
248
|
+
"SET": "receives", "REQID": "sends",
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
"SEND MAP": {
|
|
252
|
+
"identify": ["MAP"],
|
|
253
|
+
"options": {
|
|
254
|
+
"MAP": "sends", "MAPSET": "sends", "FROM": "sends", "LENGTH": "sends", "MSR": "sends",
|
|
255
|
+
"FMHPARM": "sends", "OUTPARTN": "sends", "ACTPARTN": "sends", "LDC": "sends", "SET": "receives",
|
|
256
|
+
"REQID": "sends", "CURSOR": "sends",
|
|
257
|
+
},
|
|
258
|
+
"defaults": {"FROM":{"name":"MAP","suffix":"O","unless":["MAPONLY"]}},
|
|
259
|
+
},
|
|
260
|
+
"SEND PAGE": {
|
|
261
|
+
"identify": ["PAGE"],
|
|
262
|
+
"options": {
|
|
263
|
+
"TRANSID": "sends", "TRAILER": "sends", "SET": "receives", "FMHPARM": "sends",
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
"SEND TEXT": {
|
|
267
|
+
"identify": ["TEXT"],
|
|
268
|
+
"options": {
|
|
269
|
+
"FROM": "sends", "LENGTH": "sends", "CURSOR": "sends", "FMHPARM": "sends", "OUTPARTN": "sends",
|
|
270
|
+
"ACTPARTN": "sends", "MSR": "sends", "LDC": "sends", "SET": "receives", "REQID": "sends",
|
|
271
|
+
"HEADER": "sends", "TRAILER": "sends", "JUSTIFY": "sends",
|
|
272
|
+
},
|
|
273
|
+
},
|
|
66
274
|
"SIGNOFF": {"options":{}},
|
|
67
|
-
"SIGNON": {
|
|
68
|
-
|
|
69
|
-
|
|
275
|
+
"SIGNON": {
|
|
276
|
+
"options": {
|
|
277
|
+
"USERID": "sends", "ESMREASON": "receives", "ESMRESP": "receives", "GROUPID": "sends",
|
|
278
|
+
"LANGUAGECODE": "sends", "NATLANG": "sends", "LANGINUSE": "receives", "NATLANGINUSE": "receives",
|
|
279
|
+
"PASSWORD": "sends", "NEWPASSWORD": "sends", "PHRASE": "sends", "PHRASELEN": "sends",
|
|
280
|
+
"NEWPHRASE": "sends", "NEWPHRASELEN": "sends", "OIDCARD": "sends",
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
"START": {
|
|
284
|
+
"options": {
|
|
285
|
+
"TRANSID": "sends", "INTERVAL": "sends", "TIME": "sends", "REQID": "sends", "HOURS": "sends",
|
|
286
|
+
"MINUTES": "sends", "SECONDS": "sends", "FROM": "sends", "LENGTH": "sends", "TERMID": "sends",
|
|
287
|
+
"USERID": "sends", "SYSID": "sends", "RTRANSID": "sends", "RTERMID": "sends", "QUEUE": "sends",
|
|
288
|
+
},
|
|
289
|
+
},
|
|
290
|
+
"STARTBR": {
|
|
291
|
+
"options": {
|
|
292
|
+
"FILE": "sends", "RIDFLD": "sends", "KEYLENGTH": "sends", "REQID": "sends", "SYSID": "sends",
|
|
293
|
+
},
|
|
294
|
+
},
|
|
70
295
|
"SYNCPOINT": {"options":{}},
|
|
71
296
|
"SYNCPOINT ROLLBACK": {"identify":["ROLLBACK"],"options":{}},
|
|
72
297
|
"UNLOCK": {"options":{"FILE":"sends","TOKEN":"sends","SYSID":"sends"}},
|
|
73
|
-
"UPDATE COUNTER": {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
298
|
+
"UPDATE COUNTER": {
|
|
299
|
+
"identify": ["COUNTER","DCOUNTER"],
|
|
300
|
+
"options": {
|
|
301
|
+
"COUNTER": "sends", "VALUE": "sends", "POOL": "sends", "COMPAREMIN": "sends",
|
|
302
|
+
"COMPAREMAX": "sends",
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
"WRITE": {
|
|
306
|
+
"options": {
|
|
307
|
+
"FILE": "sends", "FROM": "sends", "RIDFLD": "both", "KEYLENGTH": "sends", "SYSID": "sends",
|
|
308
|
+
"LENGTH": "sends",
|
|
309
|
+
},
|
|
310
|
+
},
|
|
311
|
+
"WRITE JOURNALNAME": {
|
|
312
|
+
"identify": ["JOURNALNAME"],
|
|
313
|
+
"options": {
|
|
314
|
+
"JOURNALNAME": "sends", "JTYPEID": "sends", "FROM": "sends", "FLENGTH": "sends",
|
|
315
|
+
"REQID": "receives", "PREFIX": "sends", "PFXLENG": "sends",
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
"WRITE OPERATOR": {
|
|
319
|
+
"identify": ["OPERATOR"],
|
|
320
|
+
"options": {
|
|
321
|
+
"TEXT": "sends", "TEXTLENGTH": "sends", "ROUTECODES": "sends", "NUMROUTES": "sends",
|
|
322
|
+
"ACTION": "sends", "REPLY": "receives", "MAXLENGTH": "sends", "REPLYLENGTH": "receives",
|
|
323
|
+
"TIMEOUT": "sends",
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
"WRITEQ TD": {
|
|
327
|
+
"identify": ["TD"],
|
|
328
|
+
"options": {
|
|
329
|
+
"QUEUE": "sends", "FROM": "sends", "LENGTH": "sends", "SYSID": "sends",
|
|
330
|
+
},
|
|
331
|
+
},
|
|
332
|
+
"WRITEQ TS": {
|
|
333
|
+
"identify": ["TS"],
|
|
334
|
+
"default": true,
|
|
335
|
+
"options": {
|
|
336
|
+
"QUEUE": "sends", "QNAME": "sends", "FROM": "sends", "LENGTH": "sends", "NUMITEMS": "receives",
|
|
337
|
+
"ITEM": "both", "SYSID": "sends",
|
|
338
|
+
},
|
|
339
|
+
},
|
|
340
|
+
"XCTL": {
|
|
341
|
+
"options": {
|
|
342
|
+
"PROGRAM": "sends", "COMMAREA": "sends", "CHANNEL": "sends", "LENGTH": "sends",
|
|
343
|
+
"INPUTMSG": "sends", "INPUTMSGLEN": "sends",
|
|
344
|
+
},
|
|
345
|
+
},
|
|
80
346
|
};
|
|
81
347
|
|
|
82
348
|
// Options any command may carry.
|
package/lib/consequence.mjs
CHANGED
|
@@ -118,6 +118,25 @@ const RULE_CLASSES = {
|
|
|
118
118
|
'zowe-config-cleartext': [],
|
|
119
119
|
'zowe-mcp-data-marking-off': [],
|
|
120
120
|
'zowe-mcp-unpinned': [],
|
|
121
|
+
// An abend stops the run; an overrun or a protection exception is a write that landed, or would
|
|
122
|
+
// have landed, where the input chose.
|
|
123
|
+
'input-causes-abend-s0c7': [],
|
|
124
|
+
'input-causes-abend': [],
|
|
125
|
+
'input-causes-abend-s0c4': [MUTATES],
|
|
126
|
+
'input-causes-abend-subscript-range': [MUTATES],
|
|
127
|
+
// Key zero or supervisor state is the operating system's authority, taken by the code itself.
|
|
128
|
+
'hlasm-supervisor-state-change': [ESCALATES],
|
|
129
|
+
// Nothing says input reaches EX's register, or which address space a cross-memory call reaches:
|
|
130
|
+
// the linkage tables grant that, and the source does not show them. Severity decides.
|
|
131
|
+
'hlasm-executes-built-instruction': [],
|
|
132
|
+
'hlasm-cross-memory-service': [],
|
|
133
|
+
// Disclosure in transit; severity decides.
|
|
134
|
+
'web-client-opens-cleartext': [],
|
|
135
|
+
'web-receive-length-exceeds-area': [MUTATES],
|
|
136
|
+
// Weak cryptography discloses or lets data be changed undetected; severity decides.
|
|
137
|
+
'icsf-single-length-des-key': [],
|
|
138
|
+
'icsf-weak-hash': [],
|
|
139
|
+
'icsf-fixed-initialization-vector': [],
|
|
121
140
|
};
|
|
122
141
|
|
|
123
142
|
// Coverage and context assert no defect, so they carry no consequence.
|