Algorithm Search⌘K

Theoremadvanced

Execution monitors enforce only safety properties

Also called EM-enforceable policies theorem.

Every policy that an execution monitor can enforce is a safety property. The converse fails, and policies such as availability or noninterference need other mechanisms.

The theorem of Schneider (2000) says what a run-time monitor cannot do. A monitor that watches one run of a program, action by action, and whose only power is to stop the program, can enforce only policies that are safety properties: a run is bad exactly when some finite prefix of it is already bad. The condition is necessary, not sufficient: some safety properties cannot be enforced by any monitor that is a program, because deciding when to stop would decide the halting problem. Policies such as availability (a liveness property) and noninterference (a hyperproperty) are not safety properties, so they need static analysis, program rewriting or monitors with more power.

Statement

Setting. Let Ψ\Psi be a countable set of actions. An execution is a finite or infinite sequence over Ψ\Psi. Write Ψ∞\Psi^\infty for the set of all executions and, for an execution σ\sigma, write σ[..i]\sigma[..i] for its prefix of length ii (so σ[..0]\sigma[..0] is the empty sequence ε\varepsilon). A target is described by the set Σ⊆Ψ∞\Sigma \subseteq \Psi^\infty of its possible executions. A security policy is a predicate PP on sets of executions; the target satisfies PP when P(Σ)P(\Sigma) holds.

  • PP is a property if there is a predicate P^\hat P on single executions with P(Σ)  ⟺  ∀σ∈Σ:P^(σ)P(\Sigma) \iff \forall \sigma \in \Sigma : \hat P(\sigma), for every Σ\Sigma.
  • A property is a safety property if every execution that breaks it has a finite prefix after which nothing can repair it: for every σ\sigma with ¬P^(σ)\neg \hat P(\sigma) there is an ii such that ¬P^(σ[..i] τ)\neg \hat P(\sigma[..i]\,\tau) for every τ∈Ψ∞\tau \in \Psi^\infty.

Execution monitor. An execution monitor is a function MM from finite sequences to {ok,stop}\{\text{ok}, \text{stop}\}. It is applied to the target as follows: before the action σi\sigma_{i} runs, the monitor sees the prefix σ[..i]\sigma[..i] (the actions so far and the next one) and, if M(σ[..i])=stopM(\sigma[..i]) = \text{stop}, it ends the execution so that σi\sigma_i does not run. The monitor lets σ\sigma run in full when M(σ[..i])=okM(\sigma[..i]) = \text{ok} for every finite prefix σ[..i]\sigma[..i], including ε\varepsilon. These are the three hypotheses of the model:

  1. the monitor sees only the current execution, and only the part of it that has happened or is about to happen;
  2. its only intervention is to stop the target before an action;
  3. a policy PP is EM-enforceable if some monitor MM satisfies, for every set Σ⊆Ψ∞\Sigma \subseteq \Psi^\infty: P(Σ)P(\Sigma) holds if and only if MM lets every execution of Σ\Sigma run in full.

Hypothesis 3 asks that the monitor stop exactly the executions of targets that break the policy. The adversary is an arbitrary target: Σ\Sigma ranges over all sets of executions, so the target may produce any sequence of actions.

Theorem (Schneider 2000). Every EM-enforceable policy is a safety property.

In plain words

A monitor that can only watch and stop must make up its mind at some moment, from what it has seen so far. If it stops a run, that run must already be bad, whatever would have come next, because the monitor cannot wait to see the rest. And it decides each run on its own, so the policy cannot be about how runs compare with each other. Policies with both features are exactly the safety properties: "nothing bad ever happens", where a bad thing is something you can point at in a finite piece of the run. "Something good eventually happens" is not of this kind, because no finite piece shows that it will not happen later.

Proof

Let MM be a monitor that enforces PP in the sense of hypothesis 3. Define the predicate on single executions

P^(σ)  ⟺  M(σ[..i])=ok for every finite prefix σ[..i] of σ,\hat P(\sigma) \iff M(\sigma[..i]) = \text{ok for every finite prefix } \sigma[..i] \text{ of } \sigma,

that is, P^(σ)\hat P(\sigma) holds when the monitor lets σ\sigma run in full.

PP is a property. Take any Σ\Sigma. By hypothesis 3, P(Σ)P(\Sigma) holds if and only if MM lets every execution of Σ\Sigma run in full, that is, if and only if P^(σ)\hat P(\sigma) for every σ∈Σ\sigma \in \Sigma. This is the definition of a property with predicate P^\hat P. (In particular P^(σ)  ⟺  P({σ})\hat P(\sigma) \iff P(\{\sigma\}), so P^\hat P is fixed by PP alone.)

P^\hat P is a safety property. Let ¬P^(σ)\neg \hat P(\sigma). Then some finite prefix has M(σ[..i])=stopM(\sigma[..i]) = \text{stop}. Take any τ∈Ψ∞\tau \in \Psi^\infty and the execution ρ=σ[..i] τ\rho = \sigma[..i]\,\tau. The prefix of ρ\rho of length ii is σ[..i]\sigma[..i], so M(ρ[..i])=stopM(\rho[..i]) = \text{stop} and ¬P^(ρ)\neg \hat P(\rho). So the prefix σ[..i]\sigma[..i] cannot be repaired by any continuation, which is the definition of safety. ■\blacksquare

The proof uses each hypothesis once. Hypothesis 1 makes the decision a function of the prefix, which gives the second part. Hypothesis 3 over all sets Σ\Sigma, including singletons, gives the first part. Hypothesis 2 is what makes "stop" final: a monitor that could take back a decision, or replace an action, would not fit the definition of MM.

Consequences

  • Liveness and availability are out. A liveness property has the feature that every finite sequence can be extended to an execution in the property (Alpern and Schneider 1985). If such a property is also a safety property, every execution is in it, so it is trivial. Hence no non-trivial liveness property is EM-enforceable. "Every request is eventually served" and "the service stays available" are of this kind. A bound such as "every request is served within 100 steps" is a safety property and is enforceable, since a run that breaks it does so at a finite step.
  • Noninterference is out. Noninterference compares runs. Take runs with a secret input hh and a public output: the set with the single run "h=0h = 0, output 0" satisfies noninterference, and so does the set with the single run "h=1h = 1, output 1", since there is nothing to compare. Their union does not. A property holds on a union when it holds on each part, so noninterference is not a property and no execution monitor enforces it. Monitors for information flow, such as no-sensitive-upgrade, therefore enforce a stronger safety property and also stop some secure runs; this is a consequence of the theorem, not a design flaw of one monitor.
  • What monitors are good for. Access control decisions, the Chinese wall policy, "no send after a file read", bounds on resources and the protocols of an interface ("open before read") are safety properties, written as security automata. An inline reference monitor enforces them by putting the automaton inside the program.
  • Where to go beyond. Static analysis can enforce policies that depend on all runs, such as noninterference via security type systems or self-composition. Monitors that can suppress or insert actions (edit automata) enforce some non-safety policies. Program rewriting is the strongest of the three in the classification of Hamlen, Morrisett and Schneider.

Tightness

The converse is false for computable monitors. A monitor is a program, so MM must be computable. Let the actions be the natural numbers, read as codes ⟨T,x⟩\langle T, x \rangle of a Turing machine TT and an input xx. Let P^(σ)\hat P(\sigma) say: no action of σ\sigma is the code of a pair such that TT halts on xx. This is a safety property: a bad execution contains a bad action at a finite position, and every extension keeps that action. Suppose a computable monitor MM enforced it. Hypothesis 3 on the one-action execution ⟨T,x⟩\langle T, x \rangle says that MM stops it if and only if TT halts on xx, so the program "run MM on ε\varepsilon and on the one-action sequence ⟨T,x⟩\langle T, x \rangle" decides the halting problem, which is impossible. So this safety property is not EM-enforceable by any computable monitor. Hamlen, Morrisett and Schneider (2006) make this gap precise: with the computability constraint, every EM-enforceable policy is a co-recursively enumerable safety property, and some safety properties of that kind are still not enforceable.

The converse is true without computability. If MM may be any function, every safety property P^\hat P is EM-enforceable. Let M(τ)=stopM(\tau) = \text{stop} exactly when no execution in P^\hat P has τ\tau as a prefix. If P^(σ)\hat P(\sigma), every prefix of σ\sigma is a prefix of a member (namely σ\sigma), so the monitor lets σ\sigma run in full. If ¬P^(σ)\neg \hat P(\sigma), safety gives a prefix σ[..i]\sigma[..i] none of whose extensions is in P^\hat P, so M(σ[..i])=stopM(\sigma[..i]) = \text{stop}. This is the same construction as the automaton of prefixes on the security automaton page. So, as a statement about the information a monitor has, the theorem is tight: safety is exactly what a run-by-run, stop-only observer can enforce, and computability is the only further loss.

The hypotheses matter. Drop hypothesis 2 and the class grows: edit automata (Ligatti, Bauer and Walker) enforce some properties that are not safety properties. Drop hypothesis 1 and let the monitor see all runs, and the mechanism becomes a static analysis. Weaken hypothesis 3 so that the monitor may also stop some good runs, and the policy actually enforced is a safety property that implies PP, as in the information flow monitors above.

History

The words safety and liveness for "nothing bad happens" and "something good eventually happens" go back to Lamport's work on concurrent programs in 1977. Alpern and Schneider gave the formal definitions in 1985 and proved that every property is the intersection of a safety property and a liveness property. Schneider's paper of 2000 defined the class EM of enforcement mechanisms that monitor a target and stop it, introduced security automata to describe the policies they enforce, and showed that an EM-enforceable policy must be a safety property; he noted that the condition is necessary and not sufficient. Viswanathan's thesis and the paper of Hamlen, Morrisett and Schneider (2006) added the computability constraint and compared monitors with static analysis and program rewriting. Ligatti, Bauer and Walker (2005, 2009) studied monitors that edit the action stream. Clarkson and Schneider (2010) placed noninterference among the hyperproperties, which explains in general why no monitor of single runs enforces it.

References

  1. Fred B. Schneider, Enforceable security policies, ACM Transactions on Information and System Security 3(1), 2000, pp. 30 to 50, the definitions of security policy, property and execution monitoring, the conditions that an EM-enforceable policy must meet, and the conclusion that it is a safety property
  2. Bowen Alpern and Fred B. Schneider, Defining liveness, Information Processing Letters 21(4), 1985, pp. 181 to 185, the formal definitions of safety and liveness and the theorem that every property is the intersection of a safety property and a liveness property
  3. Kevin W. Hamlen, Greg Morrisett and Fred B. Schneider, Computability classes for enforcement mechanisms, ACM Transactions on Programming Languages and Systems 28(1), 2006, pp. 175 to 205, the computability constraint on monitors, the gap between safety and EM-enforceability, and the classes of statically enforceable and rewriting-enforceable policies
  4. Jay Ligatti, Lujo Bauer and David Walker, Edit automata, enforcement mechanisms for run-time security policies, International Journal of Information Security 4(1-2), 2005, pp. 2 to 16, monitors that insert and suppress actions and the policies they enforce
  5. Michael R. Clarkson and Fred B. Schneider, Hyperproperties, Journal of Computer Security 18(6), 2010, pp. 1157 to 1210, security policies as sets of sets of traces, and noninterference as a hyperproperty that is not a property

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/APF8E3/text.yaml