Full name: Flux Advanced Security Kernel.
What it is
Flask is a security architecture for operating systems: a plan for where security decisions are made and where they are enforced. Ray Spencer, Stephen Smalley, Peter Loscocco, Mike Hibler, David Andersen and Jay Lepreau published it in 1999. One component, the security server, makes every access decision from a replaceable security policy. The components that provide services, such as files or message channels, enforce those decisions and keep a cache of them. Flask aims to support many different policies, including policies that change and must withdraw access already granted.
Basis of this account
This account rests on the paper “The Flask Security Architecture: System Support for Diverse Security Policies”, in the proceedings of the 8th USENIX Security Symposium, Washington, D.C., 23 to 26 August 1999. USENIX is the name of the Advanced Computing Systems Association, which hosts the paper (https://www.usenix.org/legacy/events/sec99/full_papers/spencer/spencer.pdf). Ray Spencer was at Secure Computing Corporation, Stephen Smalley and Peter Loscocco at the National Security Agency (NSA) of the United States, and the other three authors at the University of Utah. The name stands for Flux Advanced Security Kernel, after the Flux research group at Utah; the paper does not spell it out, and the expansion is the title of the project’s page at Utah.
The abstract, Sections 1 and 2, Sections 5.4 and 5.5 and Section 6.2 were read in full. Sections 3 to 5.3 and Section 6.1 were read in part, and the appendix on the individual servers was not read. The paper places the detailed message protocol for policy changes in a report of Secure Computing Corporation, which was not read either. Nothing was run or measured for this account.
What the paper claims
The authors make these claims.
Three requirements. A system supports a wide range of security policies, which the authors call policy flexibility, only if it controls the propagation of access rights, enforces fine-grained access rights and supports the revocation of access rights granted earlier. Earlier systems, they state, lack at least one of the three.
Revocation is the hardest. A revocation must reach migrated permissions: permissions that, once granted, have been recorded in other state. The paper’s first example is Unix, which checks write permission when a file is opened and records the result in the open-file description, the kernel’s record of that open file; revoking write access then stops only future opens. The paper lists further places a permission migrates to: capabilities (unforgeable references that carry access rights), access rights in page tables (the tables that tell the hardware which memory a program may use), open IPC §19.5.5 (interprocess communication) connections, and operations in progress.
Operations in progress. A revocation can abort an operation that already passed its check, restart it so that the check runs again, or wait for it to finish. The authors call only the first two safe in general. Waiting is acceptable only when the operation cannot block the revocation indefinitely, because a blocked revocation is in effect a denied revocation.
Consistency and effective atomicity §8.3. The policy is consulted for every security decision, and the cache of decisions “ensures a consistent view of policy decisions”. With the protocol described below, a policy change takes effect at a point that the security server can determine for every affected component.
Low cost. Caching §14.20 decisions inside the enforcing components almost removes the cost of the checks. On the most common message path of their prototype they measure a worst case of 2% (50 machine cycles).
Generality. The prototype is an operating system built on a microkernel §19.5.4, a minimal kernel that runs most services as separate programs, but the authors state that the security mechanisms do not depend on a microkernel and generalize beyond it.
How it works
The architecture has these parts.
Security server: holds the policy and computes three kinds of decision. Access decisions say whether a subject, an active party such as a process, holds a permission on an object. Labeling decisions say which security attributes a new object gets. Polyinstantiation decisions say which of several separate copies of a shared resource, such as a temporary directory, a subject may use.
Object managers: the components that provide objects and services. In the prototype these include the microkernel, a file server, a network server and a process manager. Each object manager asks for decisions and enforces them.
Security context: the set of attributes that the policy assigns to a subject or object, for example a user identity, a classification level, a role and a domain. Object managers treat it as an opaque string, one they store and pass on without interpreting it.
Security identifier (SID): a fixed-size number, a 32-bit integer in the prototype, that the security server maps to a security context. Object managers attach SIDs to objects and use them in queries; knowing a SID grants nothing.
Access vector cache (AVC): a module inside each object manager that stores decisions. An access vector is a set of related permissions for one pair of SIDs; all file permissions, for instance, form one vector. The security server may return more of the vector than was asked for, so that later checks find the answer in the cache.
For a controlled operation, the microkernel gives the object manager the client’s SID together with the request, so the SID comes from the kernel, not from the client’s own claim. The object manager determines the object’s SID and the permission needed, and asks its AVC about the triple (client SID, object SID, permission). On a miss, the AVC asks the security server and stores the access vector it returns. The object manager then performs the operation or refuses it.
Later standards give these roles names. RFC 2753, a framework for policy-based admission control §19.4.5 in networks [449], and the XACML (eXtensible Access Control Markup Language) standard [450] call the component that decides a policy decision point (PDP), and the component that intercepts a request and applies the decision a policy enforcement point (PEP). XACML adds a policy administration point (PAP), where policies are written and managed. In Flask the security server is the PDP, every object manager is a PEP, and the AVC is a cache of PDP answers kept at the PEP. The paper expects most security servers also to load and change the policy, and requires a security server that offers such an interface to control which subjects may use it, so the administration role sits in the security server as well. This mapping is this account’s; the paper does not use these names.
A policy change is the hard part, because every AVC holds explicit copies of earlier decisions and every object manager may hold implicit copies, the migrated permissions. The paper places two requirements on object managers. Once a change is complete, no operation that needs a revoked permission may run until a later change grants it again. And each object manager completes a change promptly, without being blocked indefinitely by its clients. The change follows a three-step protocol.
The security server notifies every object manager that may have received any part of the changed policy.
Each object manager updates its state. Its AVC updates the cached entries first, then calls the revocation routines that the object manager registered, which revoke migrated permissions.
Each object manager tells the security server that the change is complete. The security server treats the change as done only when every affected object manager has reported.
Sequence numbers order the messages that deliver decisions relative to the messages that announce changes. The last step lets a policy demand an order, for example that certain permissions be revoked before new ones are granted.
In the prototype, complete revocation routines exist only in the microkernel, which updates its AVC and then examines thread and memory state. Two properties of Fluke, the Utah research microkernel from which the prototype was derived, made this simpler: Fluke exports the complete state of a thread promptly, and every kernel operation is atomic or divided into atomic stages, so a permission check and the service it guards happen inside one atomic operation §9.8. The file server revokes permissions recorded in open-file descriptions but cannot interrupt operations in progress.
Worked example
The first part uses the paper’s own measurements, from its Table 3, taken on a 200 megahertz Pentium Pro processor. The operation is a null message round trip between a client and a server, which transfers a minimal 8-byte message and therefore shows the largest relative cost of a check.
Fluke without security checks: 13.5 microseconds.
Flask, decision found in the cache through a hint, a reference to the cache entry stored with the client’s handle for the channel: 13.8 microseconds. That is microseconds more, or .
Flask, decision found by an ordinary cache lookup: 14.4 microseconds, more.
Flask, cache miss, a trivial security server that grants everything without computing: 43.4 microseconds. The added time is microseconds, and , so 221% of the base time is added; the paper prints +221%.
Flask, cache miss, the prototype security server computing a real decision: 82.5 microseconds. The added time is microseconds, and , printed as +511%.
Asking the security server on every check would make this operation about times as slow as without security. That is why the architecture caches decisions, and why it then needs a revocation protocol.
The second part is invented to show the revocation steps. A file server’s AVC says that process P, with SID 7, may read and write file F, with SID 12. P opened F for writing earlier, and the file server recorded write access in P’s open-file description. P is now in the middle of writing 4 MiB to F when an administrator changes the policy so that SID 7 may no longer write to SID 12; the security server numbers this change 42.
The file server’s AVC removes write from the entry (7, 12). A new attempt by P to open F for writing now fails.
P’s writes through its open-file description are not checked against the AVC. The file server’s revocation routine must find that description and remove its write right, or P keeps writing.
The 4 MiB write has already passed its check. The file server aborts it with an error, or restarts it so that the check runs again and fails. Waiting for it to finish is safe only if the write cannot stall.
Only now does the file server report change 42 complete.
One race remains. Just before the change, another object manager asked the security server about (7, 12), and the reply, computed under the old policy, arrives after that manager has processed change 42. If its AVC stored the reply, it would grant write again. A simple rule closes the gap: tag each reply with the number of the latest change it reflects, here 41, and refuse to cache a reply whose number is lower than the latest change already processed, here 42. The paper says that sequence numbers handle this kind of interleaving and leaves the details to its companion report; the rule here is an illustration.
What this account does not establish
The evidence is one research prototype, measured in 1999. The paper reports the cost of revocation only for the most expensive microkernel case, revoking message connections: 1.55 milliseconds with one connection and 1.65 milliseconds with 16, mostly spent stopping all threads in the system. The authors state that the speed of policy changes was not a major consideration.
Revocation is complete only in the microkernel. The paper states that the file server cannot interrupt operations in progress. The architecture states what each object manager must do; the paper does not show that every object manager does it.
Flask does not establish complete mediation §1.16, the requirement that every access to a protected object is checked. The authors note that flexibility depends on the completeness of the set of controlled operations and on how much of the system state the policy can see. Choosing the controlled operations is left to the designer of each object manager.
Effective atomicity rests on timeliness: object managers cannot be blocked indefinitely by their clients, the microkernel delivers messages between the security server and object managers promptly, and the scheduler gives object managers processor time. A component that breaks one of these delays the point at which a change takes effect.
Flask controls how decisions are cached and withdrawn. It does not judge the policy: a wrong policy is enforced faithfully.
SELinux (Security-Enhanced Linux), released later by the NSA, implements the Flask architecture in Linux; the Linux Security Modules §21.14 paper of 2002 calls it a Linux implementation of Flask [217]. This account says nothing about how SELinux handles revocation.
Questions answered
Why is revocation harder with cached decisions?
Revocation is harder with cached decisions because each cached decision is a copy of the policy’s answer that keeps saying allow after the policy has changed, and the component that changed the policy cannot erase that copy on its own. The component that decides, the decision point, changes its rules; every component that enforces, an enforcement point, keeps acting on what it stored. The Flask paper of Spencer and colleagues (1999) names three forms of copy:
entries in a decision cache;
migrated permissions, rights recorded in other state when they were checked, such as the write right that Unix records in an open-file description when a file is opened, an entry in a page table, or an open message connection;
operations in progress that have already passed their check.
Withdrawing access therefore needs a protocol, not only an update of the stored policy.
The decision point notifies every enforcement point that may hold part of the changed policy.
Each enforcement point performs its cache invalidation §14.21, revokes the migrated permissions, and aborts or restarts the affected operations in progress; waiting for them is safe only if they cannot stall.
Each enforcement point confirms, and the change counts as effective only when all have confirmed.
Answers computed under the old policy that arrive late are recognized, for example by sequence numbers, and are not cached.
Without a cache, every check would consult the current policy, but Flask’s measurements show the price: a minimal message round trip took 82.5 microseconds when the security server computed each decision, against 13.8 to 14.4 microseconds when the decision was already in the cache.
Related entries: Key revocation (§5.32), Policy versus mechanism (§1.19), Reference monitor (§1.17), Complete mediation (§1.16), Cache invalidation (§14.21), Capability security (§1.40), Hydra: policy flexibility above protected mechanisms (§21.13), Linux Security Modules: an enforcement-hook framework (§21.14). Further reading: [215, 217, 449, 450].