@gendigital/sage-opencode 0.11.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 (44) hide show
  1. package/README.md +1 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +255 -74
  4. package/dist/index.js.map +1 -1
  5. package/dist/mcp-server.cjs +230 -96
  6. package/dist/mcp-server.cjs.map +4 -4
  7. package/dist/plugin-discovery.d.ts +1 -0
  8. package/dist/plugin-discovery.d.ts.map +1 -1
  9. package/dist/plugin-discovery.js +27 -1
  10. package/dist/plugin-discovery.js.map +1 -1
  11. package/dist/startup-scan.d.ts +11 -3
  12. package/dist/startup-scan.d.ts.map +1 -1
  13. package/dist/startup-scan.js +59 -21
  14. package/dist/startup-scan.js.map +1 -1
  15. package/dist/tool-handler.d.ts +2 -1
  16. package/dist/tool-handler.d.ts.map +1 -1
  17. package/dist/tool-handler.js +17 -4
  18. package/dist/tool-handler.js.map +1 -1
  19. package/package.json +3 -3
  20. package/resources/threats/_macros.yaml +193 -0
  21. package/resources/threats/agent-layer.yaml +19 -1
  22. package/resources/threats/commands.yaml +165 -31
  23. package/resources/threats/credentials.yaml +24 -4
  24. package/resources/threats/dummy.yaml +52 -17
  25. package/resources/threats/files.yaml +38 -0
  26. package/resources/threats/mac-commands.yaml +118 -27
  27. package/resources/threats/mac-credentials.yaml +34 -8
  28. package/resources/threats/mac-files.yaml +20 -0
  29. package/resources/threats/mac-obfuscation.yaml +28 -6
  30. package/resources/threats/mac-persistence.yaml +30 -4
  31. package/resources/threats/mac-supply-chain.yaml +12 -3
  32. package/resources/threats/mitre.yaml +325 -62
  33. package/resources/threats/obfuscation.yaml +33 -8
  34. package/resources/threats/persistence.yaml +40 -5
  35. package/resources/threats/prompt-injection.yaml +58 -0
  36. package/resources/threats/self-defense.yaml +15 -2
  37. package/resources/threats/supply_chain.yaml +6 -1
  38. package/resources/threats/urls.yaml +10 -0
  39. package/resources/threats/win-commands.yaml +294 -60
  40. package/resources/threats/win-credentials.yaml +68 -9
  41. package/resources/threats/win-files.yaml +20 -0
  42. package/resources/threats/win-obfuscation.yaml +56 -8
  43. package/resources/threats/win-persistence.yaml +45 -7
  44. package/resources/threats/win-supply-chain.yaml +5 -1
@@ -4,10 +4,13 @@
4
4
 
5
5
  # osascript 'do shell script' wrapping (shell via AppleScript)
6
6
  - id: "CLT-MAC-OBFUS-001"
7
+ version: 1
8
+ detection_name: "CMD:SageMacOSObfuscation-A [Heur]"
7
9
  category: tool
8
10
  severity: critical
9
11
  confidence: 0.90
10
- pattern: "\\bosascript\\b.*do shell script"
12
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-CMD-009.
13
+ pattern: "{{CMD_POS}}osascript{{NOT_FILENAME}}.*do shell script"
11
14
  case_insensitive: true
12
15
  match_on: command
13
16
  title: "Shell command obfuscated via AppleScript do shell script"
@@ -16,10 +19,13 @@
16
19
 
17
20
  # JXA (JavaScript for Automation) execution
18
21
  - id: "CLT-MAC-OBFUS-002"
22
+ version: 1
23
+ detection_name: "CMD:SageMacOSObfuscation-B [Heur]"
19
24
  category: tool
20
25
  severity: critical
21
26
  confidence: 0.90
