Lesson 2 of 4 Secure Design Principles

Failing Securely, Segregation of Duties and Simplicity

Good designs behave safely when things go wrong, prevent any one person from abusing a process, and stay simple enough to verify. This lesson covers fail secure and fail safe, segregation of duties and economy of mechanism.

Learning outcomes

After completing this lesson, you will be able to:

  • Distinguish fail secure from fail safe.
  • Explain segregation of duties and economy of mechanism.

Fail securely

Systems fail through crashes, power loss, resource exhaustion and unexpected input. A design that fails securely enters a state that does not expose assets: a firewall that crashes blocks traffic instead of passing it, an authentication service that cannot reach its directory denies the login, and an application exception rolls back the transaction rather than completing it. Error messages should not reveal sensitive details.

Failing securely has to be designed deliberately, because the easiest code often fails open. A common pattern is an access check written as "if the check returns an error, continue", which lets every request through when the check service is down. A secure design starts from denial and grants access only when a check positively succeeds. Error handling also needs care: a web application that shows a full database error to the user reveals table names and query structure that help an attacker craft an injection. The secure design logs the details internally and shows the user a generic message with a reference number.

Recovery from failure must be secure too. After a crash, a system should restart into a known, secure state rather than resuming with partly applied changes, and it should not fall back to weaker settings, such as an older and insecure protocol version, simply because the preferred option is unavailable. Attacks that force such a fallback are called downgrade attacks.

Physical systems distinguish fail secure (fail closed: locks stay locked) from fail safe (fail open: locks release so people can escape). Where human life is at risk, such as fire exits, fail safe is required, because people always come first.

Fail secure (closed)
PriorityProtect assets
Door lock on power lossStays locked
Firewall on failureBlocks all traffic
Choose when Data centres, vaults, network controls
Fail safe (open)
PriorityProtect people
Door lock on power lossUnlocks
Firewall on failurePasses traffic (avoid)
Choose when Emergency exits and life-safety systems

The following diagram compares failing open with failing securely.

Failing open compared with failing securely. When a security control such as an authorisation service fails or times out, a system that fails open allows every request, so an attacker who disrupts the control gains unrestricted access. A system that fails securely denies what it cannot verify, and availability is handled separately with redundancy.
Life-safety systems such as fire exits are the usual exception.
Scenario questions

Failing open or closed?

Exam skills 3.1.5

Choose the design that fails securely in each case.

Log in to try this activity Interactive activities are free with an account.

Segregation of duties

Segregation of duties (SoD) divides a sensitive process so that no single person can complete it alone, which prevents fraud and errors unless two or more people collude. Examples include separating requesting, approving and paying in procurement, and separating writing code from deploying it to production. Designs enforce SoD through roles that cannot be held together and workflows that require independent approval.

Related controls include two-person integrity for highly sensitive actions, job rotation and mandatory vacations, which help detect collusion or concealed fraud.

Segregation of duties works by ensuring that each critical step is checked by someone with no interest in hiding a problem. In the purchasing process, if one person could add a supplier, approve an invoice and release the payment, they could invent a supplier and pay themselves. Splitting those three tasks among different people means that a fraud requires collusion, which is harder to arrange and more likely to be discovered. In IT, the developer who writes a change should not be the person who approves and deploys it, so a malicious or mistaken change must pass an independent review.

Two-person integrity differs from segregation of duties. Segregation of duties gives different people different steps of a process; two-person integrity requires two people to be present or to act together for the same step, such as two authorised officers both being present to open a key vault. When each person holds only part of a secret, such as half of a passphrase, the control is called split knowledge. Small organisations that cannot separate every duty use compensating controls, such as management review of activity logs and reconciliations performed by someone outside the process.

Match the pairs

SoD and related controls

Exam skills 3.1.6

Match each control with an example of it.

Log in to try this activity Interactive activities are free with an account.

Keep it simple and small

Complexity creates flaws and makes systems harder to analyse. The principle of economy of mechanism favours the simplest design that meets requirements, and minimising the attack surface removes unused features, interfaces, services and code. Small security-critical components, such as a security kernel, can be verified much more rigorously than large ones.

The attack surface is the sum of all the points where an attacker could try to enter or extract data: open network ports, exposed APIs, login pages, file upload functions, administrative interfaces, installed software and the accounts that can reach them. Each element must be patched, configured and monitored, so each one that is not needed is a cost as well as a risk. Reducing it is often the cheapest security improvement available: disabling an unused remote management service removes every current and future vulnerability in that service at once.

Simplicity also helps people. A firewall policy with 3,000 rules accumulated over ten years is almost impossible to review, and nobody can say with confidence what it permits. Replacing it with a smaller set of documented rules grouped by purpose makes errors visible. The same reasoning favours well-understood, standard security mechanisms, such as established cryptographic libraries, over custom designs that have never been examined by outside experts.

True or false

Economy of mechanism

Exam skills 3.1.7

Check why simplicity and a small attack surface improve security.

Log in to try this activity Interactive activities are free with an account.
Worked example

A failure mode

An application checks each request against a remote authorisation service. To keep the application available, developers configure it to allow all requests if the authorisation service does not respond within two seconds. What is wrong?

The design fails open: an attacker who can slow or block the authorisation service, for example with a denial-of-service attack, gains unrestricted access. The application should fail securely by denying requests when authorisation cannot be confirmed, and address availability separately through redundant authorisation services and caching of recent decisions.

Check yourself

Should an emergency exit door's lock fail secure or fail safe?

Show answer

Fail safe (unlock), because human life takes priority.

Exam Tips

Remember for the exam

  • Fail secure protects assets; fail safe protects people.
  • Never grant access because a security check failed to complete.
  • Segregation of duties forces collusion for fraud.
  • Smaller attack surfaces mean fewer vulnerabilities.