Skip to content

Commit d86d089

Browse files
committed
Add gateway fallback for nested secret redaction
1 parent d423b0d commit d86d089

6 files changed

Lines changed: 44 additions & 5 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
{
1212
"name": "runwall",
1313
"description": "Balanced default runtime security plugin for Claude Code with shell, git, MCP, secret, exfiltration, and inline gateway guardrails.",
14-
"version": "3.3.4",
14+
"version": "3.3.5",
1515
"source": "./"
1616
}
1717
]

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "runwall",
33
"description": "Runtime security plugin for Claude Code with balanced default hooks plus the Runwall inline MCP gateway for shell, git, MCP, secret, and exfiltration risks.",
4-
"version": "3.3.4",
4+
"version": "3.3.5",
55
"author": {
66
"name": "efij"
77
},

.codex-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "runwall",
33
"description": "Runtime security plugin bundle for Codex with the Runwall inline MCP gateway, policy tools, skills, and safer defaults for coding-agent workflows.",
4-
"version": "3.3.4",
4+
"version": "3.3.5",
55
"author": {
66
"name": "efij"
77
},

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 3.3.5
4+
5+
- added a gateway-side fallback for obvious secret markers so upstream MCP responses still get redacted even when nested JSON payloads are mangled by platform-specific shell argument handling
6+
- kept the redaction attribution on `mcp-response-secret-leak-guard` so the signature model and audit trail stay consistent
7+
38
## 3.3.4
49

510
- fixed the MCP response secret redaction path on Windows by adding a deterministic fixed-string fast path for obvious secret markers before regex-file matching

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.3.4
1+
3.3.5

scripts/runwall_gateway.py

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,36 @@ def first_reason(result: dict[str, Any], fallback: str) -> str:
134134
return fallback
135135

136136

137+
def secret_redaction_fallback(result: dict[str, Any]) -> dict[str, Any] | None:
138+
payload = safe_json_dumps(result)
139+
obvious_markers = (
140+
"AWS_SECRET_ACCESS_KEY",
141+
"ghp_",
142+
"github_pat_",
143+
"PRIVATE KEY",
144+
)
145+
if not any(marker in payload for marker in obvious_markers):
146+
return None
147+
return {
148+
"allowed": True,
149+
"action": "redact",
150+
"hits": [
151+
{
152+
"module": "mcp-response-secret-leak-guard",
153+
"name": "MCP Response Secret Leak Guard Pack",
154+
"category": "mcp",
155+
"decision": "redact",
156+
"exit_code": 0,
157+
"output": "[runwall] redacting secret-like MCP response content",
158+
"metadata": {
159+
"reason": "The upstream response contains secret-like material and should be redacted before it reaches the client.",
160+
"redactions": [{"type": "full-response", "label": "secret-material"}],
161+
},
162+
}
163+
],
164+
}
165+
166+
137167
def load_gateway_config(path: pathlib.Path | None) -> dict[str, Any]:
138168
if path is None or not path.exists():
139169
return {"servers": {}}
@@ -670,6 +700,10 @@ def handle_upstream_tool(self, full_name: str, arguments: dict[str, Any]) -> dic
670700
}
671701
),
672702
)
703+
if response_eval["action"] == "allow":
704+
fallback = secret_redaction_fallback(result)
705+
if fallback is not None:
706+
response_eval = fallback
673707
if response_eval["action"] == "block":
674708
self.audit_gateway_event(
675709
{
@@ -738,7 +772,7 @@ def serve_stdio(self) -> int:
738772
"result": {
739773
"protocolVersion": "2024-11-05",
740774
"capabilities": {"tools": {}},
741-
"serverInfo": {"name": "runwall-gateway", "version": "3.3.4"},
775+
"serverInfo": {"name": "runwall-gateway", "version": "3.3.5"},
742776
},
743777
},
744778
)

0 commit comments

Comments
 (0)