Courseiva
easyMultiple ChoiceObjective-mapped

CAS-004 Practice Question: A security administrator needs to automate the…

A security administrator needs to automate the process of revoking access for terminated employees across multiple cloud services. Which scripting approach would best minimize the risk of errors and ensure consistent execution?

⚠ Common exam trap

The exam often tests the misconception that any scripting approach (e.g., Python or shell) is sufficient for automation, but the trap is that they ignore the critical need for secure credential management and idempotent execution, which configuration management tools like Ansible are specifically designed to provide.

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

Use a configuration management tool like Ansible with a playbook that calls cloud provider modules using encrypted vault files for credentials.

Ansible playbooks with encrypted vault files provide idempotent, repeatable automation across multiple cloud services without exposing credentials in plaintext. The use of dedicated cloud provider modules (e.g., aws_iam, gcp_iam) abstracts API complexities and ensures consistent revocation logic, minimizing human error compared to ad-hoc scripting.

Answer analysis

Option-by-option breakdown

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

  • Create a shell script that relies on environment variables containing API keys.

    Why it's wrong here

    Environment variables can be exposed and are less secure.

  • Use a configuration management tool like Ansible with a playbook that calls cloud provider modules using encrypted vault files for credentials.

    Why this is correct

    Ansible with vault securely automates and standardizes the process.

  • Write a Python script using separate API calls for each service with hardcoded credentials.

    Why it's wrong here

    Hardcoding credentials is insecure and error-prone.

  • Manually execute commands each time an employee is terminated.

    Why it's wrong here

    Manual process is slow and error-prone.

About these practice questions

This CAS-005 question is part of Courseiva's 968-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. 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 CAS-005 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 CAS-005 exam.