Google Cloud Associate Cloud Engineer — Question 231
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 prevent your proxy credential from being logged. What should you do?
Answer options
- A. Configure username and password by using gcloud config set proxy/username and gcloud config set proxy/password commands.
- B. Encode username and password in sha256 encoding, and save in to a text file. Use filename as a value in the gcloud config set core/custom_ca_certs_file command.
- C. Provide values for CLOUDSDK_PROXY_USERNAME and CLOUDSDK_PROXY_PASSWORD in the gcloud CLI tool configuration file.
- D. Set the CLOUDSDK_PROXY_USERNAME and CLOUDSDK_PROXY_PASSWORD properties by using environment variables in your command line tool.
Correct answer: D
Explanation
The correct answer is D because using environment variables to set CLOUDSDK_PROXY_USERNAME and CLOUDSDK_PROXY_PASSWORD prevents the credentials from being logged in gcloud logs. Options A and C would still record the credentials in the logs because they involve direct configuration within the gcloud CLI. Option B is not a valid method for preventing logging of proxy credentials.