Blame man/rpcsec_gss.3t

Packit 00408a
.\" Copyright (c) 2008 Isilon Inc http://www.isilon.com/
Packit 00408a
.\" Authors: Doug Rabson <dfr@rabson.org>
Packit 00408a
.\" Developed with Red Inc: Alfred Perlstein <alfred@FreeBSD.org>
Packit 00408a
.\"
Packit 00408a
.\" Redistribution and use in source and binary forms, with or without
Packit 00408a
.\" modification, are permitted provided that the following conditions
Packit 00408a
.\" are met:
Packit 00408a
.\" 1. Redistributions of source code must retain the above copyright
Packit 00408a
.\"    notice, this list of conditions and the following disclaimer.
Packit 00408a
.\" 2. Redistributions in binary form must reproduce the above copyright
Packit 00408a
.\"    notice, this list of conditions and the following disclaimer in the
Packit 00408a
.\"    documentation and/or other materials provided with the distribution.
Packit 00408a
.\"
Packit 00408a
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
Packit 00408a
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Packit 00408a
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Packit 00408a
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
Packit 00408a
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Packit 00408a
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
Packit 00408a
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
Packit 00408a
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
Packit 00408a
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
Packit 00408a
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
Packit 00408a
.\" SUCH DAMAGE.
Packit 00408a
.\"
Packit 00408a
.\" $FreeBSD$
Packit 00408a
.Dd January 26, 2010
Packit 00408a
.Dt RPC_GSS_SECCREATE 3
Packit 00408a
.Os
Packit 00408a
.Sh NAME
Packit 00408a
.Nm RPCSEC_GSS
Packit 00408a
.Nd "GSS-API based authentication for RPC"
Packit 00408a
.Sh SYNOPSIS
Packit 00408a
.In rpc/rpcsec_gss.h
Packit 00408a
.Sh DESCRIPTION
Packit 00408a
.Nm
Packit 00408a
is a security mechanism for the RPC protocol.
Packit 00408a
It uses the Generic Security Service API (GSS-API) to establish a
Packit 00408a
security context between a client and a server and to ensure that all
Packit 00408a
subsequent communication between client and server are properly
Packit 00408a
authenticated.
Packit 00408a
Optionally, extra protection can be applied to the connection.
Packit 00408a
The integrity service uses checksums to ensure that all data sent by
Packit 00408a
a peer is received without modification.
Packit 00408a
The privacy service uses encryption to ensure that no third party can
Packit 00408a
access the data for a connection.
Packit 00408a
.Pp
Packit 00408a
To use this system, an application must first use
Packit 00408a
.Fn rpc_gss_seccreate
Packit 00408a
to establish a security context.
Packit 00408a
.Sh DATA STRUCTURES
Packit 00408a
Data structures used by
Packit 00408a
.Nm
Packit 00408a
appear below.
Packit 00408a
.Bl -tag -width "MMMM"
Packit 00408a
.It Vt rpc_gss_service_t
Packit 00408a
This type defines the types of security service required for
Packit 00408a
.Fn rpc_gss_seccreate .
Packit 00408a
.Bd -literal
Packit 00408a
typedef enum {
Packit 00408a
	rpc_gss_svc_default	= 0,
Packit 00408a
	rpc_gss_svc_none	= 1,
Packit 00408a
	rpc_gss_svc_integrity	= 2,
Packit 00408a
	rpc_gss_svc_privacy	= 3
Packit 00408a
} rpc_gss_service_t;
Packit 00408a
.Ed
Packit 00408a
.It Vt rpc_gss_options_ret_t
Packit 00408a
This structure contains various optional values which are used while
Packit 00408a
creating a security context.
Packit 00408a
.Bd -literal
Packit 00408a
typedef struct {
Packit 00408a
	int		req_flags;	/* GSS request bits */
Packit 00408a
	int		time_req;	/* requested lifetime */
Packit 00408a
	gss_cred_id_t	my_cred;	/* GSS credential */
Packit 00408a
	gss_channel_bindings_t input_channel_bindings;
Packit 00408a
} rpc_gss_options_req_t;
Packit 00408a
.Ed
Packit 00408a
.It Vt rpc_gss_options_ret_t
Packit 00408a
Various details of the created security context are returned using
Packit 00408a
this structure.
Packit 00408a
.Bd -literal
Packit 00408a
typedef struct {
Packit 00408a
	int		major_status;
Packit 00408a
	int		minor_status;
Packit 00408a
	u_int		rpcsec_version;
Packit 00408a
	int		ret_flags;
Packit 00408a
	int		time_req;
Packit 00408a
	gss_ctx_id_t	gss_context;
Packit 00408a
	char		actual_mechanism[MAX_GSS_MECH];
Packit 00408a
} rpc_gss_options_ret_t;
Packit 00408a
.Ed
Packit 00408a
.It Vt rpc_gss_principal_t
Packit 00408a
This type is used to refer to an client principal which is represented
Packit 00408a
in GSS-API exported name form
Packit 00408a
(see
Packit 00408a
.Xr gss_export_name 3
Packit 00408a
for more details).
Packit 00408a
Names in this format may be stored in access control lists or compared
Packit 00408a
with other names in exported name form.
Packit 00408a
This structure is returned by
Packit 00408a
.Fn rpc_gss_get_principal_name
Packit 00408a
and is also referenced by the
Packit 00408a
.Vt rpc_gss_rawcred_t
Packit 00408a
structure.
Packit 00408a
.Bd -literal
Packit 00408a
typedef struct {
Packit 00408a
	int		len;
Packit 00408a
	char		name[1];
Packit 00408a
} *rpc_gss_principal_t;
Packit 00408a
.Ed
Packit 00408a
.It Vt rpc_gss_rawcred_t
Packit 00408a
This structure is used to access the raw credentials associated with a
Packit 00408a
security context.
Packit 00408a
.Bd -literal
Packit 00408a
typedef struct {
Packit 00408a
	u_int		version;	/* RPC version number */
Packit 00408a
	const char	*mechanism;	/* security mechanism */
Packit 00408a
	const char	*qop;		/* quality of protection */
Packit 00408a
	rpc_gss_principal_t client_principal; /* client name */
Packit 00408a
	const char	*svc_principal;	/* server name */
Packit 00408a
	rpc_gss_service_t service;	/* service type */
Packit 00408a
} rpc_gss_rawcred_t;
Packit 00408a
.Ed
Packit 00408a
.It Vt rpc_gss_ucred_t
Packit 00408a
Unix credentials which are derived form the raw credentials,
Packit 00408a
accessed via
Packit 00408a
.Fn rpc_gss_getcred .
Packit 00408a
.Bd -literal
Packit 00408a
typedef struct {
Packit 00408a
	uid_t		uid;		/* user ID */
Packit 00408a
	gid_t		gid;		/* group ID */
Packit 00408a
	short		gidlen;
Packit 00408a
	gid_t		*gidlist;	/* list of groups */
Packit 00408a
} rpc_gss_ucred_t;
Packit 00408a
.Ed
Packit 00408a
.It Vt rpc_gss_lock_t
Packit 00408a
Structure used to enforce a particular QOP and service.
Packit 00408a
.Bd -literal
Packit 00408a
typedef struct {
Packit 00408a
	bool_t		locked;
Packit 00408a
	rpc_gss_rawcred_t *raw_cred;
Packit 00408a
} rpc_gss_lock_t;
Packit 00408a
.Ed
Packit 00408a
.It Vt rpc_gss_callback_t
Packit 00408a
Callback structure used by
Packit 00408a
.Fn rpc_gss_set_callback .
Packit 00408a
.Bd -literal
Packit 00408a
typedef struct {
Packit 00408a
	u_int		program;	/* RPC program number */
Packit 00408a
	u_int		version;	/* RPC version number */
Packit 00408a
					/* user defined callback */
Packit 00408a
	bool_t		(*callback)(struct svc_req *req,
Packit 00408a
				    gss_cred_id_t deleg,
Packit 00408a
				    gss_ctx_id_t gss_context,
Packit 00408a
				    rpc_gss_lock_t *lock,
Packit 00408a
				    void **cookie);
Packit 00408a
} rpc_gss_callback_t;
Packit 00408a
.Ed
Packit 00408a
.It Vt rpc_gss_error_t
Packit 00408a
Structure used to return error information by
Packit 00408a
.Fn rpc_gss_get_error .
Packit 00408a
.Bd -literal
Packit 00408a
typedef struct {
Packit 00408a
	int		rpc_gss_error;
Packit 00408a
	int		system_error;	/* same as errno */
Packit 00408a
} rpc_gss_error_t;
Packit 00408a
Packit 00408a
/*
Packit 00408a
 * Values for rpc_gss_error
Packit 00408a
 */
