CISSP-117 · Lesson 2 of 12 · 26 min

Secure design principles and threat modeling for applications

Most serious software vulnerabilities are not typing mistakes. They are design decisions: an API that trusts an identifier supplied by the caller, a service that runs with far more privilege than it needs, an administrative function reachable from the internet, a workflow that assumes steps will always happen in order. Code review and testing can find such problems, but by then they are expensive to change. This lesson looks at how secure design principles and application threat modeling prevent design flaws from being built in the first place.

CISSP-112 Lesson 1 introduced secure design principles and threat modeling at the level of whole systems and architectures, and CISSP-110 Lesson 12 placed threat modeling in the risk management process. Here we apply those ideas to individual applications and features, the level at which product teams actually work, and we look at how a manager can make threat modeling a routine part of development rather than an occasional exercise.

Classic design principles

In 1975 Jerome Saltzer and Michael Schroeder published a set of design principles for protecting information in computer systems. Half a century later they remain the foundation of secure design, and they appear, sometimes under new names, in every modern framework.

Saltzer and Schroeder's eight principles with application-level examples.
PrincipleMeaningApplication example
Economy of mechanismKeep designs as simple and small as possibleUse one well-reviewed authorization module rather than checks scattered across the code
Fail-safe defaultsBase access on permission rather than exclusion; deny by defaultA new API endpoint is inaccessible until an explicit access rule is added
Complete mediationCheck every access to every object, every timeRe-check authorization on each request, not only at log-in
Open designSecurity should not depend on keeping the design secretUse published, reviewed cryptographic algorithms; keep only keys secret
Separation of privilegeRequire more than one condition or person for sensitive actionsLarge refunds need a second approver
Least privilegeGive each component and user only the rights it needsThe reporting service has read-only database access
Least common mechanismMinimize mechanisms shared between usersSeparate tenants' data and processing where practical
Psychological acceptabilityMake security easy to use correctlySensible defaults and clear error messages so users do not seek workarounds

Later practice added principles such as defense in depth (layers of independent controls), secure defaults (the product is secure as shipped, without the customer needing to harden it), minimizing the attack surface (expose as few interfaces, features and privileges as possible), separation of duties, zero trust (never grant implicit trust based on network location) and privacy by design. On the exam, recognize the principle that a scenario illustrates and the one it violates. A service account with database administrator rights used for reading reports violates least privilege; an authorization check performed only on the first page of a multi-step workflow violates complete mediation.

Secure by design and secure by default

Since 2023, government cyber security agencies have pushed software makers to take ownership of their customers' security outcomes. The joint guidance known as Secure by Design, first published in April 2023 by the US Cybersecurity and Infrastructure Security Agency (CISA) with partners including Canada's national cyber security agency and agencies from several allied countries, asks manufacturers to build products that are secure by design (security considered from the earliest stages) and secure by default (the safest settings enabled out of the box, with no extra cost or effort for the customer). It names concrete practices: eliminate default passwords, adopt memory-safe languages, make multifactor authentication standard, provide logs at no extra charge, and publish vulnerability disclosure policies.

In May 2024 CISA launched a voluntary Secure by Design pledge in which software companies committed to measurable progress on goals such as these within a year. The pledge carries no legal force, and its current status should be checked on CISA's website, but it remains a useful benchmark. A manager assessing a vendor, or setting goals for an internal platform, can ask the same questions the pledge asks: do our products ship with default credentials, is multifactor authentication on by default, can customers get security logs without paying more, and do we publish how to report vulnerabilities to us?

What application threat modeling is

Threat modeling is a structured way of answering four questions, as popularized by Adam Shostack: What are we working on? What can go wrong? What are we going to do about it? Did we do a good enough job? For an application, the first question is usually answered with a diagram of the system: its components, the data flows between them, the data stores, the external entities that interact with it, and the trust boundaries where data crosses from a less trusted to a more trusted zone. The second question uses a method such as STRIDE to generate threats systematically. The third turns threats into mitigations, which become requirements, design changes or accepted risks. The fourth checks the model against reality, for example by testing the mitigations.

Data flow diagram of a refund feature. An external entity, Merchant user, sends requests across a dashed trust boundary labeled internet to a process, Web dashboard. The dashboard calls a process, Refunds API, across a second trust boundary into the internal network. The refunds API reads and writes a data store, Payments database, and calls an external entity, Bank network, across a third trust boundary. Small tags on each element show STRIDE letters: the merchant user S and R, the data flows T and I, the processes S, T, R, I, D and E, and the data store T, I and D.
A data flow diagram of Ridgeline's refund feature, with trust boundaries and the STRIDE categories that apply to each element.

