Skip to content

harden(install-cli): chmod 700 the job-cache dir#29

Merged
stephane-segning merged 1 commit into
mainfrom
claude/install-cli-chmod
Jun 28, 2026
Merged

harden(install-cli): chmod 700 the job-cache dir#29
stephane-segning merged 1 commit into
mainfrom
claude/install-cli-chmod

Conversation

@stephane-segning

Copy link
Copy Markdown
Contributor

Follow-up to #28 review (which was merged before the bot comments landed).

Applied: gemini's suggestion to lock the cache dir to 0700 — the mktemp fallback already did this; this makes the RUNNER_TEMP path match.

Rebutted on the #28 threads (false positives):

  • gemini mktemp || exit 1 / mv || exit 1: set -euo pipefail already aborts on a failed $(…) assignment and before the trailing echo.
  • lightbridge GITHUB_PATH dot-files: by PATH-write time .download was mv'd to flutter-tools and .sha256sums rm'd — the dir holds only the binary.
  • lightbridge cache/publish race: RUNNER_TEMP is job-scoped and steps are sequential — no concurrent writers; worst case is the pre-existing redundant download (self-acknowledged benign).

🤖 Generated with Claude Code

Follow-up to #28 review. The mktemp fallback already created a 0700 dir; the
RUNNER_TEMP path used mkdir -p (umask-dependent, typically 0755). Lock the cache
dir to owner-only on both paths so the binary we exec can't be read/replaced by
another user on a shared self-hosted host.

(The other #28 review comments were false positives under set -euo pipefail /
the mv+rm cleanup — rebutted on the threads.)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the scripts/install-cli.sh script to explicitly set the permissions of the temporary binary directory to owner-only (700) using chmod, matching the fallback behavior of mktemp. There are no review comments, and I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@lightbridge-assistant lightbridge-assistant Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🅵 Fast automated pass — SAST + a quick, diff-scoped look (no repo-wide retrieval). For a deeper, repo-aware review, mention @lightbridge-assistant on this PR.

The diff is a clean, correct security hardening change. chmod 700 "$bin_dir" is applied immediately after mkdir -p, setting owner-only permissions that intentionally match the mktemp -d fallback's default 0700 behavior on line 63 — making both code paths consistent. Nothing blocking.


🤖 AI-generated review — treat it as untrusted, verify before acting; a human owns the final decision (AI governance).

@stephane-segning
stephane-segning merged commit 84cc6b0 into main Jun 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant