@gendigital/sage-opencode 0.12.0 → 0.13.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 (31) hide show
  1. package/dist/mcp-server.cjs +38 -10
  2. package/dist/mcp-server.cjs.map +2 -2
  3. package/dist/tool-handler.d.ts.map +1 -1
  4. package/dist/tool-handler.js +5 -3
  5. package/dist/tool-handler.js.map +1 -1
  6. package/package.json +3 -3
  7. package/resources/threats/_macros.yaml +193 -0
  8. package/resources/threats/agent-layer.yaml +19 -1
  9. package/resources/threats/commands.yaml +165 -31
  10. package/resources/threats/credentials.yaml +24 -4
  11. package/resources/threats/dummy.yaml +30 -0
  12. package/resources/threats/files.yaml +38 -0
  13. package/resources/threats/mac-commands.yaml +118 -27
  14. package/resources/threats/mac-credentials.yaml +34 -8
  15. package/resources/threats/mac-files.yaml +20 -0
  16. package/resources/threats/mac-obfuscation.yaml +28 -6
  17. package/resources/threats/mac-persistence.yaml +30 -4
  18. package/resources/threats/mac-supply-chain.yaml +12 -3
  19. package/resources/threats/mitre.yaml +325 -62
  20. package/resources/threats/obfuscation.yaml +33 -8
  21. package/resources/threats/persistence.yaml +40 -5
  22. package/resources/threats/prompt-injection.yaml +58 -0
  23. package/resources/threats/self-defense.yaml +15 -2
  24. package/resources/threats/supply_chain.yaml +6 -1
  25. package/resources/threats/urls.yaml +10 -0
  26. package/resources/threats/win-commands.yaml +294 -60
  27. package/resources/threats/win-credentials.yaml +68 -9
  28. package/resources/threats/win-files.yaml +20 -0
  29. package/resources/threats/win-obfuscation.yaml +56 -8
  30. package/resources/threats/win-persistence.yaml +45 -7
  31. package/resources/threats/win-supply-chain.yaml +5 -1
@@ -26,6 +26,8 @@
26
26
  # ─── Command patterns (Bash tool) ───────────────────────────────────
27
27
 
28
28
  - id: "DUMMY-CMD-DENY-001"
29
+ version: 1
30
+ detection_name: "CMD:SageTestCommandDeny-A [Tst]"
29
31
  category: testing
30
32
  severity: critical
31
33
  confidence: 0.95
@@ -36,6 +38,8 @@
36
38
  revoked: false
37
39
 
38
40
  - id: "DUMMY-CMD-DENY-002"
41
+ version: 1
42
+ detection_name: "CMD:SageTestCommandDeny-B [Tst]"
39
43
  category: testing
40
44
  severity: critical
41
45
  confidence: 0.95
@@ -46,6 +50,8 @@
46
50
  revoked: false
47
51
 
48
52
  - id: "DUMMY-CMD-ASK-001"
53
+ version: 1
54
+ detection_name: "CMD:SageTestCommandAsk-A [Tst]"
49
55
  category: testing
50
56
  severity: warning
51
57
  confidence: 0.60
@@ -56,6 +62,8 @@
56
62
  revoked: false
57
63
 
58
64
  - id: "DUMMY-CMD-ASK-002"
65
+ version: 1
66
+ detection_name: "CMD:SageTestCommandAsk-B [Tst]"
59
67
  category: testing
60
68
  severity: warning
61
69
  confidence: 0.60
@@ -66,6 +74,8 @@
66
74
  revoked: false
67
75
 
68
76
  - id: "DUMMY-CMD-LOG-001"
77
+ version: 1
78
+ detection_name: "CMD:SageTestCommandLog-A [Tst]"
69
79
  category: testing
70
80
  severity: info
71
81
  confidence: 0.10
@@ -79,6 +89,8 @@
79
89
  # ─── File-path patterns (Write / Edit / Read / Delete tools) ────────
80
90
 
81
91
  - id: "DUMMY-FILE-DENY-001"
92
+ version: 1
93
+ detection_name: "FN:SageTestFileDeny-A [Tst]"
82
94
  category: testing
83
95
  severity: critical
84
96
  confidence: 0.95
@@ -89,6 +101,8 @@
89
101
  revoked: false
90
102
 
91
103
  - id: "DUMMY-FILE-ASK-001"
104
+ version: 1
105
+ detection_name: "FN:SageTestFileAsk-A [Tst]"
92
106
  category: testing
