• Verkeerd document? Gratis ruilen
  • Geschreven door studenten die geslaagd zijn
  • Direct beschikbaar na je betaling
  • Online lezen of als PDF
Verkopen
Kies je studieland
Kies je taal
Document preview thumbnail
Voorbeeld 3 van de 17 pagina's
Tentamen (uitwerkingen)

WGU D385 Task 1 Complete Practice Guide | Software Security & Testing | Static Analysis, Python Logging, Assertions, Exception Handling & Remediation | 2026

Document preview thumbnail
Voorbeeld 3 van de 17 pagina's

This document provides a complete practice guide for WGU D385 Software Security & Testing Task 1, focusing on static analysis and secure Python programming practices. It covers Python logging, assertions, exception handling, vulnerability remediation, and related software security concepts. The material is designed to help students prepare for Task 1 by reviewing practical security techniques and understanding how to identify and remediate common software vulnerabilities.

Voorbeeld van de inhoud

WGU D385 Software Security & Testing

Task 1 Complete Practice Guide
Static Analysis, Python Logging, Assertions, Exception Handling & Remediation | 2026 |
2027




Institution Western Governors University (WGU)

Course D385 - Software Security & Testing

Assessment Task 1 - Static Analysis, Logging & Exception Handling

Academic Year

Total Questions 40 (4 sections x 10)

Cognitive Mix 30% recall | 50% application | 20% analysis

Question Style 75% scenario-based | 25% direct

Aligned Standards OWASP Top 10 (2021), NIST SSDF, CWE, Python PEP 8/8-style security

Tooling Python, Pytest, Bandit, SonarQube, Pylint, pip-audit, logging, bcrypt/argon2

Document Type Complete Practice Guide + Exemplar + Grading Rubric

Total Points 100 (2.5 pts per question)



Scope. This guide provides a scenario-driven, hands-on practice set for the WGU D385 Task 1
performance assessment: analyzing Python code with SAST tools, implementing secure
logging and exception handling, and verifying remediations with Pytest. It integrates 2026/2027
updates including AI-assisted static analysis, ML-based log anomaly detection, and modern
secure error-handling frameworks (RFC 7807 Problem Details).

How to use. Attempt all 40 questions before consulting Part 2 (Exemplar) or Part 3 (Grading
Rubric). Each rationale explains the exact vulnerability mechanism, the secure Pythonic fix,
and why distractors represent insecure code, broken tests, or flawed error management.




WGU D385 Task 1 | 2026 | 2027

, WGU D385 Task 1 | Static Analysis, Logging, Assertions & Remediation | 2026 Complete Practice Guide



Table of Contents
Part Content Page Reference

Cover Title page and guide metadata 1

Part 1 40-Question Practice Guide (Q1-Q40) 3

Section 1: Static Analysis & Code Review (Q1-Q10) 3

Section 2: Python Logging & Security Auditing (Q11-Q20) 6

Section 3: Assertions & Exception Handling (Q21-Q30) 9

Section 4: Remediation & 2026 Updates (Q31-Q40) 12

Part 2 Complete Solution (Exemplar Answer Key) 15

Part 3 Grading Rubric & Solution Key 17




Page 2

, WGU D385 Task 1 | Static Analysis, Logging, Assertions & Remediation | 2026 Complete Practice Guide



Part 1: Complete Practice Guide (40 Questions)
Instructions: Select the single best answer (A-D) for each question. Each question is worth 2.5
points (100 points total). Mark answers on a separate sheet before verifying with Part 2 and
Part 3.


Section 1: Static Analysis, Code Review, & Vulnerability Identification

Q1: Running Bandit against a Python repository reports B105 (hardcoded password string) on
the line `API_KEY = 'sk_live_4eC39HqLyjWDarjtT1zdp7dc'`. What is the most secure
remediation?
A. Move the key to a constants.py file tracked in git
B. Store the secret in an environment variable / secrets manager and read via
os.environ, with .env ignored by git [CORRECT]
C. Base64-encode the key and decode it at runtime
D. Rename the variable to obfuscate its purpose
Correct Answer: B
Rationale: Hardcoded secrets are a Sensitive Data Exposure flaw; secrets must live in
environment variables or a vault and never in source control. Option A relocates the flaw; Option C
is reversible obfuscation; Option D does not remove the secret.

Q2: A code review finds `cursor.execute("SELECT * FROM users WHERE id=" + user_id)`.
Bandit flags B608 (hardcoded SQL expressions). Which fix is correct?
A. Wrap the query in a try/except to suppress errors
B. Use a parameterized query: cursor.execute("SELECT * FROM users WHERE id=?",
(user_id,)) [CORRECT]
C. Escape single quotes manually before concatenation
D. Switch the driver from sqlite3 to psycopg2
Correct Answer: B
Rationale: Parameterized queries separate code from data so input is never parsed as SQL,
neutralizing injection. Option A hides errors but leaves injection; Option C is an error-prone
denylist; Option D changes drivers but not the unsafe pattern.

Q3: Bandit reports B301 (pickle) on `pickle.loads(request.data)`. Why is this finding critical, and
what is the secure replacement?
A. pickle is slow; replace with marshal for speed
B. pickle.loads can execute arbitrary code on untrusted input; replace with json.loads
plus schema validation [CORRECT]
C. pickle raises too many exceptions; replace with csv
D. pickle is deprecated; replace with shelve
Correct Answer: B
Rationale: pickle deserializes arbitrary Python objects, enabling remote code execution (A08
Insecure Deserialization); JSON with schema validation is the safe alternative. Options A, C, D
mischaracterize the risk and propose unsafe or unrelated alternatives.




Page 3

Documentinformatie

Geüpload op
10 september 2026
Aantal pagina's
17
Geschreven in
2026/2027
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden
€15,51

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
davidmiles
3,5
(4)
Verkocht
26
Volgers
0
Items
921
Laatst verkocht
1 week geleden

Echte notities, van echte studenten
Elk document op Stuvia is geschreven door een medestudent die hetzelfde vak deed. Zo leer je van iemand die het al heeft gehaald.



Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen