# Free SSD practice questions

> 10 free SSD practice questions with the correct answer and an explanation.

Page: https://devopscodelab.com/exams/secure-sdlc-decisions/free-practice-questions/
Practice exams: https://devopscodelab.com/exams/secure-sdlc-decisions/

### Question 1 of 10

A team is threat modeling a service built on a managed database, a managed queue, and container workloads on a managed Kubernetes service. Which approach BEST scopes the threat model?

- A. Model only the application code, since the infrastructure is defined in Terraform and was reviewed when it was written
- B. Include the managed services, focusing on customer-side duties such as IAM, network exposure, and configuration
- C. Model the provider's internal data-centre controls in detail, since physical security is the largest risk for the service
- D. Exclude all managed services from the model, because the cloud provider is responsible for every aspect of their security

**Answer:** B

**Explanation:** Under shared responsibility the provider secures the underlying service, but the customer still owns identity and access, network exposure, encryption settings, and configuration, so those belong in the model. Excluding managed services ignores the most common cloud failure modes, such as public endpoints and over-broad IAM. Provider data-centre controls are outside the team's control and covered by provider attestations. Reviewed IaC can still contain risky design choices worth modeling.

### Question 2 of 10

A company is designing a 'login with our app' OAuth integration for third-party developers. Which design choice MOST reduces the risk of authorization codes being stolen and redeemed by attackers?

- A. Require PKCE for all clients, exact redirect URI matching, and short-lived single-use authorization codes
- B. Return access tokens directly in the redirect URL fragment so that no authorization code needs to be redeemed
- C. Allow redirect URIs that match any subdomain of a developer's domain using wildcard patterns for flexibility
- D. Let developers register redirect URIs over plain HTTP so that local testing is easier on their machines

**Answer:** A

**Explanation:** PKCE binds the code to the client that started the flow, exact redirect matching prevents codes from being sent to attacker-controlled locations, and short-lived, single-use codes limit replay, as the OAuth 2.0 security best current practice recommends. Wildcard redirects enable code theft through any vulnerable subdomain. Fragment tokens are the deprecated implicit flow. Plain HTTP redirects expose codes in transit, apart from the specific case of loopback redirects for native apps.

### Question 3 of 10

An API calls an external authorization service on each request. Product managers ask that requests be allowed during outages of that service so customers are not blocked. For endpoints that modify financial data, what is the BEST design decision?

- A. Fail closed for financial writes, optionally using short-lived cached decisions, and let low-risk reads degrade gracefully
- B. Fail open for all endpoints, logging every request made during the outage so that unauthorized changes can be reviewed later
- C. Bypass the authorization service permanently and move all permission checks into the frontend for better availability
- D. Fail open only for users who logged in within the last hour, since their sessions were recently validated by the identity provider

**Answer:** A

**Explanation:** Sensitive write operations should fail closed, because availability does not justify unauthorised changes to financial data; bounded caching of recent decisions and graceful degradation for low-risk reads limit the business impact. Failing open with logs turns prevention into after-the-fact detection. A recent login proves authentication, not authorization for a specific change. Frontend checks are bypassed by anyone calling the API directly.

### Question 4 of 10

A Node.js login handler runs users.findOne({ user: req.body.user, pass: req.body.pass }). A tester sends pass as the JSON object {"$ne": null} and logs in. What is the BEST fix?

- A. Ensure the inputs are strings, for example with schema validation, and compare a password hash instead of the raw field
- B. Switch the database from MongoDB to PostgreSQL, because relational databases are not vulnerable to any form of injection
- C. Log every login request that contains a dollar sign and review the log weekly for suspicious operator injection
- D. Add a CAPTCHA to the login form so that automated tools cannot submit objects in the password field at high speed

**Answer:** A

**Explanation:** Operator injection works because the handler accepts an object where a string is expected; enforcing string types with schema validation, and verifying a password hash in code rather than querying for the password, removes the flaw. Relational databases have their own injection risks, and migrating does not fix input typing. A CAPTCHA does not stop a single crafted request. Weekly log review is detection, not prevention.

### Question 5 of 10

A legacy service encrypts session tokens with AES-CBC and returns distinct errors for 'bad padding' and 'bad token'. A tester decrypts tokens without the key by sending many modified tokens. What is the BEST fix?

- A. Increase the AES key size from 128 to 256 bits so that the tester cannot recover the plaintext within a reasonable time
- B. Change the IV to a fixed value for all tokens so that the tester can no longer manipulate it to alter the plaintext
- C. Rotate the encryption key every day so that any plaintext recovered by the tester becomes useless the following morning
- D. Use authenticated encryption such as AES-GCM, or encrypt-then-MAC, and return one generic error for every failure

**Answer:** D

**Explanation:** This is a padding oracle: distinguishable padding errors let an attacker decrypt CBC ciphertext byte by byte, whereas authenticated encryption rejects any modified token before padding is examined and a single generic error removes the oracle. A larger key does not help, because the attack never targets the key. Daily rotation still leaves a day of exposure. A fixed IV weakens CBC further.

### Question 6 of 10

A team wants to reach SLSA Build Level 3 for its release artifacts. Builds currently run on developer laptops, and a script uploads the results with a signature made by a key on the same laptop. Which change is MOST necessary?

- A. Require two developers to build the same release independently on their own laptops and compare the checksums before uploading it
- B. Store the laptop's signing key in a password manager so that it cannot be stolen by malware running on the laptop
- C. Add an SBOM to each release so that consumers can see the full list of components included in the artifacts
- D. Move builds to a hosted platform with isolated builds and signed provenance that the build steps themselves cannot forge

**Answer:** D

**Explanation:** SLSA Build L3 requires a hardened build platform where builds are isolated from one another and provenance is generated by the platform with signing material that user-defined build steps cannot access. A key in a password manager on the same laptop is still under the builder's control. An SBOM is valuable but is not part of the build-level requirements. Two-laptop builds approach a reproducibility check but still lack platform-generated, unforgeable provenance.

### Question 7 of 10

A team uses Renovate to update hundreds of dependencies, and reviewing every PR manually has become a bottleneck. Which policy BEST balances speed and supply-chain safety?

- A. Auto-merge patch and minor updates of trusted packages after a short release-age delay and green tests, and review majors
- B. Auto-merge every update, including major versions, as soon as it is published so that the team is always on the latest
- C. Accept only updates that are flagged as security fixes, and keep all other dependencies pinned at their current versions
- D. Disable Renovate and update all dependencies once per year in a single large pull request reviewed by the tech lead

**Answer:** A

**Explanation:** Automerging low-risk updates once they have aged a few days and passed tests keeps dependencies fresh, while the delay lets the community spot malicious or broken releases and majors still get human review. Merging everything instantly exposes you to freshly compromised releases. Yearly big-bang updates are risky and leave known vulnerabilities open for months. Accepting only security fixes builds up update debt that makes the next urgent upgrade harder.

### Question 8 of 10

An application on Kubernetes reads its database password from a base64-encoded Secret manifest committed to the GitOps repository. Which change BEST protects the secret while keeping the GitOps workflow?

- A. Move the Secret manifest into a separate private branch of the same repository that only the deploy tooling is meant to read
- B. Keep the manifest but base64-encode the value twice, so anyone reading the repository cannot decode it with one command
- C. Use External Secrets Operator or a similar controller to sync the value from a secrets manager, committing only a reference
- D. Store the password as a plain environment variable in the Deployment manifest so it is visible to reviewers in pull requests

**Answer:** C

**Explanation:** Committing only a reference and letting a controller fetch the value from a secrets manager keeps the secret out of Git while the desired state stays declarative; committing only encrypted values with Sealed Secrets is another valid pattern. Base64 is encoding, and doubling it is still not encryption. A branch is not an access boundary, since anyone with read access can fetch every branch. A plain environment variable in the manifest exposes the password even more directly.

### Question 9 of 10 (choose 2)

A team is hardening the deployment stage of a pipeline that pushes to production Kubernetes. Which TWO practices MOST reduce the chance that a compromised build job can alter production? (Choose two.)

- A. Allow developers to trigger the deploy job from any branch so hotfixes can reach production without waiting for review
- B. Separate build and deploy into distinct jobs with different credentials, so the build job never holds production access
- C. Have the deploy job release only artifacts referenced by digest whose signature and provenance were verified
- D. Share one long-lived kubeconfig file between all jobs so credential handling is consistent across pipeline stages
- E. Grant the build job cluster-admin so it can verify the deployment end to end before handing off to the deploy job

**Answer:** B, C

**Explanation:** Splitting build and deploy keeps production credentials away from the job that runs build steps and third-party dependencies, and deploying only verified, digest-pinned artifacts ensures that what reaches production is exactly what the trusted pipeline produced. Cluster-admin for the build job and a shared long-lived kubeconfig both put production access within reach of a compromised step. Deploying from any branch bypasses review.

### Question 10 of 10

A company commissions its first external penetration test of a customer-facing web app ahead of a SOC 2 audit. Which preparation step is MOST important for getting useful results?

- A. Schedule the test during the busiest sales week so that testers experience the application under realistic load
- B. Agree a written scope and rules of engagement, provide test accounts for each role, and name an emergency contact
- C. Give testers only the public URL and no accounts so that the test fully simulates an anonymous external attacker
- D. Deploy the newest WAF rules the day before the test so that testers find as few issues as possible for the report

**Answer:** B

**Explanation:** A clear scope and rules of engagement keep the test legal and safe, role-specific accounts let testers check authorization between roles, and an emergency contact handles any production impact. Tuning the WAF to hide issues defeats the purpose. Anonymous-only testing misses most authenticated and authorization flaws. Testing during peak load increases business risk without improving findings.

Ready for a timed run? Take the free 15-question SSD mini exam: https://devopscodelab.com/app/exams/secure-sdlc-decisions/mini/

DevOpsCode Lab is not affiliated with General. SSD and related names are trademarks of their owners. We write every question ourselves; these are not real exam questions.