93
107
  severity: warning
94
108
  confidence: 0.60
@@ -99,6 +113,8 @@
99
113
  revoked: false
100
114
 
101
115
  - id: "DUMMY-FILE-LOG-001"
116
+ version: 1
117
+ detection_name: "FN:SageTestFileLog-A [Tst]"
102
118
  category: testing
103
119
  severity: info
104
120
  confidence: 0.10
@@ -112,6 +128,8 @@
112
128
  # ─── Content patterns (Write / Edit tools — file body) ──────────────
113
129
 
114
130
  - id: "DUMMY-CONTENT-DENY-001"
131
+ version: 1
132
+ detection_name: "Other:SageTestContentDeny-A [Tst]"
115
133
  category: testing
116
134
  severity: critical
117
135
  confidence: 0.95
@@ -122,6 +140,8 @@
122
140
  revoked: false
123
141
 
124
142
  - id: "DUMMY-CONTENT-ASK-001"
143
+ version: 1
144
+ detection_name: "Other:SageTestContentAsk-A [Tst]"
125
145
  category: testing
126
146
  severity: warning
127
147
  confidence: 0.60
@@ -132,6 +152,8 @@
132
152
  revoked: false
133
153
 
134
154
  - id: "DUMMY-CONTENT-LOG-001"
155
+ version: 1
156
+ detection_name: "Other:SageTestContentLog-A [Tst]"
135
157
  category: testing
136
158
  severity: info
137
159
  confidence: 0.10
@@ -146,6 +168,8 @@
146
168
  # Uses .test TLD (RFC 2606 reserved, never resolves) for safety.
147
169
 
148
170
  - id: "DUMMY-URL-DENY-001"
171
+ version: 1
172
+ detection_name: "FN:SageTestUrlDeny-A [Tst]"
149
173
  category: testing
150
174
  severity: critical
151
175
  confidence: 0.95
@@ -156,6 +180,8 @@
156
180
  revoked: false
157
181
 
158
182
  - id: "DUMMY-URL-ASK-001"
183
+ version: 1
184
+ detection_name: "FN:SageTestUrlAsk-A [Tst]"
159
185
  category: testing
160
186
  severity: warning
161
187
  confidence: 0.60
@@ -166,6 +192,8 @@
166
192
  revoked: false
167
193
 
168
194
  - id: "DUMMY-URL-LOG-001"
195
+ version: 1
196
+ detection_name: "FN:SageTestUrlLog-A [Tst]"
169
197
  category: testing
170
198
  severity: info
171
199
  confidence: 0.10
@@ -179,6 +207,8 @@
179
207
  # ─── Domain pattern (verifies domain→url routing in heuristics) ─────
180
208
 
181
209
  - id: "DUMMY-DOMAIN-DENY-001"
210
+ version: 1
211
+ detection_name: "FN:SageTestDomainDeny-A [Tst]"
182
212
  category: testing
183
213
  severity: critical
184
214
  confidence: 0.95
@@ -5,6 +5,8 @@
5
5
 
6
6
  # --- System auth files ---
7
7
  - id: "CLT-FILE-001"
8
+ version: 1
9
+ detection_name: "FN:SageFile-A [Heur]"
8
10
  category: secrets
9
11
  severity: critical
10
12
  confidence: 0.95
@@ -16,6 +18,8 @@
16
18
 
17
19
  # --- SSH authorized_keys ---
18
20
  - id: "CLT-FILE-002"
21
+ version: 1
22
+ detection_name: "FN:SageFile-B [Heur]"
19
23
  category: secrets
20
24
  severity: critical
21
25
  confidence: 0.95
@@ -27,6 +31,8 @@
27
31
 
28
32
  # --- SSH private keys and config ---
29
33
  - id: "CLT-FILE-003"
34
+ version: 1
35
+ detection_name: "FN:SageFile-C [Heur]"
30
36
  category: secrets
31
37
  severity: warning
32
38
  confidence: 0.60
@@ -38,6 +44,8 @@
38
44
 
39
45
  # --- Shell RC files ---
40
46
  - id: "CLT-FILE-004"
47
+ version: 1
48
+ detection_name: "FN:SageFile-D [Heur]"
41
49
  category: tool
42
50
  severity: warning
43
51
  confidence: 0.60
@@ -49,6 +57,8 @@
49
57
 
50
58
  # --- Cron directories ---
51
59
  - id: "CLT-FILE-006"
60
+ version: 1
61
+ detection_name: "FN:SageFile-F [Heur]"
52
62
  category: tool
53
63
  severity: warning
54
64
  confidence: 0.60
@@ -60,6 +70,8 @@
60
70
 
61
71
  # --- systemd unit files ---
62
72
  - id: "CLT-FILE-007"
73
+ version: 1
74
+ detection_name: "FN:SageFile-G [Heur]"
63
75
  category: tool
64
76
  severity: warning
65
77
  confidence: 0.60
@@ -75,6 +87,8 @@
75
87
  # match CRED-003 but not FILE-008 — intentional, since file_path matching is more
76
88
  # targeted than command-string matching.
77
89
  - id: "CLT-FILE-008"
90
+ version: 1
91
+ detection_name: "FN:SageFile-H [Heur]"
78
92
  category: secrets
79
93
  severity: warning
80
94
  confidence: 0.60
@@ -86,6 +100,8 @@
86
100
 
87
101
  # --- Git hooks ---
88
102
  - id: "CLT-FILE-009"
103
+ version: 1
104
+ detection_name: "FN:SageFile-I [Heur]"
89
105
  category: tool
90
106
  severity: warning
91
107
  confidence: 0.60
@@ -97,6 +113,8 @@
97
113
 
98
114
  # --- Android signing files ---
99
115
  - id: "CLT-FILE-010"
116
+ version: 1
117
+ detection_name: "FN:SageFile-J [Heur]"
100
118
  category: secrets
101
119
  severity: warning
102
120
  confidence: 0.60
@@ -108,6 +126,8 @@
108
126
 
109
127
  # --- Firebase config files ---
110
128
  - id: "CLT-FILE-011"
129
+ version: 1
130
+ detection_name: "FN:SageFile-K [Heur]"
111
131
  category: secrets
112
132
  severity: warning
113
133
  confidence: 0.60
@@ -119,6 +139,8 @@
119
139
 
120
140
  # --- Cloud provider credential files ---
121
141
  - id: "CLT-FILE-012"
142
+ version: 1
143
+ detection_name: "FN:SageFile-L [Heur]"
122
144
  category: secrets
123
145
  severity: warning
124
146
  confidence: 0.60
@@ -130,6 +152,8 @@
130
152
 
131
153
  # --- Package manager tokens ---
132
154
  - id: "CLT-FILE-013"
155
+ version: 1
156
+ detection_name: "FN:SageFile-M [Heur]"
133
157
  category: secrets
134
158
  severity: warning
135
159
  confidence: 0.60
@@ -141,6 +165,8 @@
141
165
 
142
166
  # --- Terraform state files ---
143
167
  - id: "CLT-FILE-014"
168
+ version: 1
169
+ detection_name: "FN:SageFile-N [Heur]"
144
170
  category: secrets
145
171
  severity: warning
146
172
  confidence: 0.60
@@ -152,6 +178,8 @@
152
178
 
153
179
  # --- Secrets/vault files ---
154
180
  - id: "CLT-FILE-015"
181
+ version: 1
182
+ detection_name: "FN:SageFile-O [Heur]"
155
183
  category: secrets
156
184
  severity: warning
157
185
  confidence: 0.60
@@ -166,6 +194,8 @@
166
194
  # Accepted trade-off: require_approval keeps noise bounded, and excluding .pem
167
195
  # would miss private key exfiltration.
168
196
  - id: "CLT-FILE-016"
197
+ version: 1
198
+ detection_name: "FN:SageFile-P [Heur]"
169
199
  category: secrets
170
200
  severity: warning
171
201
  confidence: 0.60
@@ -177,6 +207,8 @@
177
207
 
178
208
  # --- Kubeconfig ---
179
209
  - id: "CLT-FILE-017"
210
+ version: 1
211
+ detection_name: "FN:SageFile-Q [Heur]"
180
212
  category: secrets
181
213
  severity: warning
182
214
  confidence: 0.60
@@ -188,6 +220,8 @@
188
220
 
189
221
  # --- Build system credential files ---
190
222
  - id: "CLT-FILE-018"
223
+ version: 1
224
+ detection_name: "FN:SageFile-R [Heur]"
191
225
  category: secrets
192
226
  severity: warning
193
227
  confidence: 0.60
@@ -199,6 +233,8 @@
199
233
 
200
234
  # --- Shell/REPL history files ---
201
235
  - id: "CLT-FILE-019"
236
+ version: 1
237
+ detection_name: "FN:SageFile-S [Heur]"
202
238
  category: secrets
203
239
  severity: warning
204
240
  confidence: 0.60
@@ -210,6 +246,8 @@
210
246
 
211
247
  # --- JetBrains IDE database credentials ---
212
248
  - id: "CLT-FILE-020"
249
+ version: 1
250
+ detection_name: "FN:SageFile-T [Heur]"
213
251
  category: secrets
214
252
  severity: warning
215
253
  confidence: 0.60
@@ -7,10 +7,13 @@
7
7
 
8
8
  # osascript -e 'do shell script' (AppleScript shell execution)
9
9
  - id: "CLT-MAC-CMD-001"
10
+ version: 1
11
+ detection_name: "CMD:SageMacOSCommand-A [Heur]"
10
12
  category: tool
11
13
  severity: critical
12
14
  confidence: 0.95
13
- pattern: "\\bosascript\\b.*-e.*do shell script"
15
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-CMD-009.
16
+ pattern: "{{CMD_POS}}osascript{{NOT_FILENAME}}.*-e.*do shell script"
14
17
  case_insensitive: true
15
18
  match_on: command
16
19
  title: "AppleScript shell execution via osascript -e"
@@ -19,10 +22,13 @@
19
22
 
20
23
  # osascript -l JavaScript (JXA execution)
21
24
  - id: "CLT-MAC-CMD-002"
25
+ version: 1
26
+ detection_name: "CMD:SageMacOSCommand-B [Heur]"
22
27
  category: tool
23
28
  severity: critical
24
29
  confidence: 0.90
25
- pattern: "\\bosascript\\b.*-l\\s+JavaScript"
30
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-CMD-009.
31
+ pattern: "{{CMD_POS}}osascript{{NOT_FILENAME}}.*-l\\s+JavaScript"
26
32
  case_insensitive: true
27
33
  match_on: command
28
34
  title: "JavaScript for Automation (JXA) execution via osascript"
@@ -31,10 +37,15 @@
31
37
 
32
38
  # Pipe to osascript (stdin AppleScript execution)
33
39
  - id: "CLT-MAC-CMD-003"
40
+ version: 1
41
+ detection_name: "CMD:SageMacOSCommand-C [Heur]"
34
42
  category: tool
35
43
  severity: critical
36
44
  confidence: 0.90
37
- pattern: "\\|\\s*osascript"
45
+ # {{NOT_FILENAME}} rejects a longer identifier (`osascriptable-formatter`);
46
+ # the pipe itself is already a real command-position boundary, so a full
47
+ # {{CMD_POS}} isn't needed here.
48
+ pattern: "\\|\\s*osascript{{NOT_FILENAME}}"
38
49
  match_on: command
39
50
  title: "Piped input to osascript (stdin AppleScript execution)"
40
51
  expires_at: null
@@ -42,10 +53,17 @@
42
53
 
43
54
  # osascript loading script file from remote download
44
55
  - id: "CLT-MAC-CMD-004"
56
+ version: 1
57
+ detection_name: "CMD:SageMacOSCommand-D [Heur]"
45
58
  category: tool
46
59
  severity: critical
47
60
  confidence: 0.90
48
- pattern: "(curl|wget).*\\|.*osascript|osascript.*(curl|wget)"
61
+ # {{CMD_POS}} + {{NOT_FILENAME}} on both leading AND trailing identifiers of
62
+ # each alternative, same shape as CLT-CMD-009. Had no boundary at all. The
63
+ # trailing {{NOT_FILENAME}} matters here too -- without it, "osascript" and
64
+ # "curl"/"wget" match as substrings of longer identifiers
65
+ # (osascriptable-tool, start_curling_service).
66
+ pattern: "{{CMD_POS}}(curl|wget){{NOT_FILENAME}}.*\\|.*osascript{{NOT_FILENAME}}|{{CMD_POS}}osascript{{NOT_FILENAME}}.*(curl|wget){{NOT_FILENAME}}"
49
67
  case_insensitive: true
50
68
  match_on: command
51
69
  title: "Remote script download piped to osascript"
@@ -56,10 +74,13 @@
56
74
 
57
75
  # open -a Terminal (launch Terminal with script)
58
76
  - id: "CLT-MAC-CMD-005"
77
+ version: 1
78
+ detection_name: "CMD:SageMacOSCommand-E [Heur]"
59
79
  category: tool
60
80
  severity: warning
61
81
  confidence: 0.60
62
- pattern: "\\bopen\\s+-a\\s+Terminal"
82
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-CMD-009.
83
+ pattern: "{{CMD_POS}}open{{NOT_FILENAME}}\\s+-a\\s+Terminal"
63
84
  match_on: command
64
85
  title: "Launch Terminal application via open -a"
65
86
  expires_at: null
@@ -67,10 +88,13 @@
67
88
 
68
89
  # open with hidden/background flags
69
90
  - id: "CLT-MAC-CMD-006"
91
+ version: 1
92
+ detection_name: "CMD:SageMacOSCommand-F [Heur]"
70
93
  category: tool
71
94
  severity: warning
72
95
  confidence: 0.60
73
- pattern: "\\bopen\\s+(-[jg]|--hide|--background)"
96
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-MAC-CMD-005.
97
+ pattern: "{{CMD_POS}}open{{NOT_FILENAME}}\\s+(-[jg]|--hide|--background)"
74
98
  match_on: command
75
99
  title: "Launch application hidden/background via open"
76
100
  expires_at: null
@@ -80,10 +104,13 @@
80
104
 
81
105
  # dscl user/group manipulation
82
106
  - id: "CLT-MAC-CMD-007"
107
+ version: 1
108
+ detection_name: "CMD:SageMacOSCommand-G [Heur]"
83
109
  category: tool
84
110
  severity: warning
85
111
  confidence: 0.60
86
- pattern: "\\bdscl\\b.*(-create|-delete|-passwd|-append)"
112
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-CMD-009.
113
+ pattern: "{{CMD_POS}}dscl{{NOT_FILENAME}}.*(-create|-delete|-passwd|-append)"
87
114
  match_on: command
88
115
  title: "Directory Services user/group manipulation via dscl"
89
116
  expires_at: null
@@ -91,10 +118,13 @@
91
118
 
92
119
  # networksetup proxy/DNS manipulation
93
120
  - id: "CLT-MAC-CMD-008"
121
+ version: 1
122
+ detection_name: "CMD:SageMacOSCommand-H [Heur]"
94
123
  category: tool
95
124
  severity: warning
96
125
  confidence: 0.60
97
- pattern: "\\bnetworksetup\\b.*(-setwebproxy|-setsocksfirewallproxy|-setdnsservers|-setautoproxyurl)"
126
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-CMD-009.
127
+ pattern: "{{CMD_POS}}networksetup{{NOT_FILENAME}}.*(-setwebproxy|-setsocksfirewallproxy|-setdnsservers|-setautoproxyurl)"
98
128
  case_insensitive: true
99
129
  match_on: command
100
130
  title: "Network proxy/DNS manipulation via networksetup"
@@ -103,10 +133,13 @@
103
133
 
104
134
  # systemsetup enabling remote access
105
135
  - id: "CLT-MAC-CMD-009"
136
+ version: 1
137
+ detection_name: "CMD:SageMacOSCommand-I [Heur]"
106
138
  category: tool
107
139
  severity: critical
108
140
  confidence: 0.90
109
- pattern: "\\bsystemsetup\\b.*(-setremotelogin\\s+on|-setwakeonnetworkaccess\\s+on)"
141
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-CMD-009.
142
+ pattern: "{{CMD_POS}}systemsetup{{NOT_FILENAME}}.*(-setremotelogin\\s+on|-setwakeonnetworkaccess\\s+on)"
110
143
  case_insensitive: true
111
144
  match_on: command
112
145
  title: "Enable remote login/wake via systemsetup"
@@ -115,10 +148,14 @@
115
148
 
116
149
  # kickstart ARD remote management
117
150
  - id: "CLT-MAC-CMD-010"
151
+ version: 1
152
+ detection_name: "CMD:SageMacOSCommand-J [Heur]"
118
153
  category: tool
119
154
  severity: critical
120
155
  confidence: 0.90
121
- pattern: "kickstart.*-activate.*-configure"
156
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-CMD-009. Had no
157
+ # boundary at all.
158
+ pattern: "{{CMD_POS}}kickstart{{NOT_FILENAME}}.*-activate.*-configure"
122
159
  case_insensitive: true
123
160
  match_on: command
124
161
  title: "Apple Remote Desktop activation via kickstart"
@@ -127,10 +164,13 @@
127
164
 
128
165
  # installer -pkg -target / (silent package install)
129
166
  - id: "CLT-MAC-CMD-011"
167
+ version: 1
168
+ detection_name: "CMD:SageMacOSCommand-K [Heur]"
130
169
  category: tool
131
170
  severity: warning
132
171
  confidence: 0.60
133
- pattern: "\\binstaller\\b.*-pkg.*-target"
172
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-CMD-009.
173
+ pattern: "{{CMD_POS}}installer{{NOT_FILENAME}}.*-pkg.*-target"
134
174
  case_insensitive: true
135
175
  match_on: command
136
176
  title: "Silent package install via installer command"
@@ -139,10 +179,13 @@
139
179
 
140
180
  # hdiutil mount remote DMG
141
181
  - id: "CLT-MAC-CMD-012"
182
+ version: 1
183
+ detection_name: "CMD:SageMacOSCommand-L [Heur]"
142
184
  category: tool
143
185
  severity: warning
144
186
  confidence: 0.60
145
- pattern: "\\bhdiutil\\b.*\\b(attach|mount)\\b.*https?://"
187
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-CMD-009.
188
+ pattern: "{{CMD_POS}}hdiutil{{NOT_FILENAME}}.*\\b(attach|mount)\\b.*https?://"
146
189
  case_insensitive: true
147
190
  match_on: command
148
191
  title: "Mount remote DMG via hdiutil"
@@ -151,10 +194,13 @@
151
194
 
152
195
  # pkgutil --forget (package receipt manipulation)
153
196
  - id: "CLT-MAC-CMD-013"
197
+ version: 1
198
+ detection_name: "CMD:SageMacOSCommand-M [Heur]"
154
199
  category: tool
155
200
  severity: warning
156
201
  confidence: 0.60
157
- pattern: "\\bpkgutil\\b.*--forget"
202
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-CMD-009.
203
+ pattern: "{{CMD_POS}}pkgutil{{NOT_FILENAME}}.*--forget"
158
204
  match_on: command
159
205
  title: "Package receipt removal via pkgutil --forget"
160
206
  expires_at: null
@@ -164,10 +210,13 @@
164
210
 
165
211
  # diskutil eraseDisk
166
212
  - id: "CLT-MAC-CMD-014"
213
+ version: 1
214
+ detection_name: "CMD:SageMacOSCommand-N [Heur]"
167
215
  category: tool
168
216
  severity: critical
169
217
  confidence: 0.95
170
- pattern: "\\bdiskutil\\b.*\\b(eraseDisk|partitionDisk|secureErase)\\b"
218
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-CMD-009.
219
+ pattern: "{{CMD_POS}}diskutil{{NOT_FILENAME}}.*\\b(eraseDisk|partitionDisk|secureErase)\\b"
171
220
  match_on: command
172
221
  title: "Disk erase/partition via diskutil"
173
222
  expires_at: null
@@ -175,10 +224,13 @@
175
224
 
176
225
  # tmutil delete (Time Machine backup deletion — ransomware indicator)
177
226
  - id: "CLT-MAC-CMD-015"
227
+ version: 1
228
+ detection_name: "CMD:SageMacOSCommand-O [Heur]"
178
229
  category: tool
179
230
  severity: critical
180
231
  confidence: 0.95
181
- pattern: "\\btmutil\\b.*\\b(delete|disable)\\b"
232
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-CMD-009.
233
+ pattern: "{{CMD_POS}}tmutil{{NOT_FILENAME}}.*\\b(delete|disable)\\b"
182
234
  match_on: command
183
235
  title: "Time Machine backup deletion/disable via tmutil (ransomware indicator)"
184
236
  expires_at: null
@@ -188,10 +240,13 @@
188
240
 
189
241
  # spctl --master-disable (Gatekeeper disable)
190
242
  - id: "CLT-MAC-CMD-016"
243
+ version: 1
244
+ detection_name: "CMD:SageMacOSCommand-P [Heur]"
191
245
  category: tool
192
246
  severity: critical
193
247
  confidence: 0.95
194
- pattern: "\\bspctl\\b.*--master-disable"
248
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-CMD-009.
249
+ pattern: "{{CMD_POS}}spctl{{NOT_FILENAME}}.*--master-disable"
195
250
  match_on: command
196
251
  title: "Gatekeeper disable via spctl --master-disable"
197
252
  expires_at: null
@@ -199,10 +254,13 @@
199
254
 
