Shibboleth Origin Deployment Guide
Shibboleth Version 1.2
April 14, 2004
Insert features here.
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 firstname.lastname@example.org. This should include, but not be limited to, questions about the documentation, undocumented problems, installation or operational issues, and anything else that arises. If you have not already obtained it, please download the Shibboleth origin tarball.
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.
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, can be obtained from www.pubcookie.org; the directory is provided by the origin site. Shibboleth is able to interface with a directory exporting an LDAP interface 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.
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.
The WAYF service can be either outsourced and operated by a federation 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.
A Shibboleth federation provides part of the underlying trust required for function of the Shibboleth architecture. A federation 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 federation 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 federation can be created in a variety of formats and trust models, but must provide a certain set of services to federation members. It needs to supply a registry to process applications to the federation 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 federation 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 federation members.
Some aspects of both origin and target configuration can vary and be expressed in terms of the "relying party". To an origin, a target is a relying party, while targets consider origins to be relying parties (it's a matter of perspective). Certificates, policies, and other aspects of an interaction are specified on the basis of the relying party, and may or may not vary between relying parties depending on the deployment's needs.
Each origin and target is assigned a URI, a unique identifier to enable control over configuration down to the level of an individual partner (a single relying party). By convention, this is termed a "providerId". More frequently, an entire federation will be viewed by an origin or target as a single relying party to simplify management. An individual origin or target with which this deployment exchanges information may sometimes be part of multiple relying parties if there are multiple trust agreements under which these transactions are performed. Care should be taken to avoid conflicting or inconsistent configuration in such cases.
Shibboleth "applications" are the primary unit of target configuration. Applications as viewed by the target implementation are not necessarily defined by the same metrics as in other contexts. An individual application represents a set of web resources that operates using the same attribute handling and trust configuration and shares a common session with the browser user. As a user navigates between resources on a server that cross an application boundary, a new session is established, though user interaction may not be required. As a consequence of the relationship between applications and sessions (which are tracked with a cookie), an application usually does not span more than one virtual host. Apart from cookie-based constraints, web resources can be aggregated into applications in arbitrary ways.
A single target deployment may support a large number of applications, but it need not register or publish information about each one with the origins it accepts information from. Instead it can communicate using a more limited set of distinct "providerId" values (often just a single one). This allows targets with a complex internal configuration to be treated as a single entity by origins for the purposes of attribute release.
Much of the target implementation is concerned with establishing, and subsequently maintaining, sessions with the browser user on behalf of the applications at the target. A session consists of a cookie passed between the browser and web server, associated with a security context. The context contains the user's authentication information, and generally a set of attributes that make up the user's identity. Each application maintains distinct sessions with the browser by means of separate cookies. It is important to note that all such sessions are independent and distinct: any session can exist with or without any other session, and the expiration of any one session does not imply the expiration of any other session. Shibboleth also does not support any logout functionality beyond the termination of individual application sessions by deletion of respective cookies; also, there is no way for the target to cause origin-side sessions, such as a user's SSO login, to expire.
A browser user accessing a Shibboleth-protected resource may have two outcomes: standard session establishment, and lazy session establishment. The standard session establishment mechanism in which Shibboleth protects the resource in all circumstances results in the establishment of a cookie-based browser session and a set of attributes cached for that application. Shibboleth 1.2 also supports so-called lazy session establishment, in which the resource may be accessed without prior authentication. This means the application must be intelligent enough to determine whether authentication is necessary, and then construct the proper URL to initiate a browser redirect to request authentication; if the application determines none is necessary or uses other authorization mechanisms, then the request for authentication may not need to be triggered. This complex functionality is mostly useful to protect a single URL with different access mechanisms, or to require authenticated access only in instances where the application deems it necessary.
Independently of this, a web-based application protected by Shibboleth may have a need to establish its own session with the user. This session may persist well beyond the Shibboleth session, and logouts from this session, if supported, will not terminate a Shibboleth session initiated to access the resource. Application administrators should carefully evaluate the expiration of all sessions to limit vulnerability to attacks or user negligence. Logging out of the entire desktop session is usually the only (relatively) foolproof logout mechanism on the web.
There are several essential elements that must be present in the environment to ensure Shibboleth functions well, both political and technical. Shibboleth is entirely written in Java on the origin side. These are the recommendations and requirements for a successful implementation of a Shibboleth origin.
While it is not necessary for a target or origin to join a federation, doing so greatly facilitates the implementation of multilateral trust relationships. Each federation will have a different application process. When an origin is accepted into a federation, its information is added to the sites file used by the WAYF and target sites.
Attribute release and acceptance policies, the use and caching of attributes, and definition of commonly traded attributes are examples of specifications a federation may make. The default configuration that ships with Shibboleth is intended for use in testing against a localhost target. In order to interoperate with other relying parties, such as a federation, consult the steps provided by the guidelines of that relying party.
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.
- SSL use is optional for origin sites. Federation 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.
- 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.
- 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. Proper security measures should also be in place on directory access and population(see Access Control in the LDAP recipe for more information). Use of plaintext passwords is strongly advised against.
- 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.
In the Shibboleth architecture, the origin and target must each 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 Federation rules. Different federations may require the use of different CA's.
The Attribute Authority maintains a set of policies called Attribute Release Policies (or ARP's) that govern the sharing of user attributes with Shibboleth target sites. When a user attempts to access a Shibboleth-protected resource, that resource's SHAR queries the user's AA for all attributes to which it is entitled. The SHAR provides its own name and the URI of the requesting application. The AA finds the attributes associated with the browser user, determines an "Effective ARP" for this user, and then sends to the SHAR only the attribute-value pairs allowed in this policy.
An ARP may be thought of as a sort of filter for outbound attributes; it cannot create attributes or data that aren't originally present, but it can limit the attributes released and the values those attributes may have when released. It does not change the information in the data sources in any way.
Each ARP is comprised of one or more rules that specify which attributes and values may be released to a given application and that SHAR. The assignment of rules to various targets is quite flexible and includes mechanisms for specifying: that a rule should affect all targets (default rule), exact SHAR names for which a rule is applicable, regular expressions against which SHAR names should be matched to determine if a rule is applicable, and individual applications that may span hosts and URL's as necessary.
For each request, an Effective ARP is determined by locating all ARP's applicable to the designated user and extracting each rule that matches the querying SHAR and resource. Attributes and values that are specified for release are included in the effective ARP, while those specified for denial are blocked from release. See section 5.b.i for details on how ARP's are processed.
Various ARP's may be combined in forming the Effective ARP. For instance, the Site ARP is administratively maintained and applies to all users for which the AA is answerable. User ARP's apply to a specific user only, and can be maintained either administratively or by the users themselves. All ARP's are specified using the same syntax and semantics.
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 federation members. It is recommended that at least technical and administrative contacts be designated. These contacts are then supplied to the federation and optionally to relying parties individually to facilitate communications and troubleshooting.
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.
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.
The following requirements are primarily recommendations based on the most common ways to run Shibboleth. However, the origin should be able to run under any servlet container supporting Servlet API v2.3 and JSP specification 1.2.
- Apache 1.3.26+ (<2.0)
- Tomcat 4.1.18-24 LE Java server and above
- Sun J2SE JDK v1.4.1_01 and above
Other versions of the JRE are not supported and are known to cause errors when working with certificates.
- mod_jk or mod_jk2
You may need to build mod_jk against Apache, which will generally require GCC or a platform-specific C compiler.
- An enterprise authentication mechanism
Ideally, this will be a WebISO or SSO system such as Pubcookie. The minimal requirement is for the web server to be able to authenticate browser users and supply their identity to the Handle Server.
- An enterprise attribute store
Shibboleth currently supports retrieving user attribute information from an LDAP directory or a SQL database. For testing purposes, Shibboleth also supports a minimal echo responder which will always return pre-defined attributes.
- Ensure you have already obtained the proper .tarball.
- The archive will expand into a shibboleth-origin-1.2/ directory(/opt/ recommended).
- Run the following command to move the Java files into Tomcat's tree:
cp /opt/shibboleth-origin-1.2/dist/shibboleth.war /usr/local/tomcat/webapps/
- Tomcat 4.1.x requires that several Java jarfiles used by Shibboleth be located in a special "endorsed" folder to override obsolete classes that Sun includes with their JVM. To deal with this problem use the following command, adjusting paths as needed:
$ cp /opt/shibboleth-origin-1.2/endorsed/*.jar /usr/local/tomcat/common/endorsed
Different versions of Tomcat or other Java servers may have other locations in which to place these files or deal with this problem. Refer to your application server's documentation to find out how to properly endorse classes, if necessary.
- Restart Tomcat, which will automatically detect that there has been a new .war file added. This file will by default be expanded into /usr/local/tomcat/webapps/shibboleth.
- Apache must be told to map the URL's for the Shibboleth HS and AA to Tomcat. Two popular ways of doing this are to include the following text directly in httpd.conf, or to place Include conf/mod_jk.conf in httpd.conf, and place the following lines in /etc/httpd/conf/mod_jk.conf:This will result in a HS URL of http://hostname/shibboleth/HS/.
--------- begin ---------
LoadModule jk_module libexec/mod_jk.so
JkMount /shibboleth/* ajp13
--------- end ---------
- Tomcat's /conf/server.xml ships by default with the Coyote/JK2 connector enabled, which fails with Shibboleth due to the lack of support for REMOTE_USER. This connector must be commented out. Then, uncomment and modify the traditional AJP 1.3 connector as follows:
- Add address="127.0.0.1" inside the <Ajp13Connector> configuration element to prevent off-host access.
- Add tomcatAuthentication="false" to the <Ajp13Connector> configuration element to ensure that the user's identity is passed from Apache to the servlet environment.
- The AJP13Connector for tomcat is not compatible with the new JMX support. To remove some warnings that will appear in the tomcat log every time tomcat is restarted, comment out all of the JMX stuff (anything that says "mbeans") from server.xml.
- It is strongly recommended that the AA be SSL-protected to protect attributes in transit. To do so, add an appropriate location block to httpd.conf:
SSLOptions +StdEnvVars +ExportCertData
- The origin's default configuration is designed to be tested against a target located on localhost, eliminating the need to join InQueue before being able to test an installation. It is recommended that the origin be tested now by constructing accessing a carefully formed URL using any web-browser and verifying that everything is functioning properly.
This section of the deploy guide describes only the default origin.xml file and enumerates the essential changes that need to be made to the configuration defaults for the origin to function successfully in a federated environment. More complex configuration will likely be required for many applications and federations; for a fully defined example origin.xml and definition of every element and attribute that may be used, please refer to section 5.a.
The default configuration that ships with Shibboleth is intended for use in testing against a localhost target. In order to interoperate with other relying parties, such as a federation, consult the steps provided by the guidelines of that relying party.
The main configuration file for Shibboleth's origin side is located in /webapps/shibboleth/WEB-INF/classes/conf/origin.xml. The configuration must be consistent with values elsewhere in the deployment, such as the HS' certificate and with directory access bindings, etc., or access errors may occur. All pathnames are relative, and have an effective root path of $TOMCAT_HOME/webapps/shibboleth/WEB-INF/classes/. To specify files outside of the webapp, specify a full URI, such as file:///usr/local/shibboleth/.
The following is a hyperlinked version of the basic configuration file, followed by a list of elements and attributes that must be modified as a first step to interoperation with production targets. Click on any attribute or element for more information on its population and definition.<?xml version="1.0"encoding="UTF-8"?>
<RelyingParty name="urn:mace:inqueue" signingCredential="foo">
<ErrorLog level="DEBUG" location="file:///tmp/shib-error.log"/>
<FederationProvider type="edu.internet2.middleware.shibboleth.metadata.provider.XMLMetadataLoadWrapper" uri="/conf/sites.xml"/>
The following changes must be made to the default configuration before the origin will interoperate in a federation.
Attributes within the ShibbolethOriginConfig element:
This will be the URL assigned the AA servlet in step 3.b. Note that this must be an https:// URL in order for the AA to authenticate the requesting SHAR.
This will be the URI assigned to this origin by the federation.
This is the URI of the primary federation that the origin operates within.
Although not explicitly necessary, it's highly recommended for initial installation and testing that logging be activated at the DEBUG level by uncommenting the second Logging element and ensuring that the pathnames for TransactionLog and ErrorLog are appropriate. However, in production, this will slow the operation of the origin considerably.
The default configuration file informs Shibboleth to load its key and certificate from flat files. The Key element specifies a key in DER format located at /conf/shib2.key, while the Certificate element specifies the corresponding certificate in PEM format located at /conf/shib2.crt. If any of these values is inconsistent with your deployment, change it accordingly. Note that keys are supported in a variety of formats: DER, PEM, encrypted PEM, PKCS8, and encrypted PKCS8. If a keystore must be used instead, consult section 5.a for appropriate structure and details on population.
To create proper keys and certificates for production use, please refer to section 4.b.
The resolver.xml file controls the retrieval of attributes from enterprise repositories, and the process of mapping them to Shibboleth/SAML attributes. For more precise information regarding how attributes are processed or syntactically formed, please refer to section 5.d.
In order to make the Shibboleth software operational, however, minor edits must be made to the example version of the resolver.xml file. The file can be found at /webapps/shibboleth/WEB-INF/classes/conf/resolver.xml. Two changes are necessary:
1. The value of the smartScope attribute should be changed to the Domain Name value submitted to the Federation. It appears on two SimpleAttributeDefinition elements: eduPersonScopedAffiliation and eduPersonPrincipalName.
2. The comment indicators should be removed from around the definitions of those two elements ( <!-- and --> ).
The default configuration of the attribute resolver utilizes the sample echo responder, which always responds with fixed, dummy values. The AA must be configured to use LDAP or SQL, depending on your primary attribute store.
The SAML messages generated by the HS must be digitally signed, which requires the HS be issued a private key and corresponding certificate. In most instances, the web server will be configured to use SSL, which will also require a cert/key pair. In many cases, these certs/keys can be shared between Apache/IIS and the HS; for information on sharing certificate/key pairs between Apache and Java keystores see section 5.c.. Sharing credentials is simplest when using flat-file unencrypted PEM-format certs/keys as expected by Apache.
The 1.2 origin accommodates keys and certificates in a very wide variety of formats and storage mechanisms. Java keystores may be specified in a KeyStoreResolver element or flat-file keys and certificates may be specified using a FileResolver in origin.xml. The information in that file must be consistent with the values that are established in this process.
The following text suggests a way to generate a key and certificate in flat-file PEM format, which will be simplest for most deployments. Once the key pair is generated, the public key must be sent to a certificate authority recognized by relying parties with which this origin will interact to be signed into a certificate. OpenSSL must be installed to perform this process.
The certificate and key file location should be based on whether they will also be used for Apache. If they will be used as a server certificate as well, they should probably be in the Apache tree in the usual mod_ssl-defined locations inside the Apache configuration folder. If the certificate and key will only be used by Shibboleth, they can be put in the same folder with the origin.xml file and protected appropriately.
OpenSSL commands to generate a new keypair and a certificate request are shown here, assuming 2048 bit 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 interaction between the HS and the local authentication system is implemented by supplying the HS with the identity of the browser user. Most often, this will mean protecting the HS servlet with some form of local authentication that populates REMOTE_USER. Location blocks can be added to httpd.conf, associating the appropriate authentication mechanism with the URL of the HS servlet. The following example demonstrates association of a very basic authentication method with the HS:
AuthName "Internet2 Handle Service"
Note that .htaccess files cannot be used for this purpose because URL's are "virtualized" by Tomcat.
It is recommended that the origin be tested at the end of this process using the process described in section 6.a.
Shibboleth supports client certificate authentication by utilization of a filter that relies on the web server to do all processing to ensure that the certificate is both valid and appropriate for the application. An example deployment descriptor is included with the Shibboleth distribution at $SHIB_HOME/webAppConfig/origin-client-cert.xml. To enable the filter, add the following to the deployment descriptor (web.xml):
Client Cert AuthN Filter
Client Cert AuthN Filter
By default, the filter pulls the principal name out of the CN of the cert's Subject by using regular expression grouping. This may be done using patterns such as:
regex: '.*CN=([^,/]+).*' match group: 1
The servlet filter will accept two initialization parameters, regex and matchGroup that can be used to extract the principal name differently.
For a more basic introduction to ARP's, please refer to section 2.e.
An ARP determines which attributes are released to a SHAR when a user tries to access a resource. It acts as a sort of filter on user information contained in the authoritative directory, deciding what can be released to whom, but not modifying or creating information itself. ARP's are generally administered by the site, but Shibboleth will provide for users to broker control of their own information and privacy by allowing them to create ARP's pertaining to themselves.
It is recommended that a set of policies be established between an origin and frequently accessed targets to specify default releases of expected attributes. Federation guidelines may provide more information on population of ARP's.
Currently, there is no direct mechanism for users to create their own ARP's besides direct XML writing. In future versions, a GUI will be provided for simpler management of ARP's. Care should be given to balancing giving sufficient control over information to users and avoiding access problems. For example, users may decide to restrict the release of their personal information to such a degree that access to a site for a class may become impossible because Shibboleth cannot release enough information to grant access.
The Shibboleth distribution contains an example site arp that releases the eduPersonScopedAffiliation attribute to all targets. For more precise information regarding how ARP's are processed or syntactically formed, please refer to section 5.b.i.
The Shibboleth origin leverages metadata distributed by relying parties and federations to validate the identity of requesters and the resource providers on whose behalf the request is being made. This metadata is cached locally in the form of sites.xml files. Shibboleth includes a simple utility called metadatatool which can be used to refresh a sites.xml file. These files are then pointed to by FederationProvider elements in shibboleth.xml.
The following command is appropriate for most deployments and is run from the $SHIB_HOME directory. This should be frequently run by adding it to a crontab to ensure that the data is fresh.bin/metadatatool -i https://wayf.internet2.edu/InQueue/sites.xml -k conf/internet2.jks -p shib123 -a sitesigner -o /your_path_here/sites.xml
This is a list of all the command-line parameters that may be specified:when signing: -i <uri> -s -k <keystore> -a <alias> -p <pass> [-o <outfile>]
when updating: -i <uri> [-k <keystore> -a <alias> OR -N ] [-o <outfile>]
-i,--in input file or url -k,--keystore pathname of Java keystore file -a,--alias alias of signing or verification key -p,--password keystore/key password -o,--outfile write signed copy to this file instead of stdout -s,--sign sign the input file and write out a signed version -N,--noverify allows update of file without signature check -h,--help print a list of configuration options -x,--ns XML namespace of root element -n,--name name of root element
Shibboleth 1.2 still utilizes mod_ssl for verification of certificates presented by SHAR's when processing attribute requests. This requires an updated ca-bundle.crt to ensure that all appropriate certificate authorities used by relying parties are recognized.
Shibboleth 1.2 origins are configured using the origin.xml file located in /webapps/shibboleth/WEB-INF/classes/conf/origin.xml. The XML consists of a set of individual elements that describe how the origin should operate, which may each have their own attributes or appear within other elements. This structure is represented through cross-references in the definitions and the examples presented in section 4.a, below, and through the examples in CVS.
The AAUrl, defaultRelyingParty, and providerId attributes of the ShibbolethOriginConfig element provide default values that will be used either when interacting with a target version 1.1 or lower or when not overridden by attributes on a RelyingParty element matching this request.
The following is an example origin.xml file which contains all possible configuration parameters and values. The configuration must be consistent with values elsewhere in the deployment or access errors may occur. For a more basic example, consult section 4.a. This is useful to demonstrate the structure that other types of configurations have. Few deployments will need configuration files this complex.<?xml version="1.0" encoding="UTF-8"?>
<!-- Default relying party -->
<RelyingParty name="urn:mace:inqueue" signingCredential="foo">
<!-- This site is in InQueue, but we want to send explicit errors to them -->
<RelyingParty name="urn:mace:inqueue:example.edu" signingCredential="foo" passThruErrors="true">
<!-- This references domain local service providers -->
<RelyingParty name="urn-x:localFed" signingCredential="bar" passThruErrors="true" providerId="urn-x:localSite">
<ErrorLog level="DEBUG" location="file:///var/log/shib-error.log" />
<TransactionLog location="file:///var//log/shib-access.log" />
<KeyStoreResolver Id="bar" storeType="JKS">
The following is a complete, alphabetical list of all configuration elements and their valid attributes and population. Each element also has a description of the elements it may contain and the elements that may contain it.
All pathnames are relative, and have an effective root path of $TOMCAT_HOME/webapps/shibboleth/WEB-INF/classes/. To specify files outside of the webapp, specify a full URI, such as file:///usr/local/shibboleth/.
All elements are optional unless otherwise specified. All attributes of an element are optional unless designated mandatory by a purple background.
- <ArpRepository implementation ="edu.internet2.middleware.shibboleth.aa.arp.provider.FileSystemArpRepository">
This element specifies an individual implementation of a release policy engine, with the given value specifying Shibboleth's file-based ARP repository implementation, which is currently the only available. This must contain a Path element pointing to the directory containing ARP's to be used by this engine. For more information regarding ARP's, consult section 4.d for basic information and 5.b for advanced configuration and syntax.
Note that the set of principals that an ARP applies to is not expressed by the ARP itself, but rather the implementation of the ARP repository. For example, if the ARP repository were implemented in LDAP, the ARP's that apply to a user would be attributes of that user's personal LDAP entry, and the site ARP would be an attribute of an entry representing the site. While not performed by the built-in ARP repository, a repository implementation might also implement group ARP's; for example, in an LDAP directory, the user entry might have some group membership attributes that refer to group entries, and those group entries would have ARP attributes, and all those ARP's would be applicable.
- Paired with a Path element and contained by a FileResolver element, this element allows for the specification of additional certificates in the chain up to the trust anchor. As many CAPath elements as necessary to complete the chain may be specified. The expectations of the target and the federation may determine the necessity for the use of this field.
- Specifies the alias for the certificate corresponding to the private key used by the HS. If no alias is specified, defaults to the private key's alias. Contained by the KeyStoreResolver element.
- <Certificate format="type">
- This specifies the certificate corresponding to this set of credentials. The certificate itself must be referred to using a Path element contained by this element. If this certificate isn't self-signed or signed by a root familiar to the target, the files of certificates in the path to the root may be specified using one or more CAPath elements. Valid encodings are PEM and DER. It resides within the FileResolver element and must be paired with the corresponding private key using the Key element.
- <Credentials xmlns="urn:mace:shibboleth:credentials:1.0">
- This element is the container for credentials used by the credential mechanism specified by the ShibbolethOriginConfig element. It must contain one FileResolver element for flat key and certificate files or one KeyStoreResolver element for compound keystores.
- <ErrorLog level="level" location="URL">
- Paired with a TransactionLog element, this will log any errors encountered by the origin above a certain logging threshold to a flat file at the referenced URL. Valid levels in order of decreasing sensitivity are DEBUG, INFO, WARN, ERROR, and FATAL. If no logging is desired, specify OFF; defaults to WARN. Must be contained by a Logging element.
- <FederationProvider type="edu.internet2.middleware.shibboleth.metadata.provider.XMLMetadataLoadWrapper" uri="pathname"/>
- Individual sets of targets in the form of an XML file that this origin will trust to make requests may be specified by adding FederationProvider elements to the main ShibbolethOriginConfig element for each. The uri attribute points to an XML file, generally signed and distributed by federations. This file should be regularly refreshed using metadatatool.
- <FileResolver Id="string">
- This element defines a pair of files used to store a private key and certificate associated with a given identifier and is contained by the Credentials element. RelyingParty elements will refer to these identifiers allowing multiple resolver elements to be used to specify different credential storage for different federations or target sites. It must contain one Key element and should contain one Certificate element.
- <HSNameFormat nameMapping="id"/>
- Individual RelyingParty elements may contain this element to specify the NameMapping element referenced by id to be used in generating subject names for this relying party. If this element is not present, default Shibboleth handles will be used.
- <Key format="type">
- This specifies the file containing a private key to be used by a set of credentials. Valid encodings are PEM and DER. Keys are supported in a variety of formats: DER, PEM, encrypted PEM, PKCS8, and encrypted PKCS8. It resides within the FileResolver element, should be paired with a Certificate element, and contain a Path element.
- Specifies the alias used for accessing the private key. Contained by the KeyStoreResolver element.
- Specifies the password used to retrieve the private key. Contained by the KeyStoreResolver element.
- Specifies the alias used for accessing the private key. Contained by the NameMapping element when a CryptoHandleGenerator type is specified.
- Specifies the password used to retrieve the private key. Contained by the NameMapping element when a CryptoHandleGenerator type is specified.
- Specifies the password to access the keystore containing the private key to be used for symmetric encryption. Contained by the NameMapping element when a CryptoHandleGenerator type is specified.
- Specifies the location of the keystore containing the private key to be used for symmetric encryption to pass handles between the HS and AA. Contained by the NameMapping element when a CryptoHandleGenerator type is specified.
- <KeyStoreResolver Id="string" storeType="type">
- This element is contained by the Credentials element to specify a keystore that contains both the certificate and private key for a given set of credentials. Typically, this will be a Java keystore, with a corresponding type of JKS. RelyingParty elements will refer to the Id allowing multiple resolver elements to be used to specify different credential storage for different federations or target sites. It must contain one Path element, one KeyAlias element, and one StorePassword element; it may optionally contain a KeyPassword element or a CertAlias element.
- <Log4JConfig location="pathname"/>
- This element informs Shibboleth to utilize Log4J as a logging system and points to the relevant configuration file using the location attribute. A basic configuration is included with the distribution at /WEB-INF/classes/conf/log4j.properties. This is set up to log to the console of the servlet container with a level of WARN, but there is also a commented-out example in the file to give a possible alternate configuration. This element must be contained by a Logging element and may not be paired with a TransactionLog or ErrorLog element.
- This container element identifies a logging method for both the HS and AA to use and may not occur more than once. Three different logging methods may be specified depending on what is placed inside this element. If nothing is specified, then all logs go to the container console. If ErrorLog and TransactionLog elements are present, more traditional logging flatfiles will be generated at the locations specified. A Log4JConfig element instructs the origin to use Log4J logging.
- <NameMapping xmlns="urn:mace:shibboleth:namemapper:1.0"
- This element defines a name mapping system to create SAML assertion subject names for users; in standard Shibboleth, this will be the creation of a handle to be given to the SHAR and shared with the AA.
- format should be populated with the URN urn:mace:shibboleth:1.0:nameIdentifier if traditional Shibboleth handles are used.
- handleTTL specifies in seconds how long a given handle will be considered valid; an expired handle will require the user to obtain a new handle and possibly re-authenticate. This field is only valid if Shibboleth handles are being used, e.g. format is urn:mace:shibboleth:1.0:nameIdentifier. Consult your federation guidelines for guidance on the population of this field.
- id is used by HSNameFormat elements to refer to this element and must be unique.
- type dictates how subject names such as handles are passed internally from the HS to the AA. The valid types are:
- CryptoHandleGenerator: Shibboleth handles will be passed using symmetric encryption. If this is specified, keystore information must be specified using one KeyStorePath element, one KeyStoreKeyAlias element, one KeyStorePassword element, and optionally a KeyStoreKeyPassword element.
- Principal: Shibboleth will use the primary unique identifier for the individual and not generate a handle.
- SharedMemoryShibHandle: Shibboleth will use a shared in-memory repository.
- This mandatory element specifies the path to a file or directory utilized by other elements of the configuration. It may be contained by various elements to point to different types of files required by the origin.
- The ReleasePolicyEngine element is used to specify a class of release policy processing. This should contain one ArpRepository element.
- <RelyingParty name="URI"
The RelyingParty element is used to specify one or more relying parties that this origin must recognize. This includes any federations the origin is a member of, any targets that have established bilateral agreements with the origin, or any other trust structure that origin must be aware of. In addition to its attributes, this element may contain a HSNameMapping element to specify a naming mechanism for assertions sent to this relying party. The HS and AA both perform validation against federation metadata to ensure that targets cannot construct requests that would be used to impersonate another target or other malicious behavior.
The proper RelyingParty element to handle a given attribute request is selected by the following algorithm. If at any point a match is found, processing is complete; only one relying party will be used for any given request.
- If the requesting provider is unauthenticated -- due to a lack of SSL client authentication because the AA is not protected by an https:// URL -- the default relying party is always used.
- If the requesting provider is Shibboleth 1.1 or less, the default relying party is used.
- If a RelyingParty element's providerId attribute matches the name sent by the target, then that element is used.
- A metadata lookup is performed using the sites.xml files supplied by all FederationProvider elements to determine whether the target is a member of a common federation. If there is a RelyingParty element that has the same name as the URI of the the federation, it is used. If not, the default relying party handles the request.
- name: Each RelyingParty element is differentiated by a URI specified in the name attribute. A target will send a value for this attribute with the attribute request; if the URI sent matches the name, this element will be used in the transaction. If there is no direct match, the origin uses metadata to try to find a federation that the service provider is a member of.
- AAsigningCredential: This attribute must equal the identifier of one of the FileResolver Id's. A separate set of credentials may be specified for the AA's signing of assertions/SSL session identification using this attribute, as opposed to the HS' signing of assertions. If this is not specified for this RelyingParty element, but a signingCredential attribute is, that set of credentials will be used instead. Ensure that the appropriate signing key is selected for each; an incorrect signing key will lead to trust failures.
- AAUrl: This specifies the URL for the AA to be used in conjunction with attribute requests from this relying party. It over-rides, is populated, and operates in the same manner as the AAUrl attribute of the ShibbolethOriginConfig element.
- defaultAuthMethod: The value of this attribute represents the mechanism by which the user's authentication was performed. It is used to populate authenticationMethod in SAML assertions passed to this relying party if no other authentication method is passed to the HS. For a brief list of authentication methods, consult the same attribute as part of the ShibbolethOriginConfig element.
- passThruErrors: If true, the origin will relay all Java exception messages that occur during a failed transaction without any sort of filtering. While this is valuable for debugging interaction and providing additional information in case of failure, there is a risk of revealing sensitive information to the target if true.
- providerId: If the origin must assert under a different name to this relying party, specify a providerId attribute which will over-ride the one specified in ShibbolethOriginConfig.
- signAttrAssertions: If this boolean attribute has a value of true, the attribute assertion within the SAML response will be signed. This is mostly useful for using the attribute assertion in contexts outside of the response and defaults to false.
- signAttrResponses: If this boolean attribute has a value of true, the attribute response itself will be signed in addition to the security and authentication provided by the SSL session. SAML responses contain one or more assertions. Defaults to false.
- signAuthAssertions: If this boolean attribute has a value of true, the authentication assertion within the SAML response will be signed. This is mostly useful for using the authentication assertion in contexts outside of the response and defaults to false.
- signAuthResponses: If this boolean attribute has a value of false, the authentication response will not be signed. SAML responses contain one or more assertions. Defaults to true.
- signingCredential: This attribute must equal the identifier of one of the FileResolver Id's. This allows the origin to use different signing keys and certificates for exchanges with different federations or targets. Ensure that the appropriate signing key is selected for each; an incorrect signing key will lead to trust failures.
This is the primary element that defines an origin.xml file and is the container for every other element and must appear once and only once. For most deployments, all the xmlns attributes, which specify the handlers for different aspects of origin operation, should remain unchanged. The mandatory attributes must be changed before operating the origin.
- defaultRelyingParty: This specifies the relying party to use for a request when no RelyingParty element's name attribute matches the policy URI of an incoming request. Typically, this will be populated with the URI of a federation.
- providerID: The origin uses this unique name to identify assertions it issues. This will usually be assigned by a federation.
- AAUrl specifies the URL where the default AA to be utilized by this origin unless a relying party is matched resides, which must be consistent with how it is defined in Tomcat. Note that this must be an https:// URL in order for the AA to know which SHAR is requesting attributes for ARP purposes.
- authHeaderName: If authentication methods are passed to the HS using an HTTP header variable other than the default, SAMLAuthenticationMethod, the name of the variable may be specified here.
- defaultAuthMethod: This specifies the authentication method that will be assumed if none is passed through and there is no overriding defaultAuthMethod specified for this target using a RelyingParty element. If neither this element nor the matching RelyingParty element contains this attribute, a value of urn:oasis:names:tc:SAML:1.0:am:unspecified will be used for authenticationMethod. Some common authentication methods and corresponding URI's are listed below; for a complete list, please consult section 7.1 of the SAML 1.1 core specifications or your federation's guidelines.
urn:oasis:names:tc:SAML:1.0:am:password The authentication was performed using a password. urn:ietf:rfc:1510 The authentication was performed using Kerberos. urn:oasis:names:tc:SAML:1.0:am:X509-PKI The authentication was performed using a certificate and key issued to the end user. More specific forms of PKI authentication such as SPKI and XKMS are also assigned URN's in the SAML specs.
- maxHSThreads: This attribute places a limit on the number of threads the handle service will spawn and may be useful for limiting the load of signing and other operations and improving performance. Most deployments should leave this as defaulted.
- passThruErrors: This boolean attribute determines whether the origin will relay errors in flows to the target for use in displaying these errors to the browser in the case of an unsuccessful transaction. Within the default, this should be false unless debugging is necessary.
- resolverConfig specifies the location of the configuration file for the resolver the AA uses to build attributes and if unspecified defaults to /conf/resolver.xml. For information on how to configure and use the attribute resolver, consult section 4.e.
- Specifies the password for the keystore. Contained by the KeyStoreResolver element.
- <TransactionLog location="URL">
- Paired with an ErrorLog element, this will log all transactions that the origin is involved in. The information in this file is sensitive and may be useful for auditing and security purposes. Must be contained by a Logging element.
This section applies primarily to the syntactic and technical details of ARP's as defined by the standard, file-based repository implementation. For basic information on and explanation of what an ARP is and how it should be managed, please refer to sections 2.e and 4.d.
Every ARP file contains one ARP. ARP's may be specified either as the site ARP or user ARP's. The site ARP pertains to every principal for whom the AA retrieves information; a user ARP applies only to the individual user for whom it is defined. The set of principals to whom the ARP applies is defined by the name of the ARP file: the site ARP is stored in arp.site.xml and user ARP's are stored as arp.user.$PRINCIPALNAME.xml. Up to two ARP's will apply to a principal: the site ARP, and the user ARP for that principal.
Each ARP acts as a container that holds a set of ARP rules that are applicable to the principals that ARP is effective for. Each ARP rule specifies a single release policy pertaining to a particular target application. For 1.2 targets, this is a single URI matching a providerId. Prior to 1.2, URI's for targets were not registered; this means that the SHAR name must be used in release policies for 1.1 targets accessed by users from this origin. Each ARP rule may contain specifications regarding the release of any number of attribute values to requests matching that ARP rule for that user. ARP rules may be flagged as default, implying that they are always applied to any user matched by the ARP container. Note that ARP's may also be used to restrict specific attribute/value pairs in addition to restricting or releasing individual attributes.
When a query is received, the AA generates an effective ARP, which is the fully evaluated set of ARP rules regarding that relying party based on all ARP containers applicable to the principal. This effective ARP is then applied to attribute values retrieved from the directory and the appropriate assertion is constructed. Default rules are always included in construction of the effective ARP.
When a request arrives from a particular application, the applicable set of ARP rules are parsed into an effective ARP. This parsing is done as follows:
- Identify all ARP's that should be applied to a particular principal. This is done by isolating the files in the folder specified by the ArpRepository element that have the name either arp.site.xml or arp.user.$PRINCIPALNAME.xml.
- Find all ARP rules relevant to the query:
- Any ARP rules within the identified ARP's designated as defaults are automatically included in the effective ARP without performing any matching functions.
- For each non-default rule in each identified ARP, the matching functions specified in the rule's target definition are performed. A separate matching function is performed for the requesting SHAR and the providerId on behalf of which the SHAR is making the request.
- Each matching function evaluates to TRUE if the match is successful or FALSE if it is unsuccessful. If both functions evaluate to TRUE, the rule is included in the Effective ARP.
- Construct the Attribute Filter:
- For each attribute, compile a temporary list of associated rules that includes all values with a release qualifier of permit.
- Subtract from this list all attribute values with rules specifying a release qualifier of deny. The resulting list represents the allowable release values for the attribute and is used as a mask for the values which are returned from the Attribute Resolver.
- If a statement specifies that all values should be permitted, then specific deny qualifiers for specific values should still be enforced. If a statement specifies that all values should be denied, then permit qualifiers for specific values will be ignored.
- Using the mask and attributes returned from the Attribute Resolver, an assertion is constructed.
Each ARP is described by an XML file based on a standard .xsd schema. It consists of a standard AttributeReleasePolicy element referencing the appropriate xsi:schemaLocation and a self-explanatory Description element followed by any number of Rule elements. Each Rule element must consist of a Target element and one or more Attribute elements. The Target element specifies the rules by which the target definition is formed. The Attribute elements specifies the name and values of the attributes that may be released.
The simplest possible ARP is as follows, which releases eduPersonScopedAffiliation to any target for the users the ARP applies to:
<AttributeReleasePolicy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:mace:shibboleth:arp:1.0" xsi:schemaLocation="urn:mace:shibboleth:arp:1.0 shibboleth-arp-1.0.xsd">
<Description>Simplest possible ARP.</Description>
<AnyValue release= "permit"/>
All ARP's must take the same basic form. A detailed description of how each element of the Rule element may be sub-populated follows:
The Target element:
Target may contain either the AnyTarget element, which will cause the Target to always return TRUE, or both the Requester element, which provides for matches to be performed against the SHAR name for 1.1 targets or the providerId for 1.2 targets, and the Resource element, which provides for matches to be performed against the requested URL.
When going against 1.1 targets, the Resource element will refer to individual URL trees protected by a given SHAR. However, due to the nature of application identifiers, the Resource element has no meaning when releasing to 1.2 targets. These will always function as though <AnyResource/> is specified, making the entire Resource element necessary only if this origin will be applying this ARP to 1.1 targets.
There are three matches that may be performed by the AA in evaluating ARP's by using the matchFunction component of the Requester and Resource elements. The following match patterns may be specified directly following the Requester or Resource elements, such as <Requester matchFunction="urn:mace:shibboleth:arp:matchFunction:regexMatch">:
May be used with the Requester element.
Evaluates to TRUE when the string content of the Requester element matches exactly the providerId of the requesting application of 1.2 targets or the SHAR name of 1.1 targets. Otherwise evaluates to FALSE. Serves as the default value associated with Requester if none is specified.
May be used with the Resource element. However, this has no meaning when releasing to 1.2 targets.
Evaluates to TRUE when the location of the resource either matches exactly or begins with the string content of the Resource element. Otherwise evaluates to FALSE.
May be used with both the Requester and Resource elements.
Evaluates to TRUE when the providerId of a request for 1.2 targets or the name of the requesting SHAR for or the requested URL tree for 1.1 targets is a valid match of the regular expression represented as the content of the containing element. Otherwise evaluates to FALSE. Regular expressions are evaluated in accordance with the the Java 1.4 Pattern API.
The Attribute element:
The Attribute element must always specify the URN of the attribute whose release parameters it specifies. Additionally, it must contain either the AnyValue element or one or more Value elements. These elements, in turn, must specify either release = permit or deny. The Value element must then contain one value for which the rule applies. Examples:
Permits the release of eduPersonPrincipalName with any value.
Denies the release of eduPersonScopedAffiliation value email@example.com. Other values of the attribute may still be released if so specified by a permit ARP.
Credentials stored in PEM and DER files, as is standard for Apache, are supported by Shibboleth 1.2 and later. In most deployments, it will be easiest to simply reference those using a FileResolver element. The information in this chapter is still relevant if there is a need to share keys between PEM/DER flatfiles and a Java keystore.
The JDK includes the command line program keytool for managing Java keystores. This utility cannot import or export private key information, making it difficult to use the same private key and certificate for Apache and Java-based applications. The Shibboleth distribution includes extkeytool, a program that can be used in conjunction with keytool to perform these tasks. Select the appropriate step-by-step procedure for your situation from the following guides.
Before running extkeytool, the variable SHIB_HOME must be set to the path to the directory where the Shibboleth tarball was exploded(typically /opt/shibboleth-origin-1.2/).
If you have a pre-exiting RSA key/certificate combination in a keystore and you would like to use it with Apache:
- Determine the alias of the keystore keyEntry containing the key you would like to use in your Apache setup. Assuming that your keystore is named yourstore, the following command should present a list of the entries in the keystore.
$ keytool -list -v -keystore yourstore
- Assuming that you identified the appropriate alias as youralias and the password for the keystore is yourpass, enter the following command to export the key in Base64-encoded pkcs8 format.
$ extkeytool -exportkey -keystore yourstore -alias youralias -storepass yourpass -rfc -file yourkey.pkcs8
- In order to use this key with Apache, you must convert it to PEM-encoded RSA native format. You have the option of storing the key unencrypted or encrypted:
- To use the unencrypted format, enter the following command for the conversion:
$ openssl pkcs8 -in yourkey.pkcs8 -nocrypt|openssl rsa -out yourkey.key
- To use the encrypted format, enter the following command for the conversion:
$ openssl pkcs8 -in yourkey.pkcs8 -nocrypt|openssl rsa -des3 -out yourkey.enckey
- The following command will export the corresponding certificate.
$ keytool -export -keystore yourstore -alias youralias -rfc -file yourcert
- Set the mod_ssl SSLCertificateKeyFile and SSLCertificateFile directives to point to the two files you have just created. Take care to remove any temporary files you created (i.e. yourkey.pkcs8) and set appropriate file permissions, especially if you chose to store the key in an unencrypted format.
If you have a pre-existing RSA key/certificate combination that you use with Apache and would like to import it into a java keystore:
- Convert the private key to unencrypted DER-encoded pkcs8 format. Assuming your PEM-encoded key is stored in a file named yourkey.enckey, enter the following command.
$ openssl pkcs8 -in yourkey.enckey -topk8 -nocrypt -outform DER -out yourkey.der.pkcs8
- Create a certificate bundle file. This file should include a series of PEM-encoded X509 certificates representing a complete trust chain, from the root CA certificate to the certificate that matches your private key. If your certificate is stored in a file named mycert and the CA signer certificate is stored in a file named ca.cert, you might enter the following command to create the bundle.
$ cat mycert ca.cert > cert.bundle
Note: mod_ssl-enabled Apache installations include a number of commonly recognized CA certificates in the ca-bundle.crt file under the $ServerRoot/conf/ssl.crt/ directory.
- Import the key and certificate into the keystore. Assuming you have already created a keystore named yourstore with a password of of yourpass, enter the following command to store the data under the alias youralias.
$ ./extkeytool -importkey -keystore yourstore -alias youralias -storepass yourpass -keyfile yourkey.der.pkcs8 -certfile cert.bundle -provider org.bouncycastle.jce.provider.BouncyCastleProvider
- You can verify that the import was successful by listing entry. Use the command below.
$ keytool -list -v -keystore yourstore -alias youralias
- Remember to delete yourkey.der.pkcs8, as it contains your unencrypted private key.
If you are starting from scratch and do not yet have a certificate/key pair:
- Generate an RSA private key. Use the command below, substituting yourkey with an appropriate name to use to refer to the key.
$ openssl genrsa -des3 -out yourkey.enckey 1024
- The following command generates a Certificate Signing Request, which should be communicated to a Certificate Authority.
$ openssl req -new -key yourkey.enckey
- The Certificate Authority should respond with a PEM-encoded X509 certificate. Set the mod_ssl SSLCertificateKeyFile directive to point to the key file you just created and the SSLCertificateFile directive to point to file containing the certificate issued by the Certificate Authority. Previous sections explaion how to share the key/certificate pair with a Java keystore.
Shibboleth provides a powerful attribute resolver that allows origins to quickly configure the retrieval of simple attributes from standard types of attribute stores. The resolver is configured using an xml file which should be pointed to with the edu.internet2.middleware.shibboleth.aa. attrresolv.AttributeResolver.ResolverConfig property in origin.xml as described in section 4.a. For more complex attributes or those that require processing before release, customized Java classes will need to be written. For more information, consult the programmer's guide.
The resolver is essentially a directed graph from attribute definitions to data connectors. The data connectors pull data, in the form of attributes, from external data sources. The attribute definitions then process this data into a form suitable for use by Shibboleth. This procedure can be as simple as taking an unmodified string value from a data connector and tagging it with a name or can include arbitrarily complex business rules.
The resolver.xml file that is pointed to by origin.xml consists of zero or more attribute definitions followed by zero or more data connectors. Each attribute definition consists of an identifier corresponding to the URN of the attribute, and optional references to data connectors on which it depends. Each data connector consists of a string identifier which is used by attribute definitions that refer to it, and one or more elements specific to the configuration of that data connector.
Version 1.2 of Shibboleth comes with two attribute definitions: the SimpleAttributeDefinition, which acts as a basic proxy for attributes supplied by data connectors with some name conversion and attribute scoping added, and a CustomAttributeDefinition, which can be used to configure user-created attribute definition plugins. Similarly, Shibboleth 1.2 comes with two data connectors: the JNDIDirectoryDataConnector, which pulls data from any source for which there is a JNDI Directory Context implementation, including LDAP, NDS, etc., and the CustomDataConnector, which is used to configure user-created data connector plugins.
A detailed explanation of each configuration option for the provided connectors follows:
- id = <string>
- Specifies a unique, textual name for the connector used by attribute definitions to refer to and use it to build attributes. Contained within the JNDIDirectoryDataConnector element.
- <Property name="<name>" value="<value>"/>
- An element of the element JNDIDirectoryDataConnector. Specifies a set of name/value pairs that are used to configure the JNDI Directory Context. This list of name/value pairs is defined by the context itself, but is specified within resolver.xml. Refer to the Shibboleth CVS for an example of names and values used to connect to an LDAP directory.
- An element of the element JNDIDirectoryDataConnector. This element defines the search filter used to perform the LDAP query. The search string must return no more than one result.
- An element of the element Search. This element grants some fine-grained control over the LDAP API calls.
- <cacheTime "<seconds>"/>
- An element of the element JNDIDirectoryDataConnector. Specifies an optional duration in seconds for which the attribute resolver may cache information retrieved from this connector. The default is zero seconds (no caching)
A representation of a properly constructed JNDIDirectoryDataConnector element would look like:
<Controls searchScope="SUBTREE_SCOPE" returningObjects="false" />
<Property name="java.naming.factory.initial" value="com.sun.jndi.ldap.LdapCtxFactory" <Property name="java.naming.provider.url" value="ldap://directory.cis-qas.brown.edu:636/dc=brown,dc=edu" /> <Property name="java.naming.security.principal" value="cn=stc_query,ou=Special Users,dc=brown,dc=edu" /> <Property name="java.naming.security.credentials" value="password" /> />
If the ldap server must be accessed over SSL, and JDK 1.4.1 is being used, two changes must be made to the JNDIDirectoryDataConnector element:
1. On the java.naming.provider.url Property, add <port number> after the hostname in the ldap url (the default port for ldap over SSL is 636),
2. Add this Property element:
<Property name="java.naming.security.protocol" value="ssl" ">
If the ldap server must be accessed over SSL, and JDK 1.4.2 is being used, then change ldap:// to ldaps:// in the value of the java.naming.provider.url Property.
NOTE: This assumes that the ldap server's cert is rooted with a CA that is in the JVM's default keystore (ie: a commercial CA). If not, the CA cert must be added.
- id = <string>
- Specifies a unique, textual name for the attribute which is used as the attribute's name when it is sent over the wire by Shibboleth. Contained within the SimpleAttributeDefinition element.
- <AttributeDependency / DataConnectorDependency requires="<id>"/>
- An element of the element SimpleAttributeDefinition, which may contain 0 or more of either AttributeDependency or DataConnectorDependency. These specify attributes and data connectors that can be utilized by this attribute definition. Each of these elements must contain a requires statement which this attribute definition can then use to build its value.
- smartScope = "<domain>"
- Specifes a domain scope to be attached to the attribute. If the value of the attribute as retrieved from the data connector includes a pre-existing scope (firstname.lastname@example.org), that scope is used instead. Contained within the SimpleAttributeDefinition element.
- <lifeTime "<seconds>"/>
- Specifies in the attribute assertion how long the attribute should be cached and retained by the target upon receipt. Federations and trust agreements may have some bearing on the population and use of this field. Contained within the SimpleAttributeDefinition element.
- sourceName = "<string>"
- Specifies a different source attribute name to be used in calls to the data connector, while the name on the wire will be the specified id. This would be useful to send a local UniversityID attribute as eduPersonPrincipalName. If not supplied, the connector tokenizes the id field and uses the section following the # to query data connectors. Contained within the SimpleAttributeDefinition element.
- <cacheTime "<seconds>"/>
- Specifies an optional duration in seconds for which the attribute resolver may cache this attribute for use in additional assertions. Contained within the SimpleAttributeDefinition element.
A representation of a properly constructed SimpleAttributeDefinition element would look like:
smartScope="shibdev.edu" cacheTime="600" lifeTime="3600" sourceName="universityPerson">
A properly formed resolver.xml file to automatically generate a simple response for EPPN may take the form:
<AttributeResolver xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:mace:shibboleth:resolver:1.0" xsi:schemaLocation="urn:mace:shibboleth:resolver:1.0 shibboleth-resolver-1.0.xsd">
<SimpleAttributeDefinition id="urn:mace:dir:attribute-def:eduPersonPrincipalName" smartScope="shibdev.edu">
<CustomDataConnector id="echo" class="edu.internet2.middleware.shibboleth.aa.attrresolv.provider.SampleConnector" />
There are additional examples of resolver.xml files provided in the Shibboleth CVS.
Shibboleth comes bundled with the command line utility resolvertest for testing Attribute Resolver configurations. This program takes as input resolver.xml, the name of a user, and optionally the name of a requesting SHAR. It outputs the resulting SAML <Attribute /> elements. This allows administrators to view the results of tweaking the resolver configuration without having to continually reload the origin web application. resolvertest is also useful for testing when the AA is first configured to use an attribute repository (ldap or sql). Initially, the following two steps must be performed:
- Set the shell variable SHIB_HOME to the directory path where the Shibboleth tarball was exploded (typically /opt/shibboleth-origin-1.2/).
- Move to $SHIB_HOME/bin
resolvertest may then be used by executing the shell script, passing the name of a user and a URL to the Attribute Resolver configuration file as parameters. For example:
$ ./resolvertest --user=wassa --file=file:///$SHIB_HOME/src/conf/resolver.xml
NOTE: This program does not filter the resulting attributes through the applicable ARP's. Although it does show the attributes generated by the resolver for a particular user or URL, it does not necessarily reflect what will be released by the AA to a requesting SHAR.
Origin sites are encouraged to provide federations with the URL of a local Shibboleth error page. If a browser user from the origin site encounters a problem at a shibbolized target, the target is likely to display an error page that includes a link back to this origin provided page.
The page should provide information on how to obtain local support for using Shibbolized resources. It might also include suggestions on what information should be recorded before beginning the problem resolution process.
In order for an attribute to be sent to a target, two steps are required:
1. The attribute has to be defined in resolver.xml. See section 5.d.
2. The effective ARP for that target has to release this attribute value. See section 5.b..
Note: resolvertest is a useful tool for verifying the correctness of the definitions.
Note: the AAP at the target must also define this attribute. See the Shibboleth Target Deploy Guide.
This section provides basic information about testing, logging, and error handling for Shibboleth origins. 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 email@example.com with a thorough description of errors and configurations used.
Internet2 provides a basic target that can be used to test origin setup functionality. After your origin is recognized by InQueue, simply use any browser to access https://wayf.internet2.edu/InQueue/sample.jsp. Select your origin's name and follow the login process as a user would. Note that SSL must be used, and both the HS and AA must be fully configured.
The test target will then display a simple page which includes the basic information sent to it by your origin and the authentication rules it is using.
For information regarding specific error messages that may be generated if the origin does not work successfully, please refer to section 6.c.
Shibboleth's origin components log various operations which may prove useful for auditing, testing, and security purposes. This data is sent through log4j's standard mechanism. The location of the log file, the level at which the log is output, the formatting of the logs, and many more options may be configured by editing /WEB-INF/classes/conf/log4j.properties. By default, it is setup to log to the console of the servlet container, with a level of WARN, but there is also a commented out example in the file to give a possible alternate configuration.
A knowledge base is being developed in the Shibboleth Deployer's FAQ. Please mail firstname.lastname@example.org with any additional questions or problems encountered that are not answered by this basic guide.