@gendigital/sage-opencode 0.9.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 (59) hide show
  1. package/README.md +102 -0
  2. package/dist/bundled-dirs.d.ts +12 -0
  3. package/dist/bundled-dirs.d.ts.map +1 -0
  4. package/dist/bundled-dirs.js +29 -0
  5. package/dist/bundled-dirs.js.map +1 -0
  6. package/dist/error.d.ts +7 -0
  7. package/dist/error.d.ts.map +1 -0
  8. package/dist/error.js +12 -0
  9. package/dist/error.js.map +1 -0
  10. package/dist/extractors.d.ts +6 -0
  11. package/dist/extractors.d.ts.map +1 -0
  12. package/dist/extractors.js +111 -0
  13. package/dist/extractors.js.map +1 -0
  14. package/dist/index.d.ts +8 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +128 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/logger-adaptor.d.ts +15 -0
  19. package/dist/logger-adaptor.d.ts.map +1 -0
  20. package/dist/logger-adaptor.js +32 -0
  21. package/dist/logger-adaptor.js.map +1 -0
  22. package/dist/plugin-discovery.d.ts +12 -0
  23. package/dist/plugin-discovery.d.ts.map +1 -0
  24. package/dist/plugin-discovery.js +138 -0
  25. package/dist/plugin-discovery.js.map +1 -0
  26. package/dist/startup-scan.d.ts +7 -0
  27. package/dist/startup-scan.d.ts.map +1 -0
  28. package/dist/startup-scan.js +41 -0
  29. package/dist/startup-scan.js.map +1 -0
  30. package/dist/tool-handler.d.ts +14 -0
  31. package/dist/tool-handler.d.ts.map +1 -0
  32. package/dist/tool-handler.js +93 -0
  33. package/dist/tool-handler.js.map +1 -0
  34. package/package.json +60 -0
  35. package/resources/allowlists/trusted-installer-domains.yaml +55 -0
  36. package/resources/threats/LICENSE +45 -0
  37. package/resources/threats/commands.yaml +351 -0
  38. package/resources/threats/credentials.yaml +105 -0
  39. package/resources/threats/dummy.yaml +195 -0
  40. package/resources/threats/files.yaml +239 -0
  41. package/resources/threats/mac-commands.yaml +355 -0
  42. package/resources/threats/mac-credentials.yaml +99 -0
  43. package/resources/threats/mac-files.yaml +124 -0
  44. package/resources/threats/mac-obfuscation.yaml +92 -0
  45. package/resources/threats/mac-persistence.yaml +117 -0
  46. package/resources/threats/mac-supply-chain.yaml +40 -0
  47. package/resources/threats/mitre.yaml +810 -0
  48. package/resources/threats/obfuscation.yaml +98 -0
  49. package/resources/threats/persistence.yaml +87 -0
  50. package/resources/threats/prompt-injection.yaml +334 -0
  51. package/resources/threats/self-defense.yaml +55 -0
  52. package/resources/threats/supply_chain.yaml +15 -0
  53. package/resources/threats/urls.yaml +66 -0
  54. package/resources/threats/win-commands.yaml +785 -0
  55. package/resources/threats/win-credentials.yaml +128 -0
  56. package/resources/threats/win-files.yaml +124 -0
  57. package/resources/threats/win-obfuscation.yaml +205 -0
  58. package/resources/threats/win-persistence.yaml +100 -0
  59. package/resources/threats/win-supply-chain.yaml +15 -0
@@ -0,0 +1,239 @@
1
+ # Sensitive file path threat patterns for Sage
2
+ # Author: Gen Digital Inc.
3
+ # License: DRL-1.1 (see threats/LICENSE)
4
+ # Detects Read/Write/Edit/Delete operations targeting security-sensitive files
5
+
6
+ # --- System auth files ---
7
+ - id: "CLT-FILE-001"
8
+ category: secrets
9
+ severity: critical
10
+ confidence: 0.95
11
+ action: block
12
+ pattern: "(/etc/passwd|/etc/shadow|/etc/sudoers)"
13
+ match_on: file_path
14
+ title: "Access system authentication file"
15
+ expires_at: null
16
+ revoked: false
17
+
18
+ # --- SSH authorized_keys ---
19
+ - id: "CLT-FILE-002"
20
+ category: secrets
21
+ severity: critical
22
+ confidence: 0.95
23
+ action: block
24
+ pattern: "\\.ssh/authorized_keys"
25
+ match_on: file_path
26
+ title: "Access SSH authorized_keys (unauthorized access persistence)"
27
+ expires_at: null
28
+ revoked: false
29
+
30
+ # --- SSH private keys and config ---
31
+ - id: "CLT-FILE-003"
32
+ category: secrets
33
+ severity: high
34
+ confidence: 0.90
35
+ action: require_approval
36
+ pattern: "\\.ssh/(id_rsa|id_ed25519|id_ecdsa|id_dsa|config)$"
37
+ match_on: file_path
38
+ title: "Access SSH key or config file"
39
+ expires_at: null
40
+ revoked: false
41
+
42
+ # --- Shell RC files ---
43
+ - id: "CLT-FILE-004"
44
+ category: tool
45
+ severity: high
46
+ confidence: 0.85
47
+ action: require_approval
48
+ pattern: "\\.(bashrc|zshrc|profile|bash_profile|zprofile|zshenv)$"
49
+ match_on: file_path
50
+ title: "Access shell RC file (persistence mechanism)"
51
+ expires_at: null
52
+ revoked: false
53
+
54
+ # --- Cron directories ---
55
+ - id: "CLT-FILE-006"
56
+ category: tool
57
+ severity: high
58
+ confidence: 0.85
59
+ action: require_approval
60
+ pattern: "(/etc/cron\\.(d|daily|hourly|weekly|monthly)/|/var/spool/cron/)"
61
+ match_on: file_path
62
+ title: "Access cron directory"
63
+ expires_at: null
64
+ revoked: false
65
+
66
+ # --- systemd unit files ---
67
+ - id: "CLT-FILE-007"
68
+ category: tool
69
+ severity: high
70
+ confidence: 0.85
71
+ action: require_approval
72
+ pattern: "/etc/systemd/system/"
73
+ match_on: file_path
74
+ title: "Access systemd service unit file"
75
+ expires_at: null
76
+ revoked: false
77
+
78
+ # --- Credential/env files ---
79
+ # NOTE: Uses allowlist approach (explicit suffix enumeration) unlike CLT-CRED-003's
80
+ # denylist approach (negative lookahead). This means unknown suffixes like .env.ci
81
+ # match CRED-003 but not FILE-008 — intentional, since file_path matching is more
82
+ # targeted than command-string matching.
83
+ - id: "CLT-FILE-008"
84
+ category: secrets
85
+ severity: high
86
+ confidence: 0.85
87
+ action: require_approval
88
+ pattern: "((^|[\\/\\\\])\\.env(\\.local|\\.production|\\.prod|\\.staging|\\.stage|\\.development|\\.dev|\\.test)?|\\.aws/credentials|\\.netrc|\\.pgpass)$"
89
+ match_on: file_path
90
+ title: "Access credential or environment file"
91
+ expires_at: null
92
+ revoked: false
93
+
94
+ # --- Git hooks ---
95
+ - id: "CLT-FILE-009"
96
+ category: tool
97
+ severity: high
98
+ confidence: 0.85
99
+ action: require_approval
100
+ pattern: "\\.git/hooks/"
101
+ match_on: file_path
102
+ title: "Access git hook (potential code execution on git events)"
103
+ expires_at: null
104
+ revoked: false
105
+
106
+ # --- Android signing files ---
107
+ - id: "CLT-FILE-010"
108
+ category: secrets
109
+ severity: high
110
+ confidence: 0.85
111
+ action: require_approval
112
+ pattern: "(key\\.properties|release\\.keystore|\\.jks|\\.keystore)$"
113
+ match_on: file_path
114
+ title: "Access Android signing file"
115
+ expires_at: null
116
+ revoked: false
117
+
118
+ # --- Firebase config files ---
119
+ - id: "CLT-FILE-011"
120
+ category: secrets
121
+ severity: high
122
+ confidence: 0.85
123
+ action: require_approval
124
+ pattern: "(google-services\\.json|GoogleService-Info\\.plist)$"
125
+ match_on: file_path
126
+ title: "Access Firebase configuration file"
127
+ expires_at: null
128
+ revoked: false
129
+
130
+ # --- Cloud provider credential files ---
131
+ - id: "CLT-FILE-012"
132
+ category: secrets
133
+ severity: high
134
+ confidence: 0.85
135
+ action: require_approval
136
+ pattern: "(application_default_credentials\\.json|\\.azure/(accessTokens|msal_token_cache)\\.json|\\.config/doctl/config\\.yaml)$"
137
+ match_on: file_path
138
+ title: "Access cloud provider credential file"
139
+ expires_at: null
140
+ revoked: false
141
+
142
+ # --- Package manager tokens ---
143
+ - id: "CLT-FILE-013"
144
+ category: secrets
145
+ severity: high
146
+ confidence: 0.85
147
+ action: require_approval
148
+ pattern: "(\\.npmrc|\\.pypirc|\\.gem/credentials|\\.cargo/credentials\\.toml|\\.docker/config\\.json)$"
149
+ match_on: file_path
150
+ title: "Access package manager credential file"
151
+ expires_at: null
152
+ revoked: false
153
+
154
+ # --- Terraform state files ---
155
+ - id: "CLT-FILE-014"
156
+ category: secrets
157
+ severity: high
158
+ confidence: 0.85
159
+ action: require_approval
160
+ pattern: "\\.(tfstate(\\.backup)?|tfvars(\\.json)?)$"
161
+ match_on: file_path
162
+ title: "Access Terraform state or variables file"
163
+ expires_at: null
164
+ revoked: false
165
+
166
+ # --- Secrets/vault files ---
167
+ - id: "CLT-FILE-015"
168
+ category: secrets
169
+ severity: high
170
+ confidence: 0.85
171
+ action: require_approval
172
+ pattern: "(master\\.key|credentials\\.yml\\.enc|secrets\\.yml|vault\\.yml|\\.vault-pass|\\.vault-token)$"
173
+ match_on: file_path
174
+ title: "Access secrets or vault file"
175
+ expires_at: null
176
+ revoked: false
177
+
178
+ # --- Private keys and certificates ---
179
+ # NOTE: .pem also matches public cert chains (fullchain.pem, ca-bundle.pem).
180
+ # Accepted trade-off: require_approval keeps noise bounded, and excluding .pem
181
+ # would miss private key exfiltration.
182
+ - id: "CLT-FILE-016"
183
+ category: secrets
184
+ severity: high
185
+ confidence: 0.85
186
+ action: require_approval
187
+ pattern: "\\.(pem|p12|pfx|p8)$"
188
+ match_on: file_path
189
+ title: "Access private key or certificate file"
190
+ expires_at: null
191
+ revoked: false
192
+
193
+ # --- Kubeconfig ---
194
+ - id: "CLT-FILE-017"
195
+ category: secrets
196
+ severity: high
197
+ confidence: 0.85
198
+ action: require_approval
199
+ pattern: "(\\.kube/config|kubeconfig(\\.yaml|\\.yml)?)$"
200
+ match_on: file_path
201
+ title: "Access Kubernetes configuration file"
202
+ expires_at: null
203
+ revoked: false
204
+
205
+ # --- Build system credential files ---
206
+ - id: "CLT-FILE-018"
207
+ category: secrets
208
+ severity: high
209
+ confidence: 0.85
210
+ action: require_approval
211
+ pattern: "(\\.m2/settings\\.xml|gradle\\.properties)$"
212
+ match_on: file_path
213
+ title: "Access build system credential file"
214
+ expires_at: null
215
+ revoked: false
216
+
217
+ # --- Shell/REPL history files ---
218
+ - id: "CLT-FILE-019"
219
+ category: secrets
220
+ severity: high
221
+ confidence: 0.85
222
+ action: require_approval
223
+ pattern: "\\.(bash_history|zsh_history|mysql_history|python_history|node_repl_history|psql_history|irb_history)$"
224
+ match_on: file_path
225
+ title: "Access shell or REPL history file"
226
+ expires_at: null
227
+ revoked: false
228
+
229
+ # --- JetBrains IDE database credentials ---
230
+ - id: "CLT-FILE-020"
231
+ category: secrets
232
+ severity: high
233
+ confidence: 0.85
234
+ action: require_approval
235
+ pattern: "\\.idea/dataSources(\\.xml|/)"
236
+ match_on: file_path
237
+ title: "Access JetBrains IDE database credential file"
238
+ expires_at: null
239
+ revoked: false
@@ -0,0 +1,355 @@
1
+ # macOS command threat patterns for Sage
2
+ # Author: Gen Digital Inc.
3
+ # License: DRL-1.1 (see threats/LICENSE)
4
+ # Covers: osascript RCE, macOS LOLBins, destructive ops, defense evasion, privesc, reverse shells
5
+
6
+ # --- osascript Remote Code Execution ---
7
+
8
+ # osascript -e 'do shell script' (AppleScript shell execution)
9
+ - id: "CLT-MAC-CMD-001"
10
+ category: tool
11
+ severity: critical
12
+ confidence: 0.95
13
+ action: block
14
+ pattern: "\\bosascript\\b.*-e.*do shell script"
15
+ case_insensitive: true
16
+ match_on: command
17
+ title: "AppleScript shell execution via osascript -e"
18
+ expires_at: null
19
+ revoked: false
20
+
21
+ # osascript -l JavaScript (JXA execution)
22
+ - id: "CLT-MAC-CMD-002"
23
+ category: tool
24
+ severity: critical
25
+ confidence: 0.90
26
+ action: block
27
+ pattern: "\\bosascript\\b.*-l\\s+JavaScript"
28
+ case_insensitive: true
29
+ match_on: command
30
+ title: "JavaScript for Automation (JXA) execution via osascript"
31
+ expires_at: null
32
+ revoked: false
33
+
34
+ # Pipe to osascript (stdin AppleScript execution)
35
+ - id: "CLT-MAC-CMD-003"
36
+ category: tool
37
+ severity: critical
38
+ confidence: 0.90
39
+ action: block
40
+ pattern: "\\|\\s*osascript"
41
+ match_on: command
42
+ title: "Piped input to osascript (stdin AppleScript execution)"
43
+ expires_at: null
44
+ revoked: false
45
+
46
+ # osascript loading script file from remote download
47
+ - id: "CLT-MAC-CMD-004"
48
+ category: tool
49
+ severity: critical
50
+ confidence: 0.90
51
+ action: block
52
+ pattern: "(curl|wget).*\\|.*osascript|osascript.*(curl|wget)"
53
+ case_insensitive: true
54
+ match_on: command
55
+ title: "Remote script download piped to osascript"
56
+ expires_at: null
57
+ revoked: false
58
+
59
+ # --- open command abuse ---
60
+
61
+ # open -a Terminal (launch Terminal with script)
62
+ - id: "CLT-MAC-CMD-005"
63
+ category: tool
64
+ severity: high
65
+ confidence: 0.80
66
+ action: require_approval
67
+ pattern: "\\bopen\\s+-a\\s+Terminal"
68
+ match_on: command
69
+ title: "Launch Terminal application via open -a"
70
+ expires_at: null
71
+ revoked: false
72
+
73
+ # open with hidden/background flags
74
+ - id: "CLT-MAC-CMD-006"
75
+ category: tool
76
+ severity: high
77
+ confidence: 0.85
78
+ action: require_approval
79
+ pattern: "\\bopen\\s+(-[jg]|--hide|--background)"
80
+ match_on: command
81
+ title: "Launch application hidden/background via open"
82
+ expires_at: null
83
+ revoked: false
84
+
85
+ # --- macOS LOLBins ---
86
+
87
+ # dscl user/group manipulation
88
+ - id: "CLT-MAC-CMD-007"
89
+ category: tool
90
+ severity: high
91
+ confidence: 0.85
92
+ action: require_approval
93
+ pattern: "\\bdscl\\b.*(-create|-delete|-passwd|-append)"
94
+ match_on: command
95
+ title: "Directory Services user/group manipulation via dscl"
96
+ expires_at: null
97
+ revoked: false
98
+
99
+ # networksetup proxy/DNS manipulation
100
+ - id: "CLT-MAC-CMD-008"
101
+ category: tool
102
+ severity: high
103
+ confidence: 0.85
104
+ action: require_approval
105
+ pattern: "\\bnetworksetup\\b.*(-setwebproxy|-setsocksfirewallproxy|-setdnsservers|-setautoproxyurl)"
106
+ case_insensitive: true
107
+ match_on: command
108
+ title: "Network proxy/DNS manipulation via networksetup"
109
+ expires_at: null
110
+ revoked: false
111
+
112
+ # systemsetup enabling remote access
113
+ - id: "CLT-MAC-CMD-009"
114
+ category: tool
115
+ severity: critical
116
+ confidence: 0.90
117
+ action: block
118
+ pattern: "\\bsystemsetup\\b.*(-setremotelogin\\s+on|-setwakeonnetworkaccess\\s+on)"
119
+ case_insensitive: true
120
+ match_on: command
121
+ title: "Enable remote login/wake via systemsetup"
122
+ expires_at: null
123
+ revoked: false
124
+
125
+ # kickstart ARD remote management
126
+ - id: "CLT-MAC-CMD-010"
127
+ category: tool
128
+ severity: critical
129
+ confidence: 0.90
130
+ action: block
131
+ pattern: "kickstart.*-activate.*-configure"
132
+ case_insensitive: true
133
+ match_on: command
134
+ title: "Apple Remote Desktop activation via kickstart"
135
+ expires_at: null
136
+ revoked: false
137
+
138
+ # installer -pkg -target / (silent package install)
139
+ - id: "CLT-MAC-CMD-011"
140
+ category: tool
141
+ severity: high
142
+ confidence: 0.85
143
+ action: require_approval
144
+ pattern: "\\binstaller\\b.*-pkg.*-target"
145
+ case_insensitive: true
146
+ match_on: command
147
+ title: "Silent package install via installer command"
148
+ expires_at: null
149
+ revoked: false
150
+
151
+ # hdiutil mount remote DMG
152
+ - id: "CLT-MAC-CMD-012"
153
+ category: tool
154
+ severity: high
155
+ confidence: 0.85
156
+ action: require_approval
157
+ pattern: "\\bhdiutil\\b.*\\b(attach|mount)\\b.*https?://"
158
+ case_insensitive: true
159
+ match_on: command
160
+ title: "Mount remote DMG via hdiutil"
161
+ expires_at: null
162
+ revoked: false
163
+
164
+ # pkgutil --forget (package receipt manipulation)
165
+ - id: "CLT-MAC-CMD-013"
166
+ category: tool
167
+ severity: high
168
+ confidence: 0.80
169
+ action: require_approval
170
+ pattern: "\\bpkgutil\\b.*--forget"
171
+ match_on: command
172
+ title: "Package receipt removal via pkgutil --forget"
173
+ expires_at: null
174
+ revoked: false
175
+
176
+ # --- Destructive Operations ---
177
+
178
+ # diskutil eraseDisk
179
+ - id: "CLT-MAC-CMD-014"
180
+ category: tool
181
+ severity: critical
182
+ confidence: 0.95
183
+ action: block
184
+ pattern: "\\bdiskutil\\b.*\\b(eraseDisk|partitionDisk|secureErase)\\b"
185
+ match_on: command
186
+ title: "Disk erase/partition via diskutil"
187
+ expires_at: null
188
+ revoked: false
189
+
190
+ # tmutil delete (Time Machine backup deletion — ransomware indicator)
191
+ - id: "CLT-MAC-CMD-015"
192
+ category: tool
193
+ severity: critical
194
+ confidence: 0.95
195
+ action: block
196
+ pattern: "\\btmutil\\b.*\\b(delete|disable)\\b"
197
+ match_on: command
198
+ title: "Time Machine backup deletion/disable via tmutil (ransomware indicator)"
199
+ expires_at: null
200
+ revoked: false
201
+
202
+ # --- Defense Evasion ---
203
+
204
+ # spctl --master-disable (Gatekeeper disable)
205
+ - id: "CLT-MAC-CMD-016"
206
+ category: tool
207
+ severity: critical
208
+ confidence: 0.95
209
+ action: block
210
+ pattern: "\\bspctl\\b.*--master-disable"
211
+ match_on: command
212
+ title: "Gatekeeper disable via spctl --master-disable"
213
+ expires_at: null
214
+ revoked: false
215
+
216
+ # csrutil disable (SIP disable)
217
+ - id: "CLT-MAC-CMD-017"
218
+ category: tool
219
+ severity: critical
220
+ confidence: 0.95
221
+ action: block
222
+ pattern: "\\bcsrutil\\b.*\\bdisable\\b"
223
+ match_on: command
224
+ title: "System Integrity Protection disable via csrutil"
225
+ expires_at: null
226
+ revoked: false
227
+
228
+ # defaults write LSQuarantine (quarantine flag disable)
229
+ - id: "CLT-MAC-CMD-018"
230
+ category: tool
231
+ severity: critical
232
+ confidence: 0.90
233
+ action: block
234
+ pattern: "\\bdefaults\\b.*\\bwrite\\b.*LSQuarantine"
235
+ case_insensitive: true
236
+ match_on: command
237
+ title: "Quarantine flag disable via defaults write LSQuarantine"
238
+ expires_at: null
239
+ revoked: false
240
+
241
+ # xattr -d com.apple.quarantine (quarantine removal)
242
+ - id: "CLT-MAC-CMD-019"
243
+ category: tool
244
+ severity: high
245
+ confidence: 0.85
246
+ action: require_approval
247
+ pattern: "\\bxattr\\b.*-d.*com\\.apple\\.quarantine"
248
+ match_on: command
249
+ title: "Quarantine attribute removal via xattr"
250
+ expires_at: null
251
+ revoked: false
252
+
253
+ # pfctl -d (packet filter / firewall disable)
254
+ - id: "CLT-MAC-CMD-020"
255
+ category: tool
256
+ severity: critical
257
+ confidence: 0.90
258
+ action: block
259
+ pattern: "\\bpfctl\\b.*\\s-d\\b"
260
+ match_on: command
261
+ title: "Packet filter (firewall) disable via pfctl -d"
262
+ expires_at: null
263
+ revoked: false
264
+
265
+ # tccutil reset (TCC privacy permissions reset)
266
+ - id: "CLT-MAC-CMD-021"
267
+ category: tool
268
+ severity: critical
269
+ confidence: 0.90
270
+ action: block
271
+ pattern: "\\btccutil\\b.*\\breset\\b"
272
+ match_on: command
273
+ title: "TCC privacy permissions reset via tccutil"
274
+ expires_at: null
275
+ revoked: false
276
+
277
+ # launchctl unload security daemons
278
+ - id: "CLT-MAC-CMD-022"
279
+ category: tool
280
+ severity: critical
281
+ confidence: 0.90
282
+ action: block
283
+ pattern: "\\blaunchctl\\b.*\\b(unload|bootout)\\b.*(com\\.apple\\.MRT|com\\.apple\\.XProtect|com\\.apple\\.security)"
284
+ case_insensitive: true
285
+ match_on: command
286
+ title: "Unload macOS security daemon via launchctl"
287
+ expires_at: null
288
+ revoked: false
289
+
290
+ # defaults write to disable macOS security features
291
+ - id: "CLT-MAC-CMD-023"
292
+ category: tool
293
+ severity: critical
294
+ confidence: 0.90
295
+ action: block
296
+ pattern: "\\bdefaults\\b.*\\bwrite\\b.*(com\\.apple\\.Finder\\s+AppleShowAllFiles|com\\.apple\\.LaunchServices\\s+LSQuarantine|com\\.apple\\.loginwindow)"
297
+ case_insensitive: true
298
+ match_on: command
299
+ title: "Modify macOS security-related defaults"
300
+ expires_at: null
301
+ revoked: false
302
+
303
+ # --- Privilege Escalation ---
304
+
305
+ # dscl . -passwd (change user password)
306
+ - id: "CLT-MAC-CMD-024"
307
+ category: tool
308
+ severity: critical
309
+ confidence: 0.90
310
+ action: block
311
+ pattern: "\\bdscl\\b.*\\s-passwd\\b"
312
+ match_on: command
313
+ title: "User password change via dscl"
314
+ expires_at: null
315
+ revoked: false
316
+
317
+ # dseditgroup add user to admin
318
+ - id: "CLT-MAC-CMD-025"
319
+ category: tool
320
+ severity: critical
321
+ confidence: 0.95
322
+ action: block
323
+ pattern: "\\bdseditgroup\\b.*-o\\s+edit.*-a.*admin"
324
+ match_on: command
325
+ title: "Add user to admin group via dseditgroup"
326
+ expires_at: null
327
+ revoked: false
328
+
329
+ # createhomedir — create home directory for arbitrary user
330
+ - id: "CLT-MAC-CMD-026"
331
+ category: tool
332
+ severity: high
333
+ confidence: 0.80
334
+ action: require_approval
335
+ pattern: "\\bcreatehomedir\\b"
336
+ match_on: command
337
+ title: "Create home directory for user via createhomedir"
338
+ expires_at: null
339
+ revoked: false
340
+
341
+ # Reverse shells (Python, Ruby, zsh) moved to commands.yaml (CLT-CMD-023..025)
342
+
343
+ # --- Clipboard / Screen Capture ---
344
+
345
+ # screencapture to remote or hidden location
346
+ - id: "CLT-MAC-CMD-027"
347
+ category: tool
348
+ severity: high
349
+ confidence: 0.80
350
+ action: require_approval
351
+ pattern: "\\bscreencapture\\b.*(-x|-C)"
352
+ match_on: command
353
+ title: "Silent screen capture via screencapture"
354
+ expires_at: null
355
+ revoked: false
@@ -0,0 +1,99 @@
1
+ # macOS credential exposure threat patterns for Sage
2
+ # Author: Gen Digital Inc.
3
+ # License: DRL-1.1 (see threats/LICENSE)
4
+
5
+ # Keychain password extraction (find-generic-password)
6
+ - id: "CLT-MAC-CRED-001"
7
+ category: secrets
8
+ severity: critical
9
+ confidence: 0.95
10
+ action: block
11
+ pattern: "\\bsecurity\\b.*\\bfind-generic-password\\b.*-w"
12
+ match_on: command
13
+ title: "Keychain password extraction via security find-generic-password"
14
+ expires_at: null
15
+ revoked: false
16
+
17
+ # Keychain internet password extraction
18
+ - id: "CLT-MAC-CRED-002"
19
+ category: secrets
20
+ severity: critical
21
+ confidence: 0.95
22
+ action: block
23
+ pattern: "\\bsecurity\\b.*\\bfind-internet-password\\b.*-w"
24
+ match_on: command
25
+ title: "Keychain internet password extraction via security find-internet-password"
26
+ expires_at: null
27
+ revoked: false
28
+
29
+ # Keychain dump
30
+ - id: "CLT-MAC-CRED-003"
31
+ category: secrets
32
+ severity: critical
33
+ confidence: 0.95
34
+ action: block
35
+ pattern: "\\bsecurity\\b.*\\bdump-keychain\\b"
36
+ match_on: command
37
+ title: "Full keychain dump via security dump-keychain"
38
+ expires_at: null
39
+ revoked: false
40
+
41
+ # Keychain unlock with plaintext password
42
+ - id: "CLT-MAC-CRED-004"
43
+ category: secrets
44
+ severity: critical
45
+ confidence: 0.90
46
+ action: block
47
+ pattern: "\\bsecurity\\b.*\\bunlock-keychain\\b.*-p"
48
+ match_on: command
49
+ title: "Keychain unlock with plaintext password"
50
+ expires_at: null
51
+ revoked: false
52
+
53
+ # Keychain export
54
+ - id: "CLT-MAC-CRED-005"
55
+ category: secrets
56
+ severity: high
57
+ confidence: 0.85
58
+ action: require_approval
59
+ pattern: "\\bsecurity\\b.*\\bexport\\b.*-k"
60
+ match_on: command
61
+ title: "Keychain item export via security export"
62
+ expires_at: null
63
+ revoked: false
64
+
65
+ # Keychain deletion
66
+ - id: "CLT-MAC-CRED-006"
67
+ category: secrets
68
+ severity: critical
69
+ confidence: 0.90
70
+ action: block
71
+ pattern: "\\bsecurity\\b.*\\bdelete-keychain\\b"
72
+ match_on: command
73
+ title: "Keychain deletion via security delete-keychain"
74
+ expires_at: null
75
+ revoked: false
76
+
77
+ # Directory Services auth data read
78
+ - id: "CLT-MAC-CRED-007"
79
+ category: secrets
80
+ severity: high
81
+ confidence: 0.85
82
+ action: require_approval
83
+ pattern: "\\bdscl\\b.*-read.*(AuthenticationAuthority|Password|ShadowHash)"
84
+ match_on: command
85
+ title: "Read user authentication data via dscl"
86
+ expires_at: null
87
+ revoked: false
88
+
89
+ # Direct Keychain SQLite access
90
+ - id: "CLT-MAC-CRED-008"
91
+ category: secrets
92
+ severity: critical
93
+ confidence: 0.90
94
+ action: block
95
+ pattern: "\\bsqlite3\\b.*(/Library/Keychains/|login\\.keychain)"
96
+ match_on: command
97
+ title: "Direct Keychain database access via sqlite3"
98
+ expires_at: null
99
+ revoked: false