200
255
  # csrutil disable (SIP disable)
201
256
  - id: "CLT-MAC-CMD-017"
257
+ version: 1
258
+ detection_name: "CMD:SageMacOSCommand-Q [Heur]"
202
259
  category: tool
203
260
  severity: critical
204
261
  confidence: 0.95
205
- pattern: "\\bcsrutil\\b.*\\bdisable\\b"
262
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-CMD-009.
263
+ pattern: "{{CMD_POS}}csrutil{{NOT_FILENAME}}.*\\bdisable\\b"
206
264
  match_on: command
207
265
  title: "System Integrity Protection disable via csrutil"
208
266
  expires_at: null
@@ -210,10 +268,15 @@
210
268
 
211
269
  # defaults write LSQuarantine (quarantine flag disable)
212
270
  - id: "CLT-MAC-CMD-018"
271
+ version: 1
272
+ detection_name: "CMD:SageMacOSCommand-R [Heur]"
213
273
  category: tool
214
274
  severity: critical
215
275
  confidence: 0.90
216
- pattern: "\\bdefaults\\b.*\\bwrite\\b.*LSQuarantine"
276
+ # {{CMD_POS}} + {{NOT_FILENAME}} on `defaults`, same shape as CLT-CMD-009.
277
+ # The inner `\bwrite\b` is left as bare -- only reachable once `defaults`
278
+ # has already matched at command position.
279
+ pattern: "{{CMD_POS}}defaults{{NOT_FILENAME}}.*\\bwrite\\b.*LSQuarantine"
217
280
  case_insensitive: true
218
281
  match_on: command
219
282
  title: "Quarantine flag disable via defaults write LSQuarantine"
@@ -222,10 +285,13 @@
222
285
 
223
286
  # xattr -d com.apple.quarantine (quarantine removal)
224
287
  - id: "CLT-MAC-CMD-019"
288
+ version: 1
289
+ detection_name: "CMD:SageMacOSCommand-S [Heur]"
225
290
  category: tool
226
291
  severity: warning
227
292
  confidence: 0.60
228
- pattern: "\\bxattr\\b.*-d.*com\\.apple\\.quarantine"
293
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-CMD-009.
294
+ pattern: "{{CMD_POS}}xattr{{NOT_FILENAME}}.*-d.*com\\.apple\\.quarantine"
229
295
  match_on: command
230
296
  title: "Quarantine attribute removal via xattr"
231
297
  expires_at: null
@@ -233,10 +299,13 @@
233
299
 
234
300
  # pfctl -d (packet filter / firewall disable)
235
301
  - id: "CLT-MAC-CMD-020"
302
+ version: 1
303
+ detection_name: "CMD:SageMacOSCommand-T [Heur]"
236
304
  category: tool
237
305
  severity: critical
238
306
  confidence: 0.90
239
- pattern: "\\bpfctl\\b.*\\s-d\\b"
307
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-CMD-009.
308
+ pattern: "{{CMD_POS}}pfctl{{NOT_FILENAME}}.*\\s-d\\b"
240
309
  match_on: command
241
310
  title: "Packet filter (firewall) disable via pfctl -d"
242
311
  expires_at: null
@@ -244,10 +313,13 @@
244
313
 
245
314
  # tccutil reset (TCC privacy permissions reset)
246
315
  - id: "CLT-MAC-CMD-021"
316
+ version: 1
317
+ detection_name: "CMD:SageMacOSCommand-U [Heur]"
247
318
  category: tool
248
319
  severity: critical
249
320
  confidence: 0.90
250
- pattern: "\\btccutil\\b.*\\breset\\b"
321
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-CMD-009.
322
+ pattern: "{{CMD_POS}}tccutil{{NOT_FILENAME}}.*\\breset\\b"
251
323
  match_on: command
252
324
  title: "TCC privacy permissions reset via tccutil"
253
325
  expires_at: null
@@ -255,10 +327,13 @@
255
327
 
256
328
  # launchctl unload security daemons
257
329
  - id: "CLT-MAC-CMD-022"
330
+ version: 1
331
+ detection_name: "CMD:SageMacOSCommand-V [Heur]"
258
332
  category: tool
259
333
  severity: critical
260
334
  confidence: 0.90
261
- pattern: "\\blaunchctl\\b.*\\b(unload|bootout)\\b.*(com\\.apple\\.MRT|com\\.apple\\.XProtect|com\\.apple\\.security)"
335
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-CMD-009.
336
+ pattern: "{{CMD_POS}}launchctl{{NOT_FILENAME}}.*\\b(unload|bootout)\\b.*(com\\.apple\\.MRT|com\\.apple\\.XProtect|com\\.apple\\.security)"
262
337
  case_insensitive: true
263
338
  match_on: command
264
339
  title: "Unload macOS security daemon via launchctl"
@@ -267,10 +342,13 @@
267
342
 
268
343
  # defaults write to disable macOS security features
269
344
  - id: "CLT-MAC-CMD-023"
345
+ version: 1
346
+ detection_name: "CMD:SageMacOSCommand-W [Heur]"
270
347
  category: tool
271
348
  severity: critical
272
349
  confidence: 0.90
273
- pattern: "\\bdefaults\\b.*\\bwrite\\b.*(com\\.apple\\.Finder\\s+AppleShowAllFiles|com\\.apple\\.LaunchServices\\s+LSQuarantine|com\\.apple\\.loginwindow)"
350
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-MAC-CMD-018.
351
+ pattern: "{{CMD_POS}}defaults{{NOT_FILENAME}}.*\\bwrite\\b.*(com\\.apple\\.Finder\\s+AppleShowAllFiles|com\\.apple\\.LaunchServices\\s+LSQuarantine|com\\.apple\\.loginwindow)"
274
352
  case_insensitive: true
275
353
  match_on: command
276
354
  title: "Modify macOS security-related defaults"
@@ -281,10 +359,13 @@
281
359
 
282
360
  # dscl . -passwd (change user password)
283
361
  - id: "CLT-MAC-CMD-024"
362
+ version: 1
363
+ detection_name: "CMD:SageMacOSCommand-X [Heur]"
284
364
  category: tool
285
365
  severity: critical
286
366
  confidence: 0.90
287
- pattern: "\\bdscl\\b.*\\s-passwd\\b"
367
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-MAC-CMD-007.
368
+ pattern: "{{CMD_POS}}dscl{{NOT_FILENAME}}.*\\s-passwd\\b"
288
369
  match_on: command
289
370
  title: "User password change via dscl"
290
371
  expires_at: null
@@ -292,10 +373,13 @@
292
373
 
293
374
  # dseditgroup add user to admin
294
375
  - id: "CLT-MAC-CMD-025"
376
+ version: 1
377
+ detection_name: "CMD:SageMacOSCommand-Y [Heur]"
295
378
  category: tool
296
379
  severity: critical
297
380
  confidence: 0.95
298
- pattern: "\\bdseditgroup\\b.*-o\\s+edit.*-a.*admin"
381
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-CMD-009.
382
+ pattern: "{{CMD_POS}}dseditgroup{{NOT_FILENAME}}.*-o\\s+edit.*-a.*admin"
299
383
  match_on: command
300
384
  title: "Add user to admin group via dseditgroup"
301
385
  expires_at: null
@@ -303,10 +387,14 @@
303
387
 
304
388
  # createhomedir — create home directory for arbitrary user
305
389
  - id: "CLT-MAC-CMD-026"
390
+ version: 1
391
+ detection_name: "CMD:SageMacOSCommand-Z [Heur]"
306
392
  category: tool
307
393
  severity: warning
308
394
  confidence: 0.60
309
- pattern: "\\bcreatehomedir\\b"
395
+ # {{CMD_POS}} requires command position; {{HAS_ARG}} drops a bare mention,
396
+ # since createhomedir with no flags just prints usage.
397
+ pattern: "{{CMD_POS}}createhomedir{{NOT_FILENAME}}{{HAS_ARG}}"
310
398
  match_on: command
311
399
  title: "Create home directory for user via createhomedir"
312
400
  expires_at: null
@@ -318,10 +406,13 @@
318
406
 
319
407
  # screencapture to remote or hidden location
320
408
  - id: "CLT-MAC-CMD-027"
409
+ version: 1
410
+ detection_name: "CMD:SageMacOSCommand-AA [Heur]"
321
411
  category: tool
322
412
  severity: warning
323
413
  confidence: 0.60
324
- pattern: "\\bscreencapture\\b.*(-x|-C)"
414
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-CMD-009.
415
+ pattern: "{{CMD_POS}}screencapture{{NOT_FILENAME}}.*(-x|-C)"
325
416
  match_on: command
326
417
  title: "Silent screen capture via screencapture"
327
418
  expires_at: null