Overview:

This is a new proposed feature providing Kerberos support with GSS-API layer in PBS Pro. The Kerberos support includes distributing and renewing of Kerberos credentials for users although the credentials itself are provided by an external renew-tool on demand. The renew-tool is configurable and is not part of this work. The passwordless access between nodes (and frontend) for users can be ensured by Kerberos credentials with this feature.

This implementation ensures that user credentials are distributed from the server to superior mom and to sister moms subsequently. In order to do the credential's distribution secured, the GSS layer ensures encrypted communication between the client and server and between the pbs_comm and clients (this covers server and moms). Since the Kerberos feature is added here, the GSS-API uses the Kerberos. Keep in mind that GSS layer could use another mechanism instead of Kerberos in the future. If needed.

The user credentials are obtained on the PBS Pro server by the renew-tool and are sent to the superior mom and this superior mom resends the credentials to the sister moms. This is done on the job startup and once the job is running the user credentials are renewed after a configurable time. The user credentials are destroyed on the job end. The credentials are also cached on the server. It means that the server demands new credentials for a particular user only once in a configurable time. This is very useful for renew-tools that would access the KDC directly. It significantly reduces the load on KDC.

In order to be able to provide GSS encryption, this feature requests Kerberos host keytab on each node (including the PBS Pro server) in the default keytab location. The host keytab is used to create host credential, which is used to establish the GSS context for encrypted communication between nodes (via pbs_comm). The valid user credentials are also required on the PBS Pro client (e.g. qsub, qstat, qmgr, pbsnodes, ...) for establishing the GSS context between a PBS Pro client and the PBS Pro server.

The implementation also supports OpenAFS. This support is autodetected. Once the appropriate packages are installed during compilation, the OpenAFS implementation is activated, and once the user credentials are received/renewed, the AFS logging is done (including the PAG).

GSS-API in PBS Pro:

First, GSS-API in short: GSS-API provides authentication by default and besides that, it can provide encryption between client and server. So, the identity is always verified by GSS-API and we can simply check the obtained principal with ACL. The encryption needs a GSS context on both the client and the server sides. The GSS context is used for further messages encryption. For acquiring the GSS context, we need to have valid credentials on both sides. These credentials are used for the handshake. The handshake means that the client and the server exchange messages - so-called 'tokens' as long as they need for establishing the GSS context. The client starts to establish the GSS context and sends the first token to the server. The server reads it, processes it, and responds with another token (if needed). The token exchange lingers in a loop or in some asynchronous exchange until the GSS context is established on both the client and the server. Once we have the GSS context, we can use it for encryption for further messages - it is called wrapping a message.

The GSS part has similar logic on both the TCP and the TPP. It uses the same pbs_gss* routines for establishing context and for un/wrapping messages. These routines can be found in Libutil/pbs_gss.c and use the gss_extra structure. This structure is added either to TCP connection structure or to TPP connection structure and it holds the information about GSS (like the GSS context).

Following figure 1 shows the communication within PBS Pro and what communication is covered with GSS.

 PBS Pro GSS enabled schema (original figure comes from PBS Install Guide 19.2.3)
Figure 1: PBS Pro GSS enabled schema (original figure comes from PBS Install Guide 19.2.3)

How to set up PBS Pro with Kerberos support for testing purpose:

This chapter shows how to setup PBS Pro with Kerberos support for testing. This is not a general Kerberos guide and Kerberos knowledge is expected. The used operating system is CentOS 7 and used Kerberos implementation is MIT. Some commands may vary on different systems. The setup will consist of one node only. This node will run all the components: Kerberos server, Kerberos client, PBS server, and PBS mom. The node hostname in examples will be 'pbspro-mit' and Kerberos realm will be 'PBSPRO'. Please, change it according to your requests.

[root@pbspro-mit ~]# useradd test

New Interfaces:

Interface: New option '--with-krbauth' to configure

Interface: New value 'GSS' to PBS_AUTH_METHOD in /etc/pbs.conf

Interface: New server attribute 'acl_krb_realm_enable'

Interface: New server attribute 'acl_krb_realm'

Interface: New server attribute 'acl_krb_submit_realms'

Interface: New server attribute 'cred_renew_enable'

Interface: New server attribute 'cred_renew_tool'

Interface: New server attribute 'cred_renew_period'

Interface: New server attribute 'cred_renew_cache_period'

Interface: New job attribute 'credential_id'

Interface: New job attribute 'Submit_Host'

Interface: New job attribute 'credential_validity'

Interface: New environmental variable 'PBSPRO_IGNORE_KERBEROS'

Interface: New error message 'No Kerberos credentials found.'

Interface: Job environmental variable 'KRB5CCNAME'

Interface: New job error code 'JOB_EXEC_FAIL_KRB5 = -23'

Interface: New file '/tmp/krb5cc_pbs_client'