• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 4 fuera de 199 páginas
Examen

WGU D522 Python for IT Automation — Secure Coding, Secrets and Logging Quick Reference | GitLab CI/CD and Security Checklists | Final Exam Practice 2026–2027

Document preview thumbnail
Vista previa 4 fuera de 199 páginas

This quick-reference guide covers secure coding practices for Python IT automation, focusing on secrets management, application logging, GitLab CI/CD pipelines, and security checklists. It addresses secure credential handling, environment variables, sensitive data protection, error handling, log management, automated testing, pipeline security, and practical techniques for reducing security risks in automation scripts.

Vista previa del contenido

WGU D522 PYTHON FOR IT AUTOMATION
SECURE CODING, SECRETS & LOGGING QUICK
REFERENCE | GITLAB CI/CD & SECURITY
CHECKLISTS
Final Exam Practice | 350 Questions with
Correct Answers & Detailed Rationales |
2026/2027




INTRODUCTION
This comprehensive practice exam is designed for students
preparing for the WGU D522 Python for IT Automation Final
Exam. The document contains 350 original practice questions
covering the core competency areas emphasized in the D522
security-focused exam blueprint: secure Python automation
against OWASP Top 10 vulnerabilities, secrets management and

,credential handling, structured logging and monitoring, GitLab
CI/CD security policies (SAST, DAST, dependency scanning), and
comprehensive security checklists for auditing automation
workflows .
Each question follows a four-option multiple-choice format
with a clearly identified correct answer and a detailed
rationale explaining why the correct choice reflects secure
coding and operational best practices, and why each distractor
represents a common but dangerous pattern. The questions
emphasize scenario-based application—diagnosing command
injection risks, configuring masked CI/CD variables,
implementing log redaction, and enforcing pipeline security
gates .
The guide is organized into seven sections: (1) Secure Python
Automation & OWASP Top 10 Mitigation; (2) Secrets
Management & Credential Handling; (3) Structured Logging,
Monitoring & Error Handling; (4) GitLab CI/CD Security Policies;
(5) Input Validation & Safe Command Execution; (6) Security
Checklists & Hardening Workflows; and (7) Integrated Scenarios
& Compliance.


SECTION 1: SECURE PYTHON AUTOMATION & OWASP TOP 10
MITIGATION
(Questions 1–60)

,Question 1
A Python automation script uses subprocess.run() with
shell=True to execute a user-supplied filename. Which
mitigation most effectively prevents command injection while
preserving functionality?
A) Validate the filename against a whitelist of allowed
characters
B) Use shlex.quote() to escape the filename before passing it to
the shell
C) Replace shell=True with a list of arguments and shell=False
D) Run the script with reduced privileges using a non-root user
Correct Answer: C
Rationale: Using shell=False with a list of arguments avoids
shell interpretation entirely, eliminating command injection.
Whitelisting (A) or quoting (B) may be bypassed by determined
attackers, and privilege reduction (D) does not prevent
injection—it only limits the damage after exploitation .


Question 2
A Python script constructs SQL queries by concatenating user
input. Which vulnerability does this introduce?

, A) Cross-site scripting (XSS)
B) SQL injection
C) Server-side request forgery (SSRF)
D) Insecure deserialization
Correct Answer: B
Rationale: Concatenating user input into SQL queries allows
attackers to inject malicious SQL, manipulating the query's
logic. Parameterized queries or prepared statements are the
correct mitigation .


Question 3
Which of the following is a primary risk of using pickle to
deserialize untrusted data in a Python automation script?
A) Pickle files are too large
B) Pickle can execute arbitrary code during deserialization
C) Pickle does not support dictionaries
D) Pickle cannot serialize strings
Correct Answer: B
Rationale: pickle deserialization can execute arbitrary code
embedded in the pickle data, making it a critical insecure
deserialization vulnerability. Untrusted data should never be
unpickled. JSON or other safe formats should be used instead .

Información del documento

Subido en
25 de octubre de 2026
Número de páginas
199
Escrito en
2026/2027
Tipo
Examen
Contiene
Preguntas y respuestas
$16.99

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
Vendido
14
Seguidores
1
Artículos
898
Última venta
23 horas hace




Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes