Interview Prep/DevSecOps/DAST, runtime detection and compliance scans

The authenticated ZAP full scan only ever tests the login page and `/logout`, and the report shows mostly `302` responses

IntermediateTroubleshootingDAST, runtime detection and compliance scans
Answer

Likely causes → The session is lost early. The spider hits /logout, the token expires, or ZAP was never told how to authenticate or how to recognise a logged-out state.

Diagnose → In the ZAP session history, look for redirects to /login after the first few requests. Confirm whether the app uses cookies or a bearer token.

Fix → Define authentication in an Automation Framework plan: a context with the auth method (form, JSON or script), a verification strategy using a logged-in or logged-out indicator regex, and a test user. Exclude .*logout.* from the spider and scanner. For bearer-token APIs, inject the header with the ZAP_AUTH_HEADER_VALUE env var.

Prevent → Keep the ZAP automation YAML in the repo, and add a report check that fails if fewer than N authenticated URLs were scanned.

All DevSecOps questions Roadmap: Policy as code

More on DAST, runtime detection and compliance scans