@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
|
@@ -1649,6 +1649,162 @@
|
|
|
1649
1649
|
"quote": "Check the validity of the following information inputs"
|
|
1650
1650
|
}
|
|
1651
1651
|
},
|
|
1652
|
+
{
|
|
1653
|
+
"kind": "compliance",
|
|
1654
|
+
"ruleId": "hlasm-calls-security-product",
|
|
1655
|
+
"framework": "nist-800-53r5",
|
|
1656
|
+
"clause": "CM-8",
|
|
1657
|
+
"title": "System Component Inventory",
|
|
1658
|
+
"rationale": "The rule reports: Assembler source calls the security product directly. That is a component the inventory does not accurately account for, which this control requires be documented.",
|
|
1659
|
+
"source": {
|
|
1660
|
+
"doc": "nist80053",
|
|
1661
|
+
"retrieved": "2026-09-20",
|
|
1662
|
+
"quote": "Develop and document an inventory of system components"
|
|
1663
|
+
}
|
|
1664
|
+
},
|
|
1665
|
+
{
|
|
1666
|
+
"kind": "compliance",
|
|
1667
|
+
"ruleId": "hlasm-cross-memory-service",
|
|
1668
|
+
"framework": "nist-800-53r5",
|
|
1669
|
+
"clause": "AC-6",
|
|
1670
|
+
"title": "Least Privilege",
|
|
1671
|
+
"rationale": "The rule reports: Assembler source uses a cross-memory instruction, reaching another address space or another authority. That is authority granted or exercised beyond what the task requires, which this control exists to prevent.",
|
|
1672
|
+
"source": {
|
|
1673
|
+
"doc": "nist80053",
|
|
1674
|
+
"retrieved": "2026-09-20",
|
|
1675
|
+
"quote": "Employ the principle of least privilege, allowing only authorized accesses for users (or processes acting on behalf of users) that are necessary to accomplish assigned organizational tasks."
|
|
1676
|
+
}
|
|
1677
|
+
},
|
|
1678
|
+
{
|
|
1679
|
+
"kind": "compliance",
|
|
1680
|
+
"ruleId": "hlasm-executes-built-instruction",
|
|
1681
|
+
"framework": "nist-800-53r5",
|
|
1682
|
+
"clause": "SI-10",
|
|
1683
|
+
"title": "Information Input Validation",
|
|
1684
|
+
"rationale": "The rule reports: Assembler source runs an instruction whose length or mask comes from a register at run time. That is an information input reaching an operation without its validity having been checked, which is what this control requires.",
|
|
1685
|
+
"source": {
|
|
1686
|
+
"doc": "nist80053",
|
|
1687
|
+
"retrieved": "2026-09-20",
|
|
1688
|
+
"quote": "Check the validity of the following information inputs"
|
|
1689
|
+
}
|
|
1690
|
+
},
|
|
1691
|
+
{
|
|
1692
|
+
"kind": "compliance",
|
|
1693
|
+
"ruleId": "hlasm-provides-called-module",
|
|
1694
|
+
"framework": "nist-800-53r5",
|
|
1695
|
+
"clause": "CM-8",
|
|
1696
|
+
"title": "System Component Inventory",
|
|
1697
|
+
"rationale": "The rule reports: An assembler CSECT or ENTRY is a module a COBOL program in this tree CALLs. That is a component the inventory does not accurately account for, which this control requires be documented.",
|
|
1698
|
+
"source": {
|
|
1699
|
+
"doc": "nist80053",
|
|
1700
|
+
"retrieved": "2026-09-20",
|
|
1701
|
+
"quote": "Develop and document an inventory of system components"
|
|
1702
|
+
}
|
|
1703
|
+
},
|
|
1704
|
+
{
|
|
1705
|
+
"kind": "compliance",
|
|
1706
|
+
"ruleId": "hlasm-supervisor-state-change",
|
|
1707
|
+
"framework": "nist-800-53r5",
|
|
1708
|
+
"clause": "AC-6",
|
|
1709
|
+
"title": "Least Privilege",
|
|
1710
|
+
"rationale": "The rule reports: Assembler source switches to PSW key zero or supervisor state. That is authority granted or exercised beyond what the task requires, which this control exists to prevent.",
|
|
1711
|
+
"source": {
|
|
1712
|
+
"doc": "nist80053",
|
|
1713
|
+
"retrieved": "2026-09-20",
|
|
1714
|
+
"quote": "Employ the principle of least privilege, allowing only authorized accesses for users (or processes acting on behalf of users) that are necessary to accomplish assigned organizational tasks."
|
|
1715
|
+
}
|
|
1716
|
+
},
|
|
1717
|
+
{
|
|
1718
|
+
"kind": "compliance",
|
|
1719
|
+
"ruleId": "icsf-fixed-initialization-vector",
|
|
1720
|
+
"framework": "nist-800-53r5",
|
|
1721
|
+
"clause": "SC-13",
|
|
1722
|
+
"title": "Cryptographic Protection",
|
|
1723
|
+
"rationale": "The rule reports: A program enciphers through ICSF with an initialization vector that never changes. That is cryptography too weak for the use it is put to, which this control requires be chosen for each use and implemented.",
|
|
1724
|
+
"source": {
|
|
1725
|
+
"doc": "nist80053",
|
|
1726
|
+
"retrieved": "2026-09-20",
|
|
1727
|
+
"quote": "Implement the following types of cryptography required for each specified cryptographic use"
|
|
1728
|
+
}
|
|
1729
|
+
},
|
|
1730
|
+
{
|
|
1731
|
+
"kind": "compliance",
|
|
1732
|
+
"ruleId": "icsf-single-length-des-key",
|
|
1733
|
+
"framework": "nist-800-53r5",
|
|
1734
|
+
"clause": "SC-13",
|
|
1735
|
+
"title": "Cryptographic Protection",
|
|
1736
|
+
"rationale": "The rule reports: A program generates a single-length DES key through ICSF. That is cryptography too weak for the use it is put to, which this control requires be chosen for each use and implemented.",
|
|
1737
|
+
"source": {
|
|
1738
|
+
"doc": "nist80053",
|
|
1739
|
+
"retrieved": "2026-09-20",
|
|
1740
|
+
"quote": "Implement the following types of cryptography required for each specified cryptographic use"
|
|
1741
|
+
}
|
|
1742
|
+
},
|
|
1743
|
+
{
|
|
1744
|
+
"kind": "compliance",
|
|
1745
|
+
"ruleId": "icsf-weak-hash",
|
|
1746
|
+
"framework": "nist-800-53r5",
|
|
1747
|
+
"clause": "SC-13",
|
|
1748
|
+
"title": "Cryptographic Protection",
|
|
1749
|
+
"rationale": "The rule reports: A program hashes with MD5 or SHA-1 through ICSF. That is cryptography too weak for the use it is put to, which this control requires be chosen for each use and implemented.",
|
|
1750
|
+
"source": {
|
|
1751
|
+
"doc": "nist80053",
|
|
1752
|
+
"retrieved": "2026-09-20",
|
|
1753
|
+
"quote": "Implement the following types of cryptography required for each specified cryptographic use"
|
|
1754
|
+
}
|
|
1755
|
+
},
|
|
1756
|
+
{
|
|
1757
|
+
"kind": "compliance",
|
|
1758
|
+
"ruleId": "input-causes-abend",
|
|
1759
|
+
"framework": "nist-800-53r5",
|
|
1760
|
+
"clause": "SI-10",
|
|
1761
|
+
"title": "Information Input Validation",
|
|
1762
|
+
"rationale": "The rule reports: An input the program accepts ends its run with an abend. That is an information input reaching an operation without its validity having been checked, which is what this control requires.",
|
|
1763
|
+
"source": {
|
|
1764
|
+
"doc": "nist80053",
|
|
1765
|
+
"retrieved": "2026-09-20",
|
|
1766
|
+
"quote": "Check the validity of the following information inputs"
|
|
1767
|
+
}
|
|
1768
|
+
},
|
|
1769
|
+
{
|
|
1770
|
+
"kind": "compliance",
|
|
1771
|
+
"ruleId": "input-causes-abend-s0c4",
|
|
1772
|
+
"framework": "nist-800-53r5",
|
|
1773
|
+
"clause": "SI-10",
|
|
1774
|
+
"title": "Information Input Validation",
|
|
1775
|
+
"rationale": "The rule reports: An input the program accepts ends its run with a protection exception (S0C4). That is an information input reaching an operation without its validity having been checked, which is what this control requires.",
|
|
1776
|
+
"source": {
|
|
1777
|
+
"doc": "nist80053",
|
|
1778
|
+
"retrieved": "2026-09-20",
|
|
1779
|
+
"quote": "Check the validity of the following information inputs"
|
|
1780
|
+
}
|
|
1781
|
+
},
|
|
1782
|
+
{
|
|
1783
|
+
"kind": "compliance",
|
|
1784
|
+
"ruleId": "input-causes-abend-s0c7",
|
|
1785
|
+
"framework": "nist-800-53r5",
|
|
1786
|
+
"clause": "SI-10",
|
|
1787
|
+
"title": "Information Input Validation",
|
|
1788
|
+
"rationale": "The rule reports: An input the program accepts ends its run with a data exception (S0C7). That is an information input reaching an operation without its validity having been checked, which is what this control requires.",
|
|
1789
|
+
"source": {
|
|
1790
|
+
"doc": "nist80053",
|
|
1791
|
+
"retrieved": "2026-09-20",
|
|
1792
|
+
"quote": "Check the validity of the following information inputs"
|
|
1793
|
+
}
|
|
1794
|
+
},
|
|
1795
|
+
{
|
|
1796
|
+
"kind": "compliance",
|
|
1797
|
+
"ruleId": "input-causes-abend-subscript-range",
|
|
1798
|
+
"framework": "nist-800-53r5",
|
|
1799
|
+
"clause": "SI-10",
|
|
1800
|
+
"title": "Information Input Validation",
|
|
1801
|
+
"rationale": "The rule reports: An input the program accepts drives a subscript or reference modification out of range, and the run abends. That is an information input reaching an operation without its validity having been checked, which is what this control requires.",
|
|
1802
|
+
"source": {
|
|
1803
|
+
"doc": "nist80053",
|
|
1804
|
+
"retrieved": "2026-09-20",
|
|
1805
|
+
"quote": "Check the validity of the following information inputs"
|
|
1806
|
+
}
|
|
1807
|
+
},
|
|
1652
1808
|
{
|
|
1653
1809
|
"kind": "compliance",
|
|
1654
1810
|
"ruleId": "intermediate-result-loses-high-order-digits",
|
|
@@ -2117,6 +2273,19 @@
|
|
|
2117
2273
|
"quote": "Establishing initial authenticator content for any authenticators issued by the organization"
|
|
2118
2274
|
}
|
|
2119
2275
|
},
|
|
2276
|
+
{
|
|
2277
|
+
"kind": "compliance",
|
|
2278
|
+
"ruleId": "jcl-racf-new-password",
|
|
2279
|
+
"framework": "nist-800-53r5",
|
|
2280
|
+
"clause": "IA-5",
|
|
2281
|
+
"title": "Authenticator Management",
|
|
2282
|
+
"rationale": "The rule reports: Credential pattern: jcl racf new password. That is authenticator content established in a file rather than managed, which is what this control governs.",
|
|
2283
|
+
"source": {
|
|
2284
|
+
"doc": "nist80053",
|
|
2285
|
+
"retrieved": "2026-09-20",
|
|
2286
|
+
"quote": "Establishing initial authenticator content for any authenticators issued by the organization"
|
|
2287
|
+
}
|
|
2288
|
+
},
|
|
2120
2289
|
{
|
|
2121
2290
|
"kind": "compliance",
|
|
2122
2291
|
"ruleId": "job-loads-from-an-authorised-library",
|
|
@@ -2442,6 +2611,19 @@
|
|
|
2442
2611
|
"quote": "Employ the principle of least privilege, allowing only authorized accesses for users (or processes acting on behalf of users) that are necessary to accomplish assigned organizational tasks."
|
|
2443
2612
|
}
|
|
2444
2613
|
},
|
|
2614
|
+
{
|
|
2615
|
+
"kind": "compliance",
|
|
2616
|
+
"ruleId": "web-client-opens-cleartext",
|
|
2617
|
+
"framework": "nist-800-53r5",
|
|
2618
|
+
"clause": "SC-8",
|
|
2619
|
+
"title": "Transmission Confidentiality and Integrity",
|
|
2620
|
+
"rationale": "The rule reports: A program opens an outbound HTTP connection without TLS. That is information crossing a network with nothing protecting it, which this control requires be protected in transit.",
|
|
2621
|
+
"source": {
|
|
2622
|
+
"doc": "nist80053",
|
|
2623
|
+
"retrieved": "2026-09-20",
|
|
2624
|
+
"quote": "Protect the {{ insert: param, sc-08_odp }} of transmitted information."
|
|
2625
|
+
}
|
|
2626
|
+
},
|
|
2445
2627
|
{
|
|
2446
2628
|
"kind": "compliance",
|
|
2447
2629
|
"ruleId": "web-cookie-without-secure-attributes",
|
|
@@ -2468,6 +2650,19 @@
|
|
|
2468
2650
|
"quote": "Protect the authenticity of communications sessions."
|
|
2469
2651
|
}
|
|
2470
2652
|
},
|
|
2653
|
+
{
|
|
2654
|
+
"kind": "compliance",
|
|
2655
|
+
"ruleId": "web-receive-length-exceeds-area",
|
|
2656
|
+
"framework": "nist-800-53r5",
|
|
2657
|
+
"clause": "SI-10",
|
|
2658
|
+
"title": "Information Input Validation",
|
|
2659
|
+
"rationale": "The rule reports: A web receive lets CICS write more bytes than the area it writes into. That is an information input reaching an operation without its validity having been checked, which is what this control requires.",
|
|
2660
|
+
"source": {
|
|
2661
|
+
"doc": "nist80053",
|
|
2662
|
+
"retrieved": "2026-09-20",
|
|
2663
|
+
"quote": "Check the validity of the following information inputs"
|
|
2664
|
+
}
|
|
2665
|
+
},
|
|
2471
2666
|
{
|
|
2472
2667
|
"kind": "compliance",
|
|
2473
2668
|
"ruleId": "web-request-changes-state-without-a-token",
|
|
@@ -9,19 +9,29 @@ useDefault = false
|
|
|
9
9
|
[[rules]]
|
|
10
10
|
id = "jcl-racf-password"
|
|
11
11
|
description = "RACF password in a JCL statement (JOB card, EXEC PARM or DD)"
|
|
12
|
-
regex = '''(?im)^//[^*\n][^\n]*?\bPASSWORD=\(?([A-Z0-9@#$]{1,8})(?:[,)\s]|$)'''
|
|
12
|
+
regex = '''(?im)^//[^*\n][^\n]*?\bPASSWORD=\(?([A-Z0-9@#$]{1,8})(?:[,)'\s]|$)'''
|
|
13
13
|
secretGroup = 1
|
|
14
14
|
keywords = ["password="]
|
|
15
15
|
[rules.allowlist]
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
regexes = ['''(?i)^(?:x+|\*+|y+|n+|pass|passw(?:or)?d?|pwd|secret|dummy|changeme|password|newpass(?:word)?|oldpass(?:word)?)$''']
|
|
17
|
+
|
|
18
|
+
[[rules]]
|
|
19
|
+
id = "jcl-racf-new-password"
|
|
20
|
+
description = "New RACF password in a JCL PASSWORD=(old,new)"
|
|
21
|
+
regex = '''(?im)^//[^*\n][^\n]*?\bPASSWORD=\([A-Z0-9@#$]{1,8},([A-Z0-9@#$]{1,8})\)'''
|
|
22
|
+
secretGroup = 1
|
|
23
|
+
keywords = ["password="]
|
|
24
|
+
[rules.allowlist]
|
|
25
|
+
regexes = ['''(?i)^(?:x+|\*+|y+|n+|pass|passw(?:or)?d?|pwd|secret|dummy|changeme|password|newpass(?:word)?|oldpass(?:word)?)$''']
|
|
18
26
|
|
|
19
27
|
[[rules]]
|
|
20
28
|
id = "tso-logon-password"
|
|
21
29
|
description = "TSO LOGON with an inline password"
|
|
22
|
-
regex = '''(?im)^\s*
|
|
30
|
+
regex = '''(?im)^\s*LOGON\s+[A-Z@#$][A-Z0-9@#$]{0,7}/([A-Z0-9@#$]{1,8})\b'''
|
|
23
31
|
secretGroup = 1
|
|
24
32
|
keywords = ["logon"]
|
|
33
|
+
[rules.allowlist]
|
|
34
|
+
regexes = ['''(?i)^(?:x+|\*+|y+|n+|pass|passw(?:or)?d?|pwd|secret|dummy|changeme|password|newpass(?:word)?|oldpass(?:word)?)$''']
|
|
25
35
|
|
|
26
36
|
[[rules]]
|
|
27
37
|
id = "racf-command-password"
|
|
@@ -29,29 +39,33 @@ description = "RACF ADDUSER or ALTUSER with an inline PASSWORD(...)"
|
|
|
29
39
|
regex = '''(?i)\b(?:ALTUSER|ALU|ADDUSER|AU)\s+\(?[A-Z0-9@#$]{1,8}\)?[^\n]*?\bPASSWORD\(\s*([A-Z0-9@#$]{1,8})\s*\)'''
|
|
30
40
|
secretGroup = 1
|
|
31
41
|
keywords = ["password("]
|
|
42
|
+
[rules.allowlist]
|
|
43
|
+
regexes = ['''(?i)^(?:x+|\*+|y+|n+|pass|passw(?:or)?d?|pwd|secret|dummy|changeme|password|newpass(?:word)?|oldpass(?:word)?)$''']
|
|
32
44
|
|
|
33
45
|
[[rules]]
|
|
34
46
|
id = "cobol-value-credential"
|
|
35
47
|
description = "COBOL data item named for a credential with a literal VALUE"
|
|
36
|
-
regex = '''(?im)^[^*\n]{0,7}\s*\
|
|
48
|
+
regex = '''(?im)^[^*\n]{0,7}\s*\b(?:0?[1-9]|[1-4][0-9]|77)\s+[A-Z0-9-]*(?:PASSWORD|PASSWD|PASSWRD|PSWD|PWD|SECRET|APIKEY|API-KEY|ACCESS-KEY|(?:API|ACCESS|AUTH|BEARER|OAUTH|REFRESH)-?TOKEN)[A-Z0-9-]*\b[^.]*?\bVALUES?\s+(?:IS\s+|ARE\s+)?(?:'([^'\n]{1,})'|"([^"\n]{1,})")'''
|
|
37
49
|
keywords = ["password", "passwd", "passwrd", "pswd", "pwd", "secret", "apikey", "api-key", "access-key", "token"]
|
|
38
|
-
path = '''(?i)\.(cbl|cob|cobol|cpy|copy|sqb|pco|ccp)$'''
|
|
50
|
+
path = '''(?i)\.(?:cbl|cob|cobol|cpy|copy|sqb|pco|ccp)$'''
|
|
39
51
|
[rules.allowlist]
|
|
40
52
|
regexTarget = "match"
|
|
41
|
-
regexes = ['''(?i)VALUE\s+(?:IS\s+)?['"](x+|\*+|\s+|pass(word)?|secret|dummy|changeme|password:?|enter[^'"]*|invalid[^'"]*|wrong[^'"]*)['"]''']
|
|
53
|
+
regexes = ['''(?i)VALUE\s+(?:IS\s+)?['"](?:x+|\*+|\s+|y|n|yes|no|true|false|on|off|[01]|pass(?:word)?|secret|dummy|changeme|password:?|enter[^'"]*|invalid[^'"]*|wrong[^'"]*|[^'"]*\S\s+\S[^'"]*)['"]''']
|
|
42
54
|
|
|
43
55
|
[[rules]]
|
|
44
56
|
id = "embedded-sql-connect-password"
|
|
45
57
|
description = "EXEC SQL CONNECT with a literal password"
|
|
46
|
-
regex = '''(?is)\bCONNECT\s+(?:TO\s+\S+\s+)?(?:USER\s+(?:'[^']*'|"[^"]*"|:?[A-Z0-9-]+)\s+USING|IDENTIFIED\s+BY)\s+(?:'([^'\n]{3,})'|"([^"\n]{3,})")'''
|
|
58
|
+
regex = '''(?is)\bCONNECT\s+(?:TO\s+\S+\s+)?(?:USER\s+(?:'[^']*'|"[^"]*"|:?[A-Z0-9-]+)\s+USING|(?:(?:'[^']*'|"[^"]*"|:?[A-Z0-9-]+)\s+)?IDENTIFIED\s+BY)\s+(?:'([^'\n]{3,})'|"([^"\n]{3,})")'''
|
|
47
59
|
keywords = ["connect"]
|
|
48
60
|
[rules.allowlist]
|
|
49
61
|
regexTarget = "match"
|
|
50
|
-
regexes = ['''(?i)USING
|
|
62
|
+
regexes = ['''(?i)(?:USING|IDENTIFIED\s+BY)\s+['"](?:x+|\*+|pass(?:word)?|pwd|secret|dummy|changeme|your[-_ ]?password|<[^>]*>)['"]''']
|
|
51
63
|
|
|
52
64
|
[[rules]]
|
|
53
65
|
id = "cics-signon-password"
|
|
54
66
|
description = "EXEC CICS SIGNON, VERIFY PASSWORD or CHANGE PASSWORD with a literal password"
|
|
55
|
-
regex = '''(?
|
|
67
|
+
regex = '''(?i)EXEC\s+CICS\s+(?:SIGNON|VERIFY|CHANGE)\b[^.]{0,300}?\bPASSWORD\(\s*'([^'\n]{1,8})'\s*\)'''
|
|
56
68
|
secretGroup = 1
|
|
57
69
|
keywords = ["password("]
|
|
70
|
+
[rules.allowlist]
|
|
71
|
+
regexes = ['''(?i)^(?:x+|\*+|y+|n+|pass|passw(?:or)?d?|pwd|secret|dummy|changeme|password|newpass(?:word)?|oldpass(?:word)?)$''']
|