22
- pattern: "\\bosascript\\b.*-l\\s+JavaScript.*-e"
27
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-CMD-009.
28
+ pattern: "{{CMD_POS}}osascript{{NOT_FILENAME}}.*-l\\s+JavaScript.*-e"
23
29
  case_insensitive: true
24
30
  match_on: command
25
31
  title: "JXA inline execution (JavaScript for Automation obfuscation)"
@@ -28,10 +34,15 @@
28
34
 
29
35
  # Base64 decode piped to osascript
30
36
  - id: "CLT-MAC-OBFUS-003"
37
+ version: 1
38
+ detection_name: "CMD:SageMacOSObfuscation-C [Heur]"
31
39
  category: tool
32
40
  severity: critical
33
41
  confidence: 0.95
34
- pattern: "base64\\s+(-d|-D|--decode).*\\|.*osascript"
42
+ # {{CMD_POS}} + {{NOT_FILENAME}} on `base64`, same shape as CLT-CMD-009.
43
+ # Had no boundary at all. Trailing {{NOT_FILENAME}} on `osascript` too --
44
+ # without it, a longer identifier like "osascriptable-tool" still matches.
45
+ pattern: "{{CMD_POS}}base64{{NOT_FILENAME}}\\s+(-d|-D|--decode).*\\|.*osascript{{NOT_FILENAME}}"
35
46
  match_on: command
36
47
  title: "Base64 decode piped to osascript (encoded payload execution)"
37
48
  expires_at: null
@@ -39,6 +50,8 @@
39
50
 
40
51
  # DYLD_INSERT_LIBRARIES injection
41
52
  - id: "CLT-MAC-OBFUS-004"
53
+ version: 1
54
+ detection_name: "CMD:SageMacOSObfuscation-D [Heur]"
42
55
  category: tool
43
56
  severity: critical
44
57
  confidence: 0.90
@@ -50,10 +63,13 @@
50
63
 
51
64
  # Quarantine attribute removal (evasion)
52
65
  - id: "CLT-MAC-OBFUS-005"
66
+ version: 1
67
+ detection_name: "CMD:SageMacOSObfuscation-E [Heur]"
53
68
  category: tool
54
69
  severity: warning
55
70
  confidence: 0.60
56
- pattern: "\\bxattr\\b.*(-d|-c).*com\\.apple\\.quarantine"
71
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-CMD-009.
72
+ pattern: "{{CMD_POS}}xattr{{NOT_FILENAME}}.*(-d|-c).*com\\.apple\\.quarantine"
57
73
  match_on: command
58
74
  title: "Quarantine attribute removal (Gatekeeper evasion)"
59
75
  expires_at: null
@@ -63,10 +79,13 @@
63
79
 
64
80
  # plutil plist manipulation (payload hiding)
65
81
  - id: "CLT-MAC-OBFUS-006"
82
+ version: 1
83
+ detection_name: "CMD:SageMacOSObfuscation-F [Heur]"
66
84
  category: tool
67
85
  severity: warning
68
86
  confidence: 0.60
69
- pattern: "\\bplutil\\b.*-convert\\s+(binary1|raw)"
87
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-CMD-009.
88
+ pattern: "{{CMD_POS}}plutil{{NOT_FILENAME}}.*-convert\\s+(binary1|raw)"
70
89
  match_on: command
71
90
  title: "Plist conversion to binary (payload obfuscation)"
72
91
  expires_at: null
@@ -74,10 +93,13 @@
74
93
 
75
94
  # Swift/swiftc inline execution
76
95
  - id: "CLT-MAC-OBFUS-007"
96
+ version: 1
97
+ detection_name: "CMD:SageMacOSObfuscation-G [Heur]"
77
98
  category: tool
78
99
  severity: warning
79
100
  confidence: 0.60
80
- pattern: "\\bswift\\b\\s+-e\\s+[\"'].*\\b(Process|NSTask|URLSession|shell)\\b"
101
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-CMD-009.
102
+ pattern: "{{CMD_POS}}swift{{NOT_FILENAME}}\\s+-e\\s+[\"'].*\\b(Process|NSTask|URLSession|shell)\\b"
81
103
  case_insensitive: true
82
104
  match_on: command
83
105
  title: "Swift inline execution with system calls"
@@ -5,6 +5,8 @@
5
5
 
6
6
  # LaunchAgent/LaunchDaemon plist (migrated from persistence.yaml CLT-PERSIST-004)
7
7
  - id: "CLT-MAC-PERSIST-001"
8
+ version: 1
9
+ detection_name: "CMD:SageMacOSPersistence-A [Heur]"
8
10
  category: tool
9
11
  severity: warning
10
12
  confidence: 0.90
@@ -16,10 +18,13 @@
16
18
 
17
19
  # Login Items via osascript
18
20
  - id: "CLT-MAC-PERSIST-002"
21
+ version: 1
22
+ detection_name: "CMD:SageMacOSPersistence-B [Heur]"
19
23
  category: tool
20
24
  severity: warning
21
25
  confidence: 0.60
22
- pattern: "\\bosascript\\b.*login item"
26
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-CMD-009.
27
+ pattern: "{{CMD_POS}}osascript{{NOT_FILENAME}}.*login item"
23
28
  case_insensitive: true
24
29
  match_on: command
25
30
  title: "Add login item via osascript"
@@ -28,10 +33,15 @@
28
33
 
29
34
  # Login window manipulation via defaults
30
35
  - id: "CLT-MAC-PERSIST-003"
36
+ version: 1
37
+ detection_name: "CMD:SageMacOSPersistence-C [Heur]"
31
38
  category: tool
32
39
  severity: warning
33
40
  confidence: 0.60
34
- pattern: "\\bdefaults\\b.*\\bwrite\\b.*loginwindow.*(AutoLaunch|LoginHook|LogoutHook)"
41
+ # {{CMD_POS}} + {{NOT_FILENAME}} on `defaults`, same shape as CLT-CMD-009.
42
+ # The inner `\bwrite\b` is left as bare -- only reachable once `defaults`
43
+ # has already matched at command position.
44
+ pattern: "{{CMD_POS}}defaults{{NOT_FILENAME}}.*\\bwrite\\b.*loginwindow.*(AutoLaunch|LoginHook|LogoutHook)"
35
45
  case_insensitive: true
36
46
  match_on: command
37
47
  title: "Login window hook manipulation via defaults write"
@@ -40,6 +50,8 @@
40
50
 
41
51
  # Authorization plugin persistence
42
52
  - id: "CLT-MAC-PERSIST-004"
53
+ version: 1
54
+ detection_name: "CMD:SageMacOSPersistence-D [Heur]"
43
55
  category: tool
44
56
  severity: critical
45
57
  confidence: 0.90
@@ -51,6 +63,8 @@
51
63
 
52
64
  # Periodic script drop
53
65
  - id: "CLT-MAC-PERSIST-005"
66
+ version: 1
67
+ detection_name: "CMD:SageMacOSPersistence-E [Heur]"
54
68
  category: tool
55
69
  severity: warning
56
70
  confidence: 0.60
@@ -64,6 +78,8 @@
64
78
 
65
79
  # emond rules
66
80
  - id: "CLT-MAC-PERSIST-006"
81
+ version: 1
82
+ detection_name: "CMD:SageMacOSPersistence-F [Heur]"
67
83
  category: tool
68
84
  severity: critical
69
85
  confidence: 0.90
@@ -75,6 +91,8 @@
75
91
 
76
92
  # DYLD_INSERT_LIBRARIES in RC files
77
93
  - id: "CLT-MAC-PERSIST-007"
94
+ version: 1
95
+ detection_name: "CMD:SageMacOSPersistence-G [Heur]"
78
96
  category: tool
79
97
  severity: critical
80
98
  confidence: 0.90
@@ -86,10 +104,13 @@
86
104
 
87
105
  # Folder Actions via osascript
