Begin with a threatened user action
Application security is easier to engineer when controls are tied to user actions and observable denial conditions. Suppose a hypothetical expense platform lets staff submit claims, managers approve them and finance export totals. A strong design describes who may create, read, edit and approve each claim; where untrusted inputs enter; and what happens when a component is unavailable. The ten controls below cover different failure classes, not ten fashionable product names. OWASP’s OWASP ASVS v5.0.0 provides a versioned application-verification baseline; it does not assert that an application passes until its requirements are actually tested.
1 — Object-level authorization. Check every read, update and export against the authenticated subject and the target object, not just a menu label. The negative test is that a staff member cannot fetch another employee’s expense by changing an identifier, and a manager cannot approve claims outside assigned scope. Record tenant isolation and the enforcement point. An authenticated session is not the same thing as an authorized operation.
A multi-tenant application’s test plan should not treat all “access denied” responses as interchangeable. For the fictional expense workflow, the developer needs three different principals—an employee, their manager and a finance exporter—and at least two claims belonging to unrelated tenants. The employee must be able to submit their own claim, while a guessed identifier must not reveal another employee’s claim. A manager’s valid session must not be able to approve a claim they are not assigned, and a finance export must be bounded to its authorized scope. These tests exercise object ownership, workflow state and cross-tenant controls separately.
Review the results with the team that owns the affected business rule, not only the security scanner. A return code proves little without knowing which principal, record and tenant were involved. Store synthetic test identifiers and evidence rather than actual employee payroll information. The design can be mapped to the OWASP ASVS requirements, but the requirements’ presence in a checklist is not evidence that an implementation passed them.
Control identity and state
2 — Authentication and session lifecycle. Choose phishing-resistant authentication where the business risk and platform support justify it, protect session cookies with appropriate attributes, define rotation and idle/absolute expiry, and test logout and revoked sessions. A remembered session or a valid bearer token must not allow actions that no longer belong to its owner. Denial handling should be predictable and must not leak account-enumeration information.
3 — Secure input handling. Treat server-side validation, canonicalization and output encoding as separate jobs. A numeric invoice value must obey business limits; a user-supplied search string must be safely handled by a query API; a displayed comment must be encoded for its output context. Prepared/parameterized queries are relevant to SQL injection, but they are not a universal solution for command execution, templates or cross-site scripting. Tests should use a sanctioned environment and harmless malformed inputs.
An object-level permission test must change both the resource identifier and the caller identity. Merely checking whether the API returns HTTP 403 to an unauthenticated request leaves the insecure-direct-object-reference risk unanswered. Include a legitimate access control case, a denied cross-user case and a privileged exception whose approval is logged. Also consider state transitions: a user whose account is suspended during an in-flight job may retain an old token until expiration unless the chosen architecture supports immediate invalidation. The expected behavior should be explicit before an engineer claims the system passed review.
Protect workflows and secrets
4 — Business-logic invariants. The application must enforce transitions such as submitted → approved by an authorized manager → paid once. Test duplicate submissions, conflicting approvals and retry-after-timeout behavior; a UI disabled button is not authoritative. Idempotency, transaction boundaries and actor separation should be chosen for the workflow, not copied blindly from a generic checklist. Preserve an auditable decision record without exposing unnecessary personal details.
5 — Secret and key management. Credentials and encryption keys should not be hard-coded into repos, logs or client bundles. Define which workload identity may retrieve which secret, how access is revoked, rotation impact and recovery when a key becomes unavailable. Encryption at rest does not protect plaintext once a broadly authorized application retrieves it. Test access-denied paths and the application’s safe failure response.
Reduce dependencies and attack surface
6 — Dependency and build integrity. Maintain versioned dependencies, a reliable bill of materials, artifact provenance where feasible, and patch decisions tied to exploitability and runtime exposure. A component scanner’s CVE list is triage input, not proof of a reachable exploit. Build-system credentials and third-party actions also belong in the threat model. Test that an unapproved artifact cannot be promoted to production.
7 — Safe configuration and deployment. Define least-privilege runtime accounts, allowed outbound connections, transport security, disabled debug features and non-production data boundaries. A baseline should be expressed as policy-as-code or a tested checklist. Record drift and rollback behavior. Deploying a WAF does not fix an unvalidated authorization rule inside the app.
Preserve evidence and recover from failure
8 — Meaningful security logging. Log subject, action, resource, outcome and correlation identifier for sensitive events while minimizing credentials and regulated data. Test that denied exports and elevated approvals appear in expected records, that clocks are consistent, and that retention is sufficient for an investigation. Logs that never reach the collection system cannot support the promised detection.
9 — Operational abuse limits. Apply context-appropriate request limits, anti-automation and fraud signals to costly or sensitive actions. Test account lockout recovery and denial-of-service side effects. A rate limit does not prove that credential stuffing or scraping is impossible; distributed and authenticated patterns can change the assumptions. App owners should review false-positive impact and emergency exceptions.
10 — Incident and change readiness. Rehearse disabling a compromised integration, revoking tokens, restoring database integrity, rotating keys and notifying owners using an authorized tabletop exercise. Define an alert decision threshold and an accountable containment approver. A successful deploy or green scan is not equivalent to a tested incident response. Cloud application DevSecOps controls should record artifact provenance, change authorization and rollback steps so a failed release cannot hide what changed or which key was rotated.
A security regression test should store sufficient sanitized evidence to be reproducible: request class and authorization context, control version, expected status, actual outcome, execution time and assigned defect owner. Sensitive tokens, passwords and personal data do not belong in the test report. Build or runtime scanners can identify suspect patterns but cannot replace access-control tests performed against a permitted representative environment. In web-application testing, a scoped assessment reproduces denied input and authorization paths with traceable evidence; it does not justify testing unapproved targets.
Make verification part of delivery
Tie each control to a requirement ID or scoped test, expected allowed/denied outcome, evidence field, test environment and accountable owner. A reproducible test table is preferable to unsupported “100% secure” statements. Distinguish unit tests, integration tests, penetration tests and production monitoring; they answer different questions. Clearly distinguish a controlled lab result from an untested design assumption; neither alone establishes production security.