The idea: the labels decide, not the owner
In discretionary access control (DAC) the owner of a file decides who may open it, with an access control list (ACL) or with rwx permission bits. In mandatory access control (MAC) the system decides. Every subject (a user, or a program running for that user) carries a level. Every object (a file) carries a level. A reference monitor compares the two labels on every read and every write. No owner can change the labels or switch the rule off.
The page has three levels, 3 above 2 above 1, three subjects (carol 3, alice 2, mallory 1) and three files (codes.txt 3, plan.txt 2, notes.txt 1). Two classic models give the levels a meaning. Bell-LaPadula protects confidentiality: the levels say how secret the data is. Biba protects integrity: the levels say how much the data can be trusted.
The small chips under each box show what data it holds, by the level the data came from. An allowed read copies the file's chips to the subject. An allowed write copies the subject's chips to the file, because a program may write anything it has read. A chip marked ↓ sits below its own level: a leak. A chip marked ↑ sits above its own level: taint.
Bell-LaPadula: no read up, no write down
Write L(x) for the level of x. Bell-LaPadula (1973) has two mandatory rules.
- The simple security property: a subject s may read an object o only if L(s) ≥ L(o). This is no read up. alice (2) may read notes.txt (1), but not codes.txt (3) (Demo: Bell-LaPadula, read down and read up).
- The *-property ("star property"): s may write o only if L(s) ≤ L(o). This is no write down. alice may write into codes.txt, a file she cannot read, but not into notes.txt (Demo: Bell-LaPadula, write up and write down).
No read up is the obvious rule. No write down is the clever one. alice is cleared for Secret data, so anything she writes might contain it, and a level-1 file can be read by level-1 subjects. With both rules, data can move only upwards, so the leak counter stays at 0 whatever the subjects do.
The model also keeps the owner's ACL as a third rule, the discretionary security property. An access must pass both checks. That is why the monitor on the page has two rows.
The Trojan horse that DAC cannot stop
mallory (level 1) wants plan.txt (level 2). Its ACL does not list her, so a direct read is denied. She gives alice a useful-looking program with hidden extra code: a Trojan horse. When alice runs it, the program acts as alice and has all of alice's rights. It reads plan.txt, which alice may read, and writes a copy into notes.txt, a file mallory owns and has opened for alice to write. Then mallory reads her own file.
Under DAC every step is on an ACL, yet the plan has leaked: 2 leaks on the page, one chip in notes.txt and one held by mallory (Demo: Trojan horse under DAC, the leak). An ACL controls who opens a file. It says nothing about where the data goes next, and it cannot tell alice from a program that only pretends to work for her.
Under Bell-LaPadula the program still reads plan.txt. But its write into notes.txt goes from level 2 down to level 1, so the *-property denies it. mallory reads notes.txt and finds only her own data: 0 leaks (Demo: same Trojan horse under Bell-LaPadula). The rule does not need to know that the program is hostile. It looks only at the labels.
Biba: the same rules upside down
Secrecy asks "who may learn this?". Integrity asks "who may change this, and what may it be built from?". Biba (1977) uses integrity levels I(x): high means trusted. Bad data must not flow into trusted places, so the two rules flip.
| Bell-LaPadula (secrecy) | Biba (integrity) | |
|---|---|---|
| read allowed if | L(s) ≥ L(o): no read up | I(s) ≤ I(o): no read down |
| write allowed if | L(s) ≤ L(o): no write down | I(s) ≥ I(o): no write up |
| data may flow | up only | down only |
| stops | leaks ↓ | taint ↑ |
| does not stop | taint ↑ | leaks ↓ |
No read down: alice (Medium) may not read notes.txt (Low), because untrusted input could mislead her. No write up: she may not write into codes.txt (High), because she could corrupt it (Demo: Biba, the rules upside down).
One model, one property
Each model guards one thing only. Under Bell-LaPadula, mallory writes notes.txt, alice reads it and then writes into codes.txt. Every step is legal, and level-1 data now sits inside the level-3 file: taint 3, leaks 0 (Demo: Bell-LaPadula lets bad data flow up). Biba denies the last two steps of the same chain: taint 0 (Demo: Biba blocks the same chain). But in the Biba demo alice freely copies level-2 data down into notes.txt, which is a leak.
Using both models with the same levels leaves only reads and writes on the subject's own level. Real systems use separate labels for secrecy and integrity, or pick one. SELinux has a multi-level security (MLS) policy in the Bell-LaPadula style. Windows gives every process and object an integrity level and by default blocks writes from a lower level to a higher one, which is Biba's no write up. That is how a sandboxed browser tab is kept from changing your files. Who gets which role or attribute is a different question, see RBAC vs ABAC; what goes wrong when the checks are missing in a web app is on OWASP: broken access control.
See also SQL GRANT and REVOKE in MariaDB for discretionary access control, where the holder of a privilege decides who else gets it.
See also STRIDE Threat Modelling, which finds disclosure and tampering threats on every element of a web app's data-flow diagram at design time.
What the page leaves out
Real labels are a level plus a set of categories (compartments such as NUCLEAR or CRYPTO), and "≥" becomes "dominates" in a lattice; the page uses three plain levels. Bell-LaPadula's tranquility rule (labels do not change while in use), trusted subjects that may write down to declassify data, a subject's current level versus its maximum level, and the stricter "write only at your own level" variant are not shown. Biba also has low-water-mark and ring policies; only strict integrity is drawn. Covert channels, where a high process signals a low one through timing or shared resources without any read or write, are outside both models. Clark-Wilson and Chinese Wall are other classic models that this page does not cover.