@netcatty/dsh-guard 0.2.1 → 0.2.3
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/CHANGELOG.md +27 -0
- package/README.en.md +598 -0
- package/README.md +236 -336
- package/lib/index.js +9 -1
- package/package.json +3 -2
package/lib/index.js
CHANGED
|
@@ -133,7 +133,15 @@ const REDACTIONS = [
|
|
|
133
133
|
[/\bBearer\s+[A-Za-z0-9._~+/-]{8,}=*/gi, 'Bearer ***'],
|
|
134
134
|
[/([A-Z0-9_]*(?:SECRET|TOKEN|PASSWORD|PASSWD|API_KEY|PRIVATE_KEY|ACCESS_KEY)[A-Z0-9_]*\s*=\s*)(?:"[^"]{6,}"|'[^']{6,}'|[^\s"']{6,})/g, '$1***'],
|
|
135
135
|
[/([?&](?:token|access_token|api_key|apikey|key|secret|password)=)[^&\s"']+/gi, '$1***'],
|
|
136
|
-
|
|
136
|
+
// JSON string values whose key mentions a credential, anywhere in the name
|
|
137
|
+
// (`OXIDETERM_MCP_TOKEN`, `settings.token`, `x-api-key`). The character class
|
|
138
|
+
// covers the separators JSON keys actually use, and the keyword list carries
|
|
139
|
+
// the hyphenated spellings so `x-api-key` does not slip through.
|
|
140
|
+
[/"([A-Za-z0-9_.-]*(?:token|api_key|apikey|api-key|secret|password|passwd|authorization|private_key|private-key|access_key|access-key)[A-Za-z0-9_.-]*)"\s*:\s*"[^"]{4,}"/gi, '"$1":"***"'],
|
|
141
|
+
// The same shape after the quotes were escaped, which is how JSON shows up
|
|
142
|
+
// inside a shell command: `echo "{\"token\":\"secret\"}"`. Escapes are kept so
|
|
143
|
+
// the surrounding text stays parseable after masking.
|
|
144
|
+
[/\\"([A-Za-z0-9_.-]*(?:token|api_key|apikey|api-key|secret|password|passwd|authorization|private_key|private-key|access_key|access-key)[A-Za-z0-9_.-]*)\\"\s*:\s*\\"(?![*]{3}\\")[^"\\]{4,}\\"/gi, '\\"$1\\":\\"***\\"'],
|
|
137
145
|
[/^\s*(set-)?cookie\s*:\s*.*$/gim, 'Cookie: ***'],
|
|
138
146
|
];
|
|
139
147
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netcatty/dsh-guard",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "allow/ask/deny permission gates for DeepSeek Harness tools: path/params/agents surfaces, argv decomposition, network rules, redaction, grants, dry-run, fail-closed config",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
"lib/audit-log.js",
|
|
26
26
|
"lib/diff-view.js",
|
|
27
27
|
"locale/*.json",
|
|
28
|
-
"CHANGELOG.md"
|
|
28
|
+
"CHANGELOG.md",
|
|
29
|
+
"README.en.md"
|
|
29
30
|
],
|
|
30
31
|
"dsh": {
|
|
31
32
|
"bundle": {
|