Design principles: threats first, then least access

10 min 5 sections 5 practice questions 7 sources citedISC2 objective 3.1

A design principle is a rule of thumb for building a system so that mistakes and attacks do less harm. A builder who fits one front door, and gives keys only to the people who live there, is applying two of them. No technical background is assumed. A security professional uses these principles to judge a design before money is spent building it.

By the end of this unit you will be able to:

  • Explain why a design review starts with what can go wrong, and name the six STRIDE threats
  • Tell apart least privilege, need-to-know and privilege creep
  • Tell apart a secure default and default deny
  • Name Saltzer and Schroeder's eight principles and match each to a plain example
  • Choose the principle that answers a weakness described in a design

A booking system switched on as delivered

An illustrative example

A dental practice buys an online booking system. The installer connects it on a Friday and leaves. The administrator account still has the password printed in the manual. Every receptionist account can export the full patient list, because the supplier's standard staff role allows it. A page for the supplier's engineers can be reached from the internet in case it is ever needed.

Three months later a receptionist's password is guessed, and the whole patient list is downloaded overnight. Nothing in the system was broken. Each setting was working as shipped.

Which decisions, made before the system was switched on, would have limited what one guessed password could reach?

A design starts from what can go wrong

A control is worth building only if it answers something that could happen. Threat modelling is the structured way of finding those things while the system is still a drawing. It asks four questions: what are we working on, what can go wrong, what are we going to do about it, and did we do a good enough job.

The team first draws a data-flow diagram: a box for each part of the system and an arrow for each movement of data between parts. A line marks every place where data crosses from a less trusted part to a more trusted one. The team then follows each arrow and asks what could go wrong there.

STRIDE is a checklist of six kinds of threat for that walk. Each kind breaks a different security property.

STRIDE: six kinds of threat and the property each one breaks
LetterThreatProperty brokenAt the dental practice
SSpoofing: pretending to be someone elseAuthenticationA stranger signs in with a receptionist's guessed password
TTampering: changing data without permissionAn appointment record is altered to hide a missed recall
RRepudiation: denying an action that nothing can proveA refund is issued and no record shows who issued it
IInformation disclosure: data reaching someone not allowed to see itThe patient list is exported and sent outside
DDenial of service: stopping rightful users from using the systemThousands of fake bookings fill the diary
EElevation of privilege: gaining rights that were never grantedAuthorisationA receptionist account reaches the administrator screens

Other named methods do different jobs. DREAD scores each threat on damage, reproducibility, exploitability, affected users and discoverability, so that threats can be ranked. PASTA, the Process for Attack Simulation and Threat Analysis, ties threats to business objectives. An attack tree puts the attacker's goal at the top and branches downward into the ways of reaching it.

Least privilege and need-to-know

A hotel cleaner's key card opens the rooms on one floor during one shift. It does not open the safe, the office or next week's rooms. Least privilege is the same rule for systems: every person, program and device gets only the access its task needs, for only as long as the task lasts.

The rule covers programs as much as people. A booking website that only reads the diary should connect to the database with an account that can read the diary and nothing else. If the website is taken over, the attacker inherits that small set of rights and no more.

Need-to-know is narrower and is about information. A person may hold the right clearance or the right job title and still be refused a particular file, because their present work does not require it. limits what an account can do. limits which information a person is shown.

Privilege creep is the slow failure of both. A person changes job, gains the access the new job needs and keeps the old access as well. After several moves the account can do far more than any one job requires. The cure is to remove rights when a person moves, and to review every account's access on a schedule.

Common misconception

“Least privilege is enough to stop one person committing fraud.”

Least privilege trims an account to what the job needs. If the job itself includes both raising a payment and approving it, the account still holds both. Stopping that needs the task split between two people, which is separation of duties.

Secure defaults and default deny

Most systems are run the way they arrive. A secure default means the product is safe as shipped: optional features are off, no shared or printed password works, activity is recorded, and the buyer must act to make it less safe. The opposite, open as shipped and tightened later, relies on every buyer remembering every step.

Default deny, also called implicit deny, is a rule about decisions. When no rule says a request is allowed, the answer is no. A is a device that filters network traffic by a list of rules, and its list ends with a rule that blocks everything not matched above. A new member of staff starts with no access until someone grants some.

Three rules that sound alike and answer different questions
RuleThe question it answersExample
Secure defaultHow does the product arrive?The remote support page is off until an administrator turns it on
Default denyWhat happens when no rule matches?A request that no rule covers is refused
Fail securelyWhat happens when a part breaks?A payment check that cannot reach its service refuses the order

Saltzer and Schroeder's name for default deny is fail-safe defaults: base each decision on permission, not on exclusion. A mistake in a permission-based design refuses someone who should have access, and that person reports it within the hour. A mistake in an exclusion-based design admits someone who should not have access, and nobody complains.

In this principle safe means the system refuses whenever it is in doubt. Doors and safety systems use the word the other way: a releases when power fails so people can leave, and the lock that stays shut is called fail-secure.

Saltzer and Schroeder's eight design principles

Jerome Saltzer and Michael Schroeder set out eight principles in their paper "The Protection of Information in Computer Systems". Later lists reuse them, often under new names.

The eight principles, in the order the paper gives them
PrincipleWhat it saysEveryday example
Economy of mechanismKeep the protective part small and simple, so it can be inspected for flawsOne front door to check, not six
Fail-safe defaultsRefuse unless a rule explicitly allowsA guest list at the door
Complete mediationCheck every access to every object, every timeA pass shown at each visit, not once a year
Open designProtection must not depend on the design staying secretA lock whose workings are published and whose key is private
Separation of privilegeRequire two separate conditions before allowing accessA deposit box that needs the customer's key and the bank's
Least privilegeGive each user and program only what the job needsA cleaner's card for one floor
Least common mechanismShare as little machinery between users as possibleSeparate tills, so one cashier's error cannot reach another's drawer
Psychological acceptabilityMake the secure way the easy way, or people will go round itA door that locks itself when it closes

Open design is most often tested through its opposite. Security through obscurity is relying on attackers not knowing how a system works: a hidden web address, a home-made scrambling method. Secrets of that kind leak, and nobody outside has checked the design for flaws. Obscurity may sit on top of real controls. It is never the control.

Complete mediation fails when a system checks once and remembers the answer. A user whose access was removed at noon should be refused at one minute past, even in a session opened at nine.

The attack surface of a system is every point where an outsider can reach it: each open service, each form, each account. Economy of mechanism and secure defaults both shrink it, because a feature that is absent or switched off cannot be attacked.

Five ways to structure a design

ISO/IEC TS 19249, an international catalogue of design guidance, names five architectural principles. Each is a way of arranging the parts of a system so that a fault in one part stays in that part.

Domain separation
Parts are grouped into domains, each with its own privileges, and domains talk only through defined channels. A hospital keeps payroll and patient records in separate domains.
Layering
Each layer uses only the layer beneath it, through a defined interface. An application asks the operating system for a file and never drives the disk itself.
Encapsulation
A component's inner data can be reached only through the operations it offers. A cash machine lets a customer withdraw money and does not let the customer edit the balance.
Redundancy
More than one copy of a part, so that losing one does not stop the service. A server with two power supplies keeps running when one fails.
Virtualisation
Software presents a simulated computer, so that several isolated systems can share one real machine without seeing each other.

The same catalogue lists minimisation and least privilege among its design principles, beside central checking of input and planning for errors.

A question, worked through

A housing association is designing a tenant portal. A design review finds that every support agent account can read and edit all tenant records, including payment details. Agents only reset passwords and update contact details. The project sponsor wants the finding closed before the portal opens next month.

What should the security architect recommend FIRST?

  1. Limit agent accounts to the two functions that support work requires
  2. Record every action an agent account takes on a tenant record
  3. Require a second agent to approve each change to a tenant record
  4. Encrypt the payment details held in the tenant records database
Decide on your answer, then open the reasoning
  1. The weakness is stated in the scenario: accounts can do far more than the task needs. The question asks what to recommend first, so the answer should remove that excess, not work around it.
  2. Rule out d. Encryption protects stored data from someone who takes the storage. An agent account is authorised, so the system decrypts the payment details for it.
  3. Rule out c. A second approver is separation of duties, which answers one person completing a sensitive task alone. Agents would still read every record, and the task described is routine.
  4. Between a and b: recording actions is detective. It shows misuse after it has happened and leaves the access in place. Limiting the accounts is preventive and removes the exposure.
  5. Least privilege is the first recommendation. Logging is a sound addition once the accounts hold only what the job needs.

Answer: A. Limit agent accounts to the two functions that support work requires

Choosing between good answers

An account, program or role can do more than its task needs
choose the answer that removes the excess access. Monitoring the excess is a weaker second step.
A person has the clearance or the job title and the question is whether they may see one particular item
apply need-to-know: access follows the present task, not the rank.
A product arrives with features switched on or a known password
name it a failure of secure defaults. Default deny is the different rule that refuses a request no rule covers.
An answer protects a system by keeping its design secret
treat it as security through obscurity. Prefer the answer that would still hold if the design were published.

Try it

Follow the assessor through a web shop's design and name the principle behind each control that is added.

Loading the preview.

Check your understanding

5 questions on this unit, easiest first. Confirm an answer to see the reasoning for it, then the right answer, the other options and the rule to reuse. Your answers are kept in this browser and feed readiness and review.

These questions are drafts that no named reviewer has approved yet.

Question 1 of 5

During a threat modelling session for an online shop, the team notes that a customer could deny placing an order, and nothing the shop records could show otherwise.

Which STRIDE threat has the team found?

What to remember

  • Threat modelling finds what can go wrong while the system is still a drawing. STRIDE lists six kinds of threat, each breaking one property.
  • Least privilege limits what an account can do. Need-to-know limits which information a person is shown. Privilege creep is access that outlives the job it was given for.
  • A secure default is about how a product arrives. Default deny is about what happens when no rule matches.
  • Saltzer and Schroeder's eight: economy of mechanism, fail-safe defaults, complete mediation, open design, separation of privilege, least privilege, least common mechanism, psychological acceptability.
  • Open design means the protection survives publication of the design. Obscurity is never the control.

Say it from memory

  1. What is threat modelling, when is it done, and what do the letters of STRIDE stand for?

    A structured search for what can go wrong in a design, done before the system is built. STRIDE: spoofing, tampering, repudiation, information disclosure, denial of service, elevation of privilege. They break authentication, integrity, non-repudiation, confidentiality, availability and authorisation in turn.

    Read this part again

  2. State the principle of least privilege, and say how need-to-know and privilege creep relate to it.

    Every person, program and device gets only the access its task needs, for only as long as the task lasts. Need-to-know applies the same idea to information: clearance or rank is not enough without a present need. Privilege creep is rights piling up as a person changes jobs; access reviews remove them.

    Read this part again

  3. What is a secure default, and how does it differ from default deny?

    A secure default means a product is safe as shipped: optional features off, no known password, and the buyer must act to make it less safe. Default deny, or implicit deny, means a request that no rule allows is refused. The first is about how a product arrives; the second is about how a decision is made.

    Read this part again

  4. Name Saltzer and Schroeder's eight design principles in the order their paper gives them.

    Economy of mechanism, fail-safe defaults, complete mediation, open design, separation of privilege, least privilege, least common mechanism and psychological acceptability.

    Read this part again

  5. What five architectural principles does ISO/IEC TS 19249 name?

    Domain separation, where domains with their own privileges talk only through defined channels. Layering, where each layer uses only the one beneath it. Encapsulation, where inner data is reached only through the operations offered. Redundancy, more than one copy of a part. Virtualisation, where software presents simulated, isolated computers on one real machine.

    Read this part again

Sources