Data flow diagrams use a small vocabulary: external entities (people or systems outside the team's control), processes (code that transforms data), data stores (databases, files, queues) and data flows (arrows). Trust boundaries are drawn as dashed lines wherever privilege or control changes, such as between the internet and the web tier, between services owned by different teams, or between the company and a third party. Most threats cluster at trust boundaries, because that is where untrusted input enters and where assumptions about identity and authorization are made.

STRIDE per element

STRIDE, developed at Microsoft, is a mnemonic for six categories of threat, each the opposite of a security property. Spoofing violates authenticity; tampering violates integrity; repudiation violates non-repudiation; information disclosure violates confidentiality; denial of service violates availability; elevation of privilege violates authorization. Applying STRIDE per element means asking which categories apply to each kind of element in the diagram. External entities can be spoofed and can repudiate actions; data flows can be tampered with, disclosed or flooded; data stores can be tampered with, disclosed or exhausted, and if they hold logs, repudiation applies; processes are subject to all six.

Enumerating STRIDE threats for each element of the refund diagram and ranking the ones the team rated highest.
# STRIDE-per-element threat enumeration with a simple risk score (illustrative)
stride = {
    'external entity': 'SR',
    'process': 'STRIDE',
    'data store': 'TID',
    'data flow': 'TID',
}
names = {'S': 'Spoofing', 'T': 'Tampering', 'R': 'Repudiation',
         'I': 'Information disclosure', 'D': 'Denial of service', 'E': 'Elevation of privilege'}
elements = [
    ('Merchant user', 'external entity'),
    ('Refunds API', 'process'),
    ('Payments database', 'data store'),
    ('Dashboard -> API request', 'data flow'),
]
# team's likelihood and impact estimates (1-3) for selected threats
estimates = {
    ('Merchant user', 'S'): (3, 3), ('Refunds API', 'E'): (2, 3),
    ('Refunds API', 'R'): (2, 2), ('Payments database', 'I'): (1, 3),
    ('Dashboard -> API request', 'T'): (1, 2), ('Refunds API', 'D'): (2, 2),
}
threats = []
for name, kind in elements:
    for c in stride[kind]:
        lik, imp = estimates.get((name, c), (1, 1))
        threats.append((lik * imp, name, names[c]))
print(f'{len(threats)} candidate threats generated')
print('Top five by likelihood x impact:')
for score, name, cat in sorted(threats, reverse=True)[:5]:
    print(f'  {score}  {name:26s} {cat}')
Output
14 candidate threats generated
Top five by likelihood x impact:
  9  Merchant user              Spoofing
  6  Refunds API                Elevation of privilege
  4  Refunds API                Repudiation
  4  Refunds API                Denial of service
  3  Payments database          Information disclosure

The enumeration produces many candidate threats, most of which are already handled by standard controls. The value is in the conversation it forces. For the refund feature, the highest-ranked items are spoofing of the merchant user (stolen credentials or session theft) and elevation of privilege in the refunds API (a user issuing refunds for another merchant, or a support agent exceeding their role). Each leads to concrete mitigations: phishing-resistant multifactor authentication for merchant administrators, object-level authorization on every refund request, and an audit trail that defeats repudiation.

Other methods: PASTA, attack trees and LINDDUN

STRIDE is not the only approach. PASTA (Process for Attack Simulation and Threat Analysis) is a seven-stage, risk-centric method that starts from business objectives and ends with residual risk analysis; it suits organizations that want threat modeling tightly connected to business impact, at the cost of more effort. Attack trees represent an attacker's goal as the root of a tree, with branches showing alternative or combined ways of achieving it; they help analyze which single control would cut off the most paths. LINDDUN focuses on privacy threats such as linkability, identifiability and non-compliance, and pairs well with privacy impact assessments. Teams also use threat libraries and frameworks such as MITRE ATT&CK to check that they have considered relevant adversary behavior, at a level of description appropriate to defenders.

Rating schemes such as DREAD (damage, reproducibility, exploitability, affected users, discoverability) were once common for scoring threats, but they produce inconsistent results between people and have largely been abandoned, including at Microsoft where DREAD originated. Many teams now use a simple likelihood and impact matrix aligned with the organization's risk management method, or they rate threats with the same severity scale used for vulnerabilities. Consistency with enterprise risk reporting matters more than the particular formula.

Making threat modeling routine

The biggest obstacle to threat modeling is not method but habit. Teams that see it as a long workshop led by outside experts do it rarely, usually too late. Teams that treat it as a short, regular design conversation do it often enough to matter. A practical program sets clear triggers, keeps sessions short and focused, stores models alongside the code so they evolve with it, and tracks mitigations in the same backlog as other work.

Worked problem

Setting threat modeling triggers at Ridgeline

Ridgeline's chief technology officer wants threat modeling to be routine without slowing teams down. The application security lead proposes a policy.

Show solution
  1. Full model (one to two hours, facilitated by an application security engineer): every new service, every new external integration, and any change to authentication, authorization or payment flows.
  2. Lightweight model (fifteen minutes in sprint planning, led by the security champion): any story that adds a new data flow across a trust boundary or handles a new category of sensitive data.
  3. No model needed: changes inside an existing component that do not alter data flows, trust boundaries or privileges.
  4. Store the diagram and threat list in the service repository; mitigations become backlog items linked to the model; the model is reviewed at least annually and whenever the architecture changes.

Answer: Clear triggers concentrate expert effort on the riskiest changes, make lightweight modeling a habit for everyday work, and leave evidence in the repository.

Threat models are living documents. A model drawn once at project start and never updated becomes misleading as the system changes. Lesson 12 returns to how a program measures threat modeling coverage, such as the share of services with a model reviewed in the past year.

Design review

A secure design review is an expert evaluation of a proposed design against security principles, standards and the threat model before significant implementation begins. Reviewers look for missing controls (no rate limiting on a public endpoint), misplaced trust (authorization decisions made in the mobile app rather than on the server), unnecessary exposure (an administrative interface on the public internet), weak patterns (custom cryptography or home-grown session management) and gaps between the design and regulatory requirements. Findings are recorded and tracked like any other defect. For a manager, the important point is that design reviews should be scheduled while change is still cheap, which in agile terms means before the work is broken into stories, not after the first release.

Common mistakes

  • MistakeRelying on secrecy of the design for security.

    InsteadApply open design: assume attackers know the design and protect secrets such as keys.

  • MistakeChecking authorization only at log-in.

    InsteadApply complete mediation and check authorization on every request to every object.

  • MistakeHolding one large threat modeling workshop at project start and never revisiting it.

    InsteadSet triggers, keep sessions short, store models with the code and update them as the design changes.

  • MistakeUsing DREAD scores as precise measures of risk.

    InsteadUse a consistent likelihood and impact method aligned with enterprise risk management.

  • MistakeShipping products with default passwords that customers must change.

    InsteadFollow secure by default: no default credentials, and safe settings enabled out of the box.

  • MistakePlacing authorization decisions in client-side code.

    InsteadEnforce authorization on the server, where the user cannot alter the logic.

Summary and key terms

  • Many vulnerabilities are design flaws, which are cheapest to fix before implementation.
  • Saltzer and Schroeder's principles include economy of mechanism, fail-safe defaults, complete mediation, open design, separation of privilege, least privilege, least common mechanism and psychological acceptability.
  • Secure by design and secure by default ask makers to own customer security outcomes; CISA's 2024 pledge is a voluntary benchmark.
  • Application threat modeling answers four questions and usually starts from a data flow diagram with trust boundaries.
  • STRIDE per element generates threats systematically; PASTA, attack trees and LINDDUN serve other needs.
  • DREAD has largely been abandoned; use a consistent likelihood and impact method.
  • Routine threat modeling depends on clear triggers, short sessions, models stored with code and tracked mitigations.
Complete mediation
Checking every access to every object for authorization, every time.
Fail-safe defaults
Denying access unless permission is explicitly granted.
Secure by default
Shipping software with its safest settings enabled without extra effort or cost to the customer.
Trust boundary
A point in a system where data or control passes between zones of different trust.
Data flow diagram
A diagram of external entities, processes, data stores and data flows used in threat modeling.
STRIDE
Spoofing, tampering, repudiation, information disclosure, denial of service and elevation of privilege.
PASTA
Process for Attack Simulation and Threat Analysis, a seven-stage risk-centric threat modeling method.
Attack tree
A tree with an attacker goal at the root and alternative ways of achieving it as branches.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. Which principle is violated when a reporting service uses a database administrator account?

    Show answer

    Least privilege.

  2. Which principle requires authorization on every request?

    Show answer

    Complete mediation.

  3. What does secure by default mean?

    Show answer

    Products ship with their safest settings enabled, without extra effort or cost to customers.

  4. What are the four threat modeling questions?

    Show answer

    What are we working on? What can go wrong? What are we going to do about it? Did we do a good enough job?

  5. Where do threats tend to cluster in a data flow diagram?

    Show answer

    At trust boundaries.

  6. Which STRIDE categories apply to a data store?

    Show answer

    Tampering, information disclosure and denial of service, plus repudiation if it holds logs.

  7. Which security property does repudiation threaten?

    Show answer

    Non-repudiation, the ability to prove who performed an action.

  8. Why has DREAD fallen out of favor?

    Show answer

    It gives inconsistent ratings between people.

  9. Name a privacy-focused threat modeling method.

    Show answer

    LINDDUN.

  10. Give one trigger for a full threat model at Ridgeline.

    Show answer

    A new service, a new external integration, or a change to authentication, authorization or payment flows.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz