• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 13 pages
Exam (elaborations)

WGU D522 Python for IT Automation | Secure Coding, Secrets & Logging Quick Reference | Git, Exams of Information Technology

Document preview thumbnail
Preview 2 out of 13 pages

WGU D522 Python for IT Automation | Secure Coding, Secrets & Logging Quick Reference | Git, Exams of Information Technology

Content preview

WGU D522 Python for IT Automation |
Secure Coding, Secrets & Logging Quick
Reference | Git, Exams of Information
Technology
1. Which practice best supports secure and reliable operations when a script
authenticates to a production service?
A. Hard-code passwords in the script
B. Commit tokens to version control
C. Retrieve credentials through an approved secure mechanism rather than
embedding secrets in source code
D. Print secrets to logs for debugging

Answer: C — Secrets should be protected through approved credential-
management mechanisms, not embedded in source code or committed to version
control .

2. A script must execute an external command safely. Which approach
minimizes operational and security risk?
A. Concatenate untrusted input into shell commands
B. Execute arbitrary user input directly
C. Disable all validation for speed
D. Validate inputs and use safe command-execution mechanisms rather than
constructing unsafe shell strings

Answer: D — Safe command execution reduces injection and unintended command
risks. Using shell=True with untrusted input creates shell injection vulnerabilities .

3. Production automation should include which safeguards to limit operational
risk?
A. Disabled logs and no validation
B. Untested code running with administrator rights
C. Validation, limited permissions, logging, testing, and an appropriate approval
process
D. Unlimited retries without exception handling

Answer: C — Production automation should include safeguards that limit
operational risk: validation, limited permissions, logging, testing, and approval
processes .

4. What is idempotent automation?
A. Automation that produces different results each run

, B. Automation designed to produce the desired state without unnecessary repeated
side effects
C. Automation that runs only once
D. Automation that deletes all data on each run

Answer: B — Idempotent automation produces the desired state without
unnecessary repeated side effects when rerun .

5. When a multi-system automation task encounters a failure on one target,
what is the recommended approach?
A. Stop at the first error automatically
B. Handle expected exceptions per target and record the failure without
unnecessarily terminating the entire workflow
C. Hide all exceptions
D. Retry forever until success

Answer: B — Targeted exception handling supports resilient multi-system
automation, allowing the workflow to continue while recording failures .

6. How should JSON data from an API be handled in automation scripts?
A. Assume every field exists
B. Parse the JSON into appropriate Python structures and validate required fields
before using them
C. Treat it as trusted executable code
D. Ignore malformed responses

Answer: B — Structured API data should be parsed and validated before
processing .

7. What does the principle of least privilege mean for automation scripts?
A. Give all scripts administrator rights for simplicity
B. Run scripts with only the permissions necessary for their function
C. Disable all authentication
D. Use the same credentials for all environments

Answer: B — Least privilege limits permissions to only what is necessary, reducing
potential damage from compromised or buggy scripts.

8. Why should automation scripts validate inputs before processing?
A. To slow down execution
B. To prevent injection attacks and malformed data from causing failures
C. To increase code complexity
D. To reduce logging output

Document information

Uploaded on
September 17, 2026
Number of pages
13
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$19.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
1
Followers
0
Items
343
Last sold
1 month ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions