Generation of Role Based Access Control Security Policies for Java Collaborative Applications
Generation of Role Based Access Control Security Policies for Java Collaborative Applications
Abstract—Java collaborative applications are increasingly and In current Java virtual machines, different security tools
widely used in the form of applets or servlets, as a way to easily are provided [1-3]. This paper will use the Java
download and execute small programs on one’s computer. Authentication and Authorization Service (JAAS) module.
However, security associated with these downloaded Even though this module provides numerous facilities to
applications, even if it exists, is not easily manageable. Most of control the executed code, this work will show that the use of
the time, it relies on the user's ability to define a security policy JAAS is difficult in real collaborative systems.
for his virtual machine, which is undesirable. This paper This paper is organized as follows. In the next
proposes to integrate an RBAC mechanism for any Java subsections, we discuss key ideas necessary for the solution
application. It introduces a simple tag process that allows the
design as well as objectives of this work. Section 2 outlines
developer to incorporate the appropriate policy in the source
the design and implementation of the RBAC based solution.
code of his application. The user is endowed with the ability to
choose a role that corresponds to the required level of trust Section 3 presents the details of how to adapt the solution for
required in order for him to embed the policy in the executed collaborative environments and applications. A case study
code. A case study of a collaborative application shows how that demonstrates how the implementation will work and
works the proposed API for managing roles, generating what happens in case of permission violation attempts is
policies and logging in. At the end, a discussion about the described in Section 4. Before concluding the paper in
dynamic enforcement of the generated policies is presented. Section 6, we address another important aspect of code
security: how to dynamically enforce security policies to
Keywords—RBAC; java; collaborative applications limit unnecessary permissions and thus increase application
security.
I. INTRODUCTION A. RBAC Access Management
The Role Based Access Control (RBAC) model [4] is
This paper deals with the security of a Java application widely used to enforce security between users and objects of
that a user wishes to execute. The user or several users, in a system. On operating systems, the most well-known
the case of collaborative applications, are supposed to implementations are RSBAC [5], grsecurity [6] and SELinux
execute some codes that they do not trust completely. This [7]. With an RBAC policy, the administrator has to define
could be a downloaded application or an application that roles that have certain permissions on types. These types are
could endanger the system or its data. labels that are applied on all objects of the system. The main
It is assumed that the developer that coded the drawbacks of the current implementations in modern
application is also responsible of the security policy operating systems are:
associated with the code. Furthermore, we assume that the • The administrator has to know precisely how the
user has access to the source code. If not, the proposed software works and what permissions are needed on
solution may be run by the developer in order to produce the system's objects.
policy. But to simplify the work, we suppose that the user • A user cannot change the policy he wishes to apply
has access to the code. to a particular software he wants to use, as the
The third role that is considered is the administrator of administrator has already defined the role and the
the user's computer system. He could be responsible of permissions associated to this role.
installing the software on the user's computer and possibly in These drawbacks and the difficulty to configure
charge of the security policy and maintenance of these mandatory access control mechanisms are prohibitive for a
computers. Additionally, the administrator could be in user who wants to test untrusted software. A lightweight
charge of deploying software for several users, and would solution could consist of using JAAS in order to restrict
like to provide them different levels of security to execute permissions at the level of the virtual machine.
the application.
225
Authorized licensed use limited to: Amrita School Of Engineering - Kollam. Downloaded on May 16,2025 at 11:31:51 UTC from IEEE Xplore. Restrictions apply.
From a grammatical point of view, the SELinux syntax
defines that a subject process is allowed to interact with the
permissions precised in <IT> with some objects of the
system:
In this example the root user have all types of possible The parser will populate the database and produce the
permissions. The user role has access to the clipboard object following policy file:
with awt operations and has also read and write permissions
on the config.txt file. grant Principal test.JAAS.ExamplePrincipal "Root" {
permission java.io.FilePermission "config.txt", "read";
C. JAAS Policy Generation permission java.io.FilePermission "config.txt", "write";
Once the permission information has been incorporated permission java.io.FilePermission "password.txt", "read";};
in the application’s code by the developer, it has to be D. RBAC Integration API
extracted gathered and processed in order to generate the
policy file. To do so we have chosen to create a parser that 1) Login System : From the perspective that several
would: users will be using the same application, for example in
• Locate all customized JavaDoc tags in a Java collaborative applications, we might want to authenticate
source code file. the users and give them a role defined by the developer.
• Fill a database that will have to be processed. In the implementation, we have considered that a Login
• Write the policy. Module would be appropriate. Figure 2 shows the JAAS
Since the application is likely to consist of several classes Login Module architecture and mechanism. The module
and therefore several Java source code files, the parser will will use JAAS in order to load the right policy in the virtual
have to take it into account. machine. When used, the login module will propose to the
Figure 1 shows the process of extracting tags from a user to be assigned to a role. This role will protect his
project and parsing them into a new policy file after a computer’s resources from the code itself since the access
has been restricted compared to the admin mode.
2) Role Management: The entities that will deal with
role permissions are not only the developer and the users. It
is needed to introduce a supervisor or administrator that will
write a user/role file where the relation between the two will
be expressed.
This administrator can be a user or the developer itself as
long as it does not compromise the security integrity of the
whole architecture. Figure 3 sum-up the generation process
of the user/role file and Figure 4 shows how multiple users
Figure 1. Parser and File Loader Architecture will obtain a role using the JAAS login module in order to
access to the application.
226
Authorized licensed use limited to: Amrita School Of Engineering - Kollam. Downloaded on May 16,2025 at 11:31:51 UTC from IEEE Xplore. Restrictions apply.
policy for the JSM; he will then be able to use the Java
SandBox mechanism in order to execute the code with the
minimal but needed permissions. Figure 5 represents the
sandboxing with a rectangle that contains and isolates the
application.
B. User Authentication
With the proposed solution, the developer will be able to
write a security policy enforced by the JSM that will enable
access restriction for the users. Using the JAAS Login
Module, the user will be authenticated and will obtain one
of the roles before executing the code controlled by JSM.
Figure 3. Java Collaborative Application with RBAC Implementation Figure 5 shows the access of three users to the application
that have to choose a role before being able to execute the
code.
C. Developer Policy Definition
The most noticeable contribution to Java collaborative
applications remains that developers can add security to
their application independently one from the other.
Supposing that two modules of a same application are
developed and tagged separately by two different
developers, the parser can generate a policy file for the
whole application from the source code files of the two
modules. The only restriction is that the developers have to
be coordinated on the name of the roles they use. A solution
could be to impose the developer to use a preset of roles;
nevertheless, he is allowed to create new roles that can be
Figure 4. User File Editor
used by the administrator in order to give special restricted
access.
After having explained how the main modules of our This coordination could be ensured by the administrator.
solution work, the next section shows how to integrate the The administrator will also be in charge of assigning a
solution into a large scale application with the example of a subset of roles for each user of the application. The figure 5
collaborative Java application. Moreover, the section sum-up the administrative aspects of the proposed solution.
presents how RBAC implementation can be used for these
kinds of applications. In this section, we have presented how can be used the
proposed solution in the case of a collaborative application.
In the next section, a case study will be detailed with the
III. COLLABORATIVE APPLICATIONS generated policies and their effect on a standard execution.
For Java collaborative applications, dealing with several
users may be a problem. Since there is no way to dispatch
rights between them or to restrict them from using the
application, there is a real security issue. From the
administrative point of view, the solution helps in several
ways:
• It eases the security policy generation;
• It allows sandboxing the application;
• It adds an authentication security level before using
the application;
• Its simplifies the writing of policies for developers.
A. Sandboxing
The parser which is a module from the solution can also
be used from the user end. Provided that the code has been
tagged by the developer, the user will be able to run the Figure 5. Security Solution for Java Collaborative Applications
code through the parser which will give him a security
227
Authorized licensed use limited to: Amrita School Of Engineering - Kollam. Downloaded on May 16,2025 at 11:31:51 UTC from IEEE Xplore. Restrictions apply.
IV. A CASE STUDY Authentication succeeded!!
This section focuses on a simple example with two roles Please pick a role:
---- >Root
used in an application. We shows how works the Login Role pick succeeded.
module in the console and what happens if the user tries to
overcome the permissions of the role. Actions done once authenticated..........
The file exists in the current working directory
A. Login Module the file has been read!
The file config.txt was created (write test)!
The next listing shows the case of a user that logs with
the User role. The JSM throws a security exception and the
application is not able to write into the text file.
Figure 6. Java Test Application Case Study Actions done once authenticated..........
The file exists in the current working directory
the file has been read!
java.security.AccessControlException: access denied
Figure 6 shows the three steps of a test case application: (java.io.FilePermission config.txt write)
the policy file generated with the parser from the tags in the
source code file of the application is loaded into the JSM.
The user then logs in with his username and password and V. DYNAMIC ENFORCEMENT OF POLICIES
chooses a role. Users are managed using the User File
The described methodology allows to generate the whole
Editor. The application then runs with the permissions
policy file corresponding to the tags that the developer adds
associated with the role.
to the code. Recall the following example:
B. Several Users/Roles
/**
The console output of the application will show what * @allowIT Root {file:(read);file:(write)} "config.txt" */
happens when the following permissions are loaded into the public void convertConfiguration()
JSM. These permissions come from a specific policy file ...
/*
that was generated using the parser from our solution. * @allowIT Root {file:(read);} "password.txt" */
public void authenticate(String password)
grant Principal test.JAAS.ExamplePrincipal "Root" { ...
permission java.io.FilePermission "config.txt", "read";
permission java.io.FilePermission "config.txt", "write";
};
The produced policy file will gives the read and write
grant Principal test.JAAS.ExamplePrincipal "User" { access on config.txt and a read access on password.txt.
permission java.io.FilePermission "config.txt", "read"; When enforced in JAAS, any code in the software will be
}; able to write config.txt. This is because the login module of
the proposed solution loads the policy file associated to the
We obtained the two following cases logging with two root role when the user choose this role. This way, the
users and choosing different roles. The policy file indicates method authenticate() will obtain the permission to read
that the role rsoot has the right to read and write into the password.txt but will also have the permission to write the
config.txt text file whereas User only has the right to read it file config.txt, which is useless for this method. This
but not write into it. example shows that, when executing a method, there is
The next listing shows the case of a user that logs with more permissions than needed to execute it.
the Root role and is able to read and write into the file The proposed solution is the following: when a method
config.txt. is executed, a special policy has to be loaded in the JAAS
Password linked to the username in the userfile:
module. This policy corresponds exactly to the policy
a94a8fe5ccb19ba61c4c0873d391e987982fbbd3 tagged by the developer. If the methods
Hash of the inputed password : convertConfiguration() calls the method authenticate(),
a94a8fe5ccb19ba61c4c0873d391e987982fbbd3
228
Authorized licensed use limited to: Amrita School Of Engineering - Kollam. Downloaded on May 16,2025 at 11:31:51 UTC from IEEE Xplore. Restrictions apply.
when authenticate() is executed, the code have to unload the user to choose a role in order to obtain the required level of
current policy of JAAS (the policy for trust required so that he is able to insert the security policy
convertConfiguration()), then load the policy for in the application. The policy is automatically generated
authenticate() giving only the permission of reading from the user perspective and a methodology that allows for
password.txt. Then, when authenticate() finishes and returns the dynamic enforcement of the policy for each method of
to convertConfiguration(), the policy corresponding to this the code was also presented. A case study and examples
function have to be reloaded. show that this approach does provide a more robust security
In order to achieve this mechanism, the code of the measure for Java based collaborative applications.
application has to be patched at each entry and exit point of The next challenges for this work are several. First, how
the functions that have special policy tags. Each role can be to make it possible for the user to analyze the policy
declined into subroles that have only a subset of permission. implemented by the developer. For example, a “malicious”
In this example, the root role is derivated in: developer could propose a permission that is not really
• root_convertConfiguration, that has read and write needed by the code, hence weakening the security.
permissions on config.txt. Moreover, a standard policy elaborated by the user could be
• root_authenticate that has only read permission on compared to the policy written by the developer. The
password.txt. comparison could help the user to decide whether the
The introduced patch just automatically change of role developer's policy is similar or totally different. This could
from root to root_convertConfig when entering the provide vital indication to the user about the level of trust he
convertConfig() method. This process is really similar to can associate to the policy's developer.
dynamic and automatic transition in SELinux. It can be
achieved as shown in the following listing: REFERENCES
[1] S. Oaks, “Java Security”, 2nd Edition, O’Reilly & Associates, Inc.,
/** Sebastopol, California, USA, 1998.
* @allowIT Root {file:(read);file:(write)} "config.txt" */ [2] Sun Microsystems, Inc., “Java security overview”, White Paper, April
public void convertConfiguration() { 2005, Santa Clara, California, USA.
RBAC.loadPolicy("root_convertConfiguration"); [3] L. Gong, G. Ellison, and M. Dageforde, “Inside Java™ 2 Platform
RBAC.unloadPolicy("root_convertConfiguration"); Security: Architecture, API Design, and Implementation”, 2nd
} Edition, Prentice Hall, O’Reilly & Associates, Inc., Sebastopol,
/* California, USA, 2005.
* @allowIT Root {file:(read);} "password.txt" */ [4] R.S. Sandhu, E.J. Coyne, H.L. Feinstein, and C.E. Youman, “Role-
public void authenticate(String password) { based Access Control Models. IEEE Computer”, 29(2) : 3847, 1996.
RBAC.loadPolicy("root_authenticate");
RBAC.unloadPolicy("oot_authenticate"); [5] A. Ott, “Rule Set Based Access Control as Proposed in the
} 'Generalized Framework For Access Control' Approach In Linux.
Master Thesis, Universität Hamburg, 1997.
[6] B. Spengler, “Detection, Prevention, and Containment : A study of
This approach increases drastically the security of the Grsecurity”, in Libre Software Meeting 2002 (LSM2002), Bordeaux,
code: if a bug or an attack succeeds in interfering with that France, 2002.
application during the execution of the authenticate() [7] R. Spencer, S. Smalley, P. Loscocco, M. Hibler, D. Andersen and J.
method, the perturbation is unable to access the config.txt. It Lepreau, “The Flask Security Architecture : System Support for
guarantees that each method has no more than the necessary Diverse Security Policies”. Proceedings of The Eighth USENIX
Security Symposium, Washington, D.C., USA, 1999, pp. 123-129.
permissions.
[8] M-Tech Identity Management, “Beyond Roles: A Practical Approach
to Enterprise User Provisioning”, White Paper, 2006.
VI. CONCLUSION
[9] H. Shen and P. Dewan, “Access control for collaborative
This paper discussed the possibility of increasing the environments”, In Proceedings of the ACM Conference on
security of Java based collaborative applications using role Computer-Supported Cooperative Work, Toronto, Ontario, Canada,
1992.
based policies. More specifically, it presented the
[10] W.K. Edwards, “Policies and roles in collaborative applications”, in
introduction of RBAC model as a security solution in any Proceedings of the 1996 ACM Conference on Computer Supported
collaborative Java application. The implementation allows a Cooperative Work, Boston, Massachusetts, United States, 1996.
229
Authorized licensed use limited to: Amrita School Of Engineering - Kollam. Downloaded on May 16,2025 at 11:31:51 UTC from IEEE Xplore. Restrictions apply.