AbstractAn authorization infrastructure was added to the Solaris 8 operating environment as part of the role-based access control (RBAC) project, which provides a common mechanism for managing the rights of users and roles. Although RBAC is used extensively in the Solaris Management Console and in Trusted Solaris, it is not widely used in other products. This article outlines the advantages of a common infrastructure for managing authorizations, and describes how authorization enforcement, hierarchy, delegation, and scope are supported. It provides examples in C and Java programming languages. Finally, it discusses how authorizations can be associated with executables to restrict access to authorized users. IntroductionIn traditional UNIX® systems, the root user is the superuser, and is exempt from all policy enforcement. The problem with this approach is not just that root is so powerful; it is that everyone else is so weak. Root access is required to perform almost all aspects of administration. There is no hierarchy of privileged operations, no separation of powers, nor the ability to delegate any of the powers to others. There is a mismatch between what is necessary and what is sufficient with respect to access control. For example, setting the system date requires root access, which in turn provides full access to the system. An authorization infrastructure can be used to distribute some of the superuser's powers. This is not the same thing as actually restricting the power of root. Systems that fully implement the principle of least privilege, such as Trusted Solaris, actually replace the traditional kernel policy with one based on fine-grained privileges. Authorizations can be used on systems with either the traditional superuser implementation, or a privilege based implementation. AuthorizationsThe terms privilege and authorization are frequently used interchangeably. In this article these terms are used to mean different things, and it will help to understand the context of each term. A privilege is an attribute of a process that is used to override a standard security policy. In traditional UNIX, all root processes are privileged because they may override any kernel policy. However, in systems that implement the principle of least privilege in the kernel, an arbitrary number of fine grained privileges can be associated with a process, each of which is used to override a specific policy. An authorization is a right assigned to a user or a role that is used to grant access to an otherwise restricted operation. These are generally checked by privileged programs to restrict some of their inherent functionality. A variety of authorization systems have been used in the Solaris product. These systems share no common framework, are generally not supported in name services, and are difficult to maintain. A common defect is that there are many configuration files, each containing lists of authorized users rather than direct links to the user. Thus, many files need to be modified as the user population changes, and in addition, authorizations cannot be managed globally. In the Solaris 8 operating environment, a new authorization system was introduced as part of the role-based access control (RBAC) infrastructure. RBAC authorizations address most of the deficiencies because they are managed consistently and scale well. However, they are not widely used at this time because they are new and not well understood. This article describes some of the advantages of RBAC authorizations and provides examples of their use. Legacy Authorization Checks
An authenticated user ID is required for authorization checking. Programs that are Authorization checking in existing Solaris privileged programs fall into three categories:
Programs that Check User AuthorizationsThe following table gives some examples of privileged commands and the various mechanisms they use to do authorization checking:
Servers also use a variety of mechanisms. The following table provides examples of servers that check for authorization using various mechanisms.
Programs that Check for RootRoot checks in programs are generally redundant since the kernel makes the same check in the system call. Such checks should be scrutinized since the Solaris kernel policy is evolving. A policy of least privilege is being developed that will provide an alternative to the superuser. Therefore, root checks in applications should either be replaced by better error handling or by authorization checks. The following table provides examples of programs that check for root rather than use authorization checks.
Programs that Don't Check Any IDs
Most programs rely on the kernel for all security enforcement. However, if they are
RBAC Infrastructure
RBAC extends the general concept of authorization by introducing the concept of roles. A role is a special identity that may be assumed by authorized users to perform restricted operations. A principal may be either a user or a role. When a role is assumed, the authorizations associated with the user are replaced by those of the role. If BSM auditing is enabled, the actions of a role are auditable, and each audit records indicates on whose behalf the role is operating. The user who assumed the role is recorded as the audit ID, while the role is recorded as the real user ID. Central to the RBAC design is the notion that root is a role, and that anonymous logins as root are disallowed. However, in order to provide an opportunity for users to become familiar with RBAC, root is not a role by default in Solaris, and must be explicitly declared as a role in the RBAC user attribute database,
Authorizations in RBAC are fine-grained, like privileges, but they are not directly associated with processes. Instead, they are looked up in the An authorization name is a unique string that identifies the organization that created the authorization and the functionality it controls. Following the Java convention, the hierarchical individual components of an authorization are separated by a dot (.), starting with the reverse order Internet domain of the creating organization, and ending with the specific function within a class of authorizations. An asterisk is used as a wildcard to indicate all authorizations in a class. When an authorization check is made, the authorization is compared against the explicitly assigned authorization and any wildcard entries covering the class (or superclass) of the authorization. For example,
covers the authorizations
By using the wildcard suffix discussed above, a set of hierarchical authorizations can be managed using a single assignment. Delegation
When the authorization name ends with the keyword
Authorizations are the key to providing separation of powers, and delegation. The databases that are used to maintain attributes of users and roles are managed by the Solaris Management Console, shown in Figure 1. Neither users nor roles are permitted to assign authorizations unless they satisfy the delegation policy. The Management Console enforces the appropriate authorization policy for any transaction that takes place. The principal making the request must be authenticated and authorized for the specific update or query in the domain in which the data is maintained.
For practical reasons, it is often required to have a chief security officer who has all authorizations. This is expressed by assigning the two authorizations Default Authorizations
Maintaining explicit authorizations for a large community of users can be burdensome. To make it less so, the RBAC infrastructure provides significant flexibility and scalability. For example, instead of assigning authorizations directly to principals (using the Rights Profiles
Rights profiles provide another mechanism for aggregating authorizations. The
The Rights Properties tool in the Management Console is used to manage the attributes of individual rights profiles. Authorizations that are assigned to a right may only be changed by a principal who has both a covering wildcard authorization and a covering Distributed Authorizations
Another important feature is that the authorization databases can be maintained in any of the standard Solaris name services: files, NIS, NIS+, and LDAP. Therefore, authorizations can be maintained on a central server and apply consistently to all machines in a domain. On the other hand, the use of the name service switch allows an administrator to extend or restrict a principal's distributed set of authorizations on a per-machine basis. Both the Authorization API
RBAC authorization checks are provided for both C/C++ and Java programs. The C/C++ API is implemented in the library C/C++ Example
The primary authorization function is chkauthattr
The A principal is considered to have been assigned an authorization if either of the following is true:
The following code fragment demonstrates a typical authorizations check.
#define CRONADMIN_AUTH "solaris.jobs.admin"
user = getuid();
pwd = getpwuid_r(user, &pwds, buf_pwd,
sizeof(buf_pwd));
if (pwd == NULL) {
atabort("Invalid user.n");
}
if (!chkauthattr(CRONADMIN_AUTH, pwd->pw_name))
return NOT_AUTHORIZED;
Solaris Management Console SDK Example
In the Solaris Management Console SDK, the public interface is defined in the class The following is an example of how the Management Console SDK is used to check an RBAC authorization as a VPermission object.
import com.sun.management.viper.services.Authorization
// This example illustrates how to check authorizations
// for a service that supports write authorizations
public static final String AUTH_MYSERVICE_WRITE =
"solaris.admin.myservice.write";
PermissionCollection permissionCollection = null;
ToolInfrastructure infrastructure = <gotten from SMC>;
// Get authorizations.
try {
Authorization auth =
(Authorization)infrastructure.getServiceByName(
ServiceList.AUTHORIZATION);
permissionCollection = auth.readUserPermissions(
infrastructure.getIdentity());
} catch (Exception ex) {
// Report exception
}
...
/*
* Determine if user is authorized for "write" access.
*
* @return true if user has write authorization,
* otherwise false
*/
public boolean hasWriteAuthorization() {
// Allow only if explicitly authorized.
VPermission perm = new
VPermission(AUTH_MYSERVICE_WRITE);
if ((permissionCollection != null)
&&permissionCollection.implies(perm))
return true;
// Otherwise, deny
return false;
} // hasWriteAuthorization
Authorization Checking in WBEMWeb-Based Enterprise Management (WBEM) provides a protocol for remote administration. Part of the protocol makes it possible for providers to supply their own authorization infrastructures, and RBAC is used in the Solaris implementation of WBEM.
Many of the tools provided in the Solaris Management Console are implemented using WBEM providers, built on the Solaris WBEM SDK. The Solaris WBEM providers are delivered in the package Managing Execution Attributes
Another RBAC feature is the ability to limit privileged execution to authorized principals. Instead of specifying
In Solaris 8 the attributes that are supported are real and effective user and group IDs. (The
In order to take advantage of this database, a profile-based launcher is required. The three standard Solaris shells have been enhanced to support profiles, but this feature is only enabled when the shells are invoked with the prefix Creating New Authorizations
When an application is modified to perform an authorization check, a new authorization may need to be created. A private header file, Since RBAC authorizations are intended to be used by any package and any consolidation, it is important to understand how to install new entries in these databases without affecting existing entries. The RBAC databases provide a means to upgrade the databases without destroying content that may have been stored by other development projects or by end-users. Two class action scripts support adding new entries, as well as updating individual fields in existing entries.
The Organizing the DataWhen adding only authorizations or commands to profiles, use the pre-defined profiles if possible, merging the attributes into them. An alternative is to define your own profile, but merge that profile into one of the existing pre-defined profiles. Avoid creating a lot of small, application specific profiles; rather a profile should represent an entire class of functions and commands, like Network Management.
The Updating the Core Package Build Source
The
Ideally, the files should be merged in the order: Updating the usr Package Build Source
For any new authorizations and profiles, a corresponding help file should be installed. These files are used by the Management Console tools for context help. Authorization help files go into Verifying the RBAC Databases
To facilitate loading and testing changes to these databases, a new utility, ConclusionsUsing a common infrastructure for authorization management has compelling advantages. Not only does it make it easier for customers to manage their environments in a safer fashion, but it provides an extensible mechanism for adding new security attributes to the Solaris operating environment. For users, the ability to distribute and delegate the administrative responsibilities based on functional needs reduces the risk of accident or abuse. For Solaris developers, it provides a framework that meets current needs and future directions. The fact that Solaris and Trusted Solaris can share the same files is proof of this extensibility. Policy-specific attributes for executable objects, such as privileges, labels, and clearance can be specified, as well as new executable object types, such as CDE actions. A consistent approach to administrative authorization is clearly the goal. Ultimately, the success of the RBAC infrastructure will depend on how widely and consistently it is used by developers. References
About the AuthorGlenn Faden has worked as an architect and technical contributor in the Trusted Solaris group at Sun Microsystems for over 12 years. His emphasis has been on user interfaces and window systems. He designed the multilevel versions of OpenWindows and the Common Desktop Environment, and the trusted administration tools used in Trusted Solaris. Recently he has been focused on role-based access control (RBAC) and remote administration. August 2001 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||