dsh-perm-gate 5.5.8 → 5.5.10
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 +8 -0
- package/dsh.plugin.json +1 -1
- package/lib/cred-families.js +10 -2
- package/lib/preset-rules.d.ts +6 -3
- package/lib/preset-rules.js +30 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 5.5.10 (2026-11-22)
|
|
4
|
+
|
|
5
|
+
- **unshare 用户命名空间阻断(cc-safety-net `unshare.user-namespace` 对标)**:`unshare -r`/`-U`/`--user`/`--map-*`/`-c` 把受限会话映射成 namespace root——沙箱逃逸的标准第一跳,预设表 deny 区新增 `exec.unshare-user-ns` 行(表水位 v5→v6),argv pipeline 9 个形态覆盖裸旗标与中缀组合(大小写敏感,`-C/--cgroup` 非本裁决面;裸 `--mount`/`-n` 隔离用法按裁决不拦)。
|
|
6
|
+
|
|
7
|
+
## 5.5.9 (2026-11-22)
|
|
8
|
+
|
|
9
|
+
- **凭据库扩张(cc-safety-net `secret.home.*` / `secret.cli.*` 对标)**:cloud 家族收编 `~/.gcp`、`~/.kube/config`(含 .bak/.old 等备份后缀变体)、`~/.docker/config.json`(docker login 存活的 registry 凭据)——**注意:familyOfPath 随之扩大,P0 凭据写地板现在也覆盖这三个 store 的写入**(写 kubeconfig/docker config = 安装集群/registry 凭据,默认档硬拦)。cli 家族按 cc 的**文件精度**收编 10 个 coding-CLI 凭据库:gemini(oauth_creds/mcp-oauth-tokens/a2a-oauth-tokens/gemini-credentials)、copilot(config.json/mcp-oauth-config/mcp-secrets)、kimi(-code)(credentials/server.token/mcp-oauth)、opencode(auth.json/mcp-auth.json/opencode.db)、pi、amp(secrets.json/oauth)、cursor(auth.json/projects/*/mcp-auth.json)、grok(mcp_credentials.json)、factory(auth.*)、devin(~/.local/share/devin/*)——**config 面刻意不收**(cc 把 config 类 defaultOff 的同一 FP 理由)。预设表新增 2 行(表水位 v4→v5,新 id 不动旧行):`cred.cloud-extended` / `cred.cli-extended`(文件工具读 ask,阶梯之后、家族 rung 不治理,误伤按行撤销)。glob 编译器双星上限决定了 cli 面走精确文件枚举(与 cc 目录原形态一致);新 CLI 文件名出现时走后续水位版本补行。
|
|
10
|
+
|
|
3
11
|
## 5.5.8 (2026-11-22)
|
|
4
12
|
|
|
5
13
|
- **敏感文件扩展名族(cc-safety-net `secret.ext.*` / `ext-pattern.*` 对标)**:密钥材料、keystore 数据库、VPN 配置与磁盘加密卷躲在扩展名而不是 basename 里——此前 `vault.kdbx`、`tunnel.ovpn`、`server.pem` 的读取与递归删除完全无人问津。预设表新增 3 行(表水位 v3→v4):deny `secret.ext-delete`(`rm#recursive`/`rm#force`/`remove-item#recursive`/`rmdir`/`del` × 23 个扩展名 glob:.pem/.pfx/.p12/.pkcs12/.jks/.kdb/.kdbx/.key/.keypair/.keystore/.keyring/.keychain/.kwallet/.ovpn/.tpm/.rdp/.fve/.bek/.asc/.agilekeychain/.psafe3/.cscfg/.pcap)+ ask 读面两行(文件工具 `secret.ext-read` / shell 读命令 `secret.ext-read-shell`,同清单)——贯彻 secret 口径「读 ask / 写删 deny」。`.pem` 可能只是公钥证书:ask 廉价、三行均可单条撤销。glob 语义是结尾锚定,`api.key.ts`/`keystore-notes.md` 零命中。
|
package/dsh.plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "dsh-perm-gate",
|
|
3
3
|
"name": "dsh-perm-gate",
|
|
4
|
-
"version": "5.5.
|
|
4
|
+
"version": "5.5.10",
|
|
5
5
|
"description": {
|
|
6
6
|
"en": "Deterministic-first, fail-closed permission gate for DeepSeek Harness 0.1.2+: a P0 hard-deny -> P1 precise session grant -> P2 static allow/deny rule chain -> P3 optional LLM classifier -> P4 ask pipeline over the tools/pre-execute waterfall, with a standalone CLI dry-run evaluator and an auditable decision log. Credential handling is a seven-family ladder (ssh/cloud/package/gitcreds/env/cli/db) with deny/ask/readonly/readwrite rungs kept in the rules document plus a paired write-exemption list; a protected-branch push switch keeps the P0 floor by default. It only vetoes with deny/ask and always delegates otherwise, and unknown or malformed rules fail loud instead of silently standing the gate down.",
|
|
7
7
|
"zh": "面向 DeepSeek Harness 0.1.2+ 的确定性优先、失败即拒的权限闸门:在 tools/pre-execute 瀑布上串起 P0 硬拒绝 → P1 精确会话授权 → P2 静态 allow/deny 规则链 → P3 可选 LLM 语义分类 → P4 ask,并附带独立 CLI 干跑评估器与可审计的决策日志。凭据处理为七族阶梯(ssh/cloud/package/gitcreds/env/cli/db)× deny/ask/readonly/readwrite 四档,档位存规则文档 + 成对写豁免清单;保护分支强推开关默认保留 P0 地板。只以 deny/ask 否决、其余一律放行,规则未知或非法时直接报错,绝不静默失效。",
|
package/lib/cred-families.js
CHANGED
|
@@ -33,11 +33,19 @@ export const CRED_FAMILIES = {
|
|
|
33
33
|
// private key is still a private key. Anchored at the segment start, so
|
|
34
34
|
// `myid_rsa.notes` stays unclaimed.
|
|
35
35
|
ssh: ['~/.ssh', 'id_rsa', 'id_ed25519', 'id_ecdsa', 'id_dsa', 'authorized_keys', 'id_rsa.*', 'id_ed25519.*', 'id_ecdsa.*', 'id_dsa.*'],
|
|
36
|
-
cloud:
|
|
36
|
+
// cloud: kube/docker/gcp ride the cc-safety-net secret.home.* shapes —
|
|
37
|
+
// `kubectl`/`docker login`/gcloud store live registry/cluster credentials in
|
|
38
|
+
// exactly these files, backup suffixes included (.kube/config.bak etc.).
|
|
39
|
+
cloud: ['~/.aws', '~/.gcloud', '~/.config/gcloud', '~/.azure', '~/.azure/**', 'credentials.yaml', 'credentials.json', '~/.gcp', '~/.gcp/**', '~/.kube/config', '~/.kube/config.*', '~/.docker/config.json', '~/.docker/config.json.*'],
|
|
37
40
|
package: ['~/.npmrc', '.npmrc', '~/.pypirc', '~/.netrc', '.netrc', '.pypirc', '_netrc', '~/.pip/pip.conf'],
|
|
38
41
|
gitcreds: ['~/.git-credentials', '.git-credentials'],
|
|
39
42
|
env: ['.env', '.env.*', '*.env'],
|
|
40
|
-
cli:
|
|
43
|
+
// cli: the ten coding-CLI credential stores cc covers beyond claude/codex/gh,
|
|
44
|
+
// at cc's FILE precision (exact enumeration — the glob compiler caps at two
|
|
45
|
+
// star runs, and cc's own catalog is a per-file list anyway). Credential files
|
|
46
|
+
// only; config files stay out (cc marks the config category defaultOff for
|
|
47
|
+
// the same false-positive reason).
|
|
48
|
+
cli: ['~/.claude', '~/.claude/**', '~/.codex', '~/.codex/**', '~/.config/gh', '~/.config/gh/**', '~/.gemini/oauth_creds.json', '~/.gemini/mcp-oauth-tokens.json', '~/.gemini/a2a-oauth-tokens.json', '~/.gemini/gemini-credentials.json', '~/.copilot/config.json', '~/.copilot/mcp-oauth-config', '~/.copilot/mcp-secrets', '~/.kimi-code/credentials', '~/.kimi-code/server.token', '~/.kimi/credentials', '~/.kimi/mcp-oauth', '~/.local/share/opencode/auth.json', '~/.local/share/opencode/mcp-auth.json', '~/.local/share/opencode/opencode.db', '~/.pi/agent/auth.json', '~/.local/share/amp/secrets.json', '~/.amp/oauth', '~/.cursor/auth.json', '~/.cursor/projects/*/mcp-auth.json', '~/.config/cursor/auth.json', '~/.grok/mcp_credentials.json', '~/.factory/auth*', '~/.local/share/devin/*'],
|
|
41
49
|
db: ['~/.pgpass', 'pgpass', '~/.my.cnf', '.my.cnf'],
|
|
42
50
|
};
|
|
43
51
|
/** One compiled matcher per family (lazy; compile is pure and cheap, memoize anyway). */
|
package/lib/preset-rules.d.ts
CHANGED
|
@@ -36,9 +36,12 @@ import { type CredFamily } from './cred-families.js';
|
|
|
36
36
|
* (v1 added the seven `cred.*` family rows; v2 added the four
|
|
37
37
|
* `network.cloud-metadata*` rows with the pre-execution extractor; v3 added the
|
|
38
38
|
* two ssh-key-variant rows and the dotted-variant shapes to the ssh family; v4
|
|
39
|
-
* added the three sensitive-file-extension rows
|
|
39
|
+
* added the three sensitive-file-extension rows; v5 added the two family
|
|
40
|
+
* EXTENSION rows — kube/docker/gcp + ten coding-CLI credential stores — and the
|
|
41
|
+
* same shapes to the cloud/cli family lists; v6 added the unshare user-namespace
|
|
42
|
+
* row).
|
|
40
43
|
*/
|
|
41
|
-
export declare const PRESET_TABLE_VERSION =
|
|
44
|
+
export declare const PRESET_TABLE_VERSION = 6;
|
|
42
45
|
/** Tag prefix carried by every preset entry's reason; locates an entry for revocation. */
|
|
43
46
|
export declare const PRESET_RULE_MARKER = "[deny-rule:";
|
|
44
47
|
/** Extract the `[deny-rule:<id>]` tag from one reason string (undefined when untagged). */
|
|
@@ -51,7 +54,7 @@ export declare function presetRuleId(reason: unknown): string | undefined;
|
|
|
51
54
|
* the joined pipeline — see evaluate.ts), token co-occurrence NEVER through
|
|
52
55
|
* args (args is any-token OR).
|
|
53
56
|
*/
|
|
54
|
-
export declare const PRESET_RULES_YAML = "defaultAction: ask\n\ndeny:\n # \u2500\u2500 Git \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n - command: [git]\n argv: { pipeline: [\"git reset --hard*\", \"git reset *--hard*\"] }\n reason: \"[deny-rule:git.reset-hard] Hard reset discards uncommitted changes. Use git reset --soft/--mixed, or git stash first.\"\n - command: [git]\n argv: { pipeline: [\"git reset --merge*\", \"git reset --abort*\"] }\n reason: \"[deny-rule:git.reset-merge] Merge reset discards in-progress merge work. Stash first, then reset --soft/--mixed.\"\n - command: [git]\n argv: { pipeline: [\"git clean *-f*\", \"git clean *--force*\"] }\n reason: \"[deny-rule:git.clean-force] git clean permanently deletes untracked files. Dry-run first: git clean -nd.\"\n - command: [git]\n argv: { pipeline: [\"git push origin *--delete*\", \"git push * --delete *\", \"git push --delete*\"] }\n reason: \"[deny-rule:git.push-delete] Deleting remote refs is visible to collaborators and needs explicit consent.\"\n - command: [git]\n argv: { pipeline: [\"git push --mirror*\", \"git push * --mirror\"] }\n reason: \"[deny-rule:git.push-mirror] Mirror push force-updates and deletes remote refs wholesale.\"\n - command: [git]\n argv: { pipeline: [\"git branch -D*\", \"git branch * -D\", \"git branch *--force-delete*\"] }\n reason: \"[deny-rule:git.branch-force-delete] git branch -D drops unmerged commits. Prefer merged-safe git branch -d.\"\n - command: [git]\n argv: { pipeline: [\"git stash drop*\"] }\n reason: \"[deny-rule:git.stash-drop] Dropping a stash entry is unrecoverable after GC. Verify with git stash list.\"\n - command: [git]\n argv: { pipeline: [\"git stash clear*\"] }\n reason: \"[deny-rule:git.stash-clear] Clearing all stashes destroys every saved worktree state.\"\n - command: [git]\n argv: { pipeline: [\"git tag -d*\", \"git tag --delete*\"] }\n reason: \"[deny-rule:git.tag-delete] Tag deletion removes release anchors.\"\n - command: [git]\n argv: { pipeline: [\"git reflog delete*\", \"git reflog expire*\"] }\n reason: \"[deny-rule:git.reflog-delete] Reflog deletion removes the last recovery path for lost commits.\"\n - command: [git]\n argv: { pipeline: [\"git rebase --abort*\"] }\n reason: \"[deny-rule:git.rebase-abort] Aborting a rebase discards resolution work. Prefer --continue/--skip.\"\n - command: [git]\n argv: { pipeline: [\"git merge --abort*\"] }\n reason: \"[deny-rule:git.merge-abort] Aborting a merge discards conflict resolution.\"\n - command: [git]\n argv: { pipeline: [\"git rm -rf *\", \"git rm *-rf *\", \"git rm * -rf\", \"git rm -fr *\", \"git rm --force *\", \"git rm * --force\", \"git rm -f *\", \"git rm * -f\"] }\n reason: \"[deny-rule:git.rm-force] git rm -f deletes working-tree files even when modified. Stash them first.\"\n - command: [git]\n argv: { pipeline: [\"git checkout --force *\", \"git checkout * --force\", \"git checkout -f *\", \"git checkout * -f\", \"git checkout -f\", \"git checkout * --force *\"] }\n reason: \"[deny-rule:git.checkout-force] Forced checkout overwrites local changes. git stash, then checkout.\"\n - command: [git]\n argv: { pipeline: [\"git checkout -- *\"] }\n reason: \"[deny-rule:git.checkout-double-dash] Path restore from checkout discards local edits. Use git stash push -- <path>.\"\n - command: [git]\n argv: { pipeline: [\"git checkout * -- *\"] }\n reason: \"[deny-rule:git.checkout-ref-path] Checking out a ref with a path overwrites working-tree files. Stash the paths first.\"\n - command: [git]\n argv: { pipeline: [\"git checkout *--pathspec-from-file*\"] }\n reason: \"[deny-rule:git.checkout-pathspec-from-file] Bulk path restore from a file can silently overwrite edits. List the pathspec, stash, then restore.\"\n - command: [git]\n argv: { pipeline: [\"git switch *--discard-changes*\"] }\n reason: \"[deny-rule:git.switch-discard-changes] --discard-changes throws away edits. git stash first.\"\n - command: [git]\n argv: { pipeline: [\"git switch --force *\", \"git switch * --force\", \"git switch -f *\", \"git switch * -f\"] }\n reason: \"[deny-rule:git.switch-force] Forced switch overwrites local changes. git stash first.\"\n - command: [git]\n # git restore <bare path> (the plain unstaged discard) is NOT ported here:\n # any glob broad enough to catch it also catches the harmless\n # git restore --staged <path> (G6) \u2014 only the explicit discard forms are\n # denied, the bare-path case stays in the prompt layer.\n argv: { pipeline: [\"git restore --worktree *\", \"git restore * --worktree *\", \"git restore * --worktree\", \"git restore -W *\"] }\n reason: \"[deny-rule:git.restore-worktree] Worktree restore discards local edits. git stash push -- <path> first.\"\n - command: [git]\n argv: { pipeline: [\"git worktree remove --force *\", \"git worktree remove * --force\", \"git worktree remove -f *\", \"git worktree remove * -f\"] }\n reason: \"[deny-rule:git.worktree-remove-force] Forced worktree removal discards uncommitted work in that tree.\"\n - command: [git]\n args: [\"alias.*\"]\n reason: \"[deny-rule:git.alias-config] Command-line Git aliases run arbitrary shell and cannot be analyzed.\"\n # params matches the RAW command string: the env-assignment word lands as the\n # simple command's lowercased word, so a command:[git] dimension would never\n # see this form \u2014 match on params alone.\n - params: { command: [\"*GIT_SSH_COMMAND=*\", \"*git_ssh_command=*\", \"*GIT_SSH=*\", \"*git_ssh=*\"] }\n reason: \"[deny-rule:git.ssh-env] Git network ops with an SSH env override execute unanalyzable code.\"\n\n # \u2500\u2500 Filesystem \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n - command: [\"rm#recursive\", \"rm#force\"]\n args: [\".git\", \".git/*\", \"*/.git\"]\n reason: \"[deny-rule:rm.git-metadata] Removing Git metadata destroys history and the gate's audit anchors.\"\n - command: [find]\n argv: { pipeline: [\"find .git*\"] }\n reason: \"[deny-rule:find.delete-git-metadata] Selecting .git for deletion destroys repository state.\"\n - command: [find]\n argv: { pipeline: [\"find * -delete\"] }\n reason: \"[deny-rule:find.delete] find -delete removes everything selected. Enumerate with plain find first.\"\n - command: [find]\n argv: { pipeline: [\"find *-exec rm*\", \"find *-delete*\"] }\n reason: \"[deny-rule:find.exec-rm-recursive-force] find -exec rm removes the whole tree per match. Dry-run plain find, delete explicit paths.\"\n - command: [rsync]\n argv: { pipeline: [\"rsync * --delete*\", \"rsync --delete*\"] }\n reason: \"[deny-rule:rsync.delete] rsync --delete erases destination files absent from the source. Dry-run with rsync -n --delete first.\"\n - command: [dd]\n argv: { pipeline: [\"dd * of=/dev/sd*\", \"dd * of=/dev/nvme*\", \"dd * of=/dev/mmcblk*\"] }\n reason: \"[deny-rule:dd.device-write] dd writing to a block device destroys the disk.\"\n - command: [mkfs, mke2fs, newfs, \"mkfs.*\"]\n reason: \"[deny-rule:mkfs.device] Formatting a device erases it.\"\n - command: [diskutil, wipefs, sgdisk, parted]\n reason: \"[deny-rule:disk.erase] Disk erase/partition/wipe operations destroy data.\"\n - command: [shred]\n reason: \"[deny-rule:shred.target] shred irreversibly destroys files (even --help/--version reach it).\"\n - command: [cat, head, tail, dd]\n args: [\"*/dev/sd*\", \"*/dev/nvme*\", \"*/dev/disk*\", \"*/dev/mmcblk*\"]\n reason: \"[deny-rule:redirect.block-device] Redirect target resolving to a disk device path.\"\n\n # \u2500\u2500 Network \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n # Cloud metadata endpoints (cc-safety-net network.cloud-metadata): one request\n # returns the instance's IAM/STS credentials. The known HTTP clients, raw\n # sockets and interpreters are denied outright; anything else that merely\n # names an endpoint escalates to ask (the catch-all rows in the ask section).\n # ips and domains live on separate rows \u2014 the dimension's sub-dimensions are\n # AND, and one target can only ever be one of the two shapes. At the proxy\n # face these rows fire for attributed traffic regardless of the command\n # (command is invisible there); pre-execution the network candidates come\n # from network-extract.ts.\n - command: [curl, wget, http, httpie, nc, ncat, netcat, socat, python, python3, node, deno, ruby, perl, php]\n network: { ips: [\"169.254.169.254\", \"169.254.170.2\", \"169.254.170.23\", \"fd00:ec2::254\", \"fd00:ec2::23\", \"100.100.100.200\"] }\n reason: \"[deny-rule:network.cloud-metadata-ips] A cloud metadata endpoint returns the instance's IAM credentials to whoever asks. Fetch through the platform SDK or IMDSv2 session auth \u2014 never a bare client call.\"\n - command: [curl, wget, http, httpie, nc, ncat, netcat, socat, python, python3, node, deno, ruby, perl, php]\n network: { domains: [\"metadata.google.internal\", \"metadata.goog\"] }\n reason: \"[deny-rule:network.cloud-metadata-domains] A cloud metadata endpoint returns the instance's IAM credentials to whoever asks. Fetch through the platform SDK or IMDSv2 session auth \u2014 never a bare client call.\"\n\n # \u2500\u2500 PowerShell \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n # Command words are lowercased by the decomposer \u2014 command dimensions must\n # carry the lowercased verb (Remove-Item \u2192 remove-item).\n - command: [\"remove-item#recursive\"]\n args: [\".git\", \".git/*\", \"*/.git\"]\n reason: \"[deny-rule:powershell.remove-item-git-metadata] Never target .git.\"\n - command: [powershell, pwsh]\n argv: { pipeline: [\"pwsh *Remove-Item*\", \"powershell *Remove-Item*\", \"pwsh *remove-item*\", \"powershell *remove-item*\"] }\n reason: \"[deny-rule:powershell.nested-recursive-delete-unread] A delete handed to pwsh/powershell in a non-literal form cannot be verified before it runs.\"\n - command: [\"remove-item#recursive\"]\n args: [\".\", \"./\"]\n reason: \"[deny-rule:powershell.remove-item-recursive-force-cwd-self] Deleting the current directory removes the project.\"\n - command: [\"remove-item#recursive\"]\n args: [\"../*\", \"..\\\\*\"]\n reason: \"[deny-rule:powershell.remove-item-recursive-force-outside-cwd] Deleting above the cwd escapes task scope.\"\n\n # \u2500\u2500 Command Prompt \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n # (The cc escaped-quote-collapse rule cannot be expressed faithfully with\n # these globs \u2014 every cmd /c recursion is nested behind a second parser,\n # so its true target is undecidable: it moves to the ask section instead.)\n - command: [cmd, rmdir, del]\n args: [\".git\", \".git/*\", \"*/.git\"]\n reason: \"[deny-rule:cmd.recursive-delete-git-metadata] Never target .git.\"\n - command: [rmdir, del]\n args: [\".\", \"./\"]\n reason: \"[deny-rule:cmd.recursive-delete-cwd-self] Deleting the current directory removes the project.\"\n - command: [rmdir, del]\n args: [\"../*\", \"..\\\\*\"]\n reason: \"[deny-rule:cmd.recursive-delete-outside-cwd] Delete above cwd escapes task scope.\"\n\n # \u2500\u2500 Secret targets (write/delete deny; reads are the ask section below) \u2500\u2500\n - command: [\"rm#recursive\", \"remove-item#recursive\", rmdir, del]\n args: [\"*/.ssh\", \"*/.aws\", \"*/.gnupg\", \".ssh\", \".aws\"]\n reason: \"[deny-rule:secret.delete-credential-path] Deleting credential stores destroys keys you cannot regenerate.\"\n - command: [echo, \"set-content\", \"out-file\"]\n args: [\".env\", \".env.*\"]\n reason: \"[deny-rule:secret.write-overwrite-env] Overwriting .env destroys existing secrets. Edit specific lines.\"\n - command: [\"rm#recursive\", \"remove-item#recursive\", rmdir, del]\n args: [\"*/.git-credentials\", \".git-credentials\"]\n reason: \"[deny-rule:secret.delete-git-credentials] Deleting the git credential store breaks push/pull auth.\"\n\n # \u2500\u2500 Sensitive-file extensions (cc-safety-net secret.ext.* / ext-pattern.*) \u2500\u2500\n # Key material, keystore databases, VPN profiles, disk-encryption volumes and\n # credential-capable configs hide under extensions, not basenames \u2014 a read of\n # vault.kdbx deserves the same question as a read of id_rsa. Deletion is the\n # deny side (the secret ruling: read = ask, write/delete = deny); the two read\n # rows live in the ask section below. .pem may be a plain public certificate \u2014\n # the ask is cheap and each row revokes singly.\n - command: [\"rm#recursive\", \"remove-item#recursive\", rmdir, del]\n args: [\"*.pem\", \"*.pfx\", \"*.p12\", \"*.pkcs12\", \"*.jks\", \"*.kdb\", \"*.kdbx\", \"*.key\", \"*.keypair\", \"*.keystore\", \"*.keyring\", \"*.keychain\", \"*.kwallet\", \"*.ovpn\", \"*.tpm\", \"*.rdp\", \"*.fve\", \"*.bek\", \"*.asc\", \"*.agilekeychain\", \"*.psafe3\", \"*.cscfg\", \"*.pcap\"]\n reason: \"[deny-rule:secret.ext-delete] Deleting a file whose extension names key material, a keystore, a VPN profile or a disk-encryption volume destroys credentials you may not be able to regenerate.\"\n\nask:\n # Force push: ask, not deny (revoked from cc's deny ruling 2026-10-13).\n - command: [git]\n argv: { pipeline: [\"git push *--force*\", \"git push *-f*\"] }\n reason: \"[deny-rule:git.push-force] Force push rewrites shared history. Prefer git push --force-with-lease.\"\n\n # cmd /c recursion hides the real target behind a second parser (and quoting):\n # undecidable \u2192 ask, where cc denied only the drive-root-collapse variant.\n - command: [cmd]\n argv: { pipeline: [\"cmd /c *rmdir /s*\", \"cmd /c *del /s*\"] }\n reason: \"[deny-rule:cmd.recursive-delete-nested] cmd /c recursion nests a second parser; the real target cannot be resolved. Run rmdir/del directly so the gate can see the target.\"\n\n # Dynamic targets: this gate's ruling is \"undecidable \u2192 ask\", not fail-closed deny.\n - command: [\"rm#recursive\", \"remove-item#recursive\"]\n args: [\"$*\"]\n reason: \"[deny-rule:rm.recursive-force-dynamic-target] Recursive delete of a substitution-assembled target \u2014 verify the variable yourself.\"\n # The wrapper word xargs is stripped by the decomposer, so pipeline patterns\n # never see it \u2014 match the raw command string through the params dimension.\n - params: { command: [\"*xargs rm*\", \"*xargs del*\"] }\n reason: \"[deny-rule:xargs.rm-recursive-force-dynamic] xargs-fed removals have unverifiable target sets.\"\n - command: [parallel]\n argv: { pipeline: [\"parallel *rm*\", \"*| parallel*\"] }\n reason: \"[deny-rule:parallel.rm-recursive-force-dynamic] parallel-fed rm has unresolvable targets.\"\n - command: [awk]\n args: [\"*system(*\"]\n reason: \"[deny-rule:awk.system-dynamic] awk program text containing system() cannot be analyzed.\"\n # NOTE: cc's git checkout <ref> <path> ambiguity (G5) is NOT ported \u2014 a glob\n # cannot tell ref candidates from paths, and a broad pattern would prompt on\n # every git checkout -b new-branch. Documented residual gap.\n\n # The catch-all half of the metadata guard: a non-client call (echo, cat, a\n # script) that merely names an endpoint is a question, not a theft \u2014 ask.\n - network: { ips: [\"169.254.169.254\", \"169.254.170.2\", \"169.254.170.23\", \"fd00:ec2::254\", \"fd00:ec2::23\", \"100.100.100.200\"] }\n reason: \"[deny-rule:network.cloud-metadata-ips-any] This call names a cloud metadata endpoint. Confirm why instance credentials are being addressed before it runs.\"\n - network: { domains: [\"metadata.google.internal\", \"metadata.goog\"] }\n reason: \"[deny-rule:network.cloud-metadata-domains-any] This call names a cloud metadata endpoint. Confirm why instance credentials are being addressed before it runs.\"\n\n # Credential reads: ask (A2 ruling kept; egress combos stay in the prompt layer).\n - command: [cat, head, tail, type, \"get-content\", ls, dir, \"get-childitem\", \"select-string\"]\n args: [\".env\", \".env.*\", \"*.env\", \".npmrc\", \".pypirc\", \".netrc\", \".git-credentials\", \"id_rsa\", \"id_ed25519\", \"id_ecdsa\"]\n reason: \"[deny-rule:secret.read-credential-file] Reading a credential file requires confirmation. Echo only the keys you need via a filtered command.\"\n - command: [cat, head, tail, type, \"get-content\", ls, dir, \"get-childitem\"]\n args: [\"*/.ssh\", \"*/.ssh/*\", \"*/.aws\", \"*/.aws/*\", \"*/.gnupg\", \"*/.gnupg/*\", \"*/.config/gcloud/*\", \"*/.claude/*\", \"*/.codex/*\"]\n reason: \"[deny-rule:secret.read-home-credential-dirs] Browsing ssh/cloud/coding-CLI credential stores requires confirmation.\"\n\n # \u2500\u2500 Credential family ladder (read side) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n # One row per family, restricted to the file-READ tools: decide() pre-queries the\n # rule layer for READ calls, so these rows are what a read hits (shell reads stay\n # under the secret.* rows above, which match first in this section). The settings\n # face rewrites each row as the family's rung: deny - moved to the deny section;\n # ask - stays here; readonly/readwrite - enabled:false (readwrite additionally\n # lists the family in credWriteExemptFamilies for the engine's write clause).\n # Custom credentialPaths have no family and are never write-exempt.\n - tools: [read, read_image, grep, glob, ls, lsp]\n args: [\"*/.ssh\", \"*/.ssh/*\", \"*id_rsa\", \"*id_ed25519\", \"*id_ecdsa\", \"*id_dsa\", \"*authorized_keys\"]\n reason: \"[deny-rule:cred.ssh] Reading SSH keys or authorized_keys needs confirmation (family rung: ask).\"\n - tools: [read, read_image, grep, glob, ls, lsp]\n args: [\"*/.aws\", \"*/.aws/*\", \"*/.config/gcloud\", \"*/.config/gcloud/*\", \"*/.azure\", \"*/.azure/*\", \"*credentials.yaml\", \"*credentials.json\"]\n reason: \"[deny-rule:cred.cloud] Reading cloud-provider credential stores needs confirmation (family rung: ask).\"\n - tools: [read, read_image, grep, glob, ls, lsp]\n args: [\"*/.npmrc\", \"*.npmrc\", \"*/.pypirc\", \"*/.netrc\", \"*_netrc\", \"*/pip.conf\"]\n reason: \"[deny-rule:cred.package] Reading package-registry auth files needs confirmation (family rung: ask).\"\n - tools: [read, read_image, grep, glob, ls, lsp]\n args: [\"*/.git-credentials\", \"*.git-credentials\"]\n reason: \"[deny-rule:cred.gitcreds] Reading the git credential store needs confirmation (family rung: ask).\"\n - tools: [read, read_image, grep, glob, ls, lsp]\n args: [\"*/.env\", \"*/.env.*\", \"*.env\"]\n reason: \"[deny-rule:cred.env] Reading project env files needs confirmation (family rung: ask; readwrite also lets edits, npm-login-style).\"\n - tools: [read, read_image, grep, glob, ls, lsp]\n args: [\"*/.claude\", \"*/.claude/*\", \"*/.codex\", \"*/.codex/*\", \"*/.config/gh\", \"*/.config/gh/*\"]\n reason: \"[deny-rule:cred.cli] Reading coding-CLI credential stores needs confirmation (family rung: ask).\"\n - tools: [read, read_image, grep, glob, ls, lsp]\n args: [\"*/.pgpass\", \"*pgpass\", \"*/.my.cnf\"]\n reason: \"[deny-rule:cred.db] Reading database credential files needs confirmation (family rung: ask).\"\n\n # SSH key variants (cc-safety-net secret.variant.* + the broad *_rsa|dsa|ed25519|ecdsa\n # shape + the generic \"credentials\" basename): keys get copied and renamed \u2014\n # id_rsa.bak, github_deploy_ed25519 and id_rsa-old deserve the same ask the\n # canonical names get. New rows (not a mutation of the seeded originals): the\n # watermark backfill is id-based and a mutated row would never reach existing\n # installs. They sit AFTER the family ladder so canonical shapes keep their\n # family tag (and rung governance); only what the ladder missed falls through.\n # The cred.ssh-variants row is NOT family-governed \u2014 a readonly/readwrite rung\n # on the ssh family does not silence it; revoke it by row if unwanted.\n - command: [cat, head, tail, type, \"get-content\", ls, dir, \"get-childitem\", \"select-string\"]\n args: [\"*id_rsa*\", \"*id_ed25519*\", \"*id_ecdsa*\", \"*id_dsa*\", \"*_rsa\", \"*_dsa\", \"*_ed25519\", \"*_ecdsa\", \"credentials\", \"*/credentials\"]\n reason: \"[deny-rule:secret.ssh-key-variants] This path looks like a private key under a renamed or variant basename. Reading key material needs confirmation.\"\n - tools: [read, read_image, grep, glob, ls, lsp]\n args: [\"*id_rsa*\", \"*id_ed25519*\", \"*id_ecdsa*\", \"*id_dsa*\", \"*_rsa\", \"*_dsa\", \"*_ed25519\", \"*_ecdsa\", \"credentials\", \"*/credentials\"]\n reason: \"[deny-rule:cred.ssh-variants] Reading a private-key variant basename needs confirmation (not family-governed; revoke by row).\"\n\n # The read half of the extension guard (see the deny-side secret.ext-delete).\n - tools: [read, read_image, grep, glob, ls, lsp]\n args: [\"*.pem\", \"*.pfx\", \"*.p12\", \"*.pkcs12\", \"*.jks\", \"*.kdb\", \"*.kdbx\", \"*.key\", \"*.keypair\", \"*.keystore\", \"*.keyring\", \"*.keychain\", \"*.kwallet\", \"*.ovpn\", \"*.tpm\", \"*.rdp\", \"*.fve\", \"*.bek\", \"*.asc\", \"*.agilekeychain\", \"*.psafe3\", \"*.cscfg\", \"*.pcap\"]\n reason: \"[deny-rule:secret.ext-read] Reading a file whose extension names key material, a keystore, a VPN profile or a disk-encryption volume needs confirmation (revoke by row).\"\n - command: [cat, head, tail, type, \"get-content\", ls, dir, \"get-childitem\", \"select-string\"]\n args: [\"*.pem\", \"*.pfx\", \"*.p12\", \"*.pkcs12\", \"*.jks\", \"*.kdb\", \"*.kdbx\", \"*.key\", \"*.keypair\", \"*.keystore\", \"*.keyring\", \"*.keychain\", \"*.kwallet\", \"*.ovpn\", \"*.tpm\", \"*.rdp\", \"*.fve\", \"*.bek\", \"*.asc\", \"*.agilekeychain\", \"*.psafe3\", \"*.cscfg\", \"*.pcap\"]\n reason: \"[deny-rule:secret.ext-read-shell] Reading a file whose extension names key material, a keystore, a VPN profile or a disk-encryption volume needs confirmation.\"\n\n # Self-protection: editing the gate's own rule sources needs confirmation \u2014\n # revocation must be a human act, not something an agent can slide through.\n # (Settings-namespace edits go through the host UI, not a tool call, and are\n # out of reach of this entry; documented gap.)\n - args: [\"*rules.yml\", \"*rules.yaml\", \"*deny-defaults*\"]\n reason: \"[deny-rule:gate.self-protection] This call touches the permission gate's own rule sources; changes here alter what the gate enforces.\"\n";
|
|
57
|
+
export declare const PRESET_RULES_YAML = "defaultAction: ask\n\ndeny:\n # \u2500\u2500 Git \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n - command: [git]\n argv: { pipeline: [\"git reset --hard*\", \"git reset *--hard*\"] }\n reason: \"[deny-rule:git.reset-hard] Hard reset discards uncommitted changes. Use git reset --soft/--mixed, or git stash first.\"\n - command: [git]\n argv: { pipeline: [\"git reset --merge*\", \"git reset --abort*\"] }\n reason: \"[deny-rule:git.reset-merge] Merge reset discards in-progress merge work. Stash first, then reset --soft/--mixed.\"\n - command: [git]\n argv: { pipeline: [\"git clean *-f*\", \"git clean *--force*\"] }\n reason: \"[deny-rule:git.clean-force] git clean permanently deletes untracked files. Dry-run first: git clean -nd.\"\n - command: [git]\n argv: { pipeline: [\"git push origin *--delete*\", \"git push * --delete *\", \"git push --delete*\"] }\n reason: \"[deny-rule:git.push-delete] Deleting remote refs is visible to collaborators and needs explicit consent.\"\n - command: [git]\n argv: { pipeline: [\"git push --mirror*\", \"git push * --mirror\"] }\n reason: \"[deny-rule:git.push-mirror] Mirror push force-updates and deletes remote refs wholesale.\"\n - command: [git]\n argv: { pipeline: [\"git branch -D*\", \"git branch * -D\", \"git branch *--force-delete*\"] }\n reason: \"[deny-rule:git.branch-force-delete] git branch -D drops unmerged commits. Prefer merged-safe git branch -d.\"\n - command: [git]\n argv: { pipeline: [\"git stash drop*\"] }\n reason: \"[deny-rule:git.stash-drop] Dropping a stash entry is unrecoverable after GC. Verify with git stash list.\"\n - command: [git]\n argv: { pipeline: [\"git stash clear*\"] }\n reason: \"[deny-rule:git.stash-clear] Clearing all stashes destroys every saved worktree state.\"\n - command: [git]\n argv: { pipeline: [\"git tag -d*\", \"git tag --delete*\"] }\n reason: \"[deny-rule:git.tag-delete] Tag deletion removes release anchors.\"\n - command: [git]\n argv: { pipeline: [\"git reflog delete*\", \"git reflog expire*\"] }\n reason: \"[deny-rule:git.reflog-delete] Reflog deletion removes the last recovery path for lost commits.\"\n - command: [git]\n argv: { pipeline: [\"git rebase --abort*\"] }\n reason: \"[deny-rule:git.rebase-abort] Aborting a rebase discards resolution work. Prefer --continue/--skip.\"\n - command: [git]\n argv: { pipeline: [\"git merge --abort*\"] }\n reason: \"[deny-rule:git.merge-abort] Aborting a merge discards conflict resolution.\"\n - command: [git]\n argv: { pipeline: [\"git rm -rf *\", \"git rm *-rf *\", \"git rm * -rf\", \"git rm -fr *\", \"git rm --force *\", \"git rm * --force\", \"git rm -f *\", \"git rm * -f\"] }\n reason: \"[deny-rule:git.rm-force] git rm -f deletes working-tree files even when modified. Stash them first.\"\n - command: [git]\n argv: { pipeline: [\"git checkout --force *\", \"git checkout * --force\", \"git checkout -f *\", \"git checkout * -f\", \"git checkout -f\", \"git checkout * --force *\"] }\n reason: \"[deny-rule:git.checkout-force] Forced checkout overwrites local changes. git stash, then checkout.\"\n - command: [git]\n argv: { pipeline: [\"git checkout -- *\"] }\n reason: \"[deny-rule:git.checkout-double-dash] Path restore from checkout discards local edits. Use git stash push -- <path>.\"\n - command: [git]\n argv: { pipeline: [\"git checkout * -- *\"] }\n reason: \"[deny-rule:git.checkout-ref-path] Checking out a ref with a path overwrites working-tree files. Stash the paths first.\"\n - command: [git]\n argv: { pipeline: [\"git checkout *--pathspec-from-file*\"] }\n reason: \"[deny-rule:git.checkout-pathspec-from-file] Bulk path restore from a file can silently overwrite edits. List the pathspec, stash, then restore.\"\n - command: [git]\n argv: { pipeline: [\"git switch *--discard-changes*\"] }\n reason: \"[deny-rule:git.switch-discard-changes] --discard-changes throws away edits. git stash first.\"\n - command: [git]\n argv: { pipeline: [\"git switch --force *\", \"git switch * --force\", \"git switch -f *\", \"git switch * -f\"] }\n reason: \"[deny-rule:git.switch-force] Forced switch overwrites local changes. git stash first.\"\n - command: [git]\n # git restore <bare path> (the plain unstaged discard) is NOT ported here:\n # any glob broad enough to catch it also catches the harmless\n # git restore --staged <path> (G6) \u2014 only the explicit discard forms are\n # denied, the bare-path case stays in the prompt layer.\n argv: { pipeline: [\"git restore --worktree *\", \"git restore * --worktree *\", \"git restore * --worktree\", \"git restore -W *\"] }\n reason: \"[deny-rule:git.restore-worktree] Worktree restore discards local edits. git stash push -- <path> first.\"\n - command: [git]\n argv: { pipeline: [\"git worktree remove --force *\", \"git worktree remove * --force\", \"git worktree remove -f *\", \"git worktree remove * -f\"] }\n reason: \"[deny-rule:git.worktree-remove-force] Forced worktree removal discards uncommitted work in that tree.\"\n - command: [git]\n args: [\"alias.*\"]\n reason: \"[deny-rule:git.alias-config] Command-line Git aliases run arbitrary shell and cannot be analyzed.\"\n # params matches the RAW command string: the env-assignment word lands as the\n # simple command's lowercased word, so a command:[git] dimension would never\n # see this form \u2014 match on params alone.\n - params: { command: [\"*GIT_SSH_COMMAND=*\", \"*git_ssh_command=*\", \"*GIT_SSH=*\", \"*git_ssh=*\"] }\n reason: \"[deny-rule:git.ssh-env] Git network ops with an SSH env override execute unanalyzable code.\"\n\n # \u2500\u2500 Filesystem \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n - command: [\"rm#recursive\", \"rm#force\"]\n args: [\".git\", \".git/*\", \"*/.git\"]\n reason: \"[deny-rule:rm.git-metadata] Removing Git metadata destroys history and the gate's audit anchors.\"\n - command: [find]\n argv: { pipeline: [\"find .git*\"] }\n reason: \"[deny-rule:find.delete-git-metadata] Selecting .git for deletion destroys repository state.\"\n - command: [find]\n argv: { pipeline: [\"find * -delete\"] }\n reason: \"[deny-rule:find.delete] find -delete removes everything selected. Enumerate with plain find first.\"\n - command: [find]\n argv: { pipeline: [\"find *-exec rm*\", \"find *-delete*\"] }\n reason: \"[deny-rule:find.exec-rm-recursive-force] find -exec rm removes the whole tree per match. Dry-run plain find, delete explicit paths.\"\n - command: [rsync]\n argv: { pipeline: [\"rsync * --delete*\", \"rsync --delete*\"] }\n reason: \"[deny-rule:rsync.delete] rsync --delete erases destination files absent from the source. Dry-run with rsync -n --delete first.\"\n - command: [dd]\n argv: { pipeline: [\"dd * of=/dev/sd*\", \"dd * of=/dev/nvme*\", \"dd * of=/dev/mmcblk*\"] }\n reason: \"[deny-rule:dd.device-write] dd writing to a block device destroys the disk.\"\n - command: [mkfs, mke2fs, newfs, \"mkfs.*\"]\n reason: \"[deny-rule:mkfs.device] Formatting a device erases it.\"\n - command: [diskutil, wipefs, sgdisk, parted]\n reason: \"[deny-rule:disk.erase] Disk erase/partition/wipe operations destroy data.\"\n - command: [shred]\n reason: \"[deny-rule:shred.target] shred irreversibly destroys files (even --help/--version reach it).\"\n - command: [cat, head, tail, dd]\n args: [\"*/dev/sd*\", \"*/dev/nvme*\", \"*/dev/disk*\", \"*/dev/mmcblk*\"]\n reason: \"[deny-rule:redirect.block-device] Redirect target resolving to a disk device path.\"\n\n # \u2500\u2500 Network \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n # Cloud metadata endpoints (cc-safety-net network.cloud-metadata): one request\n # returns the instance's IAM/STS credentials. The known HTTP clients, raw\n # sockets and interpreters are denied outright; anything else that merely\n # names an endpoint escalates to ask (the catch-all rows in the ask section).\n # ips and domains live on separate rows \u2014 the dimension's sub-dimensions are\n # AND, and one target can only ever be one of the two shapes. At the proxy\n # face these rows fire for attributed traffic regardless of the command\n # (command is invisible there); pre-execution the network candidates come\n # from network-extract.ts.\n - command: [curl, wget, http, httpie, nc, ncat, netcat, socat, python, python3, node, deno, ruby, perl, php]\n network: { ips: [\"169.254.169.254\", \"169.254.170.2\", \"169.254.170.23\", \"fd00:ec2::254\", \"fd00:ec2::23\", \"100.100.100.200\"] }\n reason: \"[deny-rule:network.cloud-metadata-ips] A cloud metadata endpoint returns the instance's IAM credentials to whoever asks. Fetch through the platform SDK or IMDSv2 session auth \u2014 never a bare client call.\"\n - command: [curl, wget, http, httpie, nc, ncat, netcat, socat, python, python3, node, deno, ruby, perl, php]\n network: { domains: [\"metadata.google.internal\", \"metadata.goog\"] }\n reason: \"[deny-rule:network.cloud-metadata-domains] A cloud metadata endpoint returns the instance's IAM credentials to whoever asks. Fetch through the platform SDK or IMDSv2 session auth \u2014 never a bare client call.\"\n\n # \u2500\u2500 Execution \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n # unshare creating a user namespace (cc-safety-net unshare.user-namespace):\n # -U/--user plus the map flags turn a restricted session into namespace root \u2014\n # the standard first hop of a sandbox escape. Plain isolation flags (-n/-m/-p/-C)\n # stay out of scope by ruling; the glob shapes are case-sensitive like every\n # argv pattern here. Forms are shape-complete for the map family: --map-user(s),\n # --map-group(s), --map-auto and --map-root-user all carry the --map- prefix.\n - command: [unshare]\n argv: { pipeline: [\"unshare *-U*\", \"unshare *--user*\", \"unshare *-r\", \"unshare *-r *\", \"unshare * -r\", \"unshare *--map-*\", \"unshare *-c\", \"unshare *-c *\", \"unshare * -c\"] }\n reason: \"[deny-rule:exec.unshare-user-ns] Creating a user namespace maps a restricted session to namespace root \u2014 the standard first hop of a sandbox escape. Run it outside the gate or ask your user.\"\n\n # \u2500\u2500 PowerShell \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n # Command words are lowercased by the decomposer \u2014 command dimensions must\n # carry the lowercased verb (Remove-Item \u2192 remove-item).\n - command: [\"remove-item#recursive\"]\n args: [\".git\", \".git/*\", \"*/.git\"]\n reason: \"[deny-rule:powershell.remove-item-git-metadata] Never target .git.\"\n - command: [powershell, pwsh]\n argv: { pipeline: [\"pwsh *Remove-Item*\", \"powershell *Remove-Item*\", \"pwsh *remove-item*\", \"powershell *remove-item*\"] }\n reason: \"[deny-rule:powershell.nested-recursive-delete-unread] A delete handed to pwsh/powershell in a non-literal form cannot be verified before it runs.\"\n - command: [\"remove-item#recursive\"]\n args: [\".\", \"./\"]\n reason: \"[deny-rule:powershell.remove-item-recursive-force-cwd-self] Deleting the current directory removes the project.\"\n - command: [\"remove-item#recursive\"]\n args: [\"../*\", \"..\\\\*\"]\n reason: \"[deny-rule:powershell.remove-item-recursive-force-outside-cwd] Deleting above the cwd escapes task scope.\"\n\n # \u2500\u2500 Command Prompt \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n # (The cc escaped-quote-collapse rule cannot be expressed faithfully with\n # these globs \u2014 every cmd /c recursion is nested behind a second parser,\n # so its true target is undecidable: it moves to the ask section instead.)\n - command: [cmd, rmdir, del]\n args: [\".git\", \".git/*\", \"*/.git\"]\n reason: \"[deny-rule:cmd.recursive-delete-git-metadata] Never target .git.\"\n - command: [rmdir, del]\n args: [\".\", \"./\"]\n reason: \"[deny-rule:cmd.recursive-delete-cwd-self] Deleting the current directory removes the project.\"\n - command: [rmdir, del]\n args: [\"../*\", \"..\\\\*\"]\n reason: \"[deny-rule:cmd.recursive-delete-outside-cwd] Delete above cwd escapes task scope.\"\n\n # \u2500\u2500 Secret targets (write/delete deny; reads are the ask section below) \u2500\u2500\n - command: [\"rm#recursive\", \"remove-item#recursive\", rmdir, del]\n args: [\"*/.ssh\", \"*/.aws\", \"*/.gnupg\", \".ssh\", \".aws\"]\n reason: \"[deny-rule:secret.delete-credential-path] Deleting credential stores destroys keys you cannot regenerate.\"\n - command: [echo, \"set-content\", \"out-file\"]\n args: [\".env\", \".env.*\"]\n reason: \"[deny-rule:secret.write-overwrite-env] Overwriting .env destroys existing secrets. Edit specific lines.\"\n - command: [\"rm#recursive\", \"remove-item#recursive\", rmdir, del]\n args: [\"*/.git-credentials\", \".git-credentials\"]\n reason: \"[deny-rule:secret.delete-git-credentials] Deleting the git credential store breaks push/pull auth.\"\n\n # \u2500\u2500 Sensitive-file extensions (cc-safety-net secret.ext.* / ext-pattern.*) \u2500\u2500\n # Key material, keystore databases, VPN profiles, disk-encryption volumes and\n # credential-capable configs hide under extensions, not basenames \u2014 a read of\n # vault.kdbx deserves the same question as a read of id_rsa. Deletion is the\n # deny side (the secret ruling: read = ask, write/delete = deny); the two read\n # rows live in the ask section below. .pem may be a plain public certificate \u2014\n # the ask is cheap and each row revokes singly.\n - command: [\"rm#recursive\", \"remove-item#recursive\", rmdir, del]\n args: [\"*.pem\", \"*.pfx\", \"*.p12\", \"*.pkcs12\", \"*.jks\", \"*.kdb\", \"*.kdbx\", \"*.key\", \"*.keypair\", \"*.keystore\", \"*.keyring\", \"*.keychain\", \"*.kwallet\", \"*.ovpn\", \"*.tpm\", \"*.rdp\", \"*.fve\", \"*.bek\", \"*.asc\", \"*.agilekeychain\", \"*.psafe3\", \"*.cscfg\", \"*.pcap\"]\n reason: \"[deny-rule:secret.ext-delete] Deleting a file whose extension names key material, a keystore, a VPN profile or a disk-encryption volume destroys credentials you may not be able to regenerate.\"\n\nask:\n # Force push: ask, not deny (revoked from cc's deny ruling 2026-10-13).\n - command: [git]\n argv: { pipeline: [\"git push *--force*\", \"git push *-f*\"] }\n reason: \"[deny-rule:git.push-force] Force push rewrites shared history. Prefer git push --force-with-lease.\"\n\n # cmd /c recursion hides the real target behind a second parser (and quoting):\n # undecidable \u2192 ask, where cc denied only the drive-root-collapse variant.\n - command: [cmd]\n argv: { pipeline: [\"cmd /c *rmdir /s*\", \"cmd /c *del /s*\"] }\n reason: \"[deny-rule:cmd.recursive-delete-nested] cmd /c recursion nests a second parser; the real target cannot be resolved. Run rmdir/del directly so the gate can see the target.\"\n\n # Dynamic targets: this gate's ruling is \"undecidable \u2192 ask\", not fail-closed deny.\n - command: [\"rm#recursive\", \"remove-item#recursive\"]\n args: [\"$*\"]\n reason: \"[deny-rule:rm.recursive-force-dynamic-target] Recursive delete of a substitution-assembled target \u2014 verify the variable yourself.\"\n # The wrapper word xargs is stripped by the decomposer, so pipeline patterns\n # never see it \u2014 match the raw command string through the params dimension.\n - params: { command: [\"*xargs rm*\", \"*xargs del*\"] }\n reason: \"[deny-rule:xargs.rm-recursive-force-dynamic] xargs-fed removals have unverifiable target sets.\"\n - command: [parallel]\n argv: { pipeline: [\"parallel *rm*\", \"*| parallel*\"] }\n reason: \"[deny-rule:parallel.rm-recursive-force-dynamic] parallel-fed rm has unresolvable targets.\"\n - command: [awk]\n args: [\"*system(*\"]\n reason: \"[deny-rule:awk.system-dynamic] awk program text containing system() cannot be analyzed.\"\n # NOTE: cc's git checkout <ref> <path> ambiguity (G5) is NOT ported \u2014 a glob\n # cannot tell ref candidates from paths, and a broad pattern would prompt on\n # every git checkout -b new-branch. Documented residual gap.\n\n # The catch-all half of the metadata guard: a non-client call (echo, cat, a\n # script) that merely names an endpoint is a question, not a theft \u2014 ask.\n - network: { ips: [\"169.254.169.254\", \"169.254.170.2\", \"169.254.170.23\", \"fd00:ec2::254\", \"fd00:ec2::23\", \"100.100.100.200\"] }\n reason: \"[deny-rule:network.cloud-metadata-ips-any] This call names a cloud metadata endpoint. Confirm why instance credentials are being addressed before it runs.\"\n - network: { domains: [\"metadata.google.internal\", \"metadata.goog\"] }\n reason: \"[deny-rule:network.cloud-metadata-domains-any] This call names a cloud metadata endpoint. Confirm why instance credentials are being addressed before it runs.\"\n\n # Credential reads: ask (A2 ruling kept; egress combos stay in the prompt layer).\n - command: [cat, head, tail, type, \"get-content\", ls, dir, \"get-childitem\", \"select-string\"]\n args: [\".env\", \".env.*\", \"*.env\", \".npmrc\", \".pypirc\", \".netrc\", \".git-credentials\", \"id_rsa\", \"id_ed25519\", \"id_ecdsa\"]\n reason: \"[deny-rule:secret.read-credential-file] Reading a credential file requires confirmation. Echo only the keys you need via a filtered command.\"\n - command: [cat, head, tail, type, \"get-content\", ls, dir, \"get-childitem\"]\n args: [\"*/.ssh\", \"*/.ssh/*\", \"*/.aws\", \"*/.aws/*\", \"*/.gnupg\", \"*/.gnupg/*\", \"*/.config/gcloud/*\", \"*/.claude/*\", \"*/.codex/*\"]\n reason: \"[deny-rule:secret.read-home-credential-dirs] Browsing ssh/cloud/coding-CLI credential stores requires confirmation.\"\n\n # \u2500\u2500 Credential family ladder (read side) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n # One row per family, restricted to the file-READ tools: decide() pre-queries the\n # rule layer for READ calls, so these rows are what a read hits (shell reads stay\n # under the secret.* rows above, which match first in this section). The settings\n # face rewrites each row as the family's rung: deny - moved to the deny section;\n # ask - stays here; readonly/readwrite - enabled:false (readwrite additionally\n # lists the family in credWriteExemptFamilies for the engine's write clause).\n # Custom credentialPaths have no family and are never write-exempt.\n - tools: [read, read_image, grep, glob, ls, lsp]\n args: [\"*/.ssh\", \"*/.ssh/*\", \"*id_rsa\", \"*id_ed25519\", \"*id_ecdsa\", \"*id_dsa\", \"*authorized_keys\"]\n reason: \"[deny-rule:cred.ssh] Reading SSH keys or authorized_keys needs confirmation (family rung: ask).\"\n - tools: [read, read_image, grep, glob, ls, lsp]\n args: [\"*/.aws\", \"*/.aws/*\", \"*/.config/gcloud\", \"*/.config/gcloud/*\", \"*/.azure\", \"*/.azure/*\", \"*credentials.yaml\", \"*credentials.json\"]\n reason: \"[deny-rule:cred.cloud] Reading cloud-provider credential stores needs confirmation (family rung: ask).\"\n - tools: [read, read_image, grep, glob, ls, lsp]\n args: [\"*/.npmrc\", \"*.npmrc\", \"*/.pypirc\", \"*/.netrc\", \"*_netrc\", \"*/pip.conf\"]\n reason: \"[deny-rule:cred.package] Reading package-registry auth files needs confirmation (family rung: ask).\"\n - tools: [read, read_image, grep, glob, ls, lsp]\n args: [\"*/.git-credentials\", \"*.git-credentials\"]\n reason: \"[deny-rule:cred.gitcreds] Reading the git credential store needs confirmation (family rung: ask).\"\n - tools: [read, read_image, grep, glob, ls, lsp]\n args: [\"*/.env\", \"*/.env.*\", \"*.env\"]\n reason: \"[deny-rule:cred.env] Reading project env files needs confirmation (family rung: ask; readwrite also lets edits, npm-login-style).\"\n - tools: [read, read_image, grep, glob, ls, lsp]\n args: [\"*/.claude\", \"*/.claude/*\", \"*/.codex\", \"*/.codex/*\", \"*/.config/gh\", \"*/.config/gh/*\"]\n reason: \"[deny-rule:cred.cli] Reading coding-CLI credential stores needs confirmation (family rung: ask).\"\n - tools: [read, read_image, grep, glob, ls, lsp]\n args: [\"*/.pgpass\", \"*pgpass\", \"*/.my.cnf\"]\n reason: \"[deny-rule:cred.db] Reading database credential files needs confirmation (family rung: ask).\"\n\n # Family EXTENSION rows (v5): the cloud/cli stores cc covers beyond the seeded\n # family args \u2014 kube/docker/gcp configs and ten coding-CLI credential stores.\n # New ids (the seeded cred.cloud/cred.cli rows cannot be mutated for existing\n # installs); the family LISTS gained the same shapes, so the P0 credential-write\n # floor covers them immediately. Like cred.ssh-variants, these rows are not\n # rung-governed (a readonly/readwrite rung does not silence them) \u2014 revoke by\n # row if a store is a false positive for you.\n - tools: [read, read_image, grep, glob, ls, lsp]\n args: [\"*/.gcp\", \"*/.gcp/*\", \"*/.kube/config\", \"*/.kube/config.*\", \"*/.docker/config.json\", \"*/.docker/config.json.*\"]\n reason: \"[deny-rule:cred.cloud-extended] Reading a kube/docker/gcp credential store (live registry or cluster credentials, backups included) needs confirmation (revoke by row).\"\n - tools: [read, read_image, grep, glob, ls, lsp]\n args: [\"*/.gemini/oauth_creds.json\", \"*/.gemini/mcp-oauth-tokens.json\", \"*/.gemini/a2a-oauth-tokens.json\", \"*/.gemini/gemini-credentials.json\", \"*/.copilot/config.json\", \"*/.copilot/mcp-oauth-config\", \"*/.copilot/mcp-secrets\", \"*/.kimi-code/credentials\", \"*/.kimi-code/server.token\", \"*/.kimi/credentials\", \"*/.kimi/mcp-oauth\", \"*/.local/share/opencode/auth.json\", \"*/.local/share/opencode/mcp-auth.json\", \"*/.local/share/opencode/opencode.db\", \"*/.pi/agent/auth.json\", \"*/.local/share/amp/secrets.json\", \"*/.amp/oauth\", \"*/.cursor/auth.json\", \"*/.cursor/projects/*/mcp-auth.json\", \"*/.config/cursor/auth.json\", \"*/.grok/mcp_credentials.json\", \"*/.factory/auth*\", \"*/.local/share/devin/*\"]\n reason: \"[deny-rule:cred.cli-extended] Reading a coding-CLI credential store (oauth/token/secret files) needs confirmation (revoke by row).\"\n\n # SSH key variants (cc-safety-net secret.variant.* + the broad *_rsa|dsa|ed25519|ecdsa\n # shape + the generic \"credentials\" basename): keys get copied and renamed \u2014\n # id_rsa.bak, github_deploy_ed25519 and id_rsa-old deserve the same ask the\n # canonical names get. New rows (not a mutation of the seeded originals): the\n # watermark backfill is id-based and a mutated row would never reach existing\n # installs. They sit AFTER the family ladder so canonical shapes keep their\n # family tag (and rung governance); only what the ladder missed falls through.\n # The cred.ssh-variants row is NOT family-governed \u2014 a readonly/readwrite rung\n # on the ssh family does not silence it; revoke it by row if unwanted.\n - command: [cat, head, tail, type, \"get-content\", ls, dir, \"get-childitem\", \"select-string\"]\n args: [\"*id_rsa*\", \"*id_ed25519*\", \"*id_ecdsa*\", \"*id_dsa*\", \"*_rsa\", \"*_dsa\", \"*_ed25519\", \"*_ecdsa\", \"credentials\", \"*/credentials\"]\n reason: \"[deny-rule:secret.ssh-key-variants] This path looks like a private key under a renamed or variant basename. Reading key material needs confirmation.\"\n - tools: [read, read_image, grep, glob, ls, lsp]\n args: [\"*id_rsa*\", \"*id_ed25519*\", \"*id_ecdsa*\", \"*id_dsa*\", \"*_rsa\", \"*_dsa\", \"*_ed25519\", \"*_ecdsa\", \"credentials\", \"*/credentials\"]\n reason: \"[deny-rule:cred.ssh-variants] Reading a private-key variant basename needs confirmation (not family-governed; revoke by row).\"\n\n # The read half of the extension guard (see the deny-side secret.ext-delete).\n - tools: [read, read_image, grep, glob, ls, lsp]\n args: [\"*.pem\", \"*.pfx\", \"*.p12\", \"*.pkcs12\", \"*.jks\", \"*.kdb\", \"*.kdbx\", \"*.key\", \"*.keypair\", \"*.keystore\", \"*.keyring\", \"*.keychain\", \"*.kwallet\", \"*.ovpn\", \"*.tpm\", \"*.rdp\", \"*.fve\", \"*.bek\", \"*.asc\", \"*.agilekeychain\", \"*.psafe3\", \"*.cscfg\", \"*.pcap\"]\n reason: \"[deny-rule:secret.ext-read] Reading a file whose extension names key material, a keystore, a VPN profile or a disk-encryption volume needs confirmation (revoke by row).\"\n - command: [cat, head, tail, type, \"get-content\", ls, dir, \"get-childitem\", \"select-string\"]\n args: [\"*.pem\", \"*.pfx\", \"*.p12\", \"*.pkcs12\", \"*.jks\", \"*.kdb\", \"*.kdbx\", \"*.key\", \"*.keypair\", \"*.keystore\", \"*.keyring\", \"*.keychain\", \"*.kwallet\", \"*.ovpn\", \"*.tpm\", \"*.rdp\", \"*.fve\", \"*.bek\", \"*.asc\", \"*.agilekeychain\", \"*.psafe3\", \"*.cscfg\", \"*.pcap\"]\n reason: \"[deny-rule:secret.ext-read-shell] Reading a file whose extension names key material, a keystore, a VPN profile or a disk-encryption volume needs confirmation.\"\n\n # Self-protection: editing the gate's own rule sources needs confirmation \u2014\n # revocation must be a human act, not something an agent can slide through.\n # (Settings-namespace edits go through the host UI, not a tool call, and are\n # out of reach of this entry; documented gap.)\n - args: [\"*rules.yml\", \"*rules.yaml\", \"*deny-defaults*\"]\n reason: \"[deny-rule:gate.self-protection] This call touches the permission gate's own rule sources; changes here alter what the gate enforces.\"\n";
|
|
55
58
|
export declare function parsePresetDoc(): PermissionsDoc;
|
|
56
59
|
/** Every preset id, in table order. Client view + tests use this as the row key. */
|
|
57
60
|
export declare function presetRuleIds(): string[];
|
package/lib/preset-rules.js
CHANGED
|
@@ -38,9 +38,12 @@ import { CRED_FAMILY_IDS } from './cred-families.js';
|
|
|
38
38
|
* (v1 added the seven `cred.*` family rows; v2 added the four
|
|
39
39
|
* `network.cloud-metadata*` rows with the pre-execution extractor; v3 added the
|
|
40
40
|
* two ssh-key-variant rows and the dotted-variant shapes to the ssh family; v4
|
|
41
|
-
* added the three sensitive-file-extension rows
|
|
41
|
+
* added the three sensitive-file-extension rows; v5 added the two family
|
|
42
|
+
* EXTENSION rows — kube/docker/gcp + ten coding-CLI credential stores — and the
|
|
43
|
+
* same shapes to the cloud/cli family lists; v6 added the unshare user-namespace
|
|
44
|
+
* row).
|
|
42
45
|
*/
|
|
43
|
-
export const PRESET_TABLE_VERSION =
|
|
46
|
+
export const PRESET_TABLE_VERSION = 6;
|
|
44
47
|
/** Tag prefix carried by every preset entry's reason; locates an entry for revocation. */
|
|
45
48
|
export const PRESET_RULE_MARKER = '[deny-rule:';
|
|
46
49
|
/** Extract the `[deny-rule:<id>]` tag from one reason string (undefined when untagged). */
|
|
@@ -184,6 +187,17 @@ deny:
|
|
|
184
187
|
network: { domains: ["metadata.google.internal", "metadata.goog"] }
|
|
185
188
|
reason: "[deny-rule:network.cloud-metadata-domains] A cloud metadata endpoint returns the instance's IAM credentials to whoever asks. Fetch through the platform SDK or IMDSv2 session auth — never a bare client call."
|
|
186
189
|
|
|
190
|
+
# ── Execution ─────────────────────────────────────────────────────────────
|
|
191
|
+
# unshare creating a user namespace (cc-safety-net unshare.user-namespace):
|
|
192
|
+
# -U/--user plus the map flags turn a restricted session into namespace root —
|
|
193
|
+
# the standard first hop of a sandbox escape. Plain isolation flags (-n/-m/-p/-C)
|
|
194
|
+
# stay out of scope by ruling; the glob shapes are case-sensitive like every
|
|
195
|
+
# argv pattern here. Forms are shape-complete for the map family: --map-user(s),
|
|
196
|
+
# --map-group(s), --map-auto and --map-root-user all carry the --map- prefix.
|
|
197
|
+
- command: [unshare]
|
|
198
|
+
argv: { pipeline: ["unshare *-U*", "unshare *--user*", "unshare *-r", "unshare *-r *", "unshare * -r", "unshare *--map-*", "unshare *-c", "unshare *-c *", "unshare * -c"] }
|
|
199
|
+
reason: "[deny-rule:exec.unshare-user-ns] Creating a user namespace maps a restricted session to namespace root — the standard first hop of a sandbox escape. Run it outside the gate or ask your user."
|
|
200
|
+
|
|
187
201
|
# ── PowerShell ───────────────────────────────────────────────────────────
|
|
188
202
|
# Command words are lowercased by the decomposer — command dimensions must
|
|
189
203
|
# carry the lowercased verb (Remove-Item → remove-item).
|
|
@@ -311,6 +325,20 @@ ask:
|
|
|
311
325
|
args: ["*/.pgpass", "*pgpass", "*/.my.cnf"]
|
|
312
326
|
reason: "[deny-rule:cred.db] Reading database credential files needs confirmation (family rung: ask)."
|
|
313
327
|
|
|
328
|
+
# Family EXTENSION rows (v5): the cloud/cli stores cc covers beyond the seeded
|
|
329
|
+
# family args — kube/docker/gcp configs and ten coding-CLI credential stores.
|
|
330
|
+
# New ids (the seeded cred.cloud/cred.cli rows cannot be mutated for existing
|
|
331
|
+
# installs); the family LISTS gained the same shapes, so the P0 credential-write
|
|
332
|
+
# floor covers them immediately. Like cred.ssh-variants, these rows are not
|
|
333
|
+
# rung-governed (a readonly/readwrite rung does not silence them) — revoke by
|
|
334
|
+
# row if a store is a false positive for you.
|
|
335
|
+
- tools: [read, read_image, grep, glob, ls, lsp]
|
|
336
|
+
args: ["*/.gcp", "*/.gcp/*", "*/.kube/config", "*/.kube/config.*", "*/.docker/config.json", "*/.docker/config.json.*"]
|
|
337
|
+
reason: "[deny-rule:cred.cloud-extended] Reading a kube/docker/gcp credential store (live registry or cluster credentials, backups included) needs confirmation (revoke by row)."
|
|
338
|
+
- tools: [read, read_image, grep, glob, ls, lsp]
|
|
339
|
+
args: ["*/.gemini/oauth_creds.json", "*/.gemini/mcp-oauth-tokens.json", "*/.gemini/a2a-oauth-tokens.json", "*/.gemini/gemini-credentials.json", "*/.copilot/config.json", "*/.copilot/mcp-oauth-config", "*/.copilot/mcp-secrets", "*/.kimi-code/credentials", "*/.kimi-code/server.token", "*/.kimi/credentials", "*/.kimi/mcp-oauth", "*/.local/share/opencode/auth.json", "*/.local/share/opencode/mcp-auth.json", "*/.local/share/opencode/opencode.db", "*/.pi/agent/auth.json", "*/.local/share/amp/secrets.json", "*/.amp/oauth", "*/.cursor/auth.json", "*/.cursor/projects/*/mcp-auth.json", "*/.config/cursor/auth.json", "*/.grok/mcp_credentials.json", "*/.factory/auth*", "*/.local/share/devin/*"]
|
|
340
|
+
reason: "[deny-rule:cred.cli-extended] Reading a coding-CLI credential store (oauth/token/secret files) needs confirmation (revoke by row)."
|
|
341
|
+
|
|
314
342
|
# SSH key variants (cc-safety-net secret.variant.* + the broad *_rsa|dsa|ed25519|ecdsa
|
|
315
343
|
# shape + the generic "credentials" basename): keys get copied and renamed —
|
|
316
344
|
# id_rsa.bak, github_deploy_ed25519 and id_rsa-old deserve the same ask the
|