@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.
- package/README.md +102 -0
- package/dist/bundled-dirs.d.ts +12 -0
- package/dist/bundled-dirs.d.ts.map +1 -0
- package/dist/bundled-dirs.js +29 -0
- package/dist/bundled-dirs.js.map +1 -0
- package/dist/error.d.ts +7 -0
- package/dist/error.d.ts.map +1 -0
- package/dist/error.js +12 -0
- package/dist/error.js.map +1 -0
- package/dist/extractors.d.ts +6 -0
- package/dist/extractors.d.ts.map +1 -0
- package/dist/extractors.js +111 -0
- package/dist/extractors.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +128 -0
- package/dist/index.js.map +1 -0
- package/dist/logger-adaptor.d.ts +15 -0
- package/dist/logger-adaptor.d.ts.map +1 -0
- package/dist/logger-adaptor.js +32 -0
- package/dist/logger-adaptor.js.map +1 -0
- package/dist/plugin-discovery.d.ts +12 -0
- package/dist/plugin-discovery.d.ts.map +1 -0
- package/dist/plugin-discovery.js +138 -0
- package/dist/plugin-discovery.js.map +1 -0
- package/dist/startup-scan.d.ts +7 -0
- package/dist/startup-scan.d.ts.map +1 -0
- package/dist/startup-scan.js +41 -0
- package/dist/startup-scan.js.map +1 -0
- package/dist/tool-handler.d.ts +14 -0
- package/dist/tool-handler.d.ts.map +1 -0
- package/dist/tool-handler.js +93 -0
- package/dist/tool-handler.js.map +1 -0
- package/package.json +60 -0
- package/resources/allowlists/trusted-installer-domains.yaml +55 -0
- package/resources/threats/LICENSE +45 -0
- package/resources/threats/commands.yaml +351 -0
- package/resources/threats/credentials.yaml +105 -0
- package/resources/threats/dummy.yaml +195 -0
- package/resources/threats/files.yaml +239 -0
- package/resources/threats/mac-commands.yaml +355 -0
- package/resources/threats/mac-credentials.yaml +99 -0
- package/resources/threats/mac-files.yaml +124 -0
- package/resources/threats/mac-obfuscation.yaml +92 -0
- package/resources/threats/mac-persistence.yaml +117 -0
- package/resources/threats/mac-supply-chain.yaml +40 -0
- package/resources/threats/mitre.yaml +810 -0
- package/resources/threats/obfuscation.yaml +98 -0
- package/resources/threats/persistence.yaml +87 -0
- package/resources/threats/prompt-injection.yaml +334 -0
- package/resources/threats/self-defense.yaml +55 -0
- package/resources/threats/supply_chain.yaml +15 -0
- package/resources/threats/urls.yaml +66 -0
- package/resources/threats/win-commands.yaml +785 -0
- package/resources/threats/win-credentials.yaml +128 -0
- package/resources/threats/win-files.yaml +124 -0
- package/resources/threats/win-obfuscation.yaml +205 -0
- package/resources/threats/win-persistence.yaml +100 -0
- package/resources/threats/win-supply-chain.yaml +15 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Obfuscation threat patterns for Sage
|
|
2
|
+
# Author: Gen Digital Inc.
|
|
3
|
+
# License: DRL-1.1 (see threats/LICENSE)
|
|
4
|
+
|
|
5
|
+
# --- Base64 decode piped to shell ---
|
|
6
|
+
- id: "CLT-OBFUS-001"
|
|
7
|
+
category: tool
|
|
8
|
+
severity: critical
|
|
9
|
+
confidence: 0.95
|
|
10
|
+
action: block
|
|
11
|
+
pattern: "base64\\s+(-d|--decode)\\s*\\|\\s*(bash|sh|zsh|ksh|dash)"
|
|
12
|
+
match_on: command
|
|
13
|
+
title: "Base64 decode piped to shell execution"
|
|
14
|
+
expires_at: null
|
|
15
|
+
revoked: false
|
|
16
|
+
|
|
17
|
+
# --- Hex escape sequences in printf ---
|
|
18
|
+
- id: "CLT-OBFUS-002"
|
|
19
|
+
category: tool
|
|
20
|
+
severity: medium
|
|
21
|
+
confidence: 0.70
|
|
22
|
+
action: require_approval
|
|
23
|
+
pattern: "printf\\s+[\"']\\\\x[0-9a-fA-F]{2}(\\\\x[0-9a-fA-F]{2}){3,}"
|
|
24
|
+
match_on: command
|
|
25
|
+
title: "Hex escape sequences in printf (potential obfuscation)"
|
|
26
|
+
expires_at: null
|
|
27
|
+
revoked: false
|
|
28
|
+
|
|
29
|
+
# --- Reversed string piped to shell ---
|
|
30
|
+
- id: "CLT-OBFUS-003"
|
|
31
|
+
category: tool
|
|
32
|
+
severity: critical
|
|
33
|
+
confidence: 0.90
|
|
34
|
+
action: block
|
|
35
|
+
pattern: "\\|\\s*rev\\s*\\|\\s*(bash|sh|zsh|ksh|dash)"
|
|
36
|
+
match_on: command
|
|
37
|
+
title: "Reversed string piped to shell execution"
|
|
38
|
+
expires_at: null
|
|
39
|
+
revoked: false
|
|
40
|
+
|
|
41
|
+
# --- Eval with decode ---
|
|
42
|
+
- id: "CLT-OBFUS-004"
|
|
43
|
+
category: tool
|
|
44
|
+
severity: critical
|
|
45
|
+
confidence: 0.90
|
|
46
|
+
action: block
|
|
47
|
+
pattern: "\\beval\\s+.*\\$\\(\\s*base64|python[3]?\\s+-c\\s+[\"'].*exec\\(.*decode"
|
|
48
|
+
match_on: [command, content]
|
|
49
|
+
title: "Eval with decode (obfuscated code execution)"
|
|
50
|
+
expires_at: null
|
|
51
|
+
revoked: false
|
|
52
|
+
|
|
53
|
+
# --- Shell metacharacter escaping ---
|
|
54
|
+
- id: "CLT-OBFUS-005"
|
|
55
|
+
category: tool
|
|
56
|
+
severity: high
|
|
57
|
+
confidence: 0.85
|
|
58
|
+
action: block
|
|
59
|
+
pattern: "\\|\\s*[\\\\'\"]+(bash|sh|zsh|ksh|dash)[\\\\'\"]*(\\s|$)"
|
|
60
|
+
match_on: command
|
|
61
|
+
title: "Shell metacharacter escaping to hide pipe target"
|
|
62
|
+
expires_at: null
|
|
63
|
+
revoked: false
|
|
64
|
+
|
|
65
|
+
# --- Alias/function redefinition ---
|
|
66
|
+
- id: "CLT-OBFUS-006"
|
|
67
|
+
category: tool
|
|
68
|
+
severity: high
|
|
69
|
+
confidence: 0.80
|
|
70
|
+
action: require_approval
|
|
71
|
+
pattern: "\\balias\\s+(bash|sh|zsh|curl|wget|nc|netcat|python|ruby|perl|node)="
|
|
72
|
+
match_on: command
|
|
73
|
+
title: "Alias redefinition of security-relevant command"
|
|
74
|
+
expires_at: null
|
|
75
|
+
revoked: false
|
|
76
|
+
|
|
77
|
+
- id: "CLT-OBFUS-007"
|
|
78
|
+
category: tool
|
|
79
|
+
severity: high
|
|
80
|
+
confidence: 0.80
|
|
81
|
+
action: require_approval
|
|
82
|
+
pattern: "\\b(function\\s+)?(bash|sh|curl|wget|nc|python|ruby|perl|node)\\s*\\(\\s*\\)"
|
|
83
|
+
match_on: command
|
|
84
|
+
title: "Function redefinition of security-relevant command"
|
|
85
|
+
expires_at: null
|
|
86
|
+
revoked: false
|
|
87
|
+
|
|
88
|
+
# --- Python encoded payload execution ---
|
|
89
|
+
- id: "CLT-OBFUS-008"
|
|
90
|
+
category: tool
|
|
91
|
+
severity: critical
|
|
92
|
+
confidence: 0.85
|
|
93
|
+
action: block
|
|
94
|
+
pattern: "python[23]?\\s+-c\\s+[\"'].*\\b(exec|eval|compile|__import__)\\b.*\\b(base64|decode|decompress)\\b"
|
|
95
|
+
match_on: command
|
|
96
|
+
title: "Python encoded payload execution via -c"
|
|
97
|
+
expires_at: null
|
|
98
|
+
revoked: false
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Persistence mechanism threat patterns for Sage
|
|
2
|
+
# Author: Gen Digital Inc.
|
|
3
|
+
# License: DRL-1.1 (see threats/LICENSE)
|
|
4
|
+
|
|
5
|
+
# --- Shell RC file modification ---
|
|
6
|
+
- id: "CLT-PERSIST-001"
|
|
7
|
+
category: tool
|
|
8
|
+
severity: high
|
|
9
|
+
confidence: 0.85
|
|
10
|
+
action: require_approval
|
|
11
|
+
pattern: "(>>|>)\\s*~?/?(\\$HOME/)?\\.?(bashrc|zshrc|profile|bash_profile|zprofile|zshenv)"
|
|
12
|
+
match_on: command
|
|
13
|
+
title: "Write/append to shell RC file (persistence mechanism)"
|
|
14
|
+
expires_at: null
|
|
15
|
+
revoked: false
|
|
16
|
+
|
|
17
|
+
# --- Crontab manipulation ---
|
|
18
|
+
- id: "CLT-PERSIST-002"
|
|
19
|
+
category: tool
|
|
20
|
+
severity: high
|
|
21
|
+
confidence: 0.80
|
|
22
|
+
action: require_approval
|
|
23
|
+
pattern: "\\bcrontab\\s+(-[er]|[^-])"
|
|
24
|
+
match_on: command
|
|
25
|
+
title: "Crontab manipulation (list, edit, or remove scheduled tasks)"
|
|
26
|
+
expires_at: null
|
|
27
|
+
revoked: false
|
|
28
|
+
|
|
29
|
+
# --- Cron directory writes ---
|
|
30
|
+
- id: "CLT-PERSIST-003"
|
|
31
|
+
category: tool
|
|
32
|
+
severity: high
|
|
33
|
+
confidence: 0.85
|
|
34
|
+
action: require_approval
|
|
35
|
+
pattern: "/etc/cron\\.(d|daily|hourly|weekly|monthly)/"
|
|
36
|
+
match_on: command
|
|
37
|
+
title: "Write to system cron directory"
|
|
38
|
+
expires_at: null
|
|
39
|
+
revoked: false
|
|
40
|
+
|
|
41
|
+
# --- systemd service manipulation ---
|
|
42
|
+
- id: "CLT-PERSIST-005"
|
|
43
|
+
category: tool
|
|
44
|
+
severity: high
|
|
45
|
+
confidence: 0.85
|
|
46
|
+
action: require_approval
|
|
47
|
+
pattern: "\\bsystemctl\\s+(enable|start)\\b|/etc/systemd/system/"
|
|
48
|
+
match_on: command
|
|
49
|
+
title: "systemd service enable/start or unit file write"
|
|
50
|
+
expires_at: null
|
|
51
|
+
revoked: false
|
|
52
|
+
|
|
53
|
+
# --- SSH authorized_keys modification ---
|
|
54
|
+
- id: "CLT-PERSIST-006"
|
|
55
|
+
category: tool
|
|
56
|
+
severity: critical
|
|
57
|
+
confidence: 0.95
|
|
58
|
+
action: block
|
|
59
|
+
pattern: ">>\\s*(~|\\/(root|home\\/[a-zA-Z0-9._-]{1,32}))?/?\\.ssh/authorized_keys"
|
|
60
|
+
match_on: command
|
|
61
|
+
title: "Append to SSH authorized_keys (unauthorized access persistence)"
|
|
62
|
+
expires_at: null
|
|
63
|
+
revoked: false
|
|
64
|
+
|
|
65
|
+
# --- Echo/printf append to shell RC files ---
|
|
66
|
+
- id: "CLT-PERSIST-007"
|
|
67
|
+
category: tool
|
|
68
|
+
severity: critical
|
|
69
|
+
confidence: 0.90
|
|
70
|
+
action: block
|
|
71
|
+
pattern: "(echo|printf)\\s+.*>>\\s*~?/?(\\$HOME/)?\\.?(bashrc|zshrc|profile|bash_profile)"
|
|
72
|
+
match_on: command
|
|
73
|
+
title: "Echo/printf append to shell RC file (code injection persistence)"
|
|
74
|
+
expires_at: null
|
|
75
|
+
revoked: false
|
|
76
|
+
|
|
77
|
+
# --- at job scheduling ---
|
|
78
|
+
- id: "CLT-PERSIST-008"
|
|
79
|
+
category: tool
|
|
80
|
+
severity: high
|
|
81
|
+
confidence: 0.80
|
|
82
|
+
action: require_approval
|
|
83
|
+
pattern: "\\bat\\b\\s+(-f\\s+|now|midnight|noon|teatime)"
|
|
84
|
+
match_on: command
|
|
85
|
+
title: "At-job scheduling (persistence)"
|
|
86
|
+
expires_at: null
|
|
87
|
+
revoked: false
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
# Prompt injection detection heuristic rules (tier 1)
|
|
2
|
+
# Catches common PI patterns with zero model dependency, ~1ms.
|
|
3
|
+
# Designed for low false-positive rate on coding content.
|
|
4
|
+
#
|
|
5
|
+
# Sources: original Sage PI prototype, PR #90 (promptware), @stackone/defender patterns.
|
|
6
|
+
# These complement the ML model (tier 2) which handles subtler attacks.
|
|
7
|
+
|
|
8
|
+
# ── Instruction Override ────────────────────────────────────────────
|
|
9
|
+
# The most common PI pattern family. Well-established attack surface.
|
|
10
|
+
|
|
11
|
+
- id: "CLT-PI-001"
|
|
12
|
+
category: prompt_injection
|
|
13
|
+
severity: critical
|
|
14
|
+
confidence: 0.90
|
|
15
|
+
action: block
|
|
16
|
+
case_insensitive: true
|
|
17
|
+
pattern: "ignore\\s+(all\\s+)?(previous|prior|above|earlier)\\s+(instructions?|directives?|rules?|guidelines?|prompts?|directions?)"
|
|
18
|
+
match_on: content
|
|
19
|
+
title: "Instruction override: ignore previous"
|
|
20
|
+
expires_at: null
|
|
21
|
+
revoked: false
|
|
22
|
+
|
|
23
|
+
- id: "CLT-PI-002"
|
|
24
|
+
category: prompt_injection
|
|
25
|
+
severity: critical
|
|
26
|
+
confidence: 0.90
|
|
27
|
+
action: block
|
|
28
|
+
case_insensitive: true
|
|
29
|
+
pattern: "disregard\\s+(all\\s+)?(previous|prior|above|your)\\s+(instructions?|directives?|rules?|guidelines?|safety)"
|
|
30
|
+
match_on: content
|
|
31
|
+
title: "Instruction override: disregard directives"
|
|
32
|
+
expires_at: null
|
|
33
|
+
revoked: false
|
|
34
|
+
|
|
35
|
+
- id: "CLT-PI-003"
|
|
36
|
+
category: prompt_injection
|
|
37
|
+
severity: critical
|
|
38
|
+
confidence: 0.90
|
|
39
|
+
action: block
|
|
40
|
+
case_insensitive: true
|
|
41
|
+
pattern: "forget\\s+(all\\s+)?(your\\s+)?(previous\\s+)?(instructions?|rules?|guidelines?|restrictions?|constraints?|context)"
|
|
42
|
+
match_on: content
|
|
43
|
+
title: "Instruction override: forget instructions"
|
|
44
|
+
expires_at: null
|
|
45
|
+
revoked: false
|
|
46
|
+
|
|
47
|
+
- id: "CLT-PI-004"
|
|
48
|
+
category: prompt_injection
|
|
49
|
+
severity: critical
|
|
50
|
+
confidence: 0.90
|
|
51
|
+
action: block
|
|
52
|
+
case_insensitive: true
|
|
53
|
+
pattern: "override\\s+(the\\s+)?(system\\s+)?(prompt|instructions?|rules?|guidelines?)"
|
|
54
|
+
match_on: content
|
|
55
|
+
title: "Instruction override: direct override"
|
|
56
|
+
expires_at: null
|
|
57
|
+
revoked: false
|
|
58
|
+
|
|
59
|
+
- id: "CLT-PI-005"
|
|
60
|
+
category: prompt_injection
|
|
61
|
+
severity: high
|
|
62
|
+
confidence: 0.85
|
|
63
|
+
action: block
|
|
64
|
+
case_insensitive: true
|
|
65
|
+
pattern: "(new|updated?|revised?|changed?)\\s+instructions?:\\s*"
|
|
66
|
+
match_on: content
|
|
67
|
+
title: "Instruction override: inject new instructions"
|
|
68
|
+
expires_at: null
|
|
69
|
+
revoked: false
|
|
70
|
+
|
|
71
|
+
# ── Role / Persona Override ─────────────────────────────────────────
|
|
72
|
+
# Attempts to reassign the AI's identity or role.
|
|
73
|
+
|
|
74
|
+
- id: "CLT-PI-010"
|
|
75
|
+
category: prompt_injection
|
|
76
|
+
severity: critical
|
|
77
|
+
confidence: 0.90
|
|
78
|
+
action: block
|
|
79
|
+
case_insensitive: true
|
|
80
|
+
pattern: "you\\s+are\\s+now\\s+(a\\s+)?(different|new|the|my|an?\\s+unrestricted|an?\\s+unfiltered)"
|
|
81
|
+
match_on: content
|
|
82
|
+
title: "Role override: identity reassignment"
|
|
83
|
+
expires_at: null
|
|
84
|
+
revoked: false
|
|
85
|
+
|
|
86
|
+
- id: "CLT-PI-011"
|
|
87
|
+
category: prompt_injection
|
|
88
|
+
severity: high
|
|
89
|
+
confidence: 0.85
|
|
90
|
+
action: block
|
|
91
|
+
case_insensitive: true
|
|
92
|
+
pattern: "\\bDAN\\b.*?(do\\s+anything|jailbreak|no\\s+restrictions)"
|
|
93
|
+
match_on: content
|
|
94
|
+
title: "Role override: DAN jailbreak"
|
|
95
|
+
expires_at: null
|
|
96
|
+
revoked: false
|
|
97
|
+
|
|
98
|
+
- id: "CLT-PI-012"
|
|
99
|
+
category: prompt_injection
|
|
100
|
+
severity: high
|
|
101
|
+
confidence: 0.85
|
|
102
|
+
action: block
|
|
103
|
+
case_insensitive: true
|
|
104
|
+
pattern: "developer\\s+mode\\s+(is\\s+)?(now\\s+)?(enabled?|activated?|on).{0,50}(comply|content\\s+polic|no\\s+restrict|without\\s+restrict|any\\s+request)"
|
|
105
|
+
match_on: content
|
|
106
|
+
title: "Role override: developer mode jailbreak"
|
|
107
|
+
expires_at: null
|
|
108
|
+
revoked: false
|
|
109
|
+
|
|
110
|
+
- id: "CLT-PI-013"
|
|
111
|
+
category: prompt_injection
|
|
112
|
+
severity: high
|
|
113
|
+
confidence: 0.85
|
|
114
|
+
action: block
|
|
115
|
+
case_insensitive: true
|
|
116
|
+
pattern: "act\\s+(as|like)\\s+(a\\s+)?(system|admin|root|superuser)"
|
|
117
|
+
match_on: content
|
|
118
|
+
title: "Role override: privileged role assumption"
|
|
119
|
+
expires_at: null
|
|
120
|
+
revoked: false
|
|
121
|
+
|
|
122
|
+
# ── Security Bypass ─────────────────────────────────────────────────
|
|
123
|
+
# Attempts to disable safety mechanisms.
|
|
124
|
+
|
|
125
|
+
- id: "CLT-PI-020"
|
|
126
|
+
category: prompt_injection
|
|
127
|
+
severity: critical
|
|
128
|
+
confidence: 0.85
|
|
129
|
+
action: block
|
|
130
|
+
case_insensitive: true
|
|
131
|
+
pattern: "(bypass|disable)\\s+(the\\s+)?(security|safety|guardrails?|filters?|restrictions?)"
|
|
132
|
+
match_on: content
|
|
133
|
+
title: "Security bypass: disable safety features"
|
|
134
|
+
expires_at: null
|
|
135
|
+
revoked: false
|
|
136
|
+
|
|
137
|
+
- id: "CLT-PI-021"
|
|
138
|
+
category: prompt_injection
|
|
139
|
+
severity: high
|
|
140
|
+
confidence: 0.85
|
|
141
|
+
action: block
|
|
142
|
+
case_insensitive: true
|
|
143
|
+
pattern: "ignore\\s+(the\\s+)?(safety|security|ethical)\\s+(guidelines?|rules?|restrictions?)"
|
|
144
|
+
match_on: content
|
|
145
|
+
title: "Security bypass: ignore safety guidelines"
|
|
146
|
+
expires_at: null
|
|
147
|
+
revoked: false
|
|
148
|
+
|
|
149
|
+
- id: "CLT-PI-022"
|
|
150
|
+
category: prompt_injection
|
|
151
|
+
severity: high
|
|
152
|
+
confidence: 0.80
|
|
153
|
+
action: block
|
|
154
|
+
case_insensitive: true
|
|
155
|
+
pattern: "skip\\s+(all\\s+)?security\\s+checks"
|
|
156
|
+
match_on: content
|
|
157
|
+
title: "Security bypass: skip security checks"
|
|
158
|
+
expires_at: null
|
|
159
|
+
revoked: false
|
|
160
|
+
|
|
161
|
+
- id: "CLT-PI-023"
|
|
162
|
+
category: prompt_injection
|
|
163
|
+
severity: critical
|
|
164
|
+
confidence: 0.90
|
|
165
|
+
action: block
|
|
166
|
+
case_insensitive: true
|
|
167
|
+
pattern: "system\\s+override.{0,50}(execut|disabl|bypass|security|safet|comply|filter)"
|
|
168
|
+
match_on: content
|
|
169
|
+
title: "Security bypass: system override with action"
|
|
170
|
+
expires_at: null
|
|
171
|
+
revoked: false
|
|
172
|
+
|
|
173
|
+
# ── Anti-Transparency ──────────────────────────────────────────────
|
|
174
|
+
# Instructions to hide activity from the user.
|
|
175
|
+
|
|
176
|
+
- id: "CLT-PI-030"
|
|
177
|
+
category: prompt_injection
|
|
178
|
+
severity: critical
|
|
179
|
+
confidence: 0.90
|
|
180
|
+
action: block
|
|
181
|
+
case_insensitive: true
|
|
182
|
+
pattern: "do\\s+not\\s+(tell|inform|mention|reveal|show|disclose)\\s+(the\\s+)?(user|human|operator|developer)"
|
|
183
|
+
match_on: content
|
|
184
|
+
title: "Anti-transparency: hide from user"
|
|
185
|
+
expires_at: null
|
|
186
|
+
revoked: false
|
|
187
|
+
|
|
188
|
+
# ── Prompt Exfiltration ────────────────────────────────────────────
|
|
189
|
+
# Attempts to extract the system prompt or instructions.
|
|
190
|
+
|
|
191
|
+
- id: "CLT-PI-040"
|
|
192
|
+
category: prompt_injection
|
|
193
|
+
severity: high
|
|
194
|
+
confidence: 0.85
|
|
195
|
+
action: block
|
|
196
|
+
case_insensitive: true
|
|
197
|
+
pattern: "reveal\\s+(your\\s+)?(system\\s+)?prompt"
|
|
198
|
+
match_on: content
|
|
199
|
+
title: "Prompt exfiltration: reveal system prompt"
|
|
200
|
+
expires_at: null
|
|
201
|
+
revoked: false
|
|
202
|
+
|
|
203
|
+
- id: "CLT-PI-041"
|
|
204
|
+
category: prompt_injection
|
|
205
|
+
severity: high
|
|
206
|
+
confidence: 0.85
|
|
207
|
+
action: block
|
|
208
|
+
case_insensitive: true
|
|
209
|
+
pattern: "show\\s+(me\\s+)?(your\\s+)?(initial|original|system|hidden)\\s+instructions?"
|
|
210
|
+
match_on: content
|
|
211
|
+
title: "Prompt exfiltration: show hidden instructions"
|
|
212
|
+
expires_at: null
|
|
213
|
+
revoked: false
|
|
214
|
+
|
|
215
|
+
- id: "CLT-PI-042"
|
|
216
|
+
category: prompt_injection
|
|
217
|
+
severity: high
|
|
218
|
+
confidence: 0.85
|
|
219
|
+
action: block
|
|
220
|
+
case_insensitive: true
|
|
221
|
+
pattern: "repeat\\s+(back\\s+)?(everything|all|your\\s+instructions?)"
|
|
222
|
+
match_on: content
|
|
223
|
+
title: "Prompt exfiltration: repeat instructions"
|
|
224
|
+
expires_at: null
|
|
225
|
+
revoked: false
|
|
226
|
+
|
|
227
|
+
- id: "CLT-PI-043"
|
|
228
|
+
category: prompt_injection
|
|
229
|
+
severity: high
|
|
230
|
+
confidence: 0.85
|
|
231
|
+
action: block
|
|
232
|
+
case_insensitive: true
|
|
233
|
+
pattern: "output\\s+(your\\s+)?(initialization|system\\s+prompt|initial\\s+instructions?)"
|
|
234
|
+
match_on: content
|
|
235
|
+
title: "Prompt exfiltration: output initialization"
|
|
236
|
+
expires_at: null
|
|
237
|
+
revoked: false
|
|
238
|
+
|
|
239
|
+
# ── Structural Injection ───────────────────────────────────────────
|
|
240
|
+
# Injection hiding in HTML, markdown, or JSON structures.
|
|
241
|
+
|
|
242
|
+
- id: "CLT-PI-050"
|
|
243
|
+
category: prompt_injection
|
|
244
|
+
severity: high
|
|
245
|
+
confidence: 0.85
|
|
246
|
+
action: block
|
|
247
|
+
case_insensitive: true
|
|
248
|
+
pattern: "<!--\\s*(?:system|ignore|instruction|prompt|important|override|execute).*?-->"
|
|
249
|
+
match_on: content
|
|
250
|
+
title: "Structural injection: HTML comment with injection keywords"
|
|
251
|
+
expires_at: null
|
|
252
|
+
revoked: false
|
|
253
|
+
|
|
254
|
+
- id: "CLT-PI-051"
|
|
255
|
+
category: prompt_injection
|
|
256
|
+
severity: high
|
|
257
|
+
confidence: 0.85
|
|
258
|
+
action: block
|
|
259
|
+
case_insensitive: true
|
|
260
|
+
pattern: "\\[.*?\\]\\(.*?(?:ignore|forget|system|instruction|override).*?\\)"
|
|
261
|
+
match_on: content
|
|
262
|
+
title: "Structural injection: markdown link with hidden injection"
|
|
263
|
+
expires_at: null
|
|
264
|
+
revoked: false
|
|
265
|
+
|
|
266
|
+
# ── Role Marker Injection ──────────────────────────────────────────
|
|
267
|
+
# Fake conversation turn markers to confuse the model.
|
|
268
|
+
|
|
269
|
+
- id: "CLT-PI-060"
|
|
270
|
+
category: prompt_injection
|
|
271
|
+
severity: high
|
|
272
|
+
confidence: 0.85
|
|
273
|
+
action: block
|
|
274
|
+
case_insensitive: true
|
|
275
|
+
pattern: "\\n\\s*\\n\\s*(Human|User|Assistant|System)\\s*:"
|
|
276
|
+
match_on: content
|
|
277
|
+
title: "Role marker injection: fake conversation turn"
|
|
278
|
+
expires_at: null
|
|
279
|
+
revoked: false
|
|
280
|
+
|
|
281
|
+
- id: "CLT-PI-061"
|
|
282
|
+
category: prompt_injection
|
|
283
|
+
severity: high
|
|
284
|
+
confidence: 0.85
|
|
285
|
+
action: block
|
|
286
|
+
case_insensitive: true
|
|
287
|
+
pattern: "\\[INST\\]|\\[/INST\\]"
|
|
288
|
+
match_on: content
|
|
289
|
+
title: "Role marker injection: Llama instruction format"
|
|
290
|
+
expires_at: null
|
|
291
|
+
revoked: false
|
|
292
|
+
|
|
293
|
+
# ── Encoding / Obfuscation ─────────────────────────────────────────
|
|
294
|
+
# Obfuscated injection attempts.
|
|
295
|
+
|
|
296
|
+
- id: "CLT-PI-070"
|
|
297
|
+
category: prompt_injection
|
|
298
|
+
severity: high
|
|
299
|
+
confidence: 0.80
|
|
300
|
+
action: require_approval
|
|
301
|
+
case_insensitive: true
|
|
302
|
+
pattern: "1gn0r3|f0rg3t|byp4ss|syst3m|4dm1n"
|
|
303
|
+
match_on: content
|
|
304
|
+
title: "Encoding: leetspeak obfuscation of injection keywords"
|
|
305
|
+
expires_at: null
|
|
306
|
+
revoked: false
|
|
307
|
+
|
|
308
|
+
# ── Credential Exfiltration via Injection ──────────────────────────
|
|
309
|
+
# PI-driven data exfiltration patterns. Note: bare curl/wget commands
|
|
310
|
+
# are NOT PI — these only match when combined with credential targets.
|
|
311
|
+
|
|
312
|
+
- id: "CLT-PI-080"
|
|
313
|
+
category: prompt_injection
|
|
314
|
+
severity: high
|
|
315
|
+
confidence: 0.80
|
|
316
|
+
action: block
|
|
317
|
+
case_insensitive: true
|
|
318
|
+
pattern: "cat\\s+~/\\.(env|ssh|aws|gnupg).*\\|.*curl"
|
|
319
|
+
match_on: content
|
|
320
|
+
title: "Credential exfiltration: pipe dotfile to curl"
|
|
321
|
+
expires_at: null
|
|
322
|
+
revoked: false
|
|
323
|
+
|
|
324
|
+
- id: "CLT-PI-081"
|
|
325
|
+
category: prompt_injection
|
|
326
|
+
severity: high
|
|
327
|
+
confidence: 0.80
|
|
328
|
+
action: block
|
|
329
|
+
case_insensitive: true
|
|
330
|
+
pattern: "output\\s+(all\\s+)?(the\\s+)?environment\\s+variables.{0,50}(send|post|upload|exfiltrat|curl|fetch)"
|
|
331
|
+
match_on: content
|
|
332
|
+
title: "Credential exfiltration: dump env vars and send"
|
|
333
|
+
expires_at: null
|
|
334
|
+
revoked: false
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Self-defense patterns — protect Sage and Claude Code configuration
|
|
2
|
+
# Author: Gen Digital Inc.
|
|
3
|
+
# License: DRL-1.1 (see threats/LICENSE)
|
|
4
|
+
# These flag when the AI agent may be manipulated into disabling its own guardrails
|
|
5
|
+
# Using require_approval (not block) to allow legitimate plugin dev and config changes
|
|
6
|
+
|
|
7
|
+
# Delete .sage directory
|
|
8
|
+
- id: "CLT-SELF-001"
|
|
9
|
+
category: self_defense
|
|
10
|
+
severity: critical
|
|
11
|
+
confidence: 0.90
|
|
12
|
+
action: require_approval
|
|
13
|
+
pattern: "(rm|del|rmdir|rd|Remove-Item|unlink)\\s.*\\.sage(\\s|[\\\\/]|$)"
|
|
14
|
+
case_insensitive: true
|
|
15
|
+
match_on: command
|
|
16
|
+
title: "Attempt to delete Sage configuration directory"
|
|
17
|
+
expires_at: null
|
|
18
|
+
revoked: false
|
|
19
|
+
|
|
20
|
+
# Access Sage config files
|
|
21
|
+
- id: "CLT-SELF-002"
|
|
22
|
+
category: self_defense
|
|
23
|
+
severity: high
|
|
24
|
+
confidence: 0.85
|
|
25
|
+
action: require_approval
|
|
26
|
+
pattern: "\\.sage[\\\\/](allowlist|config|exceptions|pending-exceptions)\\.json"
|
|
27
|
+
match_on: file_path
|
|
28
|
+
title: "Access Sage configuration files"
|
|
29
|
+
expires_at: null
|
|
30
|
+
revoked: false
|
|
31
|
+
|
|
32
|
+
# Delete Claude Code hook or plugin config
|
|
33
|
+
- id: "CLT-SELF-003"
|
|
34
|
+
category: self_defense
|
|
35
|
+
severity: high
|
|
36
|
+
confidence: 0.85
|
|
37
|
+
action: require_approval
|
|
38
|
+
pattern: "(rm|del|Remove-Item|unlink)\\s.*\\.claude[\\\\/].*(hooks\\.json|installed_plugins)"
|
|
39
|
+
case_insensitive: true
|
|
40
|
+
match_on: command
|
|
41
|
+
title: "Attempt to delete Claude Code hook or plugin configuration"
|
|
42
|
+
expires_at: null
|
|
43
|
+
revoked: false
|
|
44
|
+
|
|
45
|
+
# Disable Sage security features via config
|
|
46
|
+
- id: "CLT-SELF-004"
|
|
47
|
+
category: self_defense
|
|
48
|
+
severity: high
|
|
49
|
+
confidence: 0.85
|
|
50
|
+
action: require_approval
|
|
51
|
+
pattern: "\"heuristics_enabled\"\\s*:\\s*false|\"url_check\"\\s*:\\s*\\{[^}]*\"enabled\"\\s*:\\s*false"
|
|
52
|
+
match_on: content
|
|
53
|
+
title: "Attempt to disable Sage security features via config"
|
|
54
|
+
expires_at: null
|
|
55
|
+
revoked: false
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Supply chain threat patterns for Sage
|
|
2
|
+
# Author: Gen Digital Inc.
|
|
3
|
+
# License: DRL-1.1 (see threats/LICENSE)
|
|
4
|
+
|
|
5
|
+
# --- Install scripts piped to shell ---
|
|
6
|
+
- id: "CLT-SUPPLY-001"
|
|
7
|
+
category: supply_chain
|
|
8
|
+
severity: high
|
|
9
|
+
confidence: 0.85
|
|
10
|
+
action: block
|
|
11
|
+
pattern: "(curl|wget)\\s+.*install.*\\|\\s*(bash|sh|zsh|sudo\\s+bash|sudo\\s+sh)"
|
|
12
|
+
match_on: command
|
|
13
|
+
title: "Install script piped to shell (supply chain risk)"
|
|
14
|
+
expires_at: null
|
|
15
|
+
revoked: false
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# URL/domain threat patterns for Sage
|
|
2
|
+
# Author: Gen Digital Inc.
|
|
3
|
+
# License: DRL-1.1 (see threats/LICENSE)
|
|
4
|
+
# Schema: id, category, severity, confidence, action, pattern, match_on, title, expires_at, revoked
|
|
5
|
+
|
|
6
|
+
# --- Known malware hosting patterns ---
|
|
7
|
+
- id: "CLT-URL-001"
|
|
8
|
+
category: network_egress
|
|
9
|
+
severity: critical
|
|
10
|
+
confidence: 0.85
|
|
11
|
+
action: block
|
|
12
|
+
pattern: "raw\\.githubusercontent\\.com/.*/malware"
|
|
13
|
+
match_on: url
|
|
14
|
+
title: "Known malware hosting pattern on GitHub raw"
|
|
15
|
+
expires_at: null
|
|
16
|
+
revoked: false
|
|
17
|
+
|
|
18
|
+
# --- Paste sites used for C2 ---
|
|
19
|
+
- id: "CLT-URL-002"
|
|
20
|
+
category: network_egress
|
|
21
|
+
severity: high
|
|
22
|
+
confidence: 0.75
|
|
23
|
+
action: require_approval
|
|
24
|
+
pattern: "pastebin\\.com/raw/"
|
|
25
|
+
match_on: url
|
|
26
|
+
title: "Pastebin raw content (commonly used for C2 payloads)"
|
|
27
|
+
expires_at: null
|
|
28
|
+
revoked: false
|
|
29
|
+
|
|
30
|
+
- id: "CLT-URL-003"
|
|
31
|
+
category: network_egress
|
|
32
|
+
severity: high
|
|
33
|
+
confidence: 0.75
|
|
34
|
+
action: require_approval
|
|
35
|
+
pattern: "paste\\.ee/r/"
|
|
36
|
+
match_on: url
|
|
37
|
+
title: "paste.ee raw content (commonly used for C2 payloads)"
|
|
38
|
+
expires_at: null
|
|
39
|
+
revoked: false
|
|
40
|
+
|
|
41
|
+
# --- IP-based URLs (often C2 or staging) ---
|
|
42
|
+
# Excludes loopback (127/8), unspecified (0/8), RFC1918 private
|
|
43
|
+
# (10/8, 172.16/12, 192.168/16), and link-local (169.254/16) ranges,
|
|
44
|
+
# which are common in local development and rarely indicate C2 traffic.
|
|
45
|
+
- id: "CLT-URL-004"
|
|
46
|
+
category: network_egress
|
|
47
|
+
severity: medium
|
|
48
|
+
confidence: 0.65
|
|
49
|
+
action: require_approval
|
|
50
|
+
pattern: "https?://(?!(?:127|10|0)\\.|192\\.168\\.|169\\.254\\.|172\\.(?:1[6-9]|2\\d|3[01])\\.)\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}[:/]"
|
|
51
|
+
match_on: url
|
|
52
|
+
title: "Direct public IP address URL (potential C2 or staging server)"
|
|
53
|
+
expires_at: null
|
|
54
|
+
revoked: false
|
|
55
|
+
|
|
56
|
+
# --- Executable downloads ---
|
|
57
|
+
- id: "CLT-URL-005"
|
|
58
|
+
category: network_egress
|
|
59
|
+
severity: high
|
|
60
|
+
confidence: 0.80
|
|
61
|
+
action: require_approval
|
|
62
|
+
pattern: "/[^/\\s]{1,255}\\.(exe|msi|bat|cmd|ps1|vbs|scr|pif|hta|inf)([?#]|$)"
|
|
63
|
+
match_on: url
|
|
64
|
+
title: "URL pointing to executable file download"
|
|
65
|
+
expires_at: null
|
|
66
|
+
revoked: false
|