Crates.io | sudo-gcp |
lib.rs | sudo-gcp |
version | 0.2.1 |
source | src |
created_at | 2023-04-17 19:56:09.547839 |
updated_at | 2023-07-07 16:26:13.11357 |
description | A gcloud CLI wrapper to use a more secure pattern of temporary access tokens and service account impersonation. |
homepage | |
repository | https://github.com/getsentry/sudo-gcp |
max_upload_size | |
id | 841849 |
size | 79,241 |
sudo-gcp is currently in alpha stages! Expect breaking changes.
This tool enables with running Google Cloud commands with temporary elevated privileges, using short-lived OAuth access tokens.
sudo-gcp
securely caches access tokens using the operating system's secret-store/keychain, and
will reuse matching non-expired tokens on subsequent calls.
roles/iam.workloadIdentityUser
role, bound to that
service accountcargo install sudo-gcp
If both environment and file configuration sources exist, environment variables take precedence over the configuration file.
Configuration can be done with a sudo-gcp.toml
file in the current
working directory. See the example configuration file for more details.
A configuration file in a different location can be provided when running sudo-gcp
with the
--config-file
option.
# create a minimal configuration file if it does not already exist
echo > sudo-gcp.toml 'service_account = "my-terraformer@my-project.iam.gserviceaccount.com"'
Configuration is also supported via environment variables prefixed with SUDOGCP_
.
export SUDOGCP_SERVICE_ACCOUNT=my-terraformer@my-project.iam.gserviceaccount.com
After configuration, wrap commands that need elevated privileges with the
sudo-gcp
command, similar in usage to sudo
.
Examples:
sudo-gcp gcloud compute instances list
terraform plan # error: no permission to read tfstate
sudo-gcp !! # try again, but with necessary privileges
For complete usage details, run sudo-gcp --help
.