Courseiva
hardMultiple Choice

CV0-004 Practice Question: A DevOps team uses infrastructure as code to…

A DevOps team uses infrastructure as code to deploy cloud resources. Security policy requires that all storage buckets have versioning enabled and are not publicly accessible. How can these requirements be enforced automatically?

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

✓

Implement a cloud policy that disallows public access and requires versioning on all storage resources.

Using a cloud policy service (e.g., AWS Service Control Policy, Azure Policy, or GCP Organization Policy) can enforce rules like 'deny public access' and 'require versioning' at the account or organizational level, automatically applying to all storage resources. Option A is wrong because pre-commit hooks check templates but do not enforce at deployment; they can be bypassed. Option B is wrong because security groups apply to network resources like VMs, not storage buckets. Option D is wrong because a manual approval gate adds human review but does not automatically enforce the security requirements.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Add pre-commit hooks to check the IAC templates for compliance.

    Why it's wrong here

    Pre-commit hooks run on developer machines before code is committed, so they can be bypassed and do not evaluate deployed resources; policy is not enforced at deployment. It tempts as a shift-left compliance check, and would be correct for catching template errors early, not for guaranteeing enforcement.

  • ✗

    Use security group rules to restrict access to the storage buckets.

    Why it's wrong here

    Security groups filter network traffic to compute instances; they cannot inspect bucket versioning configuration or public access settings, which are bucket-level properties. It tempts because security groups are the familiar access-control tool, and would be correct for restricting inbound traffic to instances rather than enforcing storage policy.

  • ✓

    Implement a cloud policy that disallows public access and requires versioning on all storage resources.

    Why this is correct

    A cloud policy enforces both controls at the control plane: it denies creation of publicly accessible buckets and requires versioning, so non-compliant resources fail deployment regardless of the IaC template used. This satisfies the stem's automatic enforcement requirement, unlike scanning or manual review, which detect drift only after provisioning.

  • ✗

    Configure a manual approval gate in the deployment pipeline for any storage changes.

    Why it's wrong here

    A manual approval gate requires human review and does not automatically detect missing versioning or public access flags; enforcement is neither automatic nor consistent. It tempts as a governance control, and would be correct for gating high-risk releases, not for continuous policy validation of bucket configuration.

Quick reference

AWS S3 Storage Class Comparison

Storage ClassMin DurationRetrievalUse Case
S3 StandardNoneImmediateFrequently accessed data
S3 Standard-IA30 daysImmediateInfrequent access, rapid retrieval
S3 One Zone-IA30 daysImmediateNon-critical infrequent data
S3 Intelligent-TieringNoneImmediate–hoursUnknown or changing access patterns
S3 Glacier Instant90 daysMillisecondsArchive with instant retrieval
S3 Glacier Flexible90 daysMinutes–hoursArchive, flexible retrieval
S3 Glacier Deep Archive180 daysHoursLong-term compliance archive

About these practice questions

One of 834 original CV0-004 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This CV0-004 practice question is part of Courseiva's free CompTIA 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 CV0-004 exam.