Repository navigation
fix(hooks): judge a ~user path by the secret-path rules of the own home - #129
Merged
Merged
Conversation
A non-glob word such as ~root/.aws/credentials was matched literally against rules written for ~/.aws/**, so it passed. The policy now reads ~user/... as ~/..., and shell_paths refuses a leading ~user the system does not know, as it already did for globs. Glob matches under ~user keep the ~user prefix so the same rules apply to them. Closes #126 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Owner
|
@codex review |
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
レビュー結果ブロッキングな指摘はありません(P0/P1: 0件,P2/P3: 0件). 確認した点:
補足:このレビュー環境では pytest を実行できなかった(実行の承認が得られなかった)ので,CI の結果に頼っている. |
Relabeling a match as ~user/... alone dropped the real path, so a rule written for an absolute path could be missed, and a home of / produced a broken label. Return both forms and relabel only matches inside the home. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Owner
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
レビュー結果指摘事項はありません(P0〜P3 なし). 確認した点:
なお,この環境ではテストを実行できなかったため,上記はコードを読んでの確認です. |
furedea
approved these changes
Nov 10, 2026
furedea
pushed a commit
that referenced
this pull request
Nov 11, 2026
🤖 I have created a release *beep* *boop* --- ## [0.1.1](v0.1.0...v0.1.1) (2026-11-11) ### Features * **hooks:** judge session changes with jev-lint model rules at Stop ([#150](#150)) ([946e976](946e976)) ### Bug Fixes * **hooks:** ask for zsh's $=name and $~name expansions ([#152](#152)) ([9255c87](9255c87)) * **hooks:** judge a ~user path by the secret-path rules of the own home ([#129](#129)) ([64221f6](64221f6)) * **hooks:** match static words by their single-quoted form in precise command rules ([#147](#147)) ([c432a20](c432a20)) * **hooks:** run verification tools through the flake dev shell ([#132](#132)) ([63dd2f5](63dd2f5)) * **hooks:** start trusted model-rule programs and send only in-repository regular files ([#156](#156)) ([183496b](183496b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: furedea-release[bot] <353651101+furedea-release[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
cat ~root/.aws/credentialsのように glob を含まない~userのパスが,展開されないまま~/.aws/**などの規則と文字で照合され,通っていた抜けを塞ぐ.設計
secret_path_policy.normalize~user/...を~/...として照合する.awsや.sshなど名前で秘密を指す.他人のホームでも同じ名前は同じ秘密なので,規則を複製せず自分のホーム基準のまま安全側に倒せる.展開後の絶対パスを照合する案は,ホームの場所(/var/rootなど)ごとに規則を持つ必要があり採らないshell_paths.checked_home~userを確認し,ホームが不明ならUnexpandableGlob(確認に回す)known_home(旧 glob 内の展開)を共有shell_paths.expanded_paths~userの glob の一致結果を~user/...の名前で返すnormalizeが同じ規則で扱えるようにするguard_file の確認
Edit/Write の対象は
provider_adapter.check_pathsから同じblocked_ruleを通るので,normalizeの修正で~root/.aws/credentialsも止まる.guard_file.protected_reasonは自分の harness ファイルの一致を見るもので,home_expandedが既に~userを展開し,不明なユーザーは文字のまま(どの保護パスにも一致しない).他人のホームの harness ファイルは境界の対象外なので変更しない.検証
ruff check/ruff format --check/ty check/pytest(4538 passed, 1 skipped)~root/.aws/credentialsが止まる,~no-such-user/...が確認に回る,~root/notes.txtは通る,~rootの glob の一致が~root/...で返るCloses #126
🤖 Generated with Claude Code