Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam Professional Cloud Developer All Questions

View all questions & answers for the Professional Cloud Developer exam

Exam Professional Cloud Developer topic 1 question 126 discussion

Actual exam question from Google's Professional Cloud Developer
Question #: 126
Topic #: 1
[All Professional Cloud Developer Questions]

Your team develops services that run on Google Cloud. You need to build a data processing service and will use Cloud Functions. The data to be processed by the function is sensitive. You need to ensure that invocations can only happen from authorized services and follow Google-recommended best practices for securing functions. What should you do?

  • A. Enable Identity-Aware Proxy in your project. Secure function access using its permissions.
  • B. Create a service account with the Cloud Functions Viewer role. Use that service account to invoke the function.
  • C. Create a service account with the Cloud Functions Invoker role. Use that service account to invoke the function.
  • D. Create an OAuth 2.0 client ID for your calling service in the same project as the function you want to secure. Use those credentials to invoke the function.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
fabiam93
Highly Voted 2 years, 8 months ago
Selected Answer: C
For me C. In link1 we can see how google suggests to use service accounts and in link2 we can see that the invoker role exists. Link1: https://cloud.google.com/functions/docs/securing#authentication Link2: https://cloud.google.com/functions/docs/reference/iam/roles#cloud-functions-roles
upvoted 5 times
...
thewalker
Most Recent 4 months, 1 week ago
Selected Answer: C
The best answer here is C. Create a service account with the Cloud Functions Invoker role. Use that service account to invoke the function. Here's why: Cloud Functions Invoker Role: This role specifically grants the permission to invoke Cloud Functions. It's the most granular and appropriate role for this scenario, ensuring that the service account can only invoke Cloud Functions and nothing else. Least Privilege: Using the Cloud Functions Invoker role adheres to the principle of least privilege, granting only the necessary permissions to the service account. This minimizes the risk of unauthorized access or actions. Service Account Authentication: Service accounts are designed for machine-to-machine authentication. They provide a secure and reliable way to authenticate your calling service to the Cloud Function.
upvoted 1 times
thewalker
4 months, 1 week ago
Why other options are less ideal: A. Identity-Aware Proxy: Identity-Aware Proxy (IAP) is primarily used to secure web applications and APIs, not for controlling access to Cloud Functions. B. Cloud Functions Viewer Role: The Cloud Functions Viewer role only allows viewing Cloud Functions, not invoking them. It's not suitable for controlling access to the function. D. OAuth 2.0 Client ID: While OAuth 2.0 is a common authentication protocol, it's not the recommended approach for securing Cloud Functions. Service accounts provide a more streamlined and secure method for machine-to-machine authentication.
upvoted 1 times
thewalker
4 months, 1 week ago
In summary: Creating a service account with the Cloud Functions Invoker role and using it to invoke the function is the most secure and efficient way to restrict access to your sensitive data processing function, following Google-recommended best practices. Additional Security Considerations: Secret Management: Store the service account credentials securely using Google Cloud Secret Manager. Network Security: Consider using VPC Service Controls to further restrict network access to your Cloud Function. Logging and Monitoring: Enable logging and monitoring for your Cloud Function to track invocations and identify any potential security issues.
upvoted 1 times
...
...
...
Aeglas
1 year ago
Selected Answer: C
IAP is not available for Cloud Functions, so the only possible option is C
upvoted 1 times
...
Aeglas
1 year ago
IAP is not available for Cloud Functions, so the only possible answer is C
upvoted 1 times
...
__rajan__
1 year, 2 months ago
Selected Answer: A
1 The best way to ensure that invocations of a Cloud Function that processes sensitive data can only happen from authorized services and follows Google-recommended best practices is to enable Identity-Aware Proxy in your project and secure function access using its permissions.
upvoted 1 times
Aeglas
1 year ago
IAP is not available for Cloud Functions
upvoted 1 times
...
...
purushi
1 year, 3 months ago
Selected Answer: C
Since this is service to service communication, cloud function invoker role should be provided to the service that wants to invoke cloud function in the data processing pipeline.
upvoted 1 times
...
Pime13
1 year, 9 months ago
Selected Answer: C
vote c
upvoted 1 times
...
omermahgoub
1 year, 10 months ago
Selected Answer: A
The best approach is to use a combination of authn, authz, and encryption 1. Enable IAP to ensure that only authenticated and authorized users or services can access Cloud Function 2. Set up an appropriate level of access control using IAM roles and policies, such as roles/cloudfunctions.invoker, to ensure that only authorized services can invoke your Cloud Function, This can be done by creating a service account for the calling function, assign the appropriate invoker role to the service account on the data processing function and use the service account credentials in the calling function 3. Use Google-provided libraries or resources, such as KMS or Cloud Storage, to encrypt and store sensitive data 4. Apply security best practices such as limiting the scope of the service account, and using Cloud IAP to protect access to your Cloud Function 5. consider using Cloud Event that ensure your function is triggered only by authorized events, you can use Cloud Event to ensure that your function is invoked only by specific event types that you have configured
upvoted 2 times
omermahgoub
1 year, 10 months ago
Options B and D are not correct. The Cloud Functions Viewer role does not have the necessary permissions to invoke a Cloud Function and creating an OAuth 2.0 client ID for your calling service is not enough to secure a Cloud Function.
upvoted 1 times
...
omermahgoub
1 year, 10 months ago
Option C is correct that creating a service account with the appropriate invoker role is one step in securing your Cloud Function, however it should be used in conjunction with other security measures.
upvoted 1 times
...
omermahgoub
1 year, 10 months ago
Option A is correct in that it's important to enable IAP to ensure that only authenticated and authorized users or services can access your Cloud Function, but it's not enough by itself to secure your function.
upvoted 1 times
...
omermahgoub
1 year, 10 months ago
By following the above steps, you can ensure that your Cloud Function is secure and can only be invoked by authorized services.
upvoted 1 times
Aeglas
1 year ago
IAP is not available for Cloud Functions, so the correct answer is C
upvoted 1 times
...
...
...
zellck
1 year, 11 months ago
Selected Answer: C
C is the answer. https://cloud.google.com/functions/docs/securing/authenticating
upvoted 1 times
...
jcataluna
1 year, 11 months ago
Selected Answer: C
C is correct
upvoted 1 times
...
TNT87
2 years ago
ANSWER C https://medium.com/google-cloud/how-to-securely-invoke-a-cloud-function-from-google-kubernetes-engine-running-on-another-gcp-79797ec2b2c6
upvoted 4 times
...
tomato123
2 years, 3 months ago
Selected Answer: D
I think D is correct
upvoted 1 times
...
akshaychavan7
2 years, 3 months ago
Selected Answer: C
I will go with option C.
upvoted 1 times
...
mbenhassine1986
2 years, 6 months ago
C : https://cloud.google.com/functions/docs/securing/authenticating#authenticating_function_to_function_calls
upvoted 2 times
...
nqthien041292
2 years, 7 months ago
Selected Answer: C
Vote C
upvoted 1 times
...
KillerGoogle
2 years, 9 months ago
I believe this is C
upvoted 1 times
...
GCPCloudArchitectUser
2 years, 9 months ago
Selected Answer: D
Agreed D … From link reference below The tokens themselves are created using the OAuth 2 framework, and its extension, Open Identity Connect, but the sequence is complex and error-prone, and the use of Cloud Client Libraries to manage the process is highly recommended.
upvoted 2 times
fabiam93
2 years, 8 months ago
Why not C? In link1 we can see how google suggests to use service accounts and in link2 we can see that the invoker role exists. Link1: https://cloud.google.com/functions/docs/securing#authentication Link2: https://cloud.google.com/functions/docs/reference/iam/roles#cloud-functions-roles
upvoted 2 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...