From 59669dbe6a6562bacb2b6a23b8db480366c02041 Mon Sep 17 00:00:00 2001 From: Musiker15 Date: Wed, 2 Dec 2026 11:25:18 +0100 Subject: [PATCH 1/3] =?UTF-8?q?Shell=20der=20Sandbox=20startet=20wieder,?= =?UTF-8?q?=20Issues=20von=20au=C3=9Fen=20im=20Bericht?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit .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. --- .github/workflows/security-review.yml | 44 +++++++++++++++++++-------- CONTRIBUTING.md | 2 +- 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/.github/workflows/security-review.yml b/.github/workflows/security-review.yml index 35f5b93..3059a0f 100644 --- a/.github/workflows/security-review.yml +++ b/.github/workflows/security-review.yml @@ -1479,6 +1479,10 @@ jobs: # unclear (the event unread, issues unread, more than 50 issues, a # text cut short). gaps = [] + # The issues the pull request closes whose text stays out (written + # from outside, or in a repository of another owner): the report + # names them. + outside_issues = [] try: with open(os.environ['GITHUB_EVENT_PATH'], encoding='utf-8') as handle: pull = json.load(handle).get('pull_request') or {} @@ -1513,6 +1517,7 @@ jobs: else: requirements += ['', f'## Issue {where}#{issue["number"]}', '', '(Von außerhalb der Organisation geschrieben; der Text ist hier nicht übernommen.)'] + outside_issues.append(f'{where}#{issue["number"]}') if closing['totalCount'] > len(closing['nodes']): # The rest is not read: a clean result is then unclear. gaps.append('more than 50') @@ -1625,6 +1630,7 @@ jobs: # Whether the author may write, for the step that stores private # findings: only such a run counts as checked there. write(os.path.join(state, 'writer.json'), writer) + write(os.path.join(state, 'issues-outside.json'), outside_issues) # The call that checks the alerts reads a copy of the base the diff # runs against: an alert closes on the base branch, so whether it is @@ -2692,13 +2698,16 @@ jobs: deny_write=() # The folder of the helper scripts too: Claude Code starts programs # by name outside the sandbox, and the agent must leave none there. - # And the whole .git of the checkout: the git Claude Code runs - # outside the sandbox reads its configuration, that of submodules - # under .git/modules included, whose filters it would start; the - # agent only reads there, and the copy for tests has no .git. + # The tool cache both where the runner names it (RUNNER_TOOL_CACHE, + # on the runners of GitHub /opt/hostedtoolcache, where node and + # claude lie) and where a runner of one's own keeps it, beside the + # temp directory. Not the .git of the checkout: the sandbox lays a + # guard of its own over .git/config and creates a file in .git for + # it, and with .git locked it does not start at all + # (OpenGewerk/opengewerk#1177). for path in "$RUNNER_TEMP" "$(dirname "$RUNNER_TEMP")/_actions" "$(dirname "$RUNNER_TEMP")/_tool" \ - "$GITHUB_WORKSPACE/pr/.security-review/bin" "$GITHUB_WORKSPACE/pr/.git"; do - if [ -e "$path" ]; then + "${RUNNER_TOOL_CACHE:-}" "$GITHUB_WORKSPACE/pr/.security-review/bin"; do + if [ -n "$path" ] && [ -e "$path" ]; then deny_write+=("$path") fi done @@ -2785,12 +2794,14 @@ jobs: # write there (deny_write above). Its scripts have names of their own. search_path="$PATH:$GITHUB_WORKSPACE/pr/.security-review/bin" # Claude Code runs git itself, outside the sandbox, in a checkout the - # agent writes in. Two layers keep a configuration the agent leaves - # from starting anything there: the sandbox locks .git for the agent - # (above), and Claude Code runs its git with hooks and fsmonitor off - # and status without the work trees of submodules. The second is the - # pinned version's own (CLAUDE_CODE_VERSION) and clears any - # GIT_CONFIG_* of this environment: check it when raising the pin. + # agent writes in. Three layers keep a configuration the agent leaves + # from starting anything there: the sandbox guards .git/config itself; + # Claude Code runs its git with hooks and fsmonitor off and status + # without the work trees of submodules; and once the agent has used a + # tool, no second run starts in this checkout (used_tools below). The + # first two are the pinned version's own (CLAUDE_CODE_VERSION), and it + # clears any GIT_CONFIG_* of this environment: check them when raising + # the pin. # Check then too that it reads neither bunfig.toml nor .env from the # folder it starts in, the checkout of the pull request: a preload # that leaves a mark, an .env that names another API address. @@ -3248,6 +3259,15 @@ jobs: if dropped_threads and result != 'clean' and closing_lines: closing_lines = [f'{dropped_threads} Befunde haben keinen Thread am PR (ohne Stelle oder über ' 'die Grenze von 50); sie stehen nur in diesem Bericht.', ''] + closing_lines + # Issues the pull request closes whose text did not go to the review: + # named, so that a clean result does not read as measured against + # them. No doubt: a fix of a report from outside would never be clean. + outside = [entry for entry in load('issues-outside.json', []) if isinstance(entry, str) + and re.fullmatch(r'[A-Za-z0-9._-]+/[A-Za-z0-9._-]+#[0-9]+', entry)][:50] + if outside and closing_lines: + closing_lines = ['Nicht gemessen an ' + ', '.join(outside) + ': Der Text ging nicht an das Review ' + '(von außerhalb der Organisation geschrieben oder aus einem fremden Repository).', + ''] + closing_lines if result == 'clean' and doubts: result = 'unclear' # Published as what counts, with the reason, so that the report diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 648a19a..867c3eb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -67,7 +67,7 @@ Das gilt für jede Datei in jedem Repository der Organisation, und die CI prüft 3. Pull Request eröffnen, die Vorlage ausfüllen und auf das zugehörige Issue verweisen. Soll der Pull Request ein Issue schließen, gehört unter den deutschen Text eine englische Zeile `Closes #`: GitHub erkennt nur die englischen Schlüsselwörter, ein „Schließt #12“ bewirkt nichts. 4. Auf die Prüfung warten. `main` ist geschützt, direkte Pushes gibt es nicht. -Jeder Pull Request bekommt dazu ein automatisches Security-Review, ein Entwurf erst, wenn er bereit zur Prüfung ist. Es erscheint als Review am Pull Request und als Prüfung `PR-Security-Review`. Als Befund am Pull Request gilt nur, was er einführt, ändert oder neu erreichbar macht. Steht die Zeile eines solchen Befunds im Diff, hängt es einen Kommentar an diese Zeile, liegt sie sonst in einer geänderten Datei, an die Datei, höchstens 50 neue je Lauf; was darüber hinausgeht, außerhalb der geänderten Dateien liegt oder in einer Datei, die GitHub bei sehr großen Pull Requests nicht mehr auflistet, steht nur im Review. Eine Schwachstelle, die schon vorher bestand und die der Pull Request weder ändert noch neu erreichbar macht, bleibt privat, auch wenn er ihre Datei ändert: Sie steht als Code-Scanning-Alert im Repository, den nur sieht, wer dort schreiben darf. Ist der Befund eines solchen Kommentars behoben, stellt ein späterer Lauf das fest, antwortet im Thread und schließt ihn. Ein Fehler, der schon vorher bestand und keine Schwachstelle ist, steht im Review unter "Nebenbei gefunden" und macht die Prüfung nicht rot. Konnte das Review mangels Guthaben nicht abschließen, bleibt die Prüfung neutral, und am Pull Request erscheint kein Review. Geprüft wird jeweils der neueste Commit. Ändern sich Head oder Zielzweig, während das Review läuft, wird die Prüfung nicht grün: neutral, wenn es nichts findet und keinen Thread offen lässt, sonst rot. Wird der Pull Request erst danach auf einen anderen Zielzweig umgestellt, prüft erst ein neuer Push oder das Wiederöffnen neu. Kommt der Pull Request aus einem Fork oder von außerhalb der Organisation, liest das Review den Code nur und führt nichts davon aus, und es startet erst, wenn ein Maintainer es freigibt. Pull Requests des Coding-Agents von CodeRabbit aus einem Branch des Repositorys prüft es wie die eines Mitglieds, ohne Freigabe. Ein Approve gibt es ihnen nie: Findet das Review etwas oder bleibt es unklar, bittet es um Änderungen, sonst bleibt es bei einem Kommentar. Das Review ist ein Hinweis, keine Freigabe: gemergt wird nach dem Blick eines Menschen. +Jeder Pull Request bekommt dazu ein automatisches Security-Review, ein Entwurf erst, wenn er bereit zur Prüfung ist. Es erscheint als Review am Pull Request und als Prüfung `PR-Security-Review`. Als Befund am Pull Request gilt nur, was er einführt, ändert oder neu erreichbar macht. Steht die Zeile eines solchen Befunds im Diff, hängt es einen Kommentar an diese Zeile, liegt sie sonst in einer geänderten Datei, an die Datei, höchstens 50 neue je Lauf; was darüber hinausgeht, außerhalb der geänderten Dateien liegt oder in einer Datei, die GitHub bei sehr großen Pull Requests nicht mehr auflistet, steht nur im Review. Eine Schwachstelle, die schon vorher bestand und die der Pull Request weder ändert noch neu erreichbar macht, bleibt privat, auch wenn er ihre Datei ändert: Sie steht als Code-Scanning-Alert im Repository, den nur sieht, wer dort schreiben darf. Ist der Befund eines solchen Kommentars behoben, stellt ein späterer Lauf das fest, antwortet im Thread und schließt ihn. Ein Fehler, der schon vorher bestand und keine Schwachstelle ist, steht im Review unter "Nebenbei gefunden" und macht die Prüfung nicht rot. Konnte das Review mangels Guthaben nicht abschließen, bleibt die Prüfung neutral, und am Pull Request erscheint kein Review. Geprüft wird jeweils der neueste Commit; wird nur Titel oder Beschreibung geändert, startet kein neues Review. Issues, die der Pull Request schließt und die jemand von außerhalb der Organisation geschrieben hat, misst es nicht, und das Review nennt sie. Ändern sich Head oder Zielzweig, während das Review läuft, wird die Prüfung nicht grün: neutral, wenn es nichts findet und keinen Thread offen lässt, sonst rot. Wird der Pull Request erst danach auf einen anderen Zielzweig umgestellt, prüft erst ein neuer Push oder das Wiederöffnen neu. Kommt der Pull Request aus einem Fork oder von außerhalb der Organisation, liest das Review den Code nur und führt nichts davon aus, und es startet erst, wenn ein Maintainer es freigibt. Pull Requests des Coding-Agents von CodeRabbit aus einem Branch des Repositorys prüft es wie die eines Mitglieds, ohne Freigabe. Ein Approve gibt es ihnen nie: Findet das Review etwas oder bleibt es unklar, bittet es um Änderungen, sonst bleibt es bei einem Kommentar. Das Review ist ein Hinweis, keine Freigabe: gemergt wird nach dem Blick eines Menschen. Große Änderungen bitte vorher als Issue oder Discussion abstimmen. Ein fertiger Pull Request, dessen Richtung nicht passt, ist für beide Seiten ärgerlich. From e0c7eb3c8e7c87aa0797cf71d5f51496acad50fc Mon Sep 17 00:00:00 2001 From: Musiker15 Date: Wed, 2 Dec 2026 11:50:54 +0100 Subject: [PATCH 2/3] =?UTF-8?q?Programme=20au=C3=9Ferhalb=20der=20Sandbox?= =?UTF-8?q?=20lesen=20keine=20Konfiguration=20aus=20dem=20Home?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .github/workflows/security-review.yml | 48 ++++++++++++++++++++------- CONTRIBUTING.md | 2 +- 2 files changed, 37 insertions(+), 13 deletions(-) diff --git a/.github/workflows/security-review.yml b/.github/workflows/security-review.yml index 3059a0f..c780be7 100644 --- a/.github/workflows/security-review.yml +++ b/.github/workflows/security-review.yml @@ -32,10 +32,13 @@ name: Security-Review # pull_request with a shell. The shell runs in the sandbox of # Claude Code: a process namespace of its own, without the variables that # request an identity token, without the token file, without sudo and -# Docker, writing only in the checkout and reaching nothing but the npm -# registry. Nothing of the pull request runs outside it in this job, and -# the checkout, the one place the agent could write, is gone before the -# job runs anything in it again. Where the calling repository names its +# Docker, and reaching nothing but the npm registry. It writes in the +# checkout and, by the rules of the pinned Claude Code, in parts of the +# home and system folders; no program outside the sandbox reads its +# configuration from there (curl -q, jq with a home of its own, Claude Code +# with a configuration folder of its own). Nothing of the pull request runs +# outside it in this job, and the checkout is gone before the job runs +# anything in it again. Where the calling repository names its # test database (input database), the agent starts a PostgreSQL of its own # inside that sandbox, for the length of one command; none runs beside it. # The organisation variable SECURITY_REVIEW_DATABASE, set to "aus", @@ -2670,12 +2673,23 @@ jobs: AUTHOR_TYPE: ${{ github.event.pull_request.user.type }} run: | token_file="$RUNNER_TEMP/anthropic-identity-token" + # The sandbox lets the agent write in parts of the home of the runner, + # and programs this step runs outside it must read no configuration + # from there: jq would load ~/.jq into every filter, the one that + # decides about the credit and the second account included. It gets + # a home of its own here, where the sandbox writes nothing; curl runs + # with -q, and every call of Claude Code with a folder of its own. + tool_home="$RUNNER_TEMP/tool-home" + mkdir -p "$tool_home" + jq() { HOME="$tool_home" command jq "$@"; } fetch_token() { # Thirty seconds at most: a hanging request must not eat the time # of the review, nor of the call for the alerts after it. A failed # refresh leaves the token there as it is: only a value replaces it. local value - value="$(curl -sS --fail --max-time 30 -H "Authorization: Bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \ + # -q first: no .curlrc, which could write the request with its + # token into a file the agent reads. + value="$(curl -q -sS --fail --max-time 30 -H "Authorization: Bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \ "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=https://api.anthropic.com" | jq -r '.value // empty')" \ && [ -n "$value" ] || return 1 # A file of its own for each fetch: the loop in the background and @@ -2805,6 +2819,10 @@ jobs: # Check then too that it reads neither bunfig.toml nor .env from the # folder it starts in, the checkout of the pull request: a preload # that leaves a mark, an .env that names another API address. + # A configuration folder of its own for each call, where the sandbox + # writes nothing: the settings and hooks a later call reads are never + # what the agent of an earlier one left in the home of the runner. + config_dir="$RUNNER_TEMP/claude-main" run_review() { env -u ACTIONS_ID_TOKEN_REQUEST_TOKEN -u ACTIONS_ID_TOKEN_REQUEST_URL \ ANTHROPIC_IDENTITY_TOKEN_FILE="$token_file" \ @@ -2816,6 +2834,7 @@ jobs: npm_config_store_dir="$cache/pnpm-store" \ XDG_CACHE_HOME="$cache/xdg" \ DISABLE_AUTOUPDATER=1 BUN_RUNTIME_TRANSPILER_CACHE_PATH=0 \ + CLAUDE_CONFIG_DIR="$config_dir" \ "$@" \ "${limit[@]}" claude -p --safe-mode --setting-sources user --strict-mcp-config --no-session-persistence \ --settings "$run_settings" \ @@ -2932,6 +2951,7 @@ jobs: denied=(Bash WebFetch WebSearch Write Edit NotebookEdit) search_path="$PATH" cache="$RUNNER_TEMP/alerts-cache" + config_dir="$RUNNER_TEMP/claude-alerts" (cd "$RUNNER_TEMP/alerts-base" && scrub=0 && run_review "${account[@]}") echo "Die Prüfung der privaten Befunde endete mit Exit $?." fi @@ -3259,21 +3279,22 @@ jobs: if dropped_threads and result != 'clean' and closing_lines: closing_lines = [f'{dropped_threads} Befunde haben keinen Thread am PR (ohne Stelle oder über ' 'die Grenze von 50); sie stehen nur in diesem Bericht.', ''] + closing_lines + if result == 'clean' and doubts: + result = 'unclear' + # Published as what counts, with the reason, so that the report + # does not say clean where the check fails. + closing_lines = ['Der Workflow wertet dieses Ergebnis als unklar: ' + ' '.join(doubts), '', + 'REVIEW_RESULT: unclear', 'REVIEW_COMPLETE'] # Issues the pull request closes whose text did not go to the review: # named, so that a clean result does not read as measured against - # them. No doubt: a fix of a report from outside would never be clean. + # them, whatever the result. No doubt: a fix of a report from outside + # would never be clean. outside = [entry for entry in load('issues-outside.json', []) if isinstance(entry, str) and re.fullmatch(r'[A-Za-z0-9._-]+/[A-Za-z0-9._-]+#[0-9]+', entry)][:50] if outside and closing_lines: closing_lines = ['Nicht gemessen an ' + ', '.join(outside) + ': Der Text ging nicht an das Review ' '(von außerhalb der Organisation geschrieben oder aus einem fremden Repository).', ''] + closing_lines - if result == 'clean' and doubts: - result = 'unclear' - # Published as what counts, with the reason, so that the report - # does not say clean where the check fails. - closing_lines = ['Der Workflow wertet dieses Ergebnis als unklar: ' + ' '.join(doubts), '', - 'REVIEW_RESULT: unclear', 'REVIEW_COMPLETE'] # The dispositions of the private findings of earlier runs, from the # call of their own after the review; only the last block counts, only # numbers handed over, each once. @@ -3345,6 +3366,9 @@ jobs: - name: Private Befunde als Code-Scanning-Alerts ablegen env: GH_TOKEN: ${{ github.token }} + # A configuration folder of its own: the sandbox let the agent write + # in parts of the home, and gh reads its configuration from there. + GH_CONFIG_DIR: ${{ runner.temp }}/gh-config PR_NUMBER: ${{ github.event.pull_request.number }} AUTHOR_TYPE: ${{ github.event.pull_request.user.type }} BASE_REF: ${{ github.event.pull_request.base.ref }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 867c3eb..52fa804 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -67,7 +67,7 @@ Das gilt für jede Datei in jedem Repository der Organisation, und die CI prüft 3. Pull Request eröffnen, die Vorlage ausfüllen und auf das zugehörige Issue verweisen. Soll der Pull Request ein Issue schließen, gehört unter den deutschen Text eine englische Zeile `Closes #`: GitHub erkennt nur die englischen Schlüsselwörter, ein „Schließt #12“ bewirkt nichts. 4. Auf die Prüfung warten. `main` ist geschützt, direkte Pushes gibt es nicht. -Jeder Pull Request bekommt dazu ein automatisches Security-Review, ein Entwurf erst, wenn er bereit zur Prüfung ist. Es erscheint als Review am Pull Request und als Prüfung `PR-Security-Review`. Als Befund am Pull Request gilt nur, was er einführt, ändert oder neu erreichbar macht. Steht die Zeile eines solchen Befunds im Diff, hängt es einen Kommentar an diese Zeile, liegt sie sonst in einer geänderten Datei, an die Datei, höchstens 50 neue je Lauf; was darüber hinausgeht, außerhalb der geänderten Dateien liegt oder in einer Datei, die GitHub bei sehr großen Pull Requests nicht mehr auflistet, steht nur im Review. Eine Schwachstelle, die schon vorher bestand und die der Pull Request weder ändert noch neu erreichbar macht, bleibt privat, auch wenn er ihre Datei ändert: Sie steht als Code-Scanning-Alert im Repository, den nur sieht, wer dort schreiben darf. Ist der Befund eines solchen Kommentars behoben, stellt ein späterer Lauf das fest, antwortet im Thread und schließt ihn. Ein Fehler, der schon vorher bestand und keine Schwachstelle ist, steht im Review unter "Nebenbei gefunden" und macht die Prüfung nicht rot. Konnte das Review mangels Guthaben nicht abschließen, bleibt die Prüfung neutral, und am Pull Request erscheint kein Review. Geprüft wird jeweils der neueste Commit; wird nur Titel oder Beschreibung geändert, startet kein neues Review. Issues, die der Pull Request schließt und die jemand von außerhalb der Organisation geschrieben hat, misst es nicht, und das Review nennt sie. Ändern sich Head oder Zielzweig, während das Review läuft, wird die Prüfung nicht grün: neutral, wenn es nichts findet und keinen Thread offen lässt, sonst rot. Wird der Pull Request erst danach auf einen anderen Zielzweig umgestellt, prüft erst ein neuer Push oder das Wiederöffnen neu. Kommt der Pull Request aus einem Fork oder von außerhalb der Organisation, liest das Review den Code nur und führt nichts davon aus, und es startet erst, wenn ein Maintainer es freigibt. Pull Requests des Coding-Agents von CodeRabbit aus einem Branch des Repositorys prüft es wie die eines Mitglieds, ohne Freigabe. Ein Approve gibt es ihnen nie: Findet das Review etwas oder bleibt es unklar, bittet es um Änderungen, sonst bleibt es bei einem Kommentar. Das Review ist ein Hinweis, keine Freigabe: gemergt wird nach dem Blick eines Menschen. +Jeder Pull Request bekommt dazu ein automatisches Security-Review, ein Entwurf erst, wenn er bereit zur Prüfung ist. Es erscheint als Review am Pull Request und als Prüfung `PR-Security-Review`. Als Befund am Pull Request gilt nur, was er einführt, ändert oder neu erreichbar macht. Steht die Zeile eines solchen Befunds im Diff, hängt es einen Kommentar an diese Zeile, liegt sie sonst in einer geänderten Datei, an die Datei, höchstens 50 neue je Lauf; was darüber hinausgeht, außerhalb der geänderten Dateien liegt oder in einer Datei, die GitHub bei sehr großen Pull Requests nicht mehr auflistet, steht nur im Review. Eine Schwachstelle, die schon vorher bestand und die der Pull Request weder ändert noch neu erreichbar macht, bleibt privat, auch wenn er ihre Datei ändert: Sie steht als Code-Scanning-Alert im Repository, den nur sieht, wer dort schreiben darf. Ist der Befund eines solchen Kommentars behoben, stellt ein späterer Lauf das fest, antwortet im Thread und schließt ihn. Ein Fehler, der schon vorher bestand und keine Schwachstelle ist, steht im Review unter "Nebenbei gefunden" und macht die Prüfung nicht rot. Konnte das Review mangels Guthaben nicht abschließen, bleibt die Prüfung neutral, und am Pull Request erscheint kein Review. Geprüft wird jeweils der neueste Commit; wird nur Titel oder Beschreibung geändert, startet kein neues Review. Issues, die der Pull Request schließt und die jemand von außerhalb der Organisation geschrieben hat oder die in einem Repository eines anderen Eigentümers liegen, misst es nicht, und das Review nennt sie. Ändern sich Head oder Zielzweig, während das Review läuft, wird die Prüfung nicht grün: neutral, wenn es nichts findet und keinen Thread offen lässt, sonst rot. Wird der Pull Request erst danach auf einen anderen Zielzweig umgestellt, prüft erst ein neuer Push oder das Wiederöffnen neu. Kommt der Pull Request aus einem Fork oder von außerhalb der Organisation, liest das Review den Code nur und führt nichts davon aus, und es startet erst, wenn ein Maintainer es freigibt. Pull Requests des Coding-Agents von CodeRabbit aus einem Branch des Repositorys prüft es wie die eines Mitglieds, ohne Freigabe. Ein Approve gibt es ihnen nie: Findet das Review etwas oder bleibt es unklar, bittet es um Änderungen, sonst bleibt es bei einem Kommentar. Das Review ist ein Hinweis, keine Freigabe: gemergt wird nach dem Blick eines Menschen. Große Änderungen bitte vorher als Issue oder Discussion abstimmen. Ein fertiger Pull Request, dessen Richtung nicht passt, ist für beide Seiten ärgerlich. From 0b45df4b7d11155bb373b16f7a41824f66d59aaf Mon Sep 17 00:00:00 2001 From: Musiker15 Date: Wed, 2 Dec 2026 12:10:53 +0100 Subject: [PATCH 3/3] =?UTF-8?q?Ordner=20f=C3=BCr=20Node-Module=20vor=20dem?= =?UTF-8?q?=20Agenten=20anlegen=20und=20sperren?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .github/workflows/security-review.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/security-review.yml b/.github/workflows/security-review.yml index c780be7..e7df93d 100644 --- a/.github/workflows/security-review.yml +++ b/.github/workflows/security-review.yml @@ -2719,8 +2719,16 @@ jobs: # guard of its own over .git/config and creates a file in .git for # it, and with .git locked it does not start at all # (OpenGewerk/opengewerk#1177). + # And the folders where Node looks for a module that the bundle of + # an action does not carry: node_modules in every folder above the + # actions and ~/.node_modules and ~/.node_libraries. The actions + # after the agent run outside the sandbox. Made empty here, since + # the lock takes only what exists; those above /home the runner + # user cannot create, and the agent neither. + node_folders=("$(dirname "$RUNNER_TEMP")/node_modules" "$HOME/node_modules" "$HOME/.node_modules" "$HOME/.node_libraries") + mkdir -p "${node_folders[@]}" for path in "$RUNNER_TEMP" "$(dirname "$RUNNER_TEMP")/_actions" "$(dirname "$RUNNER_TEMP")/_tool" \ - "${RUNNER_TOOL_CACHE:-}" "$GITHUB_WORKSPACE/pr/.security-review/bin"; do + "${RUNNER_TOOL_CACHE:-}" "$GITHUB_WORKSPACE/pr/.security-review/bin" "${node_folders[@]}"; do if [ -n "$path" ] && [ -e "$path" ]; then deny_write+=("$path") fi @@ -2900,8 +2908,8 @@ jobs: ANTHROPIC_ORGANIZATION_ID="$FALLBACK_ORGANIZATION_ID" ANTHROPIC_SERVICE_ACCOUNT_ID="$FALLBACK_SERVICE_ACCOUNT_ID" ANTHROPIC_WORKSPACE_ID="$FALLBACK_WORKSPACE_ID" - CLAUDE_CONFIG_DIR="$RUNNER_TEMP/claude-fallback" ) + config_dir="$RUNNER_TEMP/claude-fallback" run_review "${account[@]}" code=$? if out_of_credit; then