Shibboleth Target Deployment Guide

Shibboleth Target Deployment Guide
draft-internet2-mace-shibboleth-shib-target-deploy-28.html
Nate Klingenstein
10 March, 2003
Comments should be directed to ndk@internet2.edu.

This version of the deploy guide is for Shibboleth v0.8. Unfortunately, in order to progress with the full implementation of the Shibboleth specification, Shibboleth v0.8 DOES NOT interoperate with v0.7. Every effort has been made to include any and all changes which will break future interoperability into this release. For documentation related to Shibboleth v0.7, consult the head of that branch in the Shibboleth CVS.

Shibboleth v0.8 has some limitations and lacks certain security provisions which will be present in the final version. It is strongly advised that this version not be used to protect any sensitive data. Some sections of the deploy guide have not yet been populated with text. This document describes additional functionality which will be present in the final version, but which is not implemented in the v0.8, including but not limited to:

Functionality which has been added since the previous version (v0.7) includes:

Before starting, please sign up for all applicable mailing lists. Announcements pertinent to Shibboleth deployments and developments and resources for deployment assistance can be found here.

Please send any questions, concerns, or eventual confusion to mace-shib-users@internet2.edu. This should include, but not be limited to, questions about the documentation, undocumented problems, installation or operational issues, and anything else that arises. Please ensure that you have the appropriate .tarball for your operating system. Thank you for your help in testing Shibboleth.





Shibboleth Target -- Table of Contents


  1. Shibboleth Overview

    1. Origin
    2. Target
    3. WAYF
    4. Clubs
  2. Planning

    1. Requirements
    2. Join a Club
    3. Security Considerations
    4. Server Certs
    5. Attribute Release Policies
    6. Designate Contacts
    7. Browser Requirements
    8. Clocks
    9. Other Considerations
  3. Installation

    1. Software Requirements
    2. Deploy the Shibboleth Package
    3. Configure Apache
  4. Getting Running

    1. Configuring shibboleth.ini
    2. Dynamic Error Page Generation
    3. Key Generation and Certificate Installation
    4. Protecting Webpages
    5. Designing AAP's
    6. Using Attributes in Applications
    7. Add SHAR plug-ins for attribute processing
  5. Troubleshooting

    1. Basic Testing
    2. Common Problems



License Information


Before proceeding with any installation of, implementation of, or any other use of Shibboleth or its code, read and agree to the usage terms put forth in the LICENSE file included in the tarballs. Note that Shibboleth is based on the Security Assertion Markup Language (SAML), a proposed standard in the OASIS organization. There are intellectual property claims on SAML technology that are published on the OASIS site. Shibboleth deployers are encouraged to evaluate these claims and respond to them as they see fit.




1. Shibboleth Overview

Shibboleth is a system designed to exchange attributes across realms for the primary purpose of authorization. It provides a secure framework for one organization to transmit attributes about a web-browsing individual across security domains to another institution. In the primary usage case, when a user attempts to access a resource at a remote domain, the user's own home security domain can send certain information about that user to the target site in a trusted exchange. These attributes can then be used by the resource to help determine whether to grant the user access to the resource. The user may have the ability to decide whether to release specific attributes to certain sites by specifying personal Attribute Release Policies (ARP's), effectively preserving privacy while still granting access based on trusted information.

When a user first tries to access a resource protected by Shibboleth, they are redirected to a service which asks the user to specify the organization from which they want to authenticate. If the user has not yet locally authenticated to a WebISO service, the user will then be redirected to their home institution's authentication system. After the user authenticates, the Shibboleth components at the local institution will generate a temporary reference to the user, known as a handle, for the individual and send this to the target site. The target site can then use the handle to ask for attributes about this individual. Based on these attributes, the target can decide whether or not to grant access to the resource. The user may then be allowed to access the requested materials.

There are several controls on privacy in Shibboleth, and mechanisms are provided to allow users to determine exactly which information about them is released. A user's actual identity isn't necessary for many access control decisions, so privacy often is needlessly compromised. Instead, the resource often utilizes other attributes such as faculty member or member of a certain class. While these are commonly determined using the identity of the user, Shibboleth provides a way to mutually refer to the same principal without revealing that principal's identity. Because the user is initially known to the target site only by a randomly generated temporary handle, if sufficient, the target site might know no more about the user than that the user is a member of the origin organization. This handle should never be used to decide whether or not to grant access, and is intended only as a temporary reference for requesting attributes.

1.a. Origin

There are four primary components to the origin side in Shibboleth: the Attribute Authority (AA), the Handle Service (HS), the directory service, and the local sign-on system (SSO). The AA and HS are provided with Shibboleth, and an open-source WebISO solution Pubcookie is also supplied; the directory is provided by the origin site. Shibboleth is able to interface with a directory exporting an LDAP interface or a SQL database containing user attributes, and is designed such that programming interfaces to other repositories should be readily implemented. Shibboleth relies on standard web server mechanisms to trigger local authentication. A .htaccess file can be easily used to trigger either the local WebISO system or the web server's own Basic Auth mechanism, which will likely utilize an enterprise authentication system, such as Kerberos.

From the origin site's point of view, the first contact will be the redirection of a user to the handle service, which will then consult the SSO system to determine whether the user has already been authenticated. If not, then the browser user will be asked to authenticate, and then sent back to the target URL with a handle bundled in an attribute assertion. Next, a request from the Shibboleth Attribute Requester (SHAR) will arrive at the AA which will include the previously mentioned handle. The AA then consults the ARP's for the directory entry corresponding to the handle, queries the directory for these attributes, and releases to the SHAR all attributes the SHAR is entitled to know about that user.

1.b. Target

There are three primary components to the target side in Shibboleth: the Shibboleth Indexical Reference Establisher (SHIRE), the Shibboleth Attribute Requester (SHAR), and the resource manager (RM). An implementation of each of these is included in the standard Shibboleth distribution. These components are intended to run on the same web server.

From the target's point of view, a browser will hit the RM with a request for a Shibboleth-protected resource. The RM then allows the SHIRE to step in, which will use the WAYF to acquire the name of a handle service to ask about the user. The handle service (HS) will then reply with a SAML authentication assertion containing a handle, which the SHIRE then hands off to the SHAR. The SHAR uses the handle and the supplied address of the corresponding attribute authority (AA) to request all attributes it is allowed to know about the handle. The SHAR performs some basic validation and analysis based on attribute acceptance policies (AAP's). These attributes are then handed off to the RM, which is responsible for using these attributes to decide whether to grant access.

1.c. Where are you from? (WAYF)

The WAYF service can be either outsourced and operated by a club or deployed as part of the SHIRE. It is responsible for allowing a user to associate themself with an institution of their specification, then redirecting the user to the known address for the handle service of that institution.

1.d. Clubs

A Shibboleth club provides part of the underlying trust required for function of the Shibboleth architecture. A club is a group of organizations(universities, corporations, content providers, etc.) who agree to exchange attributes using the SAML/Shibboleth protocols and abide by a common set of policies and practices. In so doing, they must implicitly or explicitly agree to a common set of guidelines. Joining a club is not explicitly necessary for operation of Shibboleth, but it dramatically expands the number of targets and origins that can interact without defining bilateral agreements between all these parties.

A club can be created in a variety of formats and trust models, but must provide a certain set of services to club members. It needs to supply a registry to process applications to the club and distribute membership information to the origin and target sites. This must include distribution of the PKI components necessary for trust between origins and targets. There also needs to be a set of agreements and best practices defined by the club governing the exchange, use, and population of attributes before and after transit, and there should be a way to find information on local authentication and authorization practices for club members.






2. Planning

There are several essential elements that must be present in the environment to ensure Shibboleth functions well, both political and technical. Shibboleth currently runs on a specific range of platforms and web server environments. The SHAR and SHIRE are implemented entirely in C/C++. These are the recommendations and requirements for a successful implementation of a Shibboleth target.

2.a. Requirements

Shibboleth currently only supports Linux and Solaris. At present, Shibboleth consists of Apache plugins and a separate SHAR process. The plugins use the ONC RPC mechanism to communicate with the SHAR. The target's web servers must be running Apache 1.3.26+. More precise technical details are discussed in 3.a.

2.b. Join a Club

While it is not necessary for a target or origin to join a club, doing so greatly facilitates the implementation of multilateral trust relationships. Each club will have a different application process.

To join InCommon for the testing period, please submit a basic application containing the following information:

For more information on Clubs, refer to 1.d or the Shibboleth v1.0 architectural document.

2.c. Security Considerations

Shibboleth's protocols and software have been extensively engineered to provide protection against many attacks. However, the most secure protocol can be compromised if it is placed in an insecure environment. To ensure Shibboleth is as secure as possible, there are several recommended security precautions which should be in place at local sites.

  1. SSL use is optional for target sites. Club guidelines should be considered when determining whether to implement SSL, and, in general, SSL should be used for interactions with client machines to provide the necessary authentication and encryption to ensure protection from man-in-the-middle attacks. It is strongly suggested that all password traffic or similarly sensitive data should be SSL-protected. Assessment of the risk tradeoff against possible performance degradation should be performed for all applications.

  2. Many other attacks can be made on the several redirection steps that Shibboleth takes to complete attribute transfer. The best protection against this is safeguarding the WAYF service and ensuring that rogue targets and origins are not used, generally by development of the trust model underneath Shibboleth. Shibboleth also leverages DNS for security, which is not uncommon, but attacks concerning bad domain information should be considered.

  3. Information regarding origin users is generally provided by the authoritative enterprise directory, and the acceptance of requests from target applications can be carefully restricted to ensure that all requests the SHAR performs are authorized and all information the origin provides is accurate. Use of plaintext passwords is strongly advised against.

  4. Server platforms should be properly secured, commensurate with the level that would be expected for a campus' other security services, and cookie stores on client machines should be well protected.

2.d. Server Certs

In the Shibboleth architecture, the SHAR, HS, and AA must all have various client and/or server certificates for use in signing assertions and creating SSL channels. These should be issued by a commonly accepted CA, which may be stipulated by some Club rules. For the Shibboleth v0.8 testing, the following CA's will be recognized by InCommon:

* The certificates issued by these CA's will expire fairly quickly and should only be used for testing.

OSU will also provide a test CA to be used during Shibboleth development. Thawte presently issues certificates with extKeyUsage restrictions that make them incompatible with Shibboleth.

2.e. Attribute Release Policies

The Attribute Authority maintains a set of rules called Attribute Release Policies (ARP's) that define which attributes are released to which targets. When a browser user tries to access a resource, the SHAR asks the origin site AA to release all the attributes it is allowed to know. The SHAR provides its own name and an optional URL on behalf of which the attribute request is made which can further refine the information the SHAR is allowed to know. The AA processes this request using all applicable ARP's, determines which attributes and values it will release, and then obtains the values actually associated with the browser user. The AA sends these attributes and values back to the SHAR.

Targets should work together with expected origin sites to ensure that the sets of attributes that both sites expect to correspond using are congruent.

2.f. Designate Contacts

Since Shibboleth deals both with daily technical and operational issues and also with contractual issues, a set of contacts should be set up to support the user base and to facilitate interactions with other Shibboleth sites and club members. It is recommended that at least technical and administrative contacts be designated. Names, titles, e-mail addresses, and phone numbers may all be useful information to provide.

2.g. Browser Requirements

A primary Shibboleth design consideration was to require very little or no modification to client machines. The only requirement is that a browser is used which supports cookies, redirection and SSL. Browser users will have to perform an additional click to submit the authentication assertion if JavaScript is not functional.

2.h. Clocks

NTP should be run on all web servers. Shibboleth employs a short handle issuance time to protect against replay attacks. Because of this, any significant degree of clock skew can hinder the ability of users to access sites successfully.

2.i. Other Considerations

Especially for higher education, there are a handful of laws enacted which may have important ramifications on the disclosure of personal information and attributes. Since Shibboleth does not necessarily need to transmit identity, it is an ideal solution for many higher education situations. Nevertheless, all parties within the United States of America are strongly advised to consult the Family Educational Rights and Privacy Act of 1974(FERPA), and all other relevant state and federal legislation before deploying Shibboleth.





3. Installation

3.a. Software Requirements

The Shibboleth project makes binary packages available for Solaris and Linux that are precompiled against recent releases of various required libraries such as OpenSSL. It is highly advisable to build from source when using Shibboleth in a production environment in order to permit patching or updating of packages as security holes and bugs are fixed. Building from source is necessary to give you complete control over your deployment platform. The binary packages represent a snapshot in time only. To build from source, see the INSTALL.txt files in the root of the OpenSAML and Shibboleth source distributions.

Operating System:

3.b. Deploy the Shibboleth Package

For the sake of clarity, this deployment guide assumes that standard directories are used for all installations. These directories may be changed for local implementations, but must be done so consistently.

  1. Ensure that you have obtained the proper tarball for your operating system.

  2. The tarballs expand into /opt/shibboleth, and should be expanded as root from /. You should see the following directory structure:

    $ ls -al
    drwxr-xr-x 10 root root 4096 Oct 24 03:54 .
    drwxr-xr-x 3 root root 4096 Oct 24 00:37 ..
    drwxr-xr-x 2 root root 4096 Oct 24 03:54 bin
    drwxr-xr-x 4 root root 4096 Oct 24 03:54 etc
    drwxr-xr-x 13 root root 4096 Oct 24 03:54 include
    drwxr-xr-x 4 root root 4096 Oct 24 03:55 lib
    drwxr-xr-x 2 root root 4096 Oct 24 03:55 libexec
    drwxr-xr-x 4 root root 4096 Oct 24 02:02 share

3.c. Configure Apache

  1. Shibboleth includes configuration directives in the file /opt/shibboleth/etc/shibboleth/apache.config which must be added to the httpd.conf file used locally. It is recommended that these directives simply be added to the end of the existing httpd.conf file rather than trying to merge it in-line; step 2 describes the necessary modifications to the Apache startup script. The default configuration will often work, but if customization is necessary, these options may be modified:

    LoadModule <module> <pathname>

    Specifies the title and location of the shibrm_module resource manager and shire_module SHIRE modules. These are installed by default at /opt/shibboleth/libexec/mod_shibrm.so and /opt/shibboleth/libexec/mod_shire.so

    SHIREConfig <pathname>

    Specifies the pathname of the SHIRE's configuration file. Defaults to /opt/shibboleth/etc/shibboleth/shibboleth.ini.

    SHIREURL <url>
    <Location <url>>
      SetHandler <method>
    </Location>

    Specifies the URL and the method the target uses to handle requests for Shibboleth-protected resources. Currently, shib-shire-post is the only available handler method. SHIREURL is used by Shibboleth when re-directing the user to the WAYF and <Location> by Apache; for this reason, both URL specifications must match. Note that the configuration file itself contains <>'s, and Location should not be replaced.

    The referenced URL can be either a partial path or an absolute URL. The partial path allows each virtual server to use its own hostname and port in the SHIRE for session cookie purposes, while the absolute URL forces HTTP virtual servers to use HTTPS for the SHIRE. Use of a full https:// URL is advised.

    ShibMapAttribute <attribute-uri> <HTTP-header> [alias]

    Registers attributes to be recognized and maps them to an authorization alias for use in .htaccess files or Location Blocks with require directives. REMOTE_USER is a special case, suggested for use with eduPersonPrincipalName, and is automatically checked by a require user rule.

  2. These modifications must be made to the Apache startup script:

    Add the following environment variables:

    SHIBCONFIG=/opt/shibboleth/etc/shibboleth/shibboleth.ini; export SHIBCONFIG

    If the OpenSSL libraries are not in the system's search path, they should be added to LD_LIBRARY_PATH as well.

    If the SHIBCONFIG environment variable is not specified, Shibboleth will use /opt/shibboleth/etc/shibboleth/shibboleth.ini by default.

  3. The SHAR must be started before Apache. Among other methods, this can be done either by creating a separate SHAR startup script or by modifying Apache's RC script to start/stop the SHAR before httpd. It is suggested that Apache's script be modified by adding:

    /opt/shibboleth/bin/shar &

    Sample init.d scripts may be included with future releases. Ensure that the environment variables referenced in 3.c.2 are in place.

  4. The options in shibboleth.ini must be configured as documented in 4.a. Apache content will then need to be modified for Shibboleth authentication. This is discussed in 4.d. It is recommended that the target then be tested as detailed in section 5.a.




4. Getting Running

4.a. Configuring shibboleth.ini

Most of the configuration for the SHAR, SHIRE, and RM is stored in the file shibboleth.ini. This file is split into four pre-defined sections: general, shire, shar, and extensions:saml. The general section holds global tags, used by all pieces. The shire and shar sections can override the general tags with SHIRE- or SHAR-specific configuration. For example, if the SHAR is looking for a tag, it will look first in the shar section; if it does not find the tag there, it will proceed to look in the general section. The extensions section enumerates the set of extra SAML modules to load at run-time, though this section will likely not need configuration for most v0.8 deployments. Example configuration files may be found in the Shibboleth CVS.

There is also information that must be configured in /usr/local/apache/conf/httpd.conf; for more information, refer to 3.c.

Information in the logger files referenced by shibboleth.ini may require additional configuration. It is recommended that after initial installation is completed, the log level in both files be changed to either INFO or WARN.

Fields that are purple are optional; grey fields are mandatory.

[general]:

logger = <pathname>

Specifies the location of the log4cpp configuration file for most Shibboleth events. This element may also be optionally specified for each of the components individually. Default logging settings should suffice. The syslog daemon must accept UDP:514 messages, and on Linux, SYSLOGD_OPTIONS must include -r to enable logging from remote machines. The logging levels are defined in the logger configuration. The configuration format is similar to that of the Log4j package's format.

schemadir = <pathname>

Specifies the directory in which the XML schema files are located; defaults to /opt/shibboleth/etc/shibboleth/. Note that the pathname must have a trailing /.

sitesFile = <url>

Specifies the location of the Sites file that maps common names to recognized HS'. Inclusion of file:// in the pathname of locally hosted Sites files is unnecessary. The default value of http://wayf.internet2.edu/shibboleth/sites.xml is appropriate for testing with InCommon.

NOTE: While every effort is made to insure the availability of this URL, until InCommon is a production service, sites using Shibboleth in configurations that require high availability should consider copying the file locally and using a local path to the file. If the path to this file is invalid or unavailable, the SHAR and Apache processes will fail. Apache starts child processes dynamically, so if the file becomes unavailable, new children will fail and respawn repeatedly, appearing to hang Apache.

sitesCertFile = <pathname>

Specifies a PEM certificate file containing the key to use to verify the signature on the sitesFile data. The default is the signing key for InCommon pilot testing. If you modify that file or create your own version, comment out the cert.

sitesRefresh = <seconds>

Specifies the interval between refreshings of the sitesFile for the SHAR and Apache processes. Note that this is a per-process activity, and there may be short periods during which the data may be out of sync between processes.

aap-uri = <uri>

Specifies the URI of an attribute acceptance policy XML file. For more information, refer to section 4.e.

The next segment of the [general] configuration section defines server-specific tags in sections defined by the server name for use by the SHIRE and RM. For example, if you have a web server at www.example.edu, you can define a section [www.example.edu] and override global tags with tags for that server only.

The following table lists the server-specific tags. It is broken into mandatory tags, and optional tags. As always, you can put tags in the [general] section for all servers, and then override specific tags on a per-server basis:

[<FQDN>]:
wayfURL = <url>

Specifies the URL of the WAYF service the user is redirected to. Clubs will generally provide this URL or provide information on how to locally host WAYF's with a distributed hosts file. The default value of https://wayf.internet2.edu/shibboleth/WAYF is appropriate for testing with InCommon.

shireSSLOnly = <true/false>

If true, the SHIRE will reject HTTP connections that are not SSL-protected. This guards the initial session sign-on from the browser, but does not preclude non-SSL content. Use of SSL is strongly recommended; see section 2.c for more information.

wayfError = <pathname>

Specifies the location of the template for the error page generated when there is an error re-directing the user to the WAYF or processing a SHIRE POST.

rmError = <pathname>

Specifies the location of the template for the error page generated if internal errors occur in the RM.

accessError = <pathname>

Specifies the location of the template for the page displayed to users when access to a protected resource is denied by the RM.

normalizeRequest = <true/false>

If true, all redirects generated by mod_shire will be created using the virtual server name assigned to the server containing this command. If false, the browser's supplied URL is used to compute the redirect back.

checkIPAddress = <true/false>

If true, Shibboleth will check client addresses for impersonation protection. In most circumstances, this should be enabled to prevent certain attacks concerning stolen cookies. Defaults to false.

supportContact = <e-mail>

Specifies the e-mail address used in the generation of error pages.

logoLocation = <pathname>

Specifies the location of the logo used in the generation of error pages. This logo can be in any format that the web browser will understand.

requestAttributes = <attr1> <attr2> <attr3>...

Specifies a space-delimited list of attributes named by URI that the SHAR will request of an AA.

[shire]:
logger = <pathname>

Specifies the location of a log4cpp which overrides the [general] log parameters for SHIRE events. Default logging settings should suffice. The syslog daemon must accept UDP:514 messages, and on Linux, SYSLOGD_OPTIONS must include -r to enable logging from remote machines. The logging levels are defined in the logger configuration. The configuration format is similar to that of the Log4j package's format.

[shar]:
logger = <pathname>

Specifies the location of a log4cpp which overrides the [general] log parameters for SHAR events. Default logging settings should suffice. The syslog daemon must accept UDP:514 messages, and on Linux, SYSLOGD_OPTIONS must include -r to enable logging from remote machines. The logging levels are defined in the logger configuration. The configuration format is similar to that of the Log4j package's format.

certFile = <pathname>

Specifies the location of the PEM-encoded certificate used by the SHAR to communicate with AA's.

keyFile = <pathname>

Specifies the location of the PEM-encoded private key used by the SHAR to communicate with AA's.

keyPass = <password>

Specifies the password used to access the keyfile.

calist = <pathname>

Specifies a single file of PEM-encoded certificates containing the certificates of root CA's the SHAR will consider valid signers of AA certificates.

cacheType = <method>

Specifies the method used by the SHAR to cache received attributes. Currently, the only valid specification is memory.

cacheClean = <seconds>

Specifies the duration in seconds between cleanups of the SHAR's cached attributes.

cacheTimeout = <minutes>

Specifies the duration in minutes that must elapse between user accesses before that user's session is destroyed, including the associated handle and all cached attributes.

The [extensions:saml] section is the list of SAML modules to be iteratively loaded at run-time.

[extensions:saml]:

<module-name>

The name of the module -- the value is the path to the Shared Object(.so) that SAML should load at runtime.

The [policies] section contains the policy URI values that control acceptance of assertions from origin sites. This may eventually have multiple elements associated it for targets that are members of multiple federations.

[policies]:

<federation> = <URI>

The name of the federation and its associated policy URI. For use of InCommon for v0.8 testing, the value should be InCommon=urn:mace:InCommon:pilot:2003.

This set of URI values is matched against the SAML Audience of assertions received from HS's and AA's. If an origin sends a particular value, the target must be configured with the same value or the assertion won't be accepted.

4.b. Dynamic Error Page Generation

Shibboleth supports the dynamic generation of information in error pages referenced by shibboleth.ini. The Shib Target employs a special Markup Language Processor to insert special tags into the generated HTML. The parser will read the error file looking for any tag that looks like:

<shibmlp tag-name />

Shibboleth will replace tag-name with the appropriate markup tag from the table below:

supportContact
The value of the supportContact for this server.
logoLocation
The value of the logoLocation for this server.
requestURL
The user's requested URL.
errorType
The type of error.
errorText
The actual error message.
errorDesc
A textual description of the error intended for human consumption.

This configuration is for servers. Apache configurations must be defined for content protection. See section 4.d.

4.c. Key Generation and Certificate Installation

The only target component that must have a private key and certificate is the SHAR. While the target server itself should support SSL in most cases, it is mandatory for the SHAR to authenticate when contacting an AA, and it must therefore be given a key and an SSL client certificate. It is permissible for the SHAR to use the same keypair and certificate used by the target server itself, provided the certificate is signed by a CA accepted by the community of sites.

The certificate and key should be placed based on whether they will also be used for Apache's server cert. If they will be used as a server certificate as well, they should probably be in the Apache tree in the usual mod_ssl spot, and the SHAR can read them from there. If the SHAR is not running as root, permissions might need to be changed to allow this access. If the certificate and key will only be used for the SHAR, they can be put in the same folder with the shibboleth.ini file.

The SHAR is assigned a key and a certificate using shibboleth.ini's certfile, keyfile and keypass, described in 4.a. These files must currently be in PEM format. OpenSSL commands to generate a new keypair and a certificate request are shown here, assuming RSA keys are to be used:

$ openssl genrsa -des3 -out ssl.key 2048 $ openssl req -new -key ssl.key -out ssl.csr

The signed certificate file returned by the CA should be usable directly, or can be converted to PEM format using the openssl x509 command.

The key and certificate files can be placed anywhere, though in or beneath /usr/local/apache/conf directory is a good choice. The Apache child processes, often running as nobody, must be able to read them while the server is running, which may require permission changes.

This particularly applies when sharing the key and certificate used by mod_ssl, which are only readable by root by default. The password, if any, must be placed in the conf file, since the module cannot prompt for it as the initial startup of mod_ssl can. The issues surrounding how to securely obtain a key while running as nobody will be addressed in a later release. Since the password will be stored in clear text in a frequently examined file, it is suggested to not reuse a password used elsewhere, or to place the keypass directive in a separate file that is Included in the main configuration file, so that its permissions can be further restricted.

Finally, the calist command provides the SHAR with a set of CA roots to trust when validating AA server certificates. In all cases, the SHAR verifies that the certificate's CN equals the AA's hostname, but the CA root bundle restricts the accepdl signers to those permitted by the SHAR. The parameter can be omitted to skip such signer validation. Section 2.d lists the CA's currently recognized by InCommon.

4.d. Protecting Webpages

Protection of webpages is primarily achieved through "mapping" attributes provided by an AA to a localized vocabulary for authorization rules. Each attribute can be mapped using the ShibMapAttribute command to an HTTP header name where it can subsequently be accessed by applications, and optionally to an alias that can be used in a Require command to search for a matching value. This mapping command must be in httpd.conf, while the rest of the commands described here appear in content-specific configuration or .htaccess files.

Any of the typical ways of protecting content may be used (.htaccess, Directory, Location, Files, etc.). There are two ways to trigger Shibboleth authentication: specifying an AuthType of shibboleth to use Shibboleth directly, or specifying ShibBasicHijack On to process existing .htaccess files using Shibboleth instead. Support for authorization consists of mod_auth-style require directives, as well as support for mod_auth group files.

A complete list of the directives and their values is below:

AuthType <string>

Use shibboleth for direct invocation, or Basic plus the ShibBasicHijack On option described below.

ShibSSLOnly<on/off>

Controls whether Shibboleth will reject non-SSL requests from clients. Defaults to off.

ShibBasicHijack <on/off>

Controls whether Shibboleth should or should not ignore requests for AuthType Basic. Defaults to off.

ShibAuthTimeout <seconds>

Sets the maximum number of seconds without any user activity that a session will remain alive. After seconds seconds without activity, the session is considered dead. Omission or 0 results in an arbitrary session timeout.

ShibExportAssertion <on/off>

Controls whether the SAML attribute assertion provided by the AA is exported in a base64-encoded HTTP header, Shib-Attributes. Defaults to off.

ShibAuthLifetime <seconds>

Sets the maximum lifetime in seconds that a user session can survive. Omission or zero results in arbitrary session lifetime.

AuthGroupFile <pathname>

Same as mod_auth; collects EPPN's into a named group for access control. Note that mod_auth will not support group files when mod_shibrm is loaded, since they share the same command.

This is implemented by placing a .htaccess file that references an AuthGroupFile stored at /path:

authgroupfile /path
require group workgroup

Note that an AuthGroupFile used by Shibboleth would resemble workgroup: joe@example.edu, jane@demo.edu, jim@sample.edu.

Require <string>

Enforce authorization using one of the following methods:

  • valid-user

    Any Shibboleth user from a trusted origin site is accepted.

  • user

    A space-delimited list of EPPN values, provided that the urn:mace:eduPerson:1.0:eduPersonPrincipalName attribute has been mapped to the REMOTE_USER header (as per the earlier example configuration commands).

  • group

    A space-delimited list of group names defined within AuthGroupFile files, again provided that the mapping to REMOTE_USER exists.

  • <alias>

    An arbitrary rule tag that matches an alias defined in a ShibMapAttribute server command. The rule value is a space- delimited list of attribute values, whose format depends on the attribute in question (e.g. an affiliation rule might look like require affiliation staff@osu.edu faculty@mit.edu).

Additionally, for user and <alias>-based rules, if a tilde character is placed immediately following user or <alias>, the expressions that follow are treated as regular expressions.

For example, the regular expression AAP require affiliation ~ ^member@.+\.edu$ would evaluate to allowing anyone with an eduPersonScopedAffiliation of member from a .edu domain.


4.e. Designing AAP's

Shibboleth allows a user and a site to release a varying set of attributes to a destination site, and does not impose restrictions on the kinds of attribute information provided by an AA. Target implementations must also be prepared to examine the attributes they receive and filter them based on policies about what information to permit an origin site to assert about its users.

Attribute acceptance is the process of filtering attribute values before passing them on to a resource manager, such as the mod_shibrm module. Data blocked by AAP filters will not be passed to the CGI environment or used when enforcing .htaccess rules. Note that the attribute assertion exported to the Shib-Attributes header is pre-filtered.

Version 0.8 includes basic scoped and simple filtering policies for different kinds of attributes supported in this release.

Scoped:

Scoped attributes are a special kind of attribute whose values are a combination of a value and a scope, or context for the value. An example is eduPersonScopedAffiliation, which adds a scope to the defined set of eduPersonAffiliation values, such as student, member, or faculty. Scopes are expressed as DNS domains and subdomains.

In the code for 0.8, any scoped attribute can be scoped only to the origin site's permitted domains. These domains are listed in the sites file that provides trust information to the system. Domains can be explicit or regular expressions, and can be changed by a target to meet its needs if a local version of the file is created. Thus, attribute acceptance processing for scoped attributes is based on the sites file.

Simple:

Simple attributes are attributes whose value is expressed in XML as a Text node; that is, the value is just a string. Multiple values are permitted. eduPersonEntitlement, in which the values are URIs, is one example of a simple attribute.

In this release, simple attribute acceptance is controlled with an external policy file written in XML. The schema for the file is described by the eduPerson.xsd schema, and an example file is included, AAP.xml. If the aap-uri parameter in the shibboleth.ini file is left out, then no policy is applied, and no filtering is done. Otherwise, the rules encoded in the file are used.

The policy is a default-deny algorithm that requires permissible attributes and values be listed explicitly. That is, an empty file permits nothing. Each attribute to be permitted must be listed in the file by name in an <AttributeRule>. Each such rule is a collection of <SiteRule> elements along with an optional <AnySite> default rule. In turn each site rule is a set of <Value> rules that specify matches to permit, either literal or regular expressions.

A syntax summary follows:

<AttributeAcceptancePolicy

The top level element in the file.

<AttributeRule Name="attribute URI">

Specifies a rule for an attribute, named with its URI.

<AnySite>

Specifies a rule that always applies to the attribute, regardless of the asserting AA.

<SiteRule Name="site.domain.name">

A rule that applies to the origin site AA corresponding to the domain name.

<Value Type="type">

Specifies a value to permit, either directly using type literal, or using a set of matching expressions as type regexp. literal is the default if Type is not specified.

The regular expression syntax is a subset of the usual Perl and Unix syntaxes that is described in the XML Schema specification by the W3C. Most typical expressions should work. Be sure to anchor them using ^ and $ to avoid unintentional matches midstring.

Note that the AAP rules described in this section are not part of the Shibboleth architecture and are simply one possible set of approaches implemented in the eduPerson attribute plugin. The OpenSAML API permits attribute classes to derive from SAMLAttribute and override the accept() method to implement application-specific AAP requirements. The eduPerson source files can be used as an example of how to build highly customized rules.

4.f. Using Attributes in Applications

Apart from the simple RM functionality provided, attribute information may be made available directly to applications via the standard practice of creating custom HTTP request headers before passing control to the application. Applications should make no assumption about the presence of specific attributes for their use unless they have intimate knowledge of the attribute release policies in place.

The ShibMapAttribute directive controls this interface, and maps a Shibboleth attribute (identified by an unambiguous URI) to a header name, such as Shib-EP-Affiliation. Using that example, any values of the mapped attribute will be placed in that header, delimited by spaces. An application that uses a CGI-like syntax to access the header will find the values in the HTTP_SHIB_EP_AFFILIATION variable. Using the command, any attribute can be placed in any header, to drive legacy applications that expect information in a particular header.

The REMOTE_USER variable is a special case that is generally populated automatically by the web server based on an internal piece of data that represents the user's username. Unlike many authentication modules, Shibboleth does not guarantee that REMOTE_USER will have any value. If it does, it is set solely based on a ShibMapAttribute command. For most purposes, the urn:mace:eduPerson:1.0:eduPersonPrincipalName attribute should be mapped to REMOTE_USER. Even so, EPPN may not be provided by the AA, and REMOTE_USER might still be empty.

Finally, the ShibExportAssertion flag instructs the module to place the entire XML message containing the SAML attribute information from the AA into a base64-encoded header called Shib-Attributes. This is a raw interface that provides an application with the entire AA response, and is not a filtered view based on any attribute acceptance rules or even based on what attributes are recognized by the target. What was sent is what you see.

4.g. Add SHAR Plug-Ins for attribute processing

In order for an attribute to be used by Shibboleth, it must be recognized as valid by the SHAR and implemented with any specific rules for how to understand and express its value based on the XML from the AA. The eduPerson module is an example of a plugin that provides this support for an initial set of eduPerson-base attributes. Extension modules like this are loaded at run time. New modules may be added to the extensions:saml section of shibboleth.ini.

In addition to the eduPersonPrincipalName, eduPersonScopedAffiliation, and eduPersonEntitlement attributes, the eduPerson plugin also provides support for adding additional string-valued attributes to the system using the shibboleth.ini file.

The plugin looks at startup for an additional section called [attributes] and examines each entry beneath it. There may be an arbitrary number of elements composed of this form:

[attributes]:

<attribute_URI>=<type>

Attribute names are URI's that are assigned by the parties standardizing the attribute. Frequently, a club or standard object class may define these URI's. The attribute type may be either scoped or simple, which defines how the attribute is processed as described in section 4.e.




5. Troubleshooting

This section provides basic information about testing Shibboleth targets. This information is not intended to be comprehensive, but instead rudimentary guidelines for basic configuration tests and problems. For more detailed information or answers to specific problems not addressed in this section, please mail mace-shib-users@internet2.edu with a thorough description of errors and configurations used.

5.a. Basic Testing

The target may be tested by generating a folder with very basic access controls on it, and accessing it using a web browser. Place a simple webpage such as index.html in /secure/. Then, add the following lines to httpd.conf, which should be removed when testing is over:

# Configure a test directory
<Location /secure>
  AuthType shibboleth
  require valid-user

  # Per-directory SHIRE Configuration
  #ShibBasicHijack On
  #ShibSSLOnly On
  #ShibAuthLifetime 60
  #ShibAuthTimeout 600

  # RM Configuration
  #AuthGroupFile /foo
  #ShibExportAssertion On
</Location>

For information regarding specific error messages that may be generated if the target does not work successfully, please refer to section 4.b, or write mace-shib-users@internet2.edu.

5.b. Common Problems

A knowledge base is being developed in the Shibboleth Deployer's FAQ. Please mail mace-shib-users@ internet2.edu with any additional questions or problems encountered that are not answered by this basic guide.