88
106
  - id: "CLT-MAC-PERSIST-008"
107
+ version: 1
108
+ detection_name: "CMD:SageMacOSPersistence-H [Heur]"
89
109
  category: tool
90
110
  severity: warning
91
111
  confidence: 0.60
92
- pattern: "\\bosascript\\b.*folder action"
112
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-CMD-009.
113
+ pattern: "{{CMD_POS}}osascript{{NOT_FILENAME}}.*folder action"
93
114
  case_insensitive: true
94
115
  match_on: command
95
116
  title: "Folder Action script persistence via osascript"
@@ -98,10 +119,15 @@
98
119
 
99
120
  # launchctl load/bootstrap persistent agent
100
121
  - id: "CLT-MAC-PERSIST-009"
122
+ version: 1
123
+ detection_name: "CMD:SageMacOSPersistence-I [Heur]"
101
124
  category: tool
102
125
  severity: warning
103
126
  confidence: 0.60
104
- pattern: "\\blaunchctl\\b.*\\b(load|bootstrap)\\b"
127
+ # {{CMD_POS}} + {{NOT_FILENAME}} on `launchctl`, same shape as CLT-CMD-009.
128
+ # The inner `\b(load|bootstrap)\b` is left as bare -- only reachable once
129
+ # `launchctl` has already matched at command position.
130
+ pattern: "{{CMD_POS}}launchctl{{NOT_FILENAME}}.*\\b(load|bootstrap)\\b"
105
131
  match_on: command
106
132
  title: "Load persistent launch agent/daemon via launchctl"
107
133
  expires_at: null
@@ -4,10 +4,13 @@
4
4
 
5
5
  # brew install without version pin
6
6
  - id: "CLT-MAC-SUPPLY-001"
7
+ version: 1
8
+ detection_name: "CMD:SageMacOSSupplyChain-A [Heur]"
7
9
  category: supply_chain
8
10
  severity: warning
9
11
  confidence: 0.60
10
- pattern: "\\bbrew\\s+install\\b(?!.*@\\d)"
12
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-CMD-009.
13
+ pattern: "{{CMD_POS}}brew{{NOT_FILENAME}}\\s+install\\b(?!.*@\\d)"
11
14
  match_on: command
12
15
  title: "Homebrew install without version pin"
13
16
  expires_at: null
@@ -15,10 +18,13 @@
15
18
 
16
19
  # installer -pkg from remote URL
17
20
  - id: "CLT-MAC-SUPPLY-002"
21
+ version: 1
22
+ detection_name: "CMD:SageMacOSSupplyChain-B [Heur]"
18
23
  category: supply_chain
19
24
  severity: warning
20
25
  confidence: 0.85
21
- pattern: "\\binstaller\\b.*-pkg.*https?://"
26
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-CMD-009.
27
+ pattern: "{{CMD_POS}}installer{{NOT_FILENAME}}.*-pkg.*https?://"
22
28
  case_insensitive: true
23
29
  match_on: command
24
30
  title: "Remote package install via installer -pkg (unsigned)"
@@ -27,10 +33,13 @@
27
33
 
28
34
  # brew install --cask from non-default tap
29
35
  - id: "CLT-MAC-SUPPLY-003"
36
+ version: 1
37
+ detection_name: "CMD:SageMacOSSupplyChain-C [Heur]"
30
38
  category: supply_chain
31
39
  severity: warning
32
40
  confidence: 0.60
33
- pattern: "\\bbrew\\s+(install|reinstall)\\s+--cask\\b"
41
+ # {{CMD_POS}} + {{NOT_FILENAME}}, same shape as CLT-CMD-009.
42
+ pattern: "{{CMD_POS}}brew{{NOT_FILENAME}}\\s+(install|reinstall)\\s+--cask\\b"
34
43
  match_on: command
35
44
  title: "Homebrew cask install (binary application)"
36
45
  expires_at: null