Skip to content

Security-Review: Shell der Sandbox startet wieder, keine Konfiguration aus dem Home - #70

Merged
Musiker15 merged 3 commits into
mainfrom
review-shell-git
Dec 2, 2026
Merged

Musiker15 merged 3 commits into
mainfrom
review-shell-git

Conversation

@Musiker15

@Musiker15 Musiker15 commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Fixes #67
Fixes #68
Refs #61

Der erste Lauf des Reviews aus #66 an OpenGewerk/opengewerk#1177 zeigt, dass die Shell der Sandbox nicht startet. Jeder Befehl endet mit bwrap: Can't create file at …/pr/.git/config.lock: Read-only file system. Ursache ist die Sperre von .git aus #66: Die Sandbox legt einen eigenen Schutz über .git/config und braucht dafür eine Datei in .git.

Was sich ändert

  • .git des Checkouts ist nicht mehr gesperrt. Gegen eine Konfiguration, die der Agent dort ablegt, bleiben drei Schichten: der Schutz der Sandbox über .git/config, die Schalter, mit denen Claude Code sein git startet (ohne Hooks und fsmonitor, status ohne die Arbeitsbäume von Submodulen), und kein zweiter Lauf, sobald der Agent ein Werkzeug benutzt hat. Eine Sperre, die die Sandbox nicht bricht, kommt mit Review: .git des Checkouts sperren, ohne die Sandbox zu brechen #69.
  • Gesperrt ist jetzt auch der Werkzeug-Cache, wie der Runner ihn nennt (RUNNER_TOOL_CACHE, auf den Runnern von GitHub /opt/hostedtoolcache, wo node und claude liegen). Bisher stand nur der Ort eines selbst gehosteten Runners in der Liste (Sperrliste der Sandbox nennt den Werkzeug-Cache der Runner von GitHub nicht #67).
  • Programme, die der Workflow außerhalb der Sandbox startet, lesen keine Konfiguration mehr aus dem Home des Runners, in das die Sandbox den Agenten teilweise schreiben lässt: curl läuft mit -q, jq mit einem eigenen Home, jeder Aufruf von Claude Code und der Schritt mit gh mit einem eigenen Konfigurationsordner unter dem Temp-Ordner des Runners. Die Ordner, in denen Node ein Modul sucht, das das Bündel einer Action nicht mitbringt (node_modules über den Actions, ~/.node_modules, ~/.node_libraries), legt der Workflow vor dem Agenten leer an und sperrt sie: Die Actions nach dem Agenten laufen außerhalb der Sandbox. Der Kopf der Datei sagt jetzt richtig, wo der Agent schreiben kann.
  • Schließt ein PR ein Issue, dessen Text nicht an das Review geht (von außen geschrieben oder aus einem fremden Repository), nennt der Bericht es, auch wenn das Ergebnis aus einem anderen Grund unklar ist. Das Ergebnis wird davon nicht unklar, sonst wäre jeder PR, der einen Fehlerbericht von außen behebt, rot (Review: Issues von außen und geänderte Beschreibung im Bericht nennen #68).
  • CONTRIBUTING.md sagt das und dass eine Änderung nur an Titel oder Beschreibung kein neues Review startet.

Geprüft

  • actionlint 1.7.9, bash -n jedes Schritts und jedes eingebettete Python-Programm: ohne Befund.
  • Die Sperrliste gegen ein nachgebautes Verzeichnis in 6 Fällen: .git bleibt frei, der Werkzeug-Cache des Runners ist gesperrt, die Ordner für Node-Module sind angelegt und gesperrt, ein leeres oder fehlendes RUNNER_TOOL_CACHE hält nichts an. Gegenproben rot.
  • Der Abruf hält die Issues fest, deren Text er auslässt, und nur diese; der Bericht nennt sie, lässt das Ergebnis sauber und nimmt nur Namen der Form owner/repo#n. Gegenproben rot.
  • Die Programme außerhalb der Sandbox in 8 Fällen: jedes curl des Schritts mit -q, jq mit eigenem Home (gegen ein jq, das sein Home ausgibt, auch in Subshell und Ersetzung), kein Aufruf an der Funktion vorbei, ein eigener Konfigurationsordner je Aufruf von Claude Code, auch nach einem Lauf mit dem zweiten Konto, und für gh. Gegenproben rot.
  • Ein unklarer Bericht behält die Nennung der Issues von außen (Gegenprobe rot).
  • Die übrigen Testreihen aus Security-Review: Threads statt Alerts, neuer Auftrag, neutral ohne Guthaben #66 laufen unverändert grün.
  • Das lokale Review über diesen Stand.

Nicht geprüft

Ob die Shell jetzt startet, zeigt erst der nächste Lauf an einem PR, der den Pin anhebt; lokal gibt es kein bwrap.

Eigene Festlegungen

  • Kein neues Review, wenn nur Titel oder Beschreibung geändert werden: Ein Review kostet einen ganzen Lauf, und die Beschreibung ändert keinen Code.

Summary by CodeRabbit

  • Security Reviews
    • Review reports now indicate when closing issues were excluded from the review, clarifying which information was considered.
    • Updating only a pull request’s title or description does not start a new security review.
  • Documentation
    • Updated guidance to clarify how the review sandbox handles file writes.

.git des Checkouts ist nicht mehr gesperrt: Die Sandbox legt einen eigenen
Schutz über .git/config und braucht dafür eine Datei in .git, mit der Sperre
startete die Shell nicht. Gesperrt ist jetzt auch der Werkzeug-Cache des
Runners. Der Bericht nennt die Issues, deren Text nicht an das Review ging,
und CONTRIBUTING sagt, dass eine geänderte Beschreibung kein neues Review
startet.
Die Sandbox lässt den Agenten in Teilen des Homes des Runners schreiben. curl
läuft deshalb mit -q, jq mit einem eigenen Home, jeder Aufruf von Claude Code
und der Schritt mit gh mit einem eigenen Konfigurationsordner unter dem
Temp-Ordner. Die Nennung der Issues von außen bleibt auch in einem unklaren
Bericht stehen.
Node sucht ein Modul, das das Bündel einer Action nicht mitbringt, auch in
node_modules über den Actions und in ~/.node_modules und ~/.node_libraries.
Die Actions nach dem Agenten laufen außerhalb der Sandbox; der Workflow legt
diese Ordner deshalb leer an und sperrt sie. Der Lauf mit dem zweiten Konto
setzt den Konfigurationsordner nur für seinen eigenen Aufruf.
@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The security-review workflow now uses isolated tool configuration, changes sandbox write protections, and identifies closing issues whose text was withheld from review. CONTRIBUTING.md clarifies that changing only a pull request’s title or description does not start a new review.

Changes: Security review workflow

Layer / File(s) Summary
Isolate tool configuration
.github/workflows/security-review.yml
Tool calls use dedicated configuration locations, including separate Claude Code configurations for the main, fallback-account, and private-alert reviews. The token request uses curl -q, and jq runs with a dedicated tool home.
Update sandbox write protections
.github/workflows/security-review.yml
The write-denial list covers the runner tool cache and Node module lookup directories instead of the checkout’s entire .git directory. The workflow comment describes the updated write boundaries and .git safeguards.
Report excluded closing issues
.github/workflows/security-review.yml, CONTRIBUTING.md
The workflow records references to closing issues whose text is withheld and adds a report notice identifying those issues. The pull request guidance states that title-only or description-only changes do not start a new review.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Low

Possibly related issues

  • Issue 69 describes removing the .git write lock that prevented sandbox shell startup; this change replaces that lock with protections for the runner tool cache and Node module lookup directories.

Possibly related PRs

  • OpenGewerk/.github#66: Both changes update the Security-Review workflow, and this PR changes sandbox protections in that workflow.
Merge Risk: Minimal · up to 0b45d

The change adjusts the security-review workflow's sandbox write protections, isolates tool configuration, reports withheld closing issues, and documents that title-only edits do not trigger a new review. No concrete defect was established. Whether the sandbox shell starts correctly will only be confirmed on the next real run, so check that run after merge.

Pre-merge checks: Passed 2 · Inconclusive 2

Failed Failed checks: 2 inconclusive

Check name Status Explanation Resolution
Linked Issues check Inconclusive Linked issues: #67 (add $RUNNER_TOOL_CACHE to the sandbox deny list) and #68 (name withheld external issues in the report without making the result unclear; document the gap in CONTRIBUTING.md). The P… Provide readable source for the changed hunks of .github/workflows/security-review.yml and CONTRIBUTING.md at the reviewed head, specifically: the protected-path list containing $RUNNER_TOOL_CACHE, the requirements-fetch step that records w…
Out of Scope Changes check Inconclusive The PR description and summary list sandbox and runner hardening beyond the two issue texts: removal of the .git lock, curl -q, jq with its own home, one Claude Code configuration folder per call, gh … Provide readable source for the changed hunks of .github/workflows/security-review.yml at the reviewed head so each hardening change can be matched to the PR's stated purpose. Confirm that no hunk outside the sandbox, notice, and documentat…
Passed Passed checks: 2 passed

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: the sandbox shell starts again, and no configuration is taken from the home directory. The workflow changes isolate Claude Code configuration directories and remove th…
Full details: Title check

Explanation

The title names the main change: the sandbox shell starts again, and no configuration is taken from the home directory. The workflow changes isolate Claude Code configuration directories and remove the blanket lock on the checkout's .git directory, which matches the title's two points. The title is in German, as is the PR objectives text. It is longer than ideal, but it is specific and related to the changeset.

Full details: Linked Issues check

Explanation

Linked issues: #67 (add $RUNNER_TOOL_CACHE to the sandbox deny list) and #68 (name withheld external issues in the report without making the result unclear; document the gap in CONTRIBUTING.md). The PR description and the whole-PR summary both state that the changes exist: RUNNER_TOOL_CACHE is on the protected list, a withheld-issue list is passed to the report parser, and CONTRIBUTING.md documents that a title or description edit starts no new review. The repository diff tool returned no text because the changed blobs were missing from the checkout. The file read of .github/workflows/security-review.yml at head was truncated at 16000 bytes and showed only the header. The exact deny-list entry, the notice logic in the parser, and the CONTRIBUTING.md text were therefore not read in source. No requirement is shown to be unmet. The author's test claims (6-case deny-list check, withheld-issue check) are not independently verified.

Resolution

Provide readable source for the changed hunks of .github/workflows/security-review.yml and CONTRIBUTING.md at the reviewed head, specifically: the protected-path list containing $RUNNER_TOOL_CACHE, the requirements-fetch step that records withheld closing issues, and the report-parser branch that adds the notice without changing the result.

Full details: Out of Scope Changes check

Explanation

The PR description and summary list sandbox and runner hardening beyond the two issue texts: removal of the .git lock, curl -q, jq with its own home, one Claude Code configuration folder per call, gh with its own configuration folder, and empty and locked Node module directories. The PR description links these to the removed .git lock as compensating controls, so they appear connected to the PR's stated purpose and no unrelated change is shown. Because the diff could not be read in source, the actual hunks cannot be checked against that stated purpose. The summary also cites a review of a stale-run timing rule and a trusted-bot list change in the same file, which I could not confirm or place.

Resolution

Provide readable source for the changed hunks of .github/workflows/security-review.yml at the reviewed head so each hardening change can be matched to the PR's stated purpose. Confirm that no hunk outside the sandbox, notice, and documentation scope is present.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 627856bc-e691-4d70-86b3-01787093b6da
Commits

Reviewing files that changed from the base of the PR and between 1cbebb2 and 0b45df4.

Files selected for processing: 2

  • .github/workflows/security-review.yml
  • CONTRIBUTING.md

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@Musiker15
Musiker15 merged commit 1606735 into main Dec 2, 2026
7 checks passed
@Musiker15
Musiker15 deleted the review-shell-git branch December 2, 2026 11:30
Musiker15 added a commit to OpenGewerk/opengewerk that referenced this pull request Dec 2, 2026
Mit OpenGewerk/.github#70 startet die Shell der Sandbox wieder, und Programme
außerhalb der Sandbox lesen keine Konfiguration aus dem Home des Runners.
Musiker15 added a commit to OpenGewerk/opengewerk-kanzlei that referenced this pull request Dec 2, 2026
Hebt das Security-Review der Organisation auf `5d6e762` an
(OpenGewerk/.github#66, OpenGewerk/.github#70 und
OpenGewerk/.github#71). Seine Befunde stehen damit als Threads an den
Zeilen, und der nächste Lauf schließt sie selbst, sobald sie behoben
sind. Es misst den PR an seiner Beschreibung und den Issues, die er
schließt, lässt vorher semgrep und gitleaks über die geänderten Dateien
laufen und endet ohne API-Guthaben neutral statt rot.

Der Aufruf gibt dafür `checks: write`, `issues: read` und `contents:
write` frei, `statuses: write` fällt weg; schreiben darf nur der Job,
der veröffentlicht, damit er die Threads früherer Läufe schließen kann.
Das Ergebnis steht ab jetzt als Prüfung `PR-Security-Review` am PR,
einen Commit-Status dieses Namens gibt es für neue Commits nicht mehr.

An diesem PR zeigt der Lauf des neuen Reviews, ob die Shell der Sandbox
auf `ubuntu-24.04` startet (OpenGewerk/.github#61). Mit `1cbebb2` tat
sie das nicht, weil `.git` gesperrt war; OpenGewerk/.github#70 behebt
das.

## Geprüft

- Lokales Security-Review über diesen Stand: clean.
Musiker15 added a commit to OpenGewerk/opengewerk-api-spec that referenced this pull request Dec 2, 2026
Hebt das Security-Review der Organisation auf `5d6e762` an
(OpenGewerk/.github#66, OpenGewerk/.github#70 und
OpenGewerk/.github#71). Seine Befunde stehen damit als Threads an den
Zeilen, und der nächste Lauf schließt sie selbst, sobald sie behoben
sind. Es misst den PR an seiner Beschreibung und den Issues, die er
schließt, lässt vorher semgrep und gitleaks über die geänderten Dateien
laufen und endet ohne API-Guthaben neutral statt rot.

Der Aufruf gibt dafür `checks: write`, `issues: read` und `contents:
write` frei, `statuses: write` fällt weg; schreiben darf nur der Job,
der veröffentlicht, damit er die Threads früherer Läufe schließen kann.
Das Ergebnis steht ab jetzt als Prüfung `PR-Security-Review` am PR,
einen Commit-Status dieses Namens gibt es für neue Commits nicht mehr.

An diesem PR zeigt der Lauf des neuen Reviews, ob die Shell der Sandbox
auf `ubuntu-24.04` startet (OpenGewerk/.github#61). Mit `1cbebb2` tat
sie das nicht, weil `.git` gesperrt war; OpenGewerk/.github#70 behebt
das.

## Geprüft

- Lokales Security-Review über diesen Stand: clean.
Musiker15 added a commit to OpenGewerk/opengewerk that referenced this pull request Dec 2, 2026
Hebt das Security-Review der Organisation auf `5d6e762` an
(OpenGewerk/.github#66, OpenGewerk/.github#70 und
OpenGewerk/.github#71). Seine Befunde stehen damit als Threads an den
Zeilen, und der nächste Lauf schließt sie selbst, sobald sie behoben
sind. Es misst den PR an seiner Beschreibung und den Issues, die er
schließt, lässt vorher semgrep und gitleaks über die geänderten Dateien
laufen und endet ohne API-Guthaben neutral statt rot.

Der Aufruf gibt dafür `checks: write`, `issues: read` und `contents:
write` frei, `statuses: write` fällt weg; schreiben darf nur der Job,
der veröffentlicht, damit er die Threads früherer Läufe schließen kann.
Das Ergebnis steht ab jetzt als Prüfung `PR-Security-Review` am PR,
einen Commit-Status dieses Namens gibt es für neue Commits nicht mehr.

An diesem PR zeigt der Lauf des neuen Reviews, ob die Shell der Sandbox
auf `ubuntu-24.04` startet (OpenGewerk/.github#61). Mit `1cbebb2` tat
sie das nicht, weil `.git` gesperrt war; OpenGewerk/.github#70 behebt
das.

## Geprüft

- Lokales Security-Review über diesen Stand: clean.
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.

Review: Issues von außen und geänderte Beschreibung im Bericht nennen Sperrliste der Sandbox nennt den Werkzeug-Cache der Runner von GitHub nicht

1 participant