Question 297 of 507
Trust and security with Google CloudeasyMultiple ChoiceObjective-mapped

Quick Answer

The correct immediate response is to revoke or delete the exposed service account key in Google Cloud IAM, review Cloud Audit Logs for unauthorized access, and generate a new key distributed through secure channels. This is because a service account key exposed in a public repository is a critical security breach—anyone with the key can authenticate as that service account and access your production resources without additional barriers. The priority is to invalidate the credential immediately, then audit logs to detect any misuse, and finally restore legitimate access with a new key. On the Google Cloud Digital Leader exam, this scenario tests your understanding of incident response fundamentals and IAM security best practices. A common trap is assuming you can simply delete the key from the repository or rotate it later; the key must be revoked at the IAM level first, as repository deletion does not invalidate the credential. Memory tip: "Revoke, Review, Replace"—the three R’s for any exposed key incident.

Cloud Digital Leader Trust and security with Google Cloud Practice Question

This GCDL practice question tests your understanding of trust and security with google cloud. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

A developer accidentally commits an application's Google Cloud service account key to a public GitHub repository. The key is valid and grants access to production resources. What is the correct immediate response?

Question 1easymultiple choice
Full question →

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Immediately revoke/delete the exposed service account key in Google Cloud IAM, review Cloud Audit Logs for unauthorized access, and generate a new key distributed through secure channels

Option B is correct because the immediate priority is to invalidate the exposed credential to prevent unauthorized access to production resources. Revoking the key in Google Cloud IAM ensures it can no longer be used for authentication, while reviewing Cloud Audit Logs helps identify any potential misuse. Generating a new key and distributing it securely restores access for legitimate applications.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Delete the commit from GitHub history using git rebase; the key is safe once removed from the repository

    Why it's wrong here

    GitHub history cannot reliably be purged — the data may already be cached, indexed, or copied. Even if removed from history, the key must be treated as compromised because it was publicly visible. Deletion from Git history is not a remediation; revocation of the key is.

  • Immediately revoke/delete the exposed service account key in Google Cloud IAM, review Cloud Audit Logs for unauthorized access, and generate a new key distributed through secure channels

    Why this is correct

    This is the complete correct response: (1) Revoke the key immediately to stop any ongoing unauthorized access. (2) Review Admin Activity and Data Access audit logs to determine if the key was used after exposure. (3) Issue a new key through a secure distribution channel (ideally Secret Manager, not environment variables). Time to revocation is critical.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Change the service account's permissions to read-only to limit the damage from potential misuse

    Why it's wrong here

    Changing permissions doesn't revoke the exposed key — unauthorized users can still authenticate. And reducing permissions is a weaker control than full revocation. The exposed key must be invalidated, not just restricted.

  • Send an internal email informing the security team and wait for their guidance before taking any action

    Why it's wrong here

    Every minute of delay extends the window of unauthorized access. Immediate action (key revocation) does not require waiting for security team guidance — revoking a compromised key is an unambiguously correct immediate action.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates may think removing the key from the repository (Option A) is sufficient, but they overlook that the key remains valid in Google Cloud and can still be used by anyone who already obtained it.

Detailed technical explanation

How to think about this question

Service account keys are long-lived credentials that authenticate as the service account via OAuth 2.0; revoking the key in IAM immediately invalidates its associated private key material, preventing any new authentication attempts. Cloud Audit Logs record all authentication events using that key, allowing forensic analysis of unauthorized access. In practice, attackers often scan public repositories for exposed keys within minutes, so automated key rotation and secret scanning tools (e.g., gitleaks, GitHub secret scanning) are essential for proactive defense.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A company's IT admin needs to give a contractor read-only access to production logs without sharing account credentials. Using role-based access control (RBAC) and temporary scoped permissions — not a permanent shared password — is the correct pattern. Questions like this test whether you can apply least-privilege access across cloud identity services.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related GCDL practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free GCDL practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this GCDL question test?

Trust and security with Google Cloud — This question tests Trust and security with Google Cloud — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Immediately revoke/delete the exposed service account key in Google Cloud IAM, review Cloud Audit Logs for unauthorized access, and generate a new key distributed through secure channels — Option B is correct because the immediate priority is to invalidate the exposed credential to prevent unauthorized access to production resources. Revoking the key in Google Cloud IAM ensures it can no longer be used for authentication, while reviewing Cloud Audit Logs helps identify any potential misuse. Generating a new key and distributing it securely restores access for legitimate applications.

What should I do if I get this GCDL question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Keep practising

More GCDL practice questions

Last reviewed: Jun 11, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This GCDL practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the GCDL exam.