dclabel-eci11-0.1: Dynamic labels to assign confidentiality and integrity levels in scenarios of mutual distrust

DCLabel.Trustworthy

Description

This module implements Disjunction Category labels.

A label consists on conjunctions of disjunctions of principals. Labels can be simply created by using the function singleton (it creates a label with only one principal). Functions '(.\/.)' and '(./\.)' create disjunction and conjunction of principals, respectively. To illustrate the use of this functions, we have the following examples.

>>> singleton "Alice"
[ Alice ]
>>> "Alice" .\/. "Bob"
[ Alice \/ Bob ]
>>> "Alice" .\/. ("Bob" ./\. "Carla")
[ Alice \/ Bob ] /\ [ Alice \/ Carla ]

A DCLabel is simple two labels, one for confidentiality (secrecy) and another one for integrity (integrity). DCLabels are created by function newDC, where the first argument is for secrecy and the second one for integrity.

>>> newDC (singleton "Alice") ("Bob" .\/. "Alice")
S=[ Alice ] I=[ Bob \/ Alice ]

Given two DCLabel it is possible to precisely compute the join and the meet by calling functions join and meet, respectively.

>>> join ( newDC (singleton "Alice") (singleton "Carla") ) (  newDC (singleton "Bob") (emptyLabel) )
S=[ Alice ] /\ [ Bob ] I=True
>>> meet ( newDC (singleton "Alice") (singleton "Bob") ) (  newDC (singleton "Carla") (singleton "Carla") )
S=[ Alice \/ Carla ] I=[ Bob ] /\ [ Carla ]

It is possible to compare if a DCLabel is more restrictive than another one by calling the function canflowto. For instance,

>>> canflowto ( newDC (singleton "Bob") (emptyLabel) ) (newDC ("Alice" ./\. "Bob") (singleton "Carla"))
False
>>> canflowto ( newDC (singleton "Bob") (singleton "Carla") ) (newDC ("Alice" ./\. "Bob") (emptyLabel))
True

Synopsis

Documentation

class Ord a => Lattice a whereSource

Methods

top :: aSource

bottom :: aSource

canflowto :: a -> a -> BoolSource

join :: a -> a -> aSource

meet :: a -> a -> aSource

Instances

Ord a => Lattice (DCLabel a)

It defines that DCLabel are elements of a lattice.

principal :: String -> PrincipalSource

It generates a principal from an string.

isPrincipal :: Principal -> Label Principal -> BoolSource

It checks that a principal appears in a label.

labelToList :: Label Principal -> [[Principal]]Source

It converts a label into a list.

singleton :: Singleton a b => a -> Label bSource

It creates a singleton label, i.e. a label with only one principal.

data DCLabel a Source

It represents disjunction category labels

Instances

Ord a => Eq (DCLabel a) 
Ord a => Ord (DCLabel a) 
Show a => Show (DCLabel a) 
Arbitrary a => Arbitrary (DCLabel a) 
Ord a => Lattice (DCLabel a)

It defines that DCLabel are elements of a lattice.

integrityDC :: DCLabel Principal -> Label PrincipalSource

It extracts the label corresponding to the integrity component of a DCLabel

secrecyDC :: DCLabel Principal -> Label PrincipalSource

It extracts the label corresponding to the secrecy component of a DCLabel

data Priv a Source

It represents privilege.

Instances

Ord a => Eq (Priv a) 
Show a => Show (Priv a) 

canflowto_p :: Lattice (DCLabel a) => Priv a -> DCLabel a -> DCLabel a -> BoolSource

It checks if a DCLabel can flow to another DCLabel given some privilege.

own :: Ord a => Priv a -> DCLabel a -> BoolSource

It creates a DCLabel based on two labels.

It checks if a privilege is owned

privToLabel :: Priv a -> DCLabel aSource

It returns the privilege in the form of a label.

createPriv :: DCLabel a -> Priv aSource

It creates privileges. This functions must be used only by trustworthy code.