-
Notifications
You must be signed in to change notification settings - Fork 0
Make WIF credential file readable inside the R2A container #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 Prompt for agentsWas this helpful? React with 👍 or 👎 to provide feedback.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| fi | ||
|
|
||
|
|
||
There was a problem hiding this comment.
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
chmodfails, aborting deployment before the container starts.Prompt for agents
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
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
installto stage a readable copy in a privatemktemp -ddirectory. It no longer requires ownership of the source file.