Skip to content

手元の開発サーバーへの curl の確認を減らし,構文解析で確認になった理由を監査ログに残す #286

Closed

Description

@furedea-agent

直近(2026-10-19〜22)でフックが出した確認 190 回のうち,curl(39 回)と構文解析(syntax,49 回)が上位.gh api と gh run の形は #265 などで解消済み.手元の開発サーバーへの読み取り専用の curl を許可し,構文解析で確認になった理由の種類を監査ログに残して次の改善の材料にする.

今 後
curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:4399/app/ 確認 許可
curl -s -D - --compressed -o /dev/null http://127.0.0.1:4411/x 確認 許可
curl -s http://localhost:3000/api | jq . 確認 許可
localhost 以外への curl,-L,-K,-x などの設定・転送系の option,変数入りの URL 確認 確認(変わらない)
構文解析による確認の監査ログ detail: "syntax" だけ 理由の種類(heredoc,展開,dollar-quote,ラッパー,解析失敗など)も残す.コマンド本文は残さない

受け入れ条件

  • localhost(localhost,127.0.0.1,[::1])への 1 回の curl で,-w/--write-out(展開を含まない固定の書式),-D -/--dump-header -(標準出力のみ),--compressed が許可される
  • その curl の出力を読み取り専用のフィルター(jq,head,tail,grep,wc)にパイプする形が許可される.フィルター側にファイル書き込みや実行の option がある形は確認のまま
  • 上の表の「変わらない」形は確認のまま(回帰テストつき)
  • 構文解析で確認になったとき,監査ログに理由の種類が残る.コマンドの本文や引数は残さない
  • uv run --frozen pytest tests/agents と lefthook が通る
出典
  • 監査ログ ~/.local/state/agent-harness/audit の集計(10/19 以降,重複を除く):gh_api 54,syntax 49,curl 39,gh_run 13,rm 3.
  • 2026-10-22 時点のフックで,gh api ... 2>&1,gh api ... | tail,gh run view --log-failed | tail は確認にならないことを確認済み.

Activity

  1. furedea-agent commented on Oct 22, 2026

    @furedea-agent
    ContributorAuthor

    プラン

    lane 1 本(local-curl,ブランチ feat/local-curl-and-syntax-audit).実装は Codex,検証・コミット・PR は Sonnet の lane,レビューは Claude(Opus).

    1. curl:agents/hooks/rules/allowed_commands.json の localhost 用 literal_words ルールに,固定書式の -w/--write-out,-D -/--dump-header -,--compressed を足す.
    2. パイプ:agents/hooks/guard_command.py で,localhost への curl 1 回を読み取り専用のフィルターにパイプする形だけを,単独の curl と同じ扱いにする.フィルターの書き込み・実行系の option(jq --rawfile 以外の書き込み系,grep -f など)は確認のまま.
    3. 監査:UnsupportedSyntax に理由の種類を持たせ,audit_log の記録に種類だけを残す.
    4. テスト:test-first.許可する形と,確認のまま残す形(localhost 以外,-L/-K/-x,変数入りの URL,-D でファイルに書く形,フィルターの書き込み系 option)を両方押さえる.
  2. added a commit that references this issue on Oct 22, 2026
    a1cd944
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions