Sample question 1 — Security Operations
A telehealth vendor runs a customer portal behind a load balancer, and penetration testers showed last week that a stolen session token still worked after the victim signed out, and that the same token travelled over plain HTTP from a partner clinic. The engineering lead must close both findings in the next sprint. Which change to session handling removes both weaknesses at once?
- A. Rotate the signing key for the session store and shorten the token lifetime to fifteen minutes.
- B. Move the session store from the application server to a managed Redis cluster with TLS enabled.
- C. Add a web application firewall rule that blocks requests without a valid user agent header.
- D. Mark session cookies Secure, HttpOnly, and SameSite Strict, and invalidate them on logout.
Answer: D. Option D is correct because the Secure attribute forces the browser to send the cookie only across TLS, HttpOnly denies scripts access to it, SameSite Strict blunts cross-site use, and server-side invalidation on logout destroys the record so the captured value is worthless. Rotating the signing key (A) does not revoke the already issued token or keep it off a clear channel. Relocating the session store (B) changes where state lives, not how the cookie is delivered. A firewall rule on the user agent (D) is trivially spoofed and ignores both findings.
