Independent learning for product cybersecurity professionals
SearchCommentary
Learning library / Practical projectsCSL-402 · Practical projects

Turn threats into security requirements

Try a scenario, make decisions, then compare with a worked answer.

Turn a threat into a requirement and an acceptance test.

What you will learn

  • Translate scenario treatments into precise requirements.
  • Define allowed and rejected behaviour with acceptance criteria.
  • Retain traceability to threats, implementation and evidence.

The scenario

A read-only warehouse operator can access the gateway’s configuration API. The API checks that the user is signed in but does not check the user’s role.

Your task

  1. Describe the threat and consequence.
  2. Write a requirement covering the configuration change.
  3. Define a permitted-action test and a rejected-action test.
  4. Identify what evidence the tests should retain.
Read the worked answer

Threat

An authenticated operator changes the upload destination without permission, disrupting or disclosing measurements.

Requirement

The configuration API shall permit destination changes only for accounts assigned the Administrator role and reject the action for other roles.

Verification

Use an Administrator account to change the destination and confirm the change. Repeat with a read-only account and confirm rejection and unchanged configuration. Send the request directly to the API as well as through the interface. Record baseline, accounts, requests, responses and resulting configuration.

Use a bounded input set

Take three threats from the connected sensor: ordinary users changing configuration, one customer obtaining another customer’s readings and an altered firmware package being installed. Keep product and account assumptions consistent with CSL-401. The exercise concerns specified behaviour and evidence, not writing production code.

Use a table containing requirement ID, source threat, rationale, trigger, required behaviour, acceptance criteria, enforcement owner and verification method. Spend about 30–45 minutes on a first version. If a value is unknown, record a decision owner rather than substituting an arbitrary number merely to make the requirement look complete.

Write tests as you write requirements

For authorisation, specify the permitted role and resource. Identify the API or device service that performs the change. A denied request must not leave a partial configuration change. For customer isolation, define which association determines access and how the service handles a request outside that scope.

For updates, distinguish package authenticity, integrity, product compatibility and version policy. Decide what remains running after rejection. Add a successful test so a design that rejects everything cannot satisfy the requirement. Then add a transition case such as expired credentials, interrupted transfer or session restart. These cases expose incomplete wording early.

Review for ambiguity and evidence quality

Ask a second person to read a row and write a test without further explanation. Differences in expected results reveal ambiguous terms such as “appropriate”, “secure”, “quickly” or “invalid”. Tighten the requirement or document the remaining decision.

Good evidence identifies the baseline, roles, resources, input, expected and actual result and relevant resulting state. A screenshot of a disabled button does not prove backend denial. A signature check demonstration does not prove compatibility handling. Keep requirements separate where the behaviour or verification differs, while retaining the common threat link.

Apply the ideas

A requirement reads “only administrators may change settings”. Rewrite it for a specific gateway destination change. Define tests for an administrator, ordinary operator and revoked administrator, including how you establish unchanged state after rejection.

Compare your approach

Specify that the destination-changing service shall authorise the current identity for the target gateway before committing the change. An authorised administrator changes only assigned resources. An operator and a revoked administrator are denied, and the stored and effective destination remain unchanged. Use direct service requests as well as the interface, retain role and gateway assignments and inspect resulting configuration. Revocation behaviour must include the session or token rules used by the service.

Review your work

  • Could another tester apply the criteria consistently?
  • Are resource scope and rejection state explicit?
  • Are missing values assigned to a decision owner?

Keep this output: Three requirements, each with positive, negative and transition tests.

Continue learning