SSD

Free SSD practice questions

10 questions from our SSD practice tests, each with the correct answer and a written explanation. Read them with the answers shown, or switch to quiz mode and answer first.

Back to the SSD practice exams

Question 1 of 10, Threat Modeling and Security Requirements

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?

  1. AModel only the application code, since the infrastructure is defined in Terraform and was reviewed when it was written
  2. BInclude the managed services, focusing on customer-side duties such as IAM, network exposure, and configuration Correct answer
  3. CModel the provider's internal data-centre controls in detail, since physical security is the largest risk for the service
  4. DExclude all managed services from the model, because the cloud provider is responsible for every aspect of their security

Answer and 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, Secure Design and Architecture

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?

  1. ARequire PKCE for all clients, exact redirect URI matching, and short-lived single-use authorization codes Correct answer
  2. BReturn access tokens directly in the redirect URL fragment so that no authorization code needs to be redeemed
  3. CAllow redirect URIs that match any subdomain of a developer's domain using wildcard patterns for flexibility
  4. DLet developers register redirect URIs over plain HTTP so that local testing is easier on their machines

Answer and 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, Secure Design and Architecture

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?

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

Answer and 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, Secure Coding and Code Review

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?

  1. AEnsure the inputs are strings, for example with schema validation, and compare a password hash instead of the raw field Correct answer
  2. BSwitch the database from MongoDB to PostgreSQL, because relational databases are not vulnerable to any form of injection
  3. CLog every login request that contains a dollar sign and review the log weekly for suspicious operator injection
  4. DAdd a CAPTCHA to the login form so that automated tools cannot submit objects in the password field at high speed

Answer and 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, Secure Coding and Code Review

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?

  1. AIncrease the AES key size from 128 to 256 bits so that the tester cannot recover the plaintext within a reasonable time
  2. BChange the IV to a fixed value for all tokens so that the tester can no longer manipulate it to alter the plaintext
  3. CRotate the encryption key every day so that any plaintext recovered by the tester becomes useless the following morning
  4. DUse authenticated encryption such as AES-GCM, or encrypt-then-MAC, and return one generic error for every failure Correct answer

Answer and 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, Software Supply Chain, SCA and SBOM

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?

  1. ARequire two developers to build the same release independently on their own laptops and compare the checksums before uploading it
  2. BStore the laptop's signing key in a password manager so that it cannot be stolen by malware running on the laptop
  3. CAdd an SBOM to each release so that consumers can see the full list of components included in the artifacts
  4. DMove builds to a hosted platform with isolated builds and signed provenance that the build steps themselves cannot forge Correct answer

Answer and 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, Software Supply Chain, SCA and SBOM

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?

  1. AAuto-merge patch and minor updates of trusted packages after a short release-age delay and green tests, and review majors Correct answer
  2. BAuto-merge every update, including major versions, as soon as it is published so that the team is always on the latest
  3. CAccept only updates that are flagged as security fixes, and keep all other dependencies pinned at their current versions
  4. DDisable Renovate and update all dependencies once per year in a single large pull request reviewed by the tech lead

Answer and 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, CI/CD Pipeline Security and Secrets

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?

  1. AMove the Secret manifest into a separate private branch of the same repository that only the deploy tooling is meant to read
  2. BKeep the manifest but base64-encode the value twice, so anyone reading the repository cannot decode it with one command
  3. CUse External Secrets Operator or a similar controller to sync the value from a secrets manager, committing only a reference Correct answer
  4. DStore the password as a plain environment variable in the Deployment manifest so it is visible to reviewers in pull requests

Answer and 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, CI/CD Pipeline Security and Secrets. 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.)

  1. AAllow developers to trigger the deploy job from any branch so hotfixes can reach production without waiting for review
  2. BSeparate build and deploy into distinct jobs with different credentials, so the build job never holds production access Correct answer
  3. CHave the deploy job release only artifacts referenced by digest whose signature and provenance were verified Correct answer
  4. DShare one long-lived kubeconfig file between all jobs so credential handling is consistent across pipeline stages
  5. EGrant the build job cluster-admin so it can verify the deployment end to end before handing off to the deploy job

Answer and 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, Security Testing and Release Decisions

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?

  1. ASchedule the test during the busiest sales week so that testers experience the application under realistic load
  2. BAgree a written scope and rules of engagement, provide test accounts for each role, and name an emergency contact Correct answer
  3. CGive testers only the public URL and no accounts so that the test fully simulates an anonymous external attacker
  4. DDeploy the newest WAF rules the day before the test so that testers find as few issues as possible for the report

Answer and 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.