The answer is that the user lacks the `cloudkms.cryptoKeyVersions.encrypt` permission on the specific key version. This error occurs because Cloud KMS enforces fine-grained IAM permissions at the key version level; the `cryptoKeyVersions.encrypt` permission is required to perform encryption operations, and without it—or a broader role like `roles/cloudkms.cryptoKeyEncrypter`—the command will fail regardless of its syntax or the key’s existence. On the Google Professional Cloud Security Engineer exam, this scenario tests your understanding of KMS IAM hierarchy, where permissions are scoped to key versions, not just the key ring. A common trap is assuming the error stems from a missing key or region mismatch, but the explicit “permission denied” message points directly to IAM. Memory tip: think “Encrypt = Key Version Permission”—if you see `cryptoKeyVersions.encrypt` in the error, check the user’s IAM role on that specific version, not the parent key.
PCSE Ensuring data protection Practice Question
This PCSE practice question tests your understanding of ensuring data protection. The scenario asks you to isolate a root cause — eliminate options that address a different problem before choosing. 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.
Exhibit
Refer to the exhibit.
```
gcloud kms encrypt \
--location=global \
--keyring=my-keyring \
--key=my-key \
--plaintext-file=secret.txt \
--ciphertext-file=secret.enc
```
A security engineer runs the command in the exhibit. The command fails with an error: 'Permission denied: cryptoKeyVersions.encrypt'. What is the most likely cause?
Clue words in this question
Noticing these words before you look at the options changes how you read each choice.
Clue: "most likely"
Why it matters: Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The user does not have the cloudkms.cryptoKeyVersions.encrypt permission on the key.
The error message 'Permission denied: cryptoKeyVersions.encrypt' explicitly indicates that the user lacks the cloudkms.cryptoKeyVersions.encrypt permission on the specific key version. In Google Cloud KMS, encrypt operations require the cloudkms.cryptoKeyVersions.encrypt permission (or a broader role like roles/cloudkms.cryptoKeyEncrypter) on the key resource. The command itself is syntactically correct, so the failure is due to insufficient IAM permissions, not resource existence or location.
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.
✗
The key ring 'my-keyring' does not exist.
Why it's wrong here
Error would be different if key ring didn't exist.
✓
The user does not have the cloudkms.cryptoKeyVersions.encrypt permission on the key.
Why this is correct
The error indicates missing encrypt permission.
Clue confirmation
The clue word "most likely" in the question point toward this answer.
Related concept
Read the scenario before looking for a memorised answer.
✗
The key ring location is incorrect.
Why it's wrong here
The command specifies global, which is valid.
✗
The user does not have the cloudkms.cryptoKeyVersions.decrypt permission.
Why it's wrong here
The command is encrypt, not decrypt.
Common exam traps
Common exam trap: answer the scenario, not the keyword
Google Cloud often tests the distinction between resource existence errors (e.g., 'Not found') and permission errors (e.g., 'Permission denied'), so candidates must read the exact error message to avoid confusing missing resources with insufficient IAM permissions.
Trap categories for this question
Command / output trap
The command specifies global, which is valid.
Detailed technical explanation
How to think about this question
Google Cloud KMS uses IAM roles to control access at the key ring, key, or key version level. The cloudkms.cryptoKeyVersions.encrypt permission is required for encrypt operations, and it is typically granted via roles like roles/cloudkms.cryptoKeyEncrypter or roles/cloudkms.cryptoOperator. A common subtlety is that permissions on a key version are inherited from the parent key, but explicit deny policies can override them. In real-world scenarios, this error often occurs when a service account or user has been granted roles on the project but not on the specific key resource.
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.
Ensuring data protection — This question tests Ensuring data protection — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: The user does not have the cloudkms.cryptoKeyVersions.encrypt permission on the key. — The error message 'Permission denied: cryptoKeyVersions.encrypt' explicitly indicates that the user lacks the cloudkms.cryptoKeyVersions.encrypt permission on the specific key version. In Google Cloud KMS, encrypt operations require the cloudkms.cryptoKeyVersions.encrypt permission (or a broader role like roles/cloudkms.cryptoKeyEncrypter) on the key resource. The command itself is syntactically correct, so the failure is due to insufficient IAM permissions, not resource existence or location.
What should I do if I get this PCSE question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
Are there clue words in this question I should notice?
Yes — watch for: "most likely". Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.
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 →
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.
This PCSE 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 PCSE exam.
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.
Sign in to join the discussion.