Packit 00408a
#define RPC_GSS_ER_SUCCESS	0	/* no error */
Packit 00408a
#define RPC_GSS_ER_SYSTEMERROR	1	/* system error */
Packit 00408a
.Ed
Packit 00408a
.El
Packit 00408a
.Sh INDEX
Packit 00408a
.Bl -tag -width "MMMM"
Packit 00408a
.It Xr rpc_gss_seccreate 3
Packit 00408a
Create a new security context
Packit 00408a
.It Xr rpc_gss_set_defaults 3
Packit 00408a
Set service and quality of protection for a context
Packit 00408a
.It Xr rpc_gss_max_data_length 3
Packit 00408a
Calculate maximum client message sizes.
Packit 00408a
.It Xr rpc_gss_get_error 3
Packit 00408a
Get details of the last error
Packit 00408a
.It Xr rpc_gss_mech_to_oid 3
Packit 00408a
Convert a mechanism name to the corresponding GSS-API oid.
Packit 00408a
.It Xr rpc_gss_oid_to_mech 3
Packit 00408a
Convert a GSS-API oid to a mechanism name
Packit 00408a
.It Xr rpc_gss_qop_to_num 3
Packit 00408a
Convert a quality of protection name to the corresponding number
Packit 00408a
.It Xr rpc_gss_get_mechanisms 3
Packit 00408a
Get a list of security mechanisms.
Packit 00408a
.It Xr rpc_gss_get_mech_info 3
Packit 00408a
Return extra information about a security mechanism
Packit 00408a
.It Xr rpc_gss_get_versions 3
Packit 00408a
Return the maximum and minimum supported versions of the
Packit 00408a
.Nm
Packit 00408a
protocol
Packit 00408a
.It Xr rpc_gss_is_installed 3
Packit 00408a
Query for the presence of a particular security mechanism
Packit 00408a
.It Xr rpc_gss_set_svc_name 3
Packit 00408a
Set the name of a service principal which matches a given RPC program
Packit 00408a
plus version pair
Packit 00408a
.It Xr rpc_gss_getcred 3
Packit 00408a
Get credential details for the security context of an RPC request
Packit 00408a
.It Xr rpc_gss_set_callback 3
Packit 00408a
Install a callback routine which is called on the server when new
Packit 00408a
security contexts are created
Packit 00408a
.It Xr rpc_gss_get_principal_name 3
Packit 00408a
Create a client principal name from various strings
Packit 00408a
.It Xr rpc_gss_svc_max_data_length 3
Packit 00408a
Calculate maximum server message sizes.
Packit 00408a
.El
Packit 00408a
.Sh AVAILABILITY
Packit 00408a
These functions are part of libtirpc.
Packit 00408a
.Sh SEE ALSO
Packit 00408a
.Xr rpc 3 ,
Packit 00408a
.Xr gssapi 3
Packit 00408a
.Sh AUTHORS
Packit 00408a
This
Packit 00408a
manual page was written by
Packit 00408a
.An Doug Rabson Aq dfr@FreeBSD.org .