Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,16 @@ runs:
echo "::error title=GCP credentials unavailable::Resolved credentials file is no longer readable."
exit 1
fi
# google-github-actions/auth writes the credential file 0600 and the
# R2A container runs as the non-root udx user, so the read-only bind
# mount is unreadable inside the container. Make it world-readable
# only while the container runs, then restore the original mode.
credential_mode="$(stat -c '%a' "$GCP_CREDENTIALS_PATH")"
restore_credential_mode() {
chmod "$credential_mode" "$GCP_CREDENTIALS_PATH" 2>/dev/null || true
}
trap restore_credential_mode EXIT
chmod 0644 "$GCP_CREDENTIALS_PATH"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Readable credentials abort deployment

An already world-readable credential file can belong to another account. The unconditional chmod fails, aborting deployment before the container starts.

Prompt for agents
In action.yml's Run Rabbit Automation Action step, avoid requiring ownership of a credential file that is already readable by the container. The current unconditional chmod 0644 fails for caller-provided, world-readable files owned by another account, which can occur on self-hosted runners or with externally mounted credentials. Inspect the effective target mode first and change permissions only when additional read access is required. Preserve the existing temporary-mode restoration behavior for files that are changed, and account for symbolic-link paths when reading and restoring the target mode.
Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Handled in #13 (8536852): the action now leaves the caller credential untouched and uses install to stage a readable copy in a private mktemp -d directory. It no longer requires ownership of the source file.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Credential fix receives no release

Merging this behavior change without a new version makes Publish release skip publication. Versioned and v1 callers never receive the fix.

Prompt for agents
Prepare this action behavior change as the next patch release. Update package.json to the next semantic version and add the matching top entry to CHANGELOG.md with concise user-facing notes. Keep both values synchronized so make test passes and the production Publish release workflow detects the version change and creates the immutable release.
Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Handled in #13 (8536852): the combined production-targeting PR carries the 1.0.5 package version and matching changelog entry. After #13 merges into this branch, the production-targeted CI check verifies the release increment.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟨 Cloud credentials exposed to runner users

chmod 0644 lets every local account read the active Google Cloud credential while the container runs. Shared-runner processes can copy it before restoration.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Handled in #13 (8536852): the caller credential is no longer chmodded. Only a temporary copy inside a private mktemp -d directory is mounted for the non-root container and removed at step exit.

gcp_mount=(-v "$GCP_CREDENTIALS_PATH:/tmp/gcp-credentials.json:ro" -e "GOOGLE_APPLICATION_CREDENTIALS=/tmp/gcp-credentials.json")
Comment on lines +554 to 564

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Handled in #13 (8536852): this follows the suggested private-directory copy pattern. The source credential remains private; the container receives a read-only mount of the staged copy, which the exit trap removes.

fi

Expand Down