Patterns and Pattern Diagrams For Access Control
Patterns and Pattern Diagrams For Access Control
Introduction
The development of secure systems requires that security be considered at all stages
of design, so as to not only satisfy their functional specifications but also satisfy
security requirements. Several methodologies that apply security at all stages have
been proposed [1], [2], [3]. Some of these methodologies start from use cases and
from them a conceptual model is developed. Security constraints are then defined in
the conceptual model. To do this we need high-level models that represent the
security policies that constrain applications. One of the most fundamental aspects of
security is access control.
Although there are only a few basic access control models, many varieties of them
have been proposed. It is confusing for a software developer to select an appropriate
model for her application. Access control models generally represent a few types of
security policies, e.g. rights are assigned to roles, and provide a formalization of
these policies using some ad hoc notation. Four basic access control models are
commonly used and they may be extended to include content and context-based
access control, delegation of rights, hierarchical structuring of subjects (including
roles), objects, or access types [4], temporal constraints, etc. Access control models
can be defined for different architectural levels, including application, database
systems, operating systems, and firewalls [5]. Some of them apply to any type of
systems while some are specialized, e.g. for distributed systems.
Access control models fall into two basic categories: Mandatory Access Control
(MAC), where users rights are defined by administrators and data may be labeled to
indicate its sensitivity, and Discretionary Access Control (DAC), where users may
administer the data items they create and own. In a MAC model, users and data are
classified by administrators and the system applies a set of built-in rules that users
cannot circumvent. In a DAC model, there is no clear separation of use and
administration; users can be owners of the data they create and act as their
administrators. Orthogonal to this classification, there are several models for access
control to information that differ on how they define and enforce their policies [6],
[7]. The most common are:
The Multilevel model organizes the data using security levels. This model is
usually implemented as a mandatory model where its entities are labeled
indicating their levels. This model is able to reach a high degree of security,
although it can be too rigid for some applications. Usually, it is not possible to
structure the variety of entities involved in complex applications into strictly
hierarchical structures.
The Access Matrix describes access by subjects (actors, entities) to protected
objects (data/resources) in specific ways (access types) [8], [6], [7]. It is more
flexible than the multilevel model and it can be made even more flexible and
precise using predicates and other extensions. However, it is intrinsically a
discretionary model in which users own the data objects and may grant access to
other subjects. It is not clear who owns the medical or financial information and
the discretionary property reduces security. This model is usually implemented
using Access Control Lists (lists of the subjects that can access a given object) or
Capabilities (tickets that allow a process to access some objects).
Role-Based Access Control (RBAC), collects users into roles based on their tasks
or functions and assigns rights to each role [9]. Some of these models, e.g. [10],
[11], have their roles structured as hierarchies, which may simplify administration.
RBAC has been extended and combined in many ways.
Attribute-Based Access Control (ABAC). This model controls access based on
properties (attributes) of subjects or objects. It is used in environments where
subjects may not be pre-registered [12].
While these basic models may be useful for specific domains or applications, they
are not flexible enough for the full range of policies present in some of these
applications [5], [4]. This is manifested in the large variety of ad hoc RBAC
variations that have been proposed; most of which add specialized policies to a basic
RBAC model. For example, some models have added content or context-dependent
access [13], delegation [14], task-based access [15], and relationships between role
entities [16]. All these models effectively incorporate a set of built-in access control
policies and cannot handle situations not considered by these policies, which means
that a complex system may need several of these models for specific users or
divisions.
All these models present a bewildering set of options to the designer, who has
problems deciding which model to use. The result in practice is that only basic models
are used and the power of more advanced models is thus lost. We try to clarify this
panorama here through the use of patterns. In particular, we use pattern diagrams to
navigate the pattern space. A pattern diagram shows relationships between patterns
Access control models have two aspects: a definition of a set of rules specifying the
valid accesses (some of them may be implied by other rules), and an enforcement
mechanism that intercepts access requests from users or processes and determines if
the request is valid. The main difference between models is on the way they define
their rules, so it makes sense to separate the patterns for enforcement mechanisms;
that is, we should provide separate patterns for rules and for enforcement
mechanisms. Typically, there is much less variety in the enforcement mechanism: it
intercepts requests and makes a decision based on the rules. As an illustration of how
pattern diagrams can put models in perspective, Figure 1 shows some variations of
access control models. One of the first access control models was the access matrix.
The basic access matrix [7] included the tuple {s,o,t}, where s indicates a subject or
active entity, o is the protected object or resource, and t indicates the type of access
permitted. [8] proved security properties of this model using the so-called HRU
(Harrison-Ruzzo-Ullman) model. In that model users are allowed to delegate their
rights (discretionary property, delegatable authorization), implying a tuple {s,o,t,f},
where f is a Boolean copy flag indicating if the right is allowed to be delegated or not.
A predicate was added later to the basic rule to allow content-based authorization
[20], becoming {s,o,t,p,f}, where p is the predicate (the predicate could also include
environment variables). Patterns for the basic rule and for the one with tuple
{s,o,t,p,f} were given in [21], [17]. The rule could also include the concept of
Authorizer (a), becoming {a,s,o,t,p,f} [22] (Explicitly Granted Authorization). RBAC
[9] can be considered a special interpretation of the basic authorization model, where
subjects are roles instead of individual users. We presented two varieties of RBAC
patterns in [21] and [17]. We combined it with sessions in [23] (The double-lined
patterns of Figure 1). Several variations and extensions of these models have
appeared. We presented a variation called Metadata-Based Access Control, which
later we renamed Attribute-Based Access Control (ABAC) [12].
Figure 1 assumed that we started from some known models. Figure 2 starts from
the basic components of access control to provide a more general approach to
developing access control models (we did not show the labels of the links for
simplicity). This diagram can be the starting point that allows a designer to select the
type of access control he needs in his application. Once this abstract level is clear, we
need to go to a software-oriented level where we can choose more specific
approaches. The center of this diagram is Policy-Based Access Control (PABC)
which indicates that the rules represent access policies, which are in turn defined by a
Policy pattern. The Policy-Based Access Control pattern decides if a subject is
authorized to access an object according to policies defined in a central policy
repository. The enforcement of these policies is defined by a Reference Monitor
pattern. Depending on its administration, PABC can be MAC or DAC. XACML is a
type of PBAC oriented SOA [24], shown here as two patterns for its aspects of rule
definition and evaluation. Policies can be implemented as Access Control Lists
(ACLs) or Capabilities. The NIST pattern is a variety of RBAC discussed in Section
4. The reference Monitor may use a Policy Enforcement Point (PEP), a Policy
Definition Point (PDP), and other patterns to describe the administrative structure of
enforcement [24]. The Access Matrix can be extended with predicates or a copy flag
and both can be used in another variation of this model.
Basic
Authorization
CopyFlag
condition
Content-based
Authorization
=Role
or =attribute values
Delegatable
Authorization
Basic
RBAC
authorizer
ABAC
session
Session-based
RBAC
Explicitly
Granted
Authorization
session
session
Access Session
session
Session-based
ABAC
Levels of abstraction
Models and their patterns may correspond to different abstraction levels; for example,
the concept of session is a concept at a lower level than RBAC because it indicates an
abstract mechanism to restrict the concurrent use of some rights (which may produce
conflicts of interest). It is possible to make explicit in the pattern diagram the
abstraction level of the patterns Figure 3 shows these levels explicitly, showing the
Policy Model, Policy Rule,and reference Monitor at the highest level, while PBAC
and the Session-Based Reference Monitor are more implementation-oriented. Many
times we do not emphasize this separation; however, when we deal with different
architectural levels this separation is important; for example, the implementation of
access control at the file system level is quite different from authorization rules at the
application level. Figure 3 also shows how some of the patterns of Figure 1 could
have been found starting from the components of Figure 2: We can define a SessionBased Reference Monitor that requires the concept of Access Session to delimit the
rights of the user. This figure also emphasizes the separation of Policy Model and
Policy Rules, not shown in Figure 2.
XACML
Evaluator
XACML
Policy
MAC
Policy-based
Access Control
Policy
ACL
DAC
Ref.Monitor
Cap
Access
Matrix
Predicate
Access matrix
RBAC
Copy Flag
Access matrix
ABAC
Session
Predicate +
copy flag
access matrix
NIST
AC model
Policy
Rule
rule
structure
Reference
Monitor
enforces
specializes
Policy-Based
Access Control
Session-Based
Reference Monitor
session
Access
Session
Lets consider a financial application. The threats to this system have been identified
and indicate that we need access control for classes Account, Transaction, and
Customer. The designer refers to a diagram such as Figure 2 and starts by choosing
PBAC because we need to apply banking policies to control access; for example, the
owner of the account has the right to deposit and withdraw money from the account.
The designer then chooses the Access Matrix model because access to accounts is
given to individuals, not roles. As owners should only access their own accounts, we
need predicates in the Access Matrix. Later, when the software architecture is
defined, the designer decides to use web services, because ATMs and branch offices
make this application highly distributed. Since any PBAC can be implemented using
XACML, the designer implements a Predicate Access Matrix using XACML.
To apply this design approach we need good pattern catalogs. In this and the next
section we see two approaches to develop catalogs. Each pattern can be augmented
with new features to produce a new model with larger functionality. Figure 4 shows
the basic RBAC pattern, where users are assigned to roles and roles are given rights.
The National Institute of Standards and Technology (NIST) RBAC pattern follows
the NIST standard [21] and allows access to resources based on the role of the subject
and adds several functions to the basic model. The NIST standard also adds a linear
role hierarchy. A subject may have several roles. Each role collects the rights that a
user can activate at a given moment (execution context), while a session controls the
way of using roles and can enforce role exclusion at execution time. Strictly, the
NIST standard allows only linear role hierarchies, while Figure 5 shows recursive
hierarchies (described by the Composite pattern [19]). Figure 5 shows also
object/resource recursive hierarchies. Similarly, we can separate administrative roles
and rights and give roles to groups of users for example. The idea is that new
functions require only adding more classes and their corresponding associations. In
fact, the pattern chains in the models of Figures 1 and 2 can be obtained in this way;
for example, in Figure 2 we added a session to RBAC to obtain an NIST RBAC
pattern.
Combining this idea with architectural levels we can define different variations of
these patterns intended for more specialized uses. For example, [25] shows an RBAC
model where access to objects is performed through views. Specific views carry sets
of rights as in the case of database systems. We can also formalize these models by
adding OCL constraints in each pattern. The constraints may make functionality more
specific, for example, by defining constraints among variables, or may define pre- or
post-conditions for the pattern. As each model is derived from a simpler model, it is
easy for the designer to see the differences and possibilities of each model.
User
id
name
Role
MemberOf
*
* id
name
ProtectionObject
isAuthorizedFor
* id
name
*
Right
accessType
checkRights
User
ProtectionObject
roleID
{Subset}
* M emberO f
addUser
removeUser
objectID
addRo le
removeRo le
addUserToRole
removeUserFro mRole
AuthorizationRule
userID
addObject
removeObject
*
Right
*
1
accessT ype
checkRights
CompositeRole
SimpleRole
WorksOn
CompositeO bject
SimpleO bject
*
Session
*
createSession
endSessio n
Fig. 5. Class model for RBAC with sessions and role/resource hierarchies
Analogy is another way to derive models from existing models [26].A model for
medical records such as the one in Figure 6 represents typical policies used in HIPAA
and other regulations. In particular, this model represents the policies:
A Patient role that has the rights to read his own record and authorize the use of
this record.
A Doctor role showing that a given doctor may act as custodian for a patient
record.
The Medical Record, that includes the constraint that any reading of a record by
persons other than health providers, must be notified to the corresponding patient.
Specific medical records may be associated (linked) with other records to
describe, for example, family relationships and physical contact, needed to trace
genetic or infectious diseases.
If we need a model for the Sarbanes/Oxley regulations, we can make the following
analogies: PatientInvestor; DoctorBroker; HospitalFinancial Institution;
Medical RecordFinancial Record. This leads to Figure 7, which is basically the
same structure although the behavior semantics of some classes may be different.
Doctor
1
Custodian
InChargeOf
MedicalRecord *
Patient
1
name
address
patient number
1..* read
modify
1
<<role>>
Patient
Right
read
authorizeUse
informPatient
Outpatient
Inpatient
*
TreatmentHistory
medications
procedures
Conclusions
We have tried to unify the many access control model varieties by using patterns. We
believe that this perspective can help developers to align their needs with the selection
of appropriate access control models. The selected access control pattern not only
guides the conceptual security of the application but later it also guides the actual
implementation of the model.
We can navigate the pattern diagram because (as shown in Section 4) patterns are
composable with features, i.e. adding a feature (perhaps embodied by another pattern)
produces a new pattern with extra features. If we have a pattern diagram we can
navigate in it to find an appropriate pattern
Using this approach we can not only clarify the relationships of access control
models but it has led us also to discover the need for new security patterns: Subject,
Object, Labeled Security, DAC, MAC. Access control patterns give us also the
possibility of evaluating commercial products: we can see if the product contains the
corresponding pattern in its design.
for own Investor
FinancialInstitution
Right
read
invest
<<role>>
Broker
Relation
InChargeOf
1
Custodian
name
address
ID number
captureInfo
exchangeInfo
FinancialRecord
*
*
1..*
1..*
read
<<role>>
invest
Investor
Investor
name
address
ID number
notify Investor
Right
read
authorizeUse
contact Investor
for own Record
*
FinancialAccount
account number
References
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
10
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.