8.0 Using security features

You are not required to use any of Legion's security options. We realize that not all systems will benefit from our security and Legion can run with or without security. However, you must decide whether or not to enable Legion security before you use your new system: the command-line tool that starts the security mode (legion_init_security) will not run correctly if you have started to work in your system (i.e., if you have created new objects, changed context space, run classes, etc.).

If you are running a multi-architecture system, you will need to register other implementations for each additional architecture (an implementation for your current architecture is automatically created when the system is first initialized). Use the legion_create_implementation command.

$ legion_create_implementation \
$LEGION/bin/$LEGION_ARCH/AuthenticationObject \
$LEGION_ARCH /class/AuthenticationObjectClass

If you choose to enable the security features (see "Choose your security setting,") you must run legion_init_security immediately after you have started a new system and you must log in as admin. If you do not enable security, Legion will run normally but none of your processes will be protected.

8.1 Security and context space

While all users can "read" (i.e., look at and move to) all of the new context space, non-admin users can "write" (i.e., create new context objects) only in the /home, /etc, /tmp, /mpi, and /pvm contexts. Only admin can "write" in the all parts of context space (Figure 6). Log out is achieved by exiting the shell.

Figure 6: Context space access in a secure Legion system

The legion_change_permissions command can be used to alter "read," "write," and "execute" object permissions so that other users can use those objects (see section 2.2.3 in the Basic User Manual).

8.2 Creating new users

You add users to your system by creating new user ids. A user id is an entry in context space that represents an AuthenticationObject. It is also used to signify ownership of all objects that a logged in user creates.

The legion_create_user command creates new user ids:

legion_create_user <user_name>

This command is actually a simple wrapper around the legion_create_user_object command (see the Reference Manual). The latter command gives more control in creating AuthenticationObjects, so that you can choose a particular host or vault, or--if you have another class that can create AuthenticationObjects--specify the new object's class.

If you have enabled security you must be logged in as admin in order to create new users. If you haven't yet done this, run the legion_login command:

$ legion_login /users/admin
Password: xxxx
$

You will be asked to assign a password (this can be changed later: see Changing user passwords). A new user id is automatically given a new context in /home. E.g., if you create user id nemo a new nemo context will be created in /home:

$ legion_create_user nemo
New Legion password: xxxx 
Retype password: xxxx
1.3622a3eb.6b000000.03000000.000001fc...
Creating a Home context: /home/nemo
Creating context "nemo" in parent "/home".
New context LOID = "1.3622a3eb.05.11000000.000001fc..."
Changing ACLs on /home/nemo
$

The new user can then log in with legion_login, using the new user id's context path (include /users):

$ legion_login /users/nemo
Password:xxxx
$

Please allow about five minutes for the new user to propagate in your system after creating a user id. If you try to log in too early you will get security errors when you try to create objects.

On a successful login, a credentials file (a user read-only file) is created in the local /tmp directory (see the Reference manual). If security is turned on the new user must move to his/her home context with the legion_set_context command immediately after logging in.1 E.g., nemo would move to the new /home/nemo context:

$ legion_set_context /home/nemo

8.3 Changing user passwords

A password can be changed with legion_passwd.

$ legion_passwd [-l <userLOID> | <username>]

Either the admin or the user can change the user's password.

8.4 Changing implicit parameters and ACL information

There is a suite of four commands for manipulating implicit parameters and access control information.

To set the implicit parameters of a user while logged into that user, run legion_set_implicit_params and specify the user and the file containing the parameters.

$ legion_set_implicit_params /home/user_name file_name

Below is an example implicit parameters file that sets message security and an access control policy.

## Set up message level protection. Legal values are 
## "Protected", "Private", and "Off".
String MessageSecurity = "Protected"

## Set up an access control set and store it in the 
## specified implicit parameter.

Notes:

  • An object instance gets both the access control lists for its specific class and the default lists (if defined). The specific class lists override the default ones on a per-method basis. For example, if the method read() is in each, only the access control information in the specific class definition for read() will be kept and used.
  • Every object instance and its class are automatically allowed to call all of the object's methods and to grant certificates for them. That is not affected by the access control set in the implicit parameters. These permissions can be modified by using the explicit SetACL method for the object.
  • On log in, an authentication object returns the implicit parameters. It adds on to the access control set in those parameters the following right: for all methods in all classes, the authentication object is a valid granter of certificates. Subsequent objects are created with this right, so a user holding a certificate from the authentication object (after legion_login) can manipulate all objects that he creates.
  • The access control for the default method is only applied if there is no control information for the specific method being called.
  • Access is denied by default. So deny unknown (though valid) is unnecessary. The main purpose of deny is to deny access to specific individuals or subgroups who would otherwise have access because of their membership in a larger group.
  • Names that only include letters and digits, plus underscore, dot, slash, and comma, do not need to be in quotes. Others must be in quotation marks. The reserved name unknown can be made unreserved by surrounding it in double quotation marks.
  • The default cases can be in any order with the others. Anything between braces can be empty.

AccessControlSet {
	instanceOf /class/BasicFileClass {
		Method "read()" {
			allow bob fred
			## Only bob and fred can call this method 
			## (the class and instance can call it and 
			## grant certificates for it, too, of 
			## course-see note above).
		}

		Method "        LegionLOID ping();" {
				allow group
		deny fred
		}
		## The function identifier for this method 
		## includes the spaces within the quotation marks

		Default {
			allow bob unknown
			## All other methods are covered by this case.
			## Suppose that bob is the one setting up this 
			## file. He probably wants to put himself in the 
			## allow list for every method he lists, as well 
			## as for the default. Of course, if he doesn't 
			## want access of a particular type (e.g., write
			## access), he can leave himself off. For any 
			## method where he grants access to unknown, he 
			## doesn't have to list himself. However, it 
			## doesn't hurt.
		}
   	}

	Default {
		Method "        LegionLOID ping();" {
			allow bob
			## Nobody can ping objects except bob
		}
		Default {
			allow unknown
		}
	}
}

Once the implicit parameters for a user have been set, you must log out and log in again for them to take affect. Alternatively, legion_set_implicit_params can be used to change the implicit parameters of the current session (if you do not specify a file name the command sets the implicit parameters of the current environment). If you do this, make sure that the implicit parameters contains a certificate definition for your AuthenticationObject, or you will have to log out and log in again in order to execute any further commands as an authenticated user. This documentation does not yet include an example of defining a certificate.

To show the current implicit parameters or the parameters for a particular user, use legion_get_implicit_params. Use legion_set_acl to change the access policy of an existing object: this is not the same as changing implicit parameters, which (in the case of access control) will only affect the creation of new objects. The legion_set_acl tool can have the same input file as legion_set_implicit_params but it only uses the access control information.

The legion_change_permissions command manipulates an object's ACL so that other users can call methods on that object.

If you have created a system with secure files, try creating a file as a logged-in user (the executable testBasicFiles will create a sample one for you). You can experiment with permissions and access control.

Run legion_get_interface to get the names of methods available on an object. The method names follow the output line titled Object Interface. Some of the methods are Legion object-mandatory functions, while others (usually listed at the end) are particular to objects of that class. You can cut and paste lines from the output into an implicit parameters file--put the names in double quotation marks in the Method definitions. Be sure to make your cut be from the real start and end of the line output by legion_get_interface, since some method names have leading or trailing tabs and spaces. Directing the output of legion_get_interface into a file then editing the file may be helpful.

If a user's AuthenticationObject is deleted there is no way to regenerate an equivalent AuthenticationObject; the user must be re-created from scratch. The reason is that the private key of the original AuthenticationObject cannot be recovered, so the same LOID cannot be used for the object.


1. In the current release a user will be in the root (/) context rather than in his or her home context after logging in.

Directory of Legion 1.6.3 Manuals
[Home] [General] [Documentation] [Software]
[Testbeds] [Et Cetera] [Map/Search]

Free JavaScripts provided by The JavaScript Source

legion@Virginia.edu
http://legion.virginia.edu/