@cyclonedx/cdxgen 12.2.1 → 12.3.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 (170) hide show
  1. package/README.md +239 -90
  2. package/bin/audit.js +191 -0
  3. package/bin/cdxgen.js +513 -167
  4. package/bin/convert.js +99 -0
  5. package/bin/evinse.js +23 -0
  6. package/bin/repl.js +339 -8
  7. package/bin/sign.js +8 -0
  8. package/bin/validate.js +8 -0
  9. package/bin/verify.js +8 -0
  10. package/data/container-knowledge-index.json +125 -0
  11. package/data/gtfobins-index.json +6296 -0
  12. package/data/lolbas-index.json +150 -0
  13. package/data/queries-darwin.json +63 -3
  14. package/data/queries-win.json +45 -3
  15. package/data/queries.json +74 -2
  16. package/data/rules/chrome-extensions.yaml +240 -0
  17. package/data/rules/ci-permissions.yaml +478 -18
  18. package/data/rules/container-risk.yaml +270 -0
  19. package/data/rules/obom-runtime.yaml +891 -0
  20. package/data/rules/package-integrity.yaml +49 -0
  21. package/data/spdx-export.schema.json +6794 -0
  22. package/data/spdx-model-v3.0.1.jsonld +15999 -0
  23. package/lib/audit/index.js +1924 -0
  24. package/lib/audit/index.poku.js +1488 -0
  25. package/lib/audit/progress.js +137 -0
  26. package/lib/audit/progress.poku.js +188 -0
  27. package/lib/audit/reporters.js +618 -0
  28. package/lib/audit/scoring.js +310 -0
  29. package/lib/audit/scoring.poku.js +341 -0
  30. package/lib/audit/targets.js +260 -0
  31. package/lib/audit/targets.poku.js +331 -0
  32. package/lib/cli/index.js +154 -11
  33. package/lib/cli/index.poku.js +251 -0
  34. package/lib/helpers/analyzer.js +446 -2
  35. package/lib/helpers/analyzer.poku.js +72 -1
  36. package/lib/helpers/annotationFormatter.js +49 -0
  37. package/lib/helpers/annotationFormatter.poku.js +44 -0
  38. package/lib/helpers/bomUtils.js +36 -0
  39. package/lib/helpers/bomUtils.poku.js +51 -0
  40. package/lib/helpers/caxa.js +2 -2
  41. package/lib/helpers/chromextutils.js +1153 -0
  42. package/lib/helpers/chromextutils.poku.js +493 -0
  43. package/lib/helpers/ciParsers/githubActions.js +1632 -45
  44. package/lib/helpers/ciParsers/githubActions.poku.js +853 -1
  45. package/lib/helpers/containerRisk.js +186 -0
  46. package/lib/helpers/containerRisk.poku.js +52 -0
  47. package/lib/helpers/display.js +241 -59
  48. package/lib/helpers/display.poku.js +162 -2
  49. package/lib/helpers/exportUtils.js +123 -0
  50. package/lib/helpers/exportUtils.poku.js +60 -0
  51. package/lib/helpers/formulationParsers.js +69 -0
  52. package/lib/helpers/formulationParsers.poku.js +44 -0
  53. package/lib/helpers/gtfobins.js +189 -0
  54. package/lib/helpers/gtfobins.poku.js +49 -0
  55. package/lib/helpers/lolbas.js +267 -0
  56. package/lib/helpers/lolbas.poku.js +39 -0
  57. package/lib/helpers/osqueryTransform.js +84 -0
  58. package/lib/helpers/osqueryTransform.poku.js +49 -0
  59. package/lib/helpers/provenanceUtils.js +193 -0
  60. package/lib/helpers/provenanceUtils.poku.js +145 -0
  61. package/lib/helpers/pylockutils.js +281 -0
  62. package/lib/helpers/pylockutils.poku.js +48 -0
  63. package/lib/helpers/registryProvenance.js +793 -0
  64. package/lib/helpers/registryProvenance.poku.js +452 -0
  65. package/lib/helpers/source.js +1267 -0
  66. package/lib/helpers/source.poku.js +771 -0
  67. package/lib/helpers/spdxUtils.js +97 -0
  68. package/lib/helpers/spdxUtils.poku.js +70 -0
  69. package/lib/helpers/unicodeScan.js +147 -0
  70. package/lib/helpers/unicodeScan.poku.js +45 -0
  71. package/lib/helpers/utils.js +700 -128
  72. package/lib/helpers/utils.poku.js +877 -80
  73. package/lib/managers/binary.js +29 -5
  74. package/lib/managers/docker.js +179 -52
  75. package/lib/managers/docker.poku.js +327 -28
  76. package/lib/managers/oci.js +107 -23
  77. package/lib/managers/oci.poku.js +132 -0
  78. package/lib/server/openapi.yaml +17 -0
  79. package/lib/server/server.js +225 -336
  80. package/lib/server/server.poku.js +16 -10
  81. package/lib/stages/postgen/annotator.js +7 -0
  82. package/lib/stages/postgen/annotator.poku.js +40 -0
  83. package/lib/stages/postgen/auditBom.js +19 -3
  84. package/lib/stages/postgen/auditBom.poku.js +1729 -67
  85. package/lib/stages/postgen/postgen.js +40 -0
  86. package/lib/stages/postgen/postgen.poku.js +47 -0
  87. package/lib/stages/postgen/ruleEngine.js +80 -2
  88. package/lib/stages/postgen/spdxConverter.js +796 -0
  89. package/lib/stages/postgen/spdxConverter.poku.js +341 -0
  90. package/lib/validator/bomValidator.js +232 -0
  91. package/lib/validator/bomValidator.poku.js +70 -0
  92. package/lib/validator/complianceRules.js +70 -7
  93. package/lib/validator/complianceRules.poku.js +30 -0
  94. package/lib/validator/reporters/annotations.js +2 -2
  95. package/lib/validator/reporters/console.js +11 -0
  96. package/lib/validator/reporters.poku.js +13 -0
  97. package/package.json +10 -7
  98. package/types/bin/audit.d.ts +3 -0
  99. package/types/bin/audit.d.ts.map +1 -0
  100. package/types/bin/convert.d.ts +3 -0
  101. package/types/bin/convert.d.ts.map +1 -0
  102. package/types/bin/repl.d.ts.map +1 -1
  103. package/types/lib/audit/index.d.ts +115 -0
  104. package/types/lib/audit/index.d.ts.map +1 -0
  105. package/types/lib/audit/progress.d.ts +27 -0
  106. package/types/lib/audit/progress.d.ts.map +1 -0
  107. package/types/lib/audit/reporters.d.ts +35 -0
  108. package/types/lib/audit/reporters.d.ts.map +1 -0
  109. package/types/lib/audit/scoring.d.ts +35 -0
  110. package/types/lib/audit/scoring.d.ts.map +1 -0
  111. package/types/lib/audit/targets.d.ts +63 -0
  112. package/types/lib/audit/targets.d.ts.map +1 -0
  113. package/types/lib/cli/index.d.ts +8 -0
  114. package/types/lib/cli/index.d.ts.map +1 -1
  115. package/types/lib/helpers/analyzer.d.ts +13 -0
  116. package/types/lib/helpers/analyzer.d.ts.map +1 -1
  117. package/types/lib/helpers/annotationFormatter.d.ts +23 -0
  118. package/types/lib/helpers/annotationFormatter.d.ts.map +1 -0
  119. package/types/lib/helpers/bomUtils.d.ts +5 -0
  120. package/types/lib/helpers/bomUtils.d.ts.map +1 -0
  121. package/types/lib/helpers/chromextutils.d.ts +97 -0
  122. package/types/lib/helpers/chromextutils.d.ts.map +1 -0
  123. package/types/lib/helpers/ciParsers/githubActions.d.ts +3 -8
  124. package/types/lib/helpers/ciParsers/githubActions.d.ts.map +1 -1
  125. package/types/lib/helpers/containerRisk.d.ts +17 -0
  126. package/types/lib/helpers/containerRisk.d.ts.map +1 -0
  127. package/types/lib/helpers/display.d.ts +4 -1
  128. package/types/lib/helpers/display.d.ts.map +1 -1
  129. package/types/lib/helpers/exportUtils.d.ts +40 -0
  130. package/types/lib/helpers/exportUtils.d.ts.map +1 -0
  131. package/types/lib/helpers/formulationParsers.d.ts.map +1 -1
  132. package/types/lib/helpers/gtfobins.d.ts +17 -0
  133. package/types/lib/helpers/gtfobins.d.ts.map +1 -0
  134. package/types/lib/helpers/lolbas.d.ts +16 -0
  135. package/types/lib/helpers/lolbas.d.ts.map +1 -0
  136. package/types/lib/helpers/osqueryTransform.d.ts +7 -0
  137. package/types/lib/helpers/osqueryTransform.d.ts.map +1 -0
  138. package/types/lib/helpers/provenanceUtils.d.ts +90 -0
  139. package/types/lib/helpers/provenanceUtils.d.ts.map +1 -0
  140. package/types/lib/helpers/pylockutils.d.ts +51 -0
  141. package/types/lib/helpers/pylockutils.d.ts.map +1 -0
  142. package/types/lib/helpers/registryProvenance.d.ts +17 -0
  143. package/types/lib/helpers/registryProvenance.d.ts.map +1 -0
  144. package/types/lib/helpers/source.d.ts +141 -0
  145. package/types/lib/helpers/source.d.ts.map +1 -0
  146. package/types/lib/helpers/spdxUtils.d.ts +2 -0
  147. package/types/lib/helpers/spdxUtils.d.ts.map +1 -0
  148. package/types/lib/helpers/unicodeScan.d.ts +46 -0
  149. package/types/lib/helpers/unicodeScan.d.ts.map +1 -0
  150. package/types/lib/helpers/utils.d.ts +29 -11
  151. package/types/lib/helpers/utils.d.ts.map +1 -1
  152. package/types/lib/managers/binary.d.ts.map +1 -1
  153. package/types/lib/managers/docker.d.ts.map +1 -1
  154. package/types/lib/managers/oci.d.ts.map +1 -1
  155. package/types/lib/server/server.d.ts +0 -36
  156. package/types/lib/server/server.d.ts.map +1 -1
  157. package/types/lib/stages/postgen/annotator.d.ts.map +1 -1
  158. package/types/lib/stages/postgen/auditBom.d.ts.map +1 -1
  159. package/types/lib/stages/postgen/postgen.d.ts.map +1 -1
  160. package/types/lib/stages/postgen/ruleEngine.d.ts.map +1 -1
  161. package/types/lib/stages/postgen/spdxConverter.d.ts +11 -0
  162. package/types/lib/stages/postgen/spdxConverter.d.ts.map +1 -0
  163. package/types/lib/validator/bomValidator.d.ts +1 -0
  164. package/types/lib/validator/bomValidator.d.ts.map +1 -1
  165. package/types/lib/validator/complianceRules.d.ts.map +1 -1
  166. package/types/lib/validator/reporters/console.d.ts.map +1 -1
  167. package/types/bin/dependencies.d.ts +0 -3
  168. package/types/bin/dependencies.d.ts.map +0 -1
  169. package/types/bin/licenses.d.ts +0 -3
  170. package/types/bin/licenses.d.ts.map +0 -1
@@ -0,0 +1,150 @@
1
+ {
2
+ "entries": {
3
+ "bitsadmin.exe": {
4
+ "attackTactics": ["TA0002", "TA0011"],
5
+ "attackTechniques": ["T1105", "T1197"],
6
+ "contexts": ["admin", "user"],
7
+ "functions": ["download", "upload", "command"],
8
+ "reference": "https://lolbas-project.github.io/lolbas/Binaries/Bitsadmin/",
9
+ "riskTags": ["network-transfer", "persistence"]
10
+ },
11
+ "certutil.exe": {
12
+ "attackTactics": ["TA0005", "TA0011"],
13
+ "attackTechniques": ["T1105", "T1140"],
14
+ "contexts": ["admin", "user"],
15
+ "functions": ["download", "decode", "file-read", "file-write"],
16
+ "reference": "https://lolbas-project.github.io/lolbas/Binaries/Certutil/",
17
+ "riskTags": ["defense-evasion", "network-transfer"]
18
+ },
19
+ "cmd.exe": {
20
+ "attackTactics": ["TA0002"],
21
+ "attackTechniques": ["T1059.003"],
22
+ "contexts": ["admin", "user"],
23
+ "functions": ["command", "shell"],
24
+ "reference": "https://lolbas-project.github.io/lolbas/Binaries/Cmd/",
25
+ "riskTags": ["execution"]
26
+ },
27
+ "cmdkey.exe": {
28
+ "attackTactics": ["TA0006"],
29
+ "attackTechniques": ["T1555"],
30
+ "contexts": ["admin", "user"],
31
+ "functions": ["credential-access"],
32
+ "reference": "https://lolbas-project.github.io/lolbas/Binaries/Cmdkey/",
33
+ "riskTags": ["credential-access"]
34
+ },
35
+ "cmstp.exe": {
36
+ "attackTactics": ["TA0003", "TA0005"],
37
+ "attackTechniques": ["T1218.003", "T1548.002"],
38
+ "contexts": ["admin", "uac-bypass", "user"],
39
+ "functions": ["proxy-execution", "uac-bypass"],
40
+ "reference": "https://lolbas-project.github.io/lolbas/Binaries/Cmstp/",
41
+ "riskTags": ["defense-evasion", "persistence", "uac-bypass"]
42
+ },
43
+ "cscript.exe": {
44
+ "attackTactics": ["TA0002", "TA0005"],
45
+ "attackTechniques": ["T1059.005", "T1216"],
46
+ "contexts": ["admin", "user"],
47
+ "functions": ["proxy-execution", "script-execution"],
48
+ "reference": "https://lolbas-project.github.io/lolbas/Binaries/Cscript/",
49
+ "riskTags": ["defense-evasion", "execution"]
50
+ },
51
+ "ftp.exe": {
52
+ "attackTactics": ["TA0011"],
53
+ "attackTechniques": ["T1041", "T1105"],
54
+ "contexts": ["admin", "user"],
55
+ "functions": ["download", "upload"],
56
+ "reference": "https://lolbas-project.github.io/lolbas/Binaries/Ftp/",
57
+ "riskTags": ["network-transfer"]
58
+ },
59
+ "installutil.exe": {
60
+ "attackTactics": ["TA0002", "TA0005"],
61
+ "attackTechniques": ["T1218.004"],
62
+ "contexts": ["admin", "user"],
63
+ "functions": ["library-load", "proxy-execution"],
64
+ "reference": "https://lolbas-project.github.io/lolbas/Binaries/Installutil/",
65
+ "riskTags": ["defense-evasion", "execution"]
66
+ },
67
+ "msbuild.exe": {
68
+ "attackTactics": ["TA0002", "TA0005"],
69
+ "attackTechniques": ["T1127.001"],
70
+ "contexts": ["admin", "user"],
71
+ "functions": ["compile", "proxy-execution", "script-execution"],
72
+ "reference": "https://lolbas-project.github.io/lolbas/Binaries/Msbuild/",
73
+ "riskTags": ["defense-evasion", "execution"]
74
+ },
75
+ "mshta.exe": {
76
+ "attackTactics": ["TA0002", "TA0005"],
77
+ "attackTechniques": ["T1218.005"],
78
+ "contexts": ["admin", "user"],
79
+ "functions": ["proxy-execution", "script-execution"],
80
+ "reference": "https://lolbas-project.github.io/lolbas/Binaries/Mshta/",
81
+ "riskTags": ["defense-evasion", "execution"]
82
+ },
83
+ "msiexec.exe": {
84
+ "attackTactics": ["TA0002", "TA0005", "TA0011"],
85
+ "attackTechniques": ["T1105", "T1218.007"],
86
+ "contexts": ["admin", "user"],
87
+ "functions": ["download", "proxy-execution"],
88
+ "reference": "https://lolbas-project.github.io/lolbas/Binaries/Msiexec/",
89
+ "riskTags": ["defense-evasion", "network-transfer"]
90
+ },
91
+ "odbcconf.exe": {
92
+ "attackTactics": ["TA0002", "TA0005"],
93
+ "attackTechniques": ["T1218.008"],
94
+ "contexts": ["admin", "user"],
95
+ "functions": ["library-load", "proxy-execution"],
96
+ "reference": "https://lolbas-project.github.io/lolbas/Binaries/Odbcconf/",
97
+ "riskTags": ["defense-evasion", "execution"]
98
+ },
99
+ "powershell.exe": {
100
+ "attackTactics": ["TA0002", "TA0005", "TA0011"],
101
+ "attackTechniques": ["T1041", "T1059.001", "T1105"],
102
+ "contexts": ["admin", "user"],
103
+ "functions": ["command", "download", "script-execution", "shell", "upload"],
104
+ "reference": "https://lolbas-project.github.io/lolbas/Binaries/Powershell/",
105
+ "riskTags": ["execution", "network-transfer", "persistence"]
106
+ },
107
+ "pwsh.exe": {
108
+ "attackTactics": ["TA0002", "TA0005", "TA0011"],
109
+ "attackTechniques": ["T1041", "T1059.001", "T1105"],
110
+ "contexts": ["admin", "user"],
111
+ "functions": ["command", "download", "script-execution", "shell", "upload"],
112
+ "reference": "https://lolbas-project.github.io/lolbas/Binaries/Powershell/",
113
+ "riskTags": ["execution", "network-transfer", "persistence"]
114
+ },
115
+ "regsvr32.exe": {
116
+ "attackTactics": ["TA0002", "TA0005"],
117
+ "attackTechniques": ["T1218.010"],
118
+ "contexts": ["admin", "user"],
119
+ "functions": ["library-load", "proxy-execution", "script-execution"],
120
+ "reference": "https://lolbas-project.github.io/lolbas/Binaries/Regsvr32/",
121
+ "riskTags": ["defense-evasion", "execution"]
122
+ },
123
+ "rundll32.exe": {
124
+ "attackTactics": ["TA0002", "TA0005"],
125
+ "attackTechniques": ["T1218.011"],
126
+ "contexts": ["admin", "user"],
127
+ "functions": ["library-load", "proxy-execution"],
128
+ "reference": "https://lolbas-project.github.io/lolbas/Binaries/Rundll32/",
129
+ "riskTags": ["defense-evasion", "execution"]
130
+ },
131
+ "wmic.exe": {
132
+ "attackTactics": ["TA0002", "TA0005", "TA0011"],
133
+ "attackTechniques": ["T1047", "T1105"],
134
+ "contexts": ["admin", "user"],
135
+ "functions": ["command", "download", "process-create"],
136
+ "reference": "https://lolbas-project.github.io/lolbas/Binaries/Wmic/",
137
+ "riskTags": ["execution", "network-transfer", "reconnaissance"]
138
+ },
139
+ "wscript.exe": {
140
+ "attackTactics": ["TA0002", "TA0005"],
141
+ "attackTechniques": ["T1059.005", "T1216"],
142
+ "contexts": ["admin", "user"],
143
+ "functions": ["proxy-execution", "script-execution"],
144
+ "reference": "https://lolbas-project.github.io/lolbas/Binaries/Wscript/",
145
+ "riskTags": ["defense-evasion", "execution"]
146
+ }
147
+ },
148
+ "source": "https://github.com/LOLBAS-Project/LOLBAS",
149
+ "sourceRef": "https://lolbas-project.github.io/"
150
+ }
@@ -14,7 +14,7 @@
14
14
  "chrome_extensions": {
15
15
  "query": "select chrome_extensions.* from users join chrome_extensions using (uid);",
16
16
  "description": "Retrieves the list of extensions for Chrome in the target system.",
17
- "purlType": "swid",
17
+ "purlType": "chrome-extension",
18
18
  "componentType": "application"
19
19
  },
20
20
  "firefox_addons": {
@@ -26,7 +26,7 @@
26
26
  "vscode_extensions": {
27
27
  "query": "select vscode_extensions.* from users join vscode_extensions using (uid);",
28
28
  "description": "Lists all vscode extensions.",
29
- "purlType": "vsix",
29
+ "purlType": "vscode-extension",
30
30
  "componentType": "application"
31
31
  },
32
32
  "apps": {
@@ -47,6 +47,66 @@
47
47
  "purlType": "swid",
48
48
  "componentType": "data"
49
49
  },
50
+ "users_snapshot": {
51
+ "query": "SELECT username as name, uuid as version, description, directory, shell, uid, gid, is_hidden FROM users;",
52
+ "description": "Local account inventory including hidden-user attributes on macOS.",
53
+ "purlType": "swid",
54
+ "componentType": "data"
55
+ },
56
+ "logged_in_users_snapshot": {
57
+ "query": "SELECT user as name, '' as version, type as description, pid, host, tty, time FROM logged_in_users;",
58
+ "description": "Interactive and remote user sessions currently active on the host.",
59
+ "purlType": "swid",
60
+ "componentType": "data"
61
+ },
62
+ "shell_history_snapshot": {
63
+ "query": "SELECT users.username as name, '' as version, shell_history.command as description, shell_history.time, shell_history.history_file, shell_history.uid FROM users JOIN shell_history USING (uid);",
64
+ "description": "User shell command history metadata for investigation support.",
65
+ "purlType": "swid",
66
+ "componentType": "data"
67
+ },
68
+ "homebrew_packages": {
69
+ "query": "SELECT * FROM homebrew_packages;",
70
+ "description": "Homebrew formula and cask inventory including auto-update behavior.",
71
+ "purlType": "swid",
72
+ "componentType": "application"
73
+ },
74
+ "launchd_services": {
75
+ "query": "SELECT name, label, path, program, run_at_load, keep_alive, disabled, username, groupname, stdout_path, stderr_path, start_interval, program_arguments, watch_paths, queue_directories, start_on_mount, working_directory, process_type FROM launchd;",
76
+ "description": "LaunchAgents and LaunchDaemons configuration used for macOS persistence.",
77
+ "purlType": "swid",
78
+ "componentType": "application"
79
+ },
80
+ "launchd_overrides": {
81
+ "query": "SELECT label as name, key as version, value as description, uid, path FROM launchd_overrides;",
82
+ "description": "Per-user launchd override state that can alter startup behavior.",
83
+ "purlType": "swid",
84
+ "componentType": "data"
85
+ },
86
+ "alf": {
87
+ "query": "SELECT 'alf' as name, global_state as version, version as description, allow_signed_enabled, firewall_unload, logging_enabled, logging_option, stealth_enabled FROM alf;",
88
+ "description": "Application Layer Firewall (ALF) configuration and enforcement posture.",
89
+ "purlType": "swid",
90
+ "componentType": "data"
91
+ },
92
+ "alf_exceptions": {
93
+ "query": "SELECT path as name, state as version FROM alf_exceptions;",
94
+ "description": "Firewall allow/block exception list for specific executables or bundle identifiers.",
95
+ "purlType": "swid",
96
+ "componentType": "data"
97
+ },
98
+ "xprotect_entries": {
99
+ "query": "SELECT * FROM xprotect_entries;",
100
+ "description": "Built-in XProtect malware signature entries on macOS.",
101
+ "purlType": "swid",
102
+ "componentType": "data"
103
+ },
104
+ "xprotect_meta": {
105
+ "query": "SELECT identifier as name, min_version as version, type as description, developer_id FROM xprotect_meta;",
106
+ "description": "XProtect browser extension/plugin policy metadata.",
107
+ "purlType": "swid",
108
+ "componentType": "data"
109
+ },
50
110
  "package_bom": {
51
111
  "query": "SELECT * FROM package_bom;",
52
112
  "description": "macOS package bill of materials (BOM) file list.",
@@ -84,7 +144,7 @@
84
144
  "componentType": "data"
85
145
  },
86
146
  "listening_ports": {
87
- "query": "SELECT DISTINCT process.name, listening.port, listening.protocol, listening.family, listening.address, process.pid, process.path, process.on_disk, process.parent, process.start_time FROM processes AS process JOIN listening_ports AS listening ON process.pid = listening.pid;",
147
+ "query": "SELECT DISTINCT process.name, listening.port, listening.protocol, listening.family, listening.address, process.pid, process.path, process.cmdline, process.cwd, process.uid, process.on_disk, process.parent, process.start_time FROM processes AS process JOIN listening_ports AS listening ON process.pid = listening.pid;",
88
148
  "description": "List all processes and their listening_ports.",
89
149
  "purlType": "swid",
90
150
  "componentType": "application"
@@ -15,7 +15,7 @@
15
15
  "chrome_extensions": {
16
16
  "query": "select chrome_extensions.* from users join chrome_extensions using (uid);",
17
17
  "description": "Retrieves the list of extensions for Chrome in the target system.",
18
- "purlType": "swid",
18
+ "purlType": "chrome-extension",
19
19
  "componentType": "application"
20
20
  },
21
21
  "firefox_addons": {
@@ -27,7 +27,7 @@
27
27
  "vscode_extensions": {
28
28
  "query": "select vscode_extensions.* from users join vscode_extensions using (uid);",
29
29
  "description": "Lists all vscode extensions.",
30
- "purlType": "vsix",
30
+ "purlType": "vscode-extension",
31
31
  "componentType": "application"
32
32
  },
33
33
  "browser_plugins": {
@@ -88,6 +88,24 @@
88
88
  "purlType": "swid",
89
89
  "componentType": "data"
90
90
  },
91
+ "users_snapshot": {
92
+ "query": "SELECT username as name, uuid as version, description, directory, uid, type, gid FROM users;",
93
+ "description": "Local and domain-backed user account inventory on Windows endpoints.",
94
+ "purlType": "swid",
95
+ "componentType": "data"
96
+ },
97
+ "logged_in_users_snapshot": {
98
+ "query": "SELECT user as name, '' as version, type as description, pid, host, tty, time, sid, registry_hive FROM logged_in_users;",
99
+ "description": "Interactive and remote user sessions active on the endpoint.",
100
+ "purlType": "swid",
101
+ "componentType": "data"
102
+ },
103
+ "logon_sessions": {
104
+ "query": "SELECT user as name, logon_type as version, authentication_package as description, logon_id, logon_domain, session_id, logon_sid, logon_time, logon_server, dns_domain_name, upn, profile_path, home_directory, home_directory_drive FROM logon_sessions;",
105
+ "description": "Windows logon session inventory for authentication and identity investigations.",
106
+ "purlType": "swid",
107
+ "componentType": "data"
108
+ },
91
109
  "pipes_snapshot": {
92
110
  "query": "SELECT processes.path, processes.cmdline, processes.uid, processes.on_disk, pipes.name, pid FROM pipes JOIN processes USING (pid);",
93
111
  "description": "Pipes snapshot query.",
@@ -130,6 +148,30 @@
130
148
  "purlType": "swid",
131
149
  "componentType": "data"
132
150
  },
151
+ "windows_security_products": {
152
+ "query": "SELECT * FROM windows_security_products;",
153
+ "description": "Registered endpoint security products and signature posture.",
154
+ "purlType": "swid",
155
+ "componentType": "data"
156
+ },
157
+ "windows_security_center": {
158
+ "query": "SELECT antivirus as name, firewall as version, autoupdate as description, internet_settings, windows_security_center_service, user_account_control FROM windows_security_center;",
159
+ "description": "Windows Security Center overall protection health indicators.",
160
+ "purlType": "swid",
161
+ "componentType": "data"
162
+ },
163
+ "windows_bitlocker_info": {
164
+ "query": "SELECT device_id as name, drive_letter as version, encryption_method as description, persistent_volume_id, conversion_status, protection_status, percentage_encrypted, lock_status FROM bitlocker_info;",
165
+ "description": "BitLocker protection and encryption state for local drives.",
166
+ "purlType": "swid",
167
+ "componentType": "data"
168
+ },
169
+ "windows_run_keys": {
170
+ "query": "SELECT path as name, mtime as version, data as description, key, type FROM registry WHERE (key LIKE 'HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\%' OR key LIKE 'HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce\\%' OR key LIKE 'HKEY_USERS\\%\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\%' OR key LIKE 'HKEY_USERS\\%\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce\\%') AND type != 'subkey';",
171
+ "description": "Registry Run/RunOnce autostart entries commonly abused for persistence.",
172
+ "purlType": "swid",
173
+ "componentType": "data"
174
+ },
133
175
  "etc_hosts": {
134
176
  "query": "SELECT * FROM etc_hosts;",
135
177
  "description": "List the contents of the Windows hosts file.",
@@ -165,7 +207,7 @@
165
207
  "componentType": "data"
166
208
  },
167
209
  "listening_ports": {
168
- "query": "SELECT DISTINCT process.name, listening.port, listening.protocol, listening.family, listening.address, process.pid, process.path, process.on_disk, process.parent, process.start_time FROM processes AS process JOIN listening_ports AS listening ON process.pid = listening.pid;",
210
+ "query": "SELECT DISTINCT process.name, listening.port, listening.protocol, listening.family, listening.address, process.pid, process.path, process.cmdline, process.cwd, process.uid, process.on_disk, process.parent, process.start_time FROM processes AS process JOIN listening_ports AS listening ON process.pid = listening.pid;",
169
211
  "description": "List all processes and their listening_ports.",
170
212
  "purlType": "swid",
171
213
  "componentType": "application"
package/data/queries.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "chrome_extensions": {
16
16
  "query": "select chrome_extensions.* from users join chrome_extensions using (uid);",
17
17
  "description": "Retrieves the list of extensions for Chrome in the target system.",
18
- "purlType": "swid",
18
+ "purlType": "chrome-extension",
19
19
  "componentType": "application"
20
20
  },
21
21
  "firefox_addons": {
@@ -66,6 +66,36 @@
66
66
  "purlType": "swid",
67
67
  "componentType": "data"
68
68
  },
69
+ "users_snapshot": {
70
+ "query": "SELECT username as name, uuid as version, description, directory, shell, uid, gid FROM users;",
71
+ "description": "Local user inventory for account and shell posture analysis.",
72
+ "purlType": "swid",
73
+ "componentType": "data"
74
+ },
75
+ "logged_in_users_snapshot": {
76
+ "query": "SELECT user as name, '' as version, type as description, pid, tty, host, time FROM logged_in_users;",
77
+ "description": "Interactive and remote user sessions currently active on the host.",
78
+ "purlType": "swid",
79
+ "componentType": "data"
80
+ },
81
+ "shell_history_snapshot": {
82
+ "query": "SELECT users.username as name, '' as version, shell_history.command as description, shell_history.time, shell_history.history_file, shell_history.uid FROM users JOIN shell_history USING (uid);",
83
+ "description": "User shell command history metadata for investigation support.",
84
+ "purlType": "swid",
85
+ "componentType": "data"
86
+ },
87
+ "authorized_keys_snapshot": {
88
+ "query": "SELECT users.username as name, authorized_keys.algorithm as version, authorized_keys.comment as description, authorized_keys.key_file, authorized_keys.options, authorized_keys.uid FROM users JOIN authorized_keys USING (uid);",
89
+ "description": "Authorized SSH key metadata per account without exporting key material.",
90
+ "purlType": "swid",
91
+ "componentType": "data"
92
+ },
93
+ "sudoers_snapshot": {
94
+ "query": "SELECT header as name, source as path, rule_details as description FROM sudoers;",
95
+ "description": "Sudo policy entries for least-privilege and privileged access review.",
96
+ "purlType": "swid",
97
+ "componentType": "data"
98
+ },
69
99
  "etc_hosts": {
70
100
  "query": "SELECT * FROM etc_hosts;",
71
101
  "description": "List the contents of the Windows hosts file.",
@@ -84,6 +114,18 @@
84
114
  "purlType": "swid",
85
115
  "componentType": "data"
86
116
  },
117
+ "systemd_units": {
118
+ "query": "SELECT id as name, active_state as version, description, load_state, sub_state, unit_file_state, user, fragment_path, source_path FROM systemd_units;",
119
+ "description": "Systemd unit state and execution source inventory.",
120
+ "purlType": "swid",
121
+ "componentType": "application"
122
+ },
123
+ "etc_services": {
124
+ "query": "SELECT * FROM etc_services;",
125
+ "description": "Service-to-port mappings configured in /etc/services.",
126
+ "purlType": "swid",
127
+ "componentType": "data"
128
+ },
87
129
  "behavioral_reverse_shell": {
88
130
  "query": "SELECT DISTINCT(processes.pid), processes.parent, processes.name, processes.path, processes.cmdline, processes.cwd, processes.root, processes.uid, processes.gid, processes.start_time, process_open_sockets.remote_address, process_open_sockets.remote_port, (SELECT cmdline FROM processes AS parent_cmdline WHERE pid=processes.parent) AS parent_cmdline FROM processes JOIN process_open_sockets USING (pid) LEFT OUTER JOIN process_open_files ON processes.pid = process_open_files.pid WHERE (name='sh' OR name='bash') AND remote_address NOT IN ('0.0.0.0', '::', '') AND remote_address NOT LIKE '10.%' AND remote_address NOT LIKE '192.168.%';",
89
131
  "description": "Find shell processes that have open sockets.",
@@ -96,6 +138,24 @@
96
138
  "purlType": "swid",
97
139
  "componentType": "data"
98
140
  },
141
+ "sudo_executions": {
142
+ "query": "SELECT COALESCE((SELECT proc.name FROM processes AS proc WHERE proc.pid = process_events.pid), process_events.path) AS name, process_events.path, process_events.cmdline, process_events.cwd, process_events.auid, process_events.uid, process_events.euid, process_events.gid, process_events.egid, process_events.parent, process_events.pid, process_events.time, process_events.ctime, COALESCE((SELECT username FROM users WHERE uid = process_events.auid), '') AS login_user, COALESCE((SELECT username FROM users WHERE uid = process_events.uid), '') AS real_user, COALESCE((SELECT username FROM users WHERE uid = process_events.euid), '') AS effective_user, COALESCE((SELECT parent.name FROM processes AS parent WHERE parent.pid = process_events.parent), '') AS parent_name, COALESCE((SELECT parent.path FROM processes AS parent WHERE parent.pid = process_events.parent), '') AS parent_path, COALESCE((SELECT parent.cmdline FROM processes AS parent WHERE parent.pid = process_events.parent), '') AS parent_cmdline, COALESCE((SELECT unit.id FROM systemd_units AS unit WHERE unit.fragment_path = process_events.path OR unit.source_path = process_events.path LIMIT 1), '') AS service_unit, CASE WHEN process_events.path LIKE '/usr/bin/%' OR process_events.path LIKE '/usr/sbin/%' OR process_events.path LIKE '/bin/%' OR process_events.path LIKE '/sbin/%' THEN 'system-package-path' WHEN process_events.path LIKE '/opt/%' THEN 'optional-system-path' WHEN process_events.path LIKE '/snap/%' THEN 'snap-path' WHEN process_events.path LIKE '/home/%' OR process_events.path LIKE '/tmp/%' OR process_events.path LIKE '/var/tmp/%' OR process_events.path LIKE '/dev/shm/%' OR process_events.path LIKE '/run/user/%' THEN 'user-writable-path' ELSE 'unclassified-path' END AS package_source_hint FROM process_events WHERE (process_events.path IN ('/usr/bin/sudo', '/usr/bin/pkexec', '/usr/bin/doas', '/bin/su', '/usr/bin/su') OR process_events.cmdline LIKE 'sudo %' OR process_events.cmdline LIKE 'pkexec %' OR process_events.cmdline LIKE '% pkexec %' OR process_events.cmdline LIKE 'doas %' OR process_events.cmdline LIKE '% doas %' OR process_events.cmdline LIKE 'su %') AND process_events.cmdline NOT LIKE '%_key%' AND process_events.cmdline NOT LIKE '%secret%';",
143
+ "description": "Privileged execution events involving sudo, pkexec, doas, or su.",
144
+ "purlType": "swid",
145
+ "componentType": "application"
146
+ },
147
+ "privilege_transitions": {
148
+ "query": "SELECT COALESCE((SELECT proc.name FROM processes AS proc WHERE proc.pid = process_events.pid), process_events.path) AS name, process_events.path, process_events.cmdline, process_events.cwd, process_events.auid, process_events.uid, process_events.euid, process_events.gid, process_events.egid, process_events.parent, process_events.pid, process_events.time, process_events.ctime, COALESCE((SELECT username FROM users WHERE uid = process_events.auid), '') AS login_user, COALESCE((SELECT username FROM users WHERE uid = process_events.uid), '') AS real_user, COALESCE((SELECT username FROM users WHERE uid = process_events.euid), '') AS effective_user, COALESCE((SELECT parent.name FROM processes AS parent WHERE parent.pid = process_events.parent), '') AS parent_name, COALESCE((SELECT parent.path FROM processes AS parent WHERE parent.pid = process_events.parent), '') AS parent_path, COALESCE((SELECT parent.cmdline FROM processes AS parent WHERE parent.pid = process_events.parent), '') AS parent_cmdline, COALESCE((SELECT unit.id FROM systemd_units AS unit WHERE unit.fragment_path = process_events.path OR unit.source_path = process_events.path LIMIT 1), '') AS service_unit, CASE WHEN process_events.path LIKE '/usr/bin/%' OR process_events.path LIKE '/usr/sbin/%' OR process_events.path LIKE '/bin/%' OR process_events.path LIKE '/sbin/%' THEN 'system-package-path' WHEN process_events.path LIKE '/opt/%' THEN 'optional-system-path' WHEN process_events.path LIKE '/snap/%' THEN 'snap-path' WHEN process_events.path LIKE '/home/%' OR process_events.path LIKE '/tmp/%' OR process_events.path LIKE '/var/tmp/%' OR process_events.path LIKE '/dev/shm/%' OR process_events.path LIKE '/run/user/%' THEN 'user-writable-path' ELSE 'unclassified-path' END AS package_source_hint FROM process_events WHERE (process_events.uid != process_events.euid OR process_events.gid != process_events.egid) AND process_events.path NOT IN ('/bin/sed', '/usr/bin/tr', '/bin/gawk', '/bin/date', '/bin/mktemp', '/usr/bin/dirname', '/usr/bin/head', '/usr/bin/jq', '/bin/cut', '/bin/uname', '/bin/basename') AND process_events.cmdline NOT LIKE '%_key%' AND process_events.cmdline NOT LIKE '%secret%';",
149
+ "description": "Process executions where real and effective privileges differ.",
150
+ "purlType": "swid",
151
+ "componentType": "application"
152
+ },
153
+ "elevated_processes": {
154
+ "query": "SELECT DISTINCT process.name, process.path, process.cmdline, process.cwd, process.root, process.uid, process.gid, process.pid, process.parent, process.start_time, process.on_disk, COALESCE(users.username, '') AS account, COALESCE((SELECT parent.name FROM processes AS parent WHERE parent.pid = process.parent), '') AS parent_name, COALESCE((SELECT parent.path FROM processes AS parent WHERE parent.pid = process.parent), '') AS parent_path, COALESCE((SELECT parent.cmdline FROM processes AS parent WHERE parent.pid = process.parent), '') AS parent_cmdline, COALESCE((SELECT unit.id FROM systemd_units AS unit WHERE unit.fragment_path = process.path OR unit.source_path = process.path LIMIT 1), '') AS service_unit, CASE WHEN process.path LIKE '/usr/bin/%' OR process.path LIKE '/usr/sbin/%' OR process.path LIKE '/bin/%' OR process.path LIKE '/sbin/%' THEN 'system-package-path' WHEN process.path LIKE '/opt/%' THEN 'optional-system-path' WHEN process.path LIKE '/snap/%' THEN 'snap-path' WHEN process.path LIKE '/home/%' OR process.path LIKE '/tmp/%' OR process.path LIKE '/var/tmp/%' OR process.path LIKE '/dev/shm/%' OR process.path LIKE '/run/user/%' THEN 'user-writable-path' ELSE 'unclassified-path' END AS package_source_hint FROM processes AS process LEFT JOIN users ON process.uid = users.uid WHERE process.uid = 0 OR process.uid BETWEEN 1 AND 999;",
155
+ "description": "Processes running as root or service-style system accounts with lineage hints.",
156
+ "purlType": "swid",
157
+ "componentType": "application"
158
+ },
99
159
  "ld_preload": {
100
160
  "query": "SELECT process_envs.pid, process_envs.key, process_envs.value, processes.name, processes.path, processes.cmdline, processes.cwd FROM process_envs join processes USING (pid) WHERE key = 'LD_PRELOAD';",
101
161
  "description": "Any processes that run with an LD_PRELOAD environment variable.",
@@ -114,6 +174,12 @@
114
174
  "purlType": "swid",
115
175
  "componentType": "data"
116
176
  },
177
+ "process_open_sockets": {
178
+ "query": "SELECT * FROM process_open_sockets WHERE remote_address NOT IN ('0.0.0.0', '::', '');",
179
+ "description": "Network sockets opened by processes with non-empty remote endpoints.",
180
+ "purlType": "swid",
181
+ "componentType": "data"
182
+ },
117
183
  "startup_items": {
118
184
  "query": "SELECT * FROM startup_items;",
119
185
  "description": "List all startup_items.",
@@ -121,11 +187,17 @@
121
187
  "componentType": "data"
122
188
  },
123
189
  "listening_ports": {
124
- "query": "SELECT DISTINCT process.name, listening.port, listening.protocol, listening.family, listening.address, process.pid, process.path, process.on_disk, process.parent, process.start_time FROM processes AS process JOIN listening_ports AS listening ON process.pid = listening.pid;",
190
+ "query": "SELECT DISTINCT process.name, listening.port, listening.protocol, listening.family, listening.address, process.pid, process.path, process.cmdline, process.cwd, process.uid, process.on_disk, process.parent, process.start_time FROM processes AS process JOIN listening_ports AS listening ON process.pid = listening.pid;",
125
191
  "description": "List all processes and their listening_ports.",
126
192
  "purlType": "swid",
127
193
  "componentType": "application"
128
194
  },
195
+ "privileged_listening_ports": {
196
+ "query": "SELECT DISTINCT process.name, listening.port, listening.protocol, listening.family, listening.address, process.pid, process.path, process.cmdline, process.cwd, process.uid, process.gid, process.on_disk, process.parent, process.start_time, COALESCE(users.username, '') AS account, COALESCE((SELECT parent.name FROM processes AS parent WHERE parent.pid = process.parent), '') AS parent_name, COALESCE((SELECT parent.path FROM processes AS parent WHERE parent.pid = process.parent), '') AS parent_path, COALESCE((SELECT parent.cmdline FROM processes AS parent WHERE parent.pid = process.parent), '') AS parent_cmdline, COALESCE((SELECT unit.id FROM systemd_units AS unit WHERE unit.fragment_path = process.path OR unit.source_path = process.path LIMIT 1), '') AS service_unit, CASE WHEN process.path LIKE '/usr/bin/%' OR process.path LIKE '/usr/sbin/%' OR process.path LIKE '/bin/%' OR process.path LIKE '/sbin/%' THEN 'system-package-path' WHEN process.path LIKE '/opt/%' THEN 'optional-system-path' WHEN process.path LIKE '/snap/%' THEN 'snap-path' WHEN process.path LIKE '/home/%' OR process.path LIKE '/tmp/%' OR process.path LIKE '/var/tmp/%' OR process.path LIKE '/dev/shm/%' OR process.path LIKE '/run/user/%' THEN 'user-writable-path' ELSE 'unclassified-path' END AS package_source_hint FROM processes AS process JOIN listening_ports AS listening ON process.pid = listening.pid LEFT JOIN users ON process.uid = users.uid WHERE process.uid = 0 OR process.uid BETWEEN 1 AND 999;",
197
+ "description": "Listening ports owned by root or service-style processes with lineage and path hints.",
198
+ "purlType": "swid",
199
+ "componentType": "application"
200
+ },
129
201
  "interface_addresses": {
130
202
  "query": "SELECT * FROM interface_addresses;",
131
203
  "description": "List all interface_addresses.",