Algorithm Search⌘K

Modelintro

Access control matrix

Also called Lampson access matrix, protection matrix.

A model of protection state as a matrix whose rows are subjects, whose columns are objects, and whose cells list the rights a subject holds on an object.

The access control matrix is the basic model of a protection state: a table AA with one row for each subject, one column for each object, and in the cell A[s,o]A[s, o] the set of rights that subject ss holds on object oo. A request "may ss do rr to oo?" is allowed exactly when r∈A[s,o]r \in A[s, o]. Lampson (1971) proposed it, Graham and Denning (1972) gave rules that change it, and the Harrison-Ruzzo-Ullman model (1976) made those rules into a formal system whose safety question is undecidable. Real systems do not store the matrix as a table: they store its columns as access control lists or its rows as capability lists.

The machine

State. A protection state is a triple (S,O,A)(S, O, A). SS is a finite set of subjects (users, processes, domains), OO is a finite set of objects (files, devices, memory segments, and also the subjects themselves), with S⊆OS \subseteq O, and RR is a fixed finite set of generic rights, for example {own,r,w,x}\{own, r, w, x\}. The matrix is a function A:S×O→2RA : S \times O \to 2^R. Write s=∣S∣s = |S|, o=∣O∣o = |O| and r=∣R∣r = |R|. The subjects are also columns so that rights over a subject, such as the right to stop a process, fit in the same table.

Request. A request is a triple (s,o,r)(s, o, r) with s∈Ss \in S, o∈Oo \in O and r∈Rr \in R. The decision is

allow(s,o,r)  ⟺  r∈A[s,o].\mathrm{allow}(s, o, r) \iff r \in A[s, o].

A reference monitor is the component that receives each request and applies this test.

Transitions. The state changes through commands. In the HRU form, a command has parameters, a condition that is a conjunction of tests "r∈A[x,y]r \in A[x, y]", and a body that is a sequence of six primitive operations: enter rr into A[x,y]A[x, y], delete rr from A[x,y]A[x, y], create subject xx, create object yy, destroy subject xx, destroy object yy. A command runs its body only when its condition holds. Two typical commands are:

  1. command CREATE-FILE(x, f)
  2. 1create object f
  3. 2enter own into A[x, f]
  4. 3enter r into A[x, f]
  5. 4enter w into A[x, f]
  6. command GRANT-READ(x, y, f)
  7. 5if own in A[x, f] then
  8. 6enter r into A[y, f]

The commands are the policy of the system. A system where the owner of an object adds rights for others is discretionary; a system with no command that lets a user change rights on labeled objects is mandatory. Graham and Denning used a fixed set of eight rules: create and destroy an object, create and destroy a subject, read, grant, delete and transfer a right. Their rules use a right own on an object, a right control on a subject, and a copy flag: a holder of r∗r^* may pass rr or r∗r^* to another subject.

Example. Take three subjects alice, bob and carol, and three objects f1, f2 and p (a printer). The columns for the subjects are left out, because no right on a subject is used.

f1 f2 p
alice own, r, w r
bob r own, r, w w
carol r w

The request (bob, f2, w) is allowed. The request (carol, f2, w) is denied, because w is not in A[carol,f2]A[\text{carol}, \text{f2}]. The command GRANT-READ(alice, carol, f1) passes the test of line L5, because alice owns f1, and line L6 enters r into A[carol,f1]A[\text{carol}, \text{f1}]. The command GRANT-READ(carol, alice, f2) does nothing, because carol does not own f2.

What it counts

The model answers two questions of very different cost.

The access decision. For a fixed state, the decision is one membership test. In the word RAM, with the matrix stored as an array of s⋅os \cdot o cells and each cell as a bit mask of rr bits, the test takes O(1)O(1) time and the state takes s⋅o⋅rs \cdot o \cdot r bits. Most cells are empty in practice, so systems store only the nonempty cells, as a sparse matrix does. The cost of the decision then depends on the storage:

storage what one object or subject keeps cost of the decision
full table nothing; one array O(1)O(1)
by column (access control list) each object keeps the list of (s,A[s,o])(s, A[s, o]) with A[s,o]≠∅A[s, o] \ne \emptyset a scan of one list, O(s)O(s); O(1)O(1) expected with a hash table
by row (capability list) each subject keeps the list of (o,A[s,o])(o, A[s, o]) O(1)O(1) when the subject names the entry; O(o)O(o) to search the row
authorization relation the set of triples (s,o,r)(s, o, r) with r∈A[s,o]r \in A[s, o] O(1)O(1) expected with a hash table

The two views make different questions cheap. "Who can use object oo?" is one column, so it is cheap with lists and costs a scan of all rows with capabilities. "What can subject ss use?" is one row, so it is cheap with capabilities and costs a scan of all lists with access lists. Revoking all rights of one subject, or all access to one object, has the same split.

The safety question. Given a set of commands, an initial state Q0Q_0 and a right rr, is there a sequence of commands that enters rr into a cell of the matrix that did not hold rr before? HRU call a state where some command does this a leak of rr, and Q0Q_0 is unsafe for rr if a leak is reachable from it. This page uses the plain form, where every subject of Q0Q_0 counts. HRU also discuss the form where the subjects that are trusted to pass rights are removed first, because those subjects leak rights by design. In the example, with the two commands above, the state is unsafe for r, because GRANT-READ(alice, carol, f1) leaks it. It is also unsafe for w in the plain form, because CREATE-FILE enters w into the new cell of the new file. This shows how coarse the plain question is. The question a defender asks, "can carol ever get w on f2?", has the answer no: line L6 enters only r, and line L4 enters w only into the column of a file that the command creates. The number of states over fixed sets SS and OO is 2sor2^{s o r}, which is 227=1342177282^{27} = 134217728 for the example; when commands can create subjects and objects, the set of reachable states can be infinite.

Relation to other models

Known results in the model

  • Decision. For a fixed stored state the access decision is a lookup, in O(1)O(1) time in the word RAM with a full table.
  • General safety is undecidable. HRU (1976) proved that the safety question is undecidable for arbitrary command sets, by a reduction from the halting problem of a Turing machine: the matrix holds the tape on its diagonal and each command does one move. See HRU safety undecidability.
  • Mono-operational systems. When each command has one primitive operation, safety is decidable, and HRU showed that it is NP-complete. Tripunitara and Li (2013) found an error in the proof that the problem is in NP and gave a corrected proof.
  • Monotonic systems. Harrison and Ruzzo (1978) showed that safety stays undecidable when no command deletes a right or destroys a subject or object, and stays undecidable for monotonic systems with conditions of two tests. With one test per condition, the monotonic case is decidable.
  • Take-Grant. In the Take-Grant model, safety is decidable in time linear in the size of the graph (Jones, Lipton and Snyder 1976; Lipton and Snyder 1977).
  • Storage is exact. Both the set of access lists and the set of capability lists determine the matrix, and the matrix determines both. The proofs are on the access control list and capability list pages, and their code checks the two views against the matrix by brute force.

References

  1. Butler W. Lampson, Protection, Proceedings of the 5th Princeton Conference on Information Sciences and Systems, 1971, reprinted in ACM SIGOPS Operating Systems Review 8(1), 1974, pages 18 to 24 of the reprint (domains, objects, the access matrix, and its storage by rows as capability lists and by columns as access lists)
  2. G. Scott Graham and Peter J. Denning, Protection, principles and practice, AFIPS Spring Joint Computer Conference, 1972, pages 417 to 429 (the protection rules with the owner and control rights and the copy flag, and the storage of the matrix)
  3. Michael A. Harrison, Walter L. Ruzzo and Jeffrey D. Ullman, Protection in operating systems, Communications of the ACM 19(8), 1976, pages 461 to 471 (commands with conditions and primitive operations, the safety question, its undecidability, and the mono-operational case)
  4. Mahesh V. Tripunitara and Ninghui Li, The foundational work of Harrison-Ruzzo-Ullman revisited, IEEE Transactions on Dependable and Secure Computing 10(1), 2013, pages 28 to 39 (the error in the proof that mono-operational safety is in NP, and a corrected proof)
  5. Michael A. Harrison and Walter L. Ruzzo, Monotonic protection systems, in R. A. DeMillo, D. P. Dobkin, A. K. Jones and R. J. Lipton (editors), Foundations of Secure Computation, Academic Press, 1978, the undecidability of safety for monotonic systems with two tests per condition, and its decidability with one test
  6. Richard J. Lipton and Lawrence Snyder, A linear time algorithm for deciding subject security, Journal of the ACM 24(3), 1977, pages 455 to 464 (safety in the Take-Grant model in linear time)
  7. Matt Bishop, Computer Security: Art and Science, second edition, Addison-Wesley, 2018, ISBN 9780321712332, Chapter 2 (the access control matrix, protection state transitions and copying, owning and attenuation of privilege) and Chapter 3 (the foundational results on safety)

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/95ERZP/text.yaml