ASSOCIATE-CLOUD-ENGINEER · Question #308
You installed the Google Cloud CLI on your workstation and set the proxy configuration. However, you are worried that your proxy credentials will be recorded in the gcloud CLI logs. You want to…
The correct answer is D. Set the CLOUDSDK_PROXY_USERNAME and CLOUDSDK_PROXY_PASSWORD properties. Setting CLOUDSDK_PROXY_USERNAME and CLOUDSDK_PROXY_PASSWORD as OS-level environment variables (Option D) is the secure approach because these values are read by the gcloud CLI directly from the process environment at runtime and are never written to gcloud's configuration files…
Question
Options
- AConfigure username and password by using gcloud config set proxy/username and gcloud config
- BEncode username and password in sha256 encoding, and save in to a text file. Use filename as a
- CProvide values for CLOUDSDK_PROXY_USERNAME and CLOUDSDK_PROXY_PASSWORD
- DSet the CLOUDSDK_PROXY_USERNAME and CLOUDSDK_PROXY_PASSWORD properties
How the community answered
(36 responses)- A6% (2)
- B3% (1)
- C3% (1)
- D89% (32)
Explanation
Setting CLOUDSDK_PROXY_USERNAME and CLOUDSDK_PROXY_PASSWORD as OS-level environment variables (Option D) is the secure approach because these values are read by the gcloud CLI directly from the process environment at runtime and are never written to gcloud's configuration files or command logs.
Why the distractors are wrong:
- A is wrong because
gcloud config setwrites values to the gcloud configuration file and those commands (including the credentials) can appear in shell history and CLI logs - exactly what you're trying to avoid. - B is wrong because SHA-256 is a one-way hash function, not a reversible encoding; the gcloud CLI cannot recover the original password from a hash to authenticate with the proxy.
- C appears similar to D but refers to "providing values" inline (e.g., as command-line arguments or config properties), which exposes them to process listings or logs - the distinction is how you supply them, not just what you supply.
Memory tip: When credentials must stay out of logs, think "Env vars live in memory, not on disk." Anything passed through gcloud config set or command-line flags risks being persisted or logged; environment variables are the shell's secure handoff mechanism.
Topics
Community Discussion
No community discussion yet for this question.