Professional Cloud Developer Exam QuestionsBrowse all questions from this exam

Professional Cloud Developer Exam - Question 69


Your application requires service accounts to be authenticated to GCP products via credentials stored on its host Compute Engine virtual machine instances. You want to distribute these credentials to the host instances as securely as possible.

What should you do?

Show Answer
Correct Answer: B

Using the instance's service account Application Default Credentials (ADC) is the most secure method for distributing credentials to the host instances. This allows the instance to automatically authenticate with the required resources using the instance's built-in service account. By leveraging ADC, you eliminate the need to store credentials on the instance or transmit them over the network, significantly reducing the risk of exposure or compromise. This method also simplifies management by removing the need for manual setup steps.

Discussion

11 comments
Sign in to comment
woriheck93Option: B
Sep 5, 2021

Answer is B https://cloud.google.com/docs/authentication/production#automatically If the environment variable GOOGLE_APPLICATION_CREDENTIALS isn't set, ADC uses the service account that is attached to the resource that is running your code.

omermahgoubOption: B
Jan 8, 2023

B. Use the instance's service account Application Default Credentials to authenticate to the required resources. Using the instance's service account Application Default Credentials is the most secure method for distributing credentials to the host instances. This method allows the instance to automatically authenticate with the required resources using the instance's built-in service account, without requiring the credentials to be stored on the instance or transmitted over the network. This eliminates the risk of the credentials being compromised or exposed. Additionally, this method is the most convenient, as it requires no manual steps to set up the credentials on the instance.

syu31svcOption: C
Jul 10, 2021

"authenticated to GCP" is the key part of the qn https://cloud.google.com/iam/docs/creating-managing-service-account-keys: "To use a service account from outside of Google Cloud, such as on other platforms or on-premises, you must first establish the identity of the service account" "You can create service account keys in JSON or PKCS#12 (P12) format. " C is the answer

syu31svc
Jul 31, 2021

https://cloud.google.com/compute/docs/api/how-tos/authorization: "If you run applications on your Compute Engine instances, application default credentials can get credentials through built-in service accounts" Answer is B not C

tomato123Option: B
Aug 20, 2022

I think B is correct

ralf_ccOption: C
Jun 22, 2021

Only C sounds right

GoReplyGCPExamOption: C
May 28, 2022

Your application requires service accounts to be authenticated to GCP products via credentials stored on its host Compute Engine virtual machine instances. The application requires the credentials to be stored on the VM instance, so I think the application code points to a file stored in the Instance.

cloud_enth0325Option: B
May 31, 2022

I'm also considering this part -- "distribute these credentials to the host instances as securely as possible" This falls under B.

telpOption: B
Jan 12, 2023

Answer B because best practice is to not store file with account service information when possible. With compute engine, the account service of the vm can be used to call google api if the roles are added to this account service.

RajanOption: A
Sep 20, 2023

This approach ensures that the credentials are securely managed and automatically provided to the instances when needed.

RajanOption: B
Sep 20, 2023

Option B is Correct: This approach ensures that the credentials are securely managed and automatically provided to the instances when needed.

thewalkerOption: B
Jul 17, 2024

The most secure approach is B. Use the instance's service account Application Default Credentials to authenticate to the required resources. Here's why: Application Default Credentials (ADC): ADC is a Google Cloud feature that allows applications running on Google Cloud to automatically authenticate using the service account associated with the instance. This eliminates the need to store credentials directly on the instance, reducing security risks. No Manual Credential Management: ADC handles authentication automatically, eliminating the need to manually manage credentials, which can be error-prone and introduce security vulnerabilities. Key Rotation: Google Cloud automatically rotates service account keys, further enhancing security.

thewalker
Jul 17, 2024

Let's look at why the other options are less secure: A. Use HTTP signed URLs to securely provide access to the required resources: HTTP signed URLs are useful for providing temporary access to specific resources, but they don't address the core issue of securely storing and managing service account credentials. C. Generate a P12 file from the GCP Console after the instance is deployed and copy the credentials to the host instance before starting the application: This approach requires storing credentials on the instance, which is a security risk. It also introduces manual steps that can be error-prone. D. Commit the credential JSON file into your application's source repository and have your CI/CD process package it with the software that is deployed to the instance: This is a major security risk. Storing credentials in source code exposes them to anyone with access to the repository.