=head1 NAME wallet - Client for retrieving secure data from a central server =for stopwords -hv srvtab arg keytabs metadata keytab ACL PTS kinit klist remctl PKINIT acl timestamp autocreate backend-specific setacl enctypes enctype ktadd KDC appdefaults remctld Allbery nul uuencode getacl backend =head1 SYNOPSIS B [B<-hv>] [B<-c> I] [B<-f> I] [B<-k> I] [B<-p> I] [S I>] [B<-S> I] [B<-u> I] I [I ...] =head1 DESCRIPTION B is a client for the wallet system, which stores or creates secure information such as Kerberos keytabs, associates them with ACLs and other metadata, and allows clients to view and download them. This client provides the user interface to the wallet system for both users and wallet administrators. The B command-line client takes a command and optional arguments on the command line, authenticates to the wallet server using Kerberos, and sends that command and arguments to server. It then reads the results and displays them to the user or stores them in a file. The client itself does not know which commands are valid and which aren't; apart from some special handling of particular commands, it sends all commands to the server to respond to appropriately. This allows additional commands to be added to the wallet system without changing all of the clients. The primary commands of the wallet system are C, which retrieves some secure data from the wallet, C, which stores some secure data in the wallet, and C, which stores the metadata about an object stored in the wallet. Each object in the wallet has a type, which determines what data the object represents and may determine special handling when downloading or storing that object, and a name. For example, a wallet object for the C Kerberos keytab would have a type of C and a name of C. The meaning of the name is specific to each type of object. Most other wallet commands besides those three are only available to wallet administrators. The exception is attribute commands; see L. The other commands allow setting ownership and ACLs on objects, creating and destroying objects, creating and destroying ACLs, and adding and removing entries from ACLs. An ACL consists of one or more entries, each of which is a scheme and an identifier. A scheme specifies a way of checking whether a user is authorized. An identifier is some data specific to the scheme that specifies which users are authorized. For example, for the C scheme, the identifier is a principal name and only that principal is authorized by that ACL entry. To run the wallet command-line client, you must either already have a Kerberos ticket or use the B<-u> option. You can obtain a Kerberos ticket with B and see your current Kerberos tickets with B. The wallet client uses the remctl protocol to talk to the wallet server. =head1 OPTIONS =over 4 =item B<-c> I The command prefix (remctl type) to use. Normally this is an internal implementation detail and the default (C) should be fine. It may sometimes be useful to use a different prefix for testing a different version of the wallet code on the server. This option can also be set in F; see L below. =item B<-f> I This flag is only used in combination with the C and C commands. For C, rather than sending the secure data to standard output (the default), the secure data will be stored in I. For C, the data to be stored will be read from I. With C, if the object being retrieved is not a keytab object, any current file named I is renamed to F.bak> before the new file is created. F.new> is used as a temporary file and any existing file with that name will be deleted. If the object being retrieved is a keytab object and the file I already exists, the downloaded keys will be added to the existing keytab file I. Old keys are not removed; you may wish to run C or an equivalent later to clean up old keys. F.new> is still used as a temporary file and any existing file with that name will be deleted. C does not yet support nul bytes in I (or in any other way of specifying the data to be stored). To store binary files in the wallet, you will need to encode them with uuencode, base64, or some similar scheme and then decode them after retrieval. =item B<-k> I The service principal of the wallet server. The default is to use the C principal for the wallet server. The principal chosen must match one of the keys in the keytab used by B on the wallet server. This option can also be set in F; see L below. =item B<-h> Display a brief summary of options and exit. All other valid options and commands are ignored. =item B<-p> I The port to connect to on the wallet server. The default is the default remctl port. This option can also be set in F; see L below. =item B<-S> I This flag is only used in combination with the C command on a C object, and must be used in conjunction with the B<-f> flag. After the keytab is saved to the file specified by B<-f>, the DES key for that principal will be extracted and written as a Kerberos v4 srvtab to the file I. Any existing contents of I will be destroyed. The Kerberos v4 principal name will be generated from the Kerberos v5 principal name using the krb5_524_conv_principal() function of the Kerberos libraries. See its documentation for more information, but briefly (and in the absence of special configuration), the Kerberos v4 principal name will be the same as the Kerberos v5 principal name except that the components are separated by C<.> instead of C; the second component is truncated after the first C<.> if the first component is one of the recognized host-based principals (generally C, C, C, or C); and the first component is C if the Kerberos v5 principal component is C. The principal name must not contain more than two components. =item B<-s> I The wallet server to connect to. The default may be set when compiling the wallet client. If it isn't, either B<-s> must be given or the server must be set in F. See L below. =item B<-u> I Rather than using the user's existing ticket cache for authentication, authenticate as I first and use those credentials for authentication to the wallet server. B will prompt for the password for I. Non-password authentication methods such as PKINIT aren't supported; to use those, run B first and use an existing ticket cache. =item B<-v> Display the version of the B client and exit. All other valid options and commands are ignored. =back =head1 COMMANDS As mentioned above, most commands are only available to wallet administrators. The exceptions are C, C, C, C, C, C, C, C, and C. All of those commands have their own ACLs except C and C, which use the C ACL, and C, which uses the C ACL. If the appropriate ACL is set, it alone is checked to see if the user has access. Otherwise, C, C, C, C, C, and C access is permitted if the user is authorized by the owner ACL of the object. Administrators can run any command on any object or ACL except for C and C. For C and C, they must still be authorized by either the appropriate specific ACL or the owner ACL. If the locked flag is set on an object, no commands can be run on that object that change data except the C commands, nor can the C command be used on that object. C, C, C, C, and C or C without an argument can still be used on that object. For more information on attributes, see L. =over 4 =item acl add Adds an entry with and to the ACL . may be either the name of an ACL or its numeric identifier. =item acl create Create a new, empty ACL with name . When setting an ACL on an object with a set of entries that don't match an existing ACL, first create a new ACL with C, add the appropriate entries to it with C, and then set the ACL on an object with the C or C commands. =item acl destroy Destroy the ACL . This ACL must no longer be referenced by any object or the ACL destruction will fail. The special ACL named C cannot be destroyed. =item acl history Display the history of the ACL . Each change to the ACL (not including changes to the name of the ACL) will be represented by two lines. The first line will have a timestamp of the change followed by a description of the change, and the second line will give the user who made the change and the host from which the change was made. =item acl remove Remove the entry with and from the ACL . may be either the name of an ACL or its numeric identifier. The last entry in the special ACL C cannot be removed to protect against accidental lockout, but administrators can remove themselves from the C ACL and can leave only a non-functioning entry on the ACL. Use caution when removing entries from the C ACL. =item acl show Display the name, numeric ID, and entries of the ACL . =item autocreate Create a new object of type with name . The user must be listed in the default ACL for an object with that type and name, and the object will be created with that default ACL set as the object owner. Normally, there's no need to run this command directly. It's automatically run when trying to get or store an object that doesn't already exist. =item check Check whether an object of type and name already exists. If it does, prints C; if not, prints C. =item create Create a new object of type with name . With some backends, this will trigger creation of an entry in an external system as well. The new object will have no ACLs and no owner set, so usually the administrator will want to then set an owner with C so that the object will be usable. =item destroy Destroy the object identified by and . With some backends, this will trigger destruction of an object in an external system as well. =item expires [] If is not given, displays the current expiration of the object identified by and , or C if none is set. The expiration will be displayed in seconds since epoch. If is given, sets the expiration on the object identified by and to and (if given)