DACS_AUTH_TRANSFER(8) | DACS Web Services Manual | DACS_AUTH_TRANSFER(8) |
NAME¶
dacs_auth_transfer - transfer credentials between federations
SYNOPSIS¶
dacs_auth_transfer [dacsoptions[1]]
DESCRIPTION¶
This web service is part of the DACS suite.
The dacs_auth_transfer service securely exports credentials (which represent an identity) from one DACS federation to another (or from DACS to a different identity management system), or securely imports an identity from one DACS federation to another (or from a different identity management system to DACS). This ability to transfer credentials (i.e., import or export them) lets a DACS federation federate with another system, creating a "super federation" with single sign-on capability. DACS calls such federations affiliated federations.
A DACS federation can use dacs_auth_transfer to leverage authentication mechanisms not available to it, other systems can use it to leverage DACS, and users can potentially access any access-controlled resource located in any of the cooperating federations.
In a Nutshell
For two DACS federations, here is how the service is typically used. One or more jurisdictions in Federation A provide links labelled "Transfer Login To Federation B" (or similar). Following any of these links will initiate the mechanism to export the user's identity to Federation B. Alternatively, or additionally, one or more jurisdictions in Federation B provide links labelled "Transfer Login From Federation A". Following any of these links will initiate the mechanism to import the user's identity from Federation A.
A user authenticates in Federation A, obtaining credentials understood only in that federation. When the user decides to access resources in Federation B, he follows one of the links. Assuming all access control constraints are satisfied, new credentials will be returned to him that are understood in Federation B. His existing Federation A credentials continue to exist.
The user is now recognized by both federations. If the user is known as FedA::J1:bobo in Federation A, then he will also be known by that name in Federation B. If Federation B happens to have a jurisdiction named J1 and a user at that jurisdiction named bobo, that user (FedB::J1:bobo) is separate and distinct as far as DACS is concerned.
Note that, in general, it is not correct in the scenario above for Federation B to automatically initiate a credential transfer if an unauthenticated user (with respect to Federation B) is denied access. This is because Federation B cannot tell with which federation it should be initiated (if there is more than one) or even if this is something that the user wants done (perhaps the user needs to authenticate in the usual way at Federation A). Therefore, except perhaps in special circumstances, explicit user interaction is necessary.
For DACS, the complete protocol is implemented by one program, dacs_auth_transfer. It provides the importing, exporting, and server-to-server stages of the protocol and it can also optionally assist middleware with the initial presentation stage of the protocol. The protocol is described below.
If an identity needs to be imported to a non-DACS system, that system must implement the identity transfer protocol described here, or a subset of it. If a non-DACS system only needs to export an identity to a DACS federation, it may only need a small amount of middleware to initiate the transfer.
Security
The Identity Transfer Protocol¶
The ability to transfer credentials from one identity management system to another is a feature that can be beneficial to both users and system administrators. For users, it can provide the convenience of single sign-on; a user need only be authenticated by one federation to be able to access resources within a different federated system. For a system administrator, it means that fewer user identities need to be created and managed.
Overview
The systems being federated might exist within a single organization or be associated with different, autonomous organizations that have a trust relationship, very much as DACS jurisdictions do. The transfer of credentials need not be reciprocal; that is, Federation A may allow identities to be imported from Federation B but not vice versa.
The architecture of the transfer mechanism is primarily constrained by the typical browser-oriented usage of DACS, where credentials are encapsulated within an HTTP cookie, thereby dictating how credentials are set in an off-the-shelf browser and when credentials will be sent by the browser. The approach is complicated somewhat because a DACS user may have multiple concurrent credentials or may be unauthenticated. Also, a DACS federation may wish to federate with more than one foreign federation. Therefore, interaction with the user will sometimes be necessary so that she can select the particular identity to be transferred and a target federation to which that identity is to be transferred. A jurisdiction or federation must be able to customize this interaction for appropriate web site integration (i.e., look and feel), but a bare-bones capability must still be provided by dacs_auth_transfer.
The design tries to balance security, usability, performance, availability, configuration complexity, implementation effort, administrative needs, generality, and extensibility, all within the constraints of the DACS architecture and requirements.
Though it is assumed that SSL/TLS is used to secure all network communication and identify the communicating hosts where necessary, some major potential threats against a transfer capability must be addressed by the design:
Replay is addressed in the transfer protocol by restricting the exposure of authentication and protocol material and by limiting its validity period. Injection of copied material is also made difficult. Forgery and tampering are addressed through cryptographic means; using well-established techniques, it is thought to be practically impossible to create forged authentication material or modify it undetectably.
Security
Importation of identities has federation-wide ramifications but it is the responsibility of each jurisdiction to decide whether it will allow its dacs_auth_transfer service to import an identity or its rules to honour an identity imported by another jurisdiction within the federation. A jurisdiction may independently allow identities to be imported from an external system, just as it may unilaterally decide whether it will authenticate users and how it will do so. On the other hand, a jurisdiction is free to reject imported identities, just as it is free to reject an identity vouched for by another jurisdiction in its federation. Federation members may wish to establish guidelines and procedures for importing identities.
Protocol Operation
The purpose of the protocol is to transfer an identity understood by the initial federation to the target federation. The initial federation exports an identity; the target federation imports the identity.
The four stages (operations) of the protocol are now described, in the order in which they are used. In all cases, "the user" can be a browser or middleware.
A token is cryptographically protected, opaque information encapsulated within a URL as its query component; the token is meaningful only to the target federation (i.e., its meaning is unspecified by the protocol). It could contain a database key for the transaction, a nonce, or a self-contained description of the transaction. All that is required by the protocol is that it be kept secret among the communicating parties for as long as it is valid, that its validity period be no longer than what is required to complete the last stage of identity transfer, that it be difficult to forge, and that it be tamper-resistant.
If the request for a token is granted, the target federation returns a URL that encapsulates it, otherwise an error indication is returned to the initial federation which in turn returns an error indication to the user and terminates the protocol.
Implementation
The dacs_auth_transfer service implements all of the stages as separate operations of a single web service; a different implementation might create separate services for each stage or operation, or implement a subset of the functionality (e.g., it might only support exporting identities).
Each of the federating systems must be assigned a unique name (for DACS, through the FEDERATION_NAME directive) so that identities can be globally unique. The federating systems need not share a common domain name suffix.
Note
In the current implementation of dacs_auth_transfer, configuration information associated with target federations is not automatically distributed by DACS to a federation's jurisdictions. This means that only those jurisdictions that have been specifically configured to import identities will be able to do so; a jurisdiction will not automatically understand how to interact with a given target federation that is configured at a different jurisdiction. Each jurisdiction's administrator wanting to provide this service must configure his site's dacs_auth_transfer service appropriately.
Details of the dacs_auth_transfer implementation and configuration requirements are now presented. A different implementation of the protocol could look very different.
PRESENTATION
The list of known target federation names from which a user can select is obtained from mappings that have been configured at this jurisdiction (see below).
When emitting HTML, the web page generated by dacs_auth_transfer can be customized through the auth_transfer VFS item type. The following items are emitted if they exist:
For example, consider the configuration directive:
VFS "[auth_transfer]dacs-fs:${Conf::DACS_HOME}/auth_transfer"
If files named header and trailer exist in the directory ${Conf::DACS_HOME}/auth_transfer, they are expected to contain the initial and final HTML content, respectively. Note that these files consist of text and HTML markup but are not complete HTML documents.
Customization of the HTML form is possible using configuration variables:
For example, the submit button's text can be specified using the directive:
EVAL ${Conf::transfer_submit_label} = "Execute the transfer!"
EXPORT
For example, this URL asks the jurisdiction associated with example.com to export the identity EXAMPLE:bobo to the target federation DSS:
https://example.com/dacs/dacs_auth_transfer?OPERATION=EXPORT\
&TARGET_FEDERATION=DSS\
&DACS_IDENTITY=EXAMPLE:bobo
For the request to succeed, credentials for EXAMPLE:bobo must be sent with the request, permission must be granted (by example.com) to export the identity, example.com must be configured with an appropriate mapping, described below, such that it knows how to submit a TOKEN request to a service associated with federation DSS, and that service must allow importation of the identity.
The mappings of federation identifiers to URLs for export purposes are provided through the AUTH_TRANSFER_EXPORT[6] directive. That is, these mappings indicate which target federations have been configured at this jurisdiction and associate a target federation identifier (a short, descriptive keyword) with a URL of a web service that implements the TOKEN operation for the target federation. It is from these mappings that the list of selectable target federations is obtained.
Note
Unless jurisdictions coordinate mappings with each other, the same jurisdiction must perform both the PRESENTATION and EXPORT operations.
AUTH_TRANSFER_EXPORT "DSS https://dacs.dss.ca/cgi-bin/dacs/dacs_auth_transfer"
This directive specifies one target federation, identified by the name DSS, and associates it with the URL of a service implementing the TOKEN operation.
Security
The TOKEN operation must be performed over a secure communication channel, typically using SSL/TLS. URLs appearing in these mappings should therefore specify https. The issuer of the TOKEN operation may identify itself using an SSL client certificate; if SSL_PROG_CLIENT_CRT[7] is configured, that certificate will automatically be used.
If the issuer of the TOKEN operation possesses DACS credentials obtained offline from the target federation (e.g., using dacscookie(1)[8]), it can specify that they be sent with the request by putting them in an object named FEDNAME.cookies relative to the auth_transfer item type. directory ${Conf::DACS_HOME}/auth_transfer, one cookie per line. The FEDNAME filename suffix is the federation identifier for the importing federation.
For instance, given the AUTH_TRANSFER_EXPORT directive and the VFS directive for auth_transfer above, all cookies found in a file named /usr/local/dacs/auth_transfer/DSS.cookies would be sent with the TOKEN operation to identify the initial federation. These cookies would have been obtained from federation DSS over a secure communication channel.
TOKEN
Note
The identity to be transferred must be a syntactically valid DACS username.
A jurisdiction within the target federation that provides identity importation must must configure at least one Transfer clause. The transfer directives are largely analogous to the authentication and roles directives. Each Transfer element must have an id attribute. Its value is merely a label (an alphabetic followed by zero or more alphanumerics, hyphens, and underscores) that allows the clause to be referenced. The id attribute values must be unique (case-sensitively) within the clause's Jurisdiction section.
Security
Transfer Clause Directives Index:
IMPORT_FROM (Required)
REFEDERATE (Optional1)
For example, if the TOKEN operation at jurisdiction ALPHA of federation FED2 is passed DACS_IDENTITY with a value of FED1::BETA:bobo and REFEDERATE is enabled, then the imported identity will be FED2::ALPHA:bobo .
Security
This directive is useful in certain circumstances in that it can prevent a particular individual from being known by multiple names, which may complicate access control rules. It must be used with care, however.
Say Bobo is naturally known as ALPHA:bobo within federation FED2. If she authenticates as FED1::BETA:bobo and uses dacs_auth_transfer to obtain credentials in FED2, then by default her new credentials will be for the name FED1::BETA:bobo; i.e., her DACS identity is retained.
Access control rules in FED2 may need to handle both names, however, which can lead to problems. Some DACS administrators in FED2 may not even be aware of FED1, and so access to FED1::BETA:bobo may be denied while access to the same resource may be granted to FED2::ALPHA:bobo.
If no two distinct identities in FED1 can be mapped to the same identity in FED2 (i.e., the same username component is not associated with more than one jurisdiction that can export the identity to FED2), then the administrator at the initial federation can advise the administrator at the target federation that the REFEDERATE directive should be enabled. Transferred identities will then be modified to appear to have been authenticated by FED2::ALPHA. When this feature is configured, although Bobo authenticates as FED1::BETA:bobo, her imported identity will be FED2::ALPHA:bobo.
If enabling this directive would cause two or more distinct identities to be mapped to the same DACS identity, the directive should not be used because different individuals may be assigned the same DACS name in the target federation.
PREDICATE (Optional1)
CREDENTIALS_LIFETIME_SECS (Optional1)
IMPORT_ROLES (Optional1)
IMPORT_URL (Optional1)
SUCCESS_URL (Optional1)
ERROR_URL (Optional1)
ROLES* (Optional1)
For example, to add fed1 to those found in the existing credentials:
IMPORT_ROLES "yes" ROLES* '${Auth::IMPORTED_ROLES} . ",fed1"'
EXIT* (Optional1)
This directive maps all imported usernames to guest, relative to the target jurisdiction:
EXIT* '${Auth::IMPORTED_USERNAME} = "guest"'
IMPORT
DACS credentials imported by dacs_auth_transfer are marked as being alien and imported, the jurisdiction that executed the importation is recorded, and the IP address associated with the user's initial credentials are associated with the new credentials; these characteristics can be tested using the dacs.exprs(5)[10] function.
Security
An access control rule must be in place to ensure that this operation can only be executed by appropriate users. Access might well be granted to any user but might reasonably be restricted based on IP address, etc.
To recap, assuming dacs_auth_transfer is used to transfer credentials between two DACS federations (which we will call Federation A and Federation B) and no errors occur, the flow of control will typically be as follows:
To interoperate with dacs_auth_transfer to import DACS credentials, a program must implement the TOKEN operation. It must also provide functionality similar to that of the IMPORT operation. Because the TOKEN operation returns a URL encapsulating an IMPORT request to which the client is redirected, however, the IMPORT operation can be implementation-dependent and does need to interoperate with dacs_auth_transfer.
To interoperate with dacs_auth_transfer to export credentials to a DACS federation, a program must be capable of invoking dacs_auth_transfer with the TOKEN operation and its arguments, and redirect the client to the URL provided by dacs_auth_transfer.
Web Service Arguments¶
In addition to the standard CGI arguments[12], dacs_auth_agent understands a variety of arguments that depend on the operation being requested. The descriptions of the arguments that follow are therefore grouped by operation.
The additional arguments accepted by dacs_auth_transfer follow.
Presentation
For this stage, the value of the OPERATION argument is PRESENTATION (case insensitive).
The FORMAT argument (see dacs(1)[13]) determines the type of output, with the default being HTML.
Additional arguments:
REDIRECT_DEFAULT
Export
For this stage, the value of the OPERATION argument is EXPORT (case insensitive).
Additional arguments:
DACS_IDENTITY
TARGET_FEDERATION
TRANSFER_SUCCESS_URL
TRANSFER_ERROR_URL
DACS_DEBUG
Token
For this stage, the value of the OPERATION argument is TOKEN (case insensitive).
Additional arguments:
DACS_IDENTITY
INITIAL_FEDERATION
CLIENT_ADDR
TRANSFER_SUCCESS_URL
TRANSFER_ERROR_URL
DACS_DEBUG
Import
For this stage, the value of the OPERATION argument is IMPORT (case insensitive).
Additional arguments:
TOKEN
TRANSFER_SUCCESS_URL
TRANSFER_ERROR_URL
DACS_DEBUG
EXAMPLE¶
The following example describes step-by-step how to configure two DACS federations, FED_EX1 (example.com) and FED_EX2 (example.net), to enable credentials to be transferred from FED_EX1 to FED_EX2. For FED_EX1, the jurisdiction J1 (j1.example.com) will be configured to export credentials and for FED_EX2, J2 (j2.example.net) will be configured to import credentials. The example assumes that these two jurisdictions have already installed and configured DACS and that it is possible to authenticate (obtain credentials) somewhere within FED_EX1.
Note
This example will not actually work without changing the domain names, URLs, and identities that it uses for demonstration purposes to those configured for your federations and jurisdictions. Having successfully reproduced this example functionality on your systems, it should be apparent how to extend it for additional jurisdictions and federations, and how to make credential transfer bidirectional.
<acl_rule status="enabled">
<services>
<service url_expr='"${Conf::dacs_cgi_bin_prefix}/dacs_auth_transfer"'/>
</services>
<rule order="allow,deny" pass_credentials="all">
<allow>
user("auth") and (${Args::OPERATION} eq "PRESENTATION"
or ${Args::OPERATION} eq "EXPORT")
</allow>
</rule> </acl_rule>
At J2, add a jurisdiction-specific access control rule that allows dacs_auth_transfer to be used to import an identity:
<acl_rule status="enabled">
<services>
<service url_expr='"${Conf::dacs_cgi_bin_prefix}/dacs_auth_transfer"'/>
</services>
<rule order="allow,deny" pass_credentials="all">
<allow>
(from("j1.example.com") and ${Args::OPERATION} eq "TOKEN")
or ${Args::OPERATION} eq "IMPORT"
</allow>
</rule> </acl_rule>
Security
In particular, the rule at the target federation must restrict access based on the identity, or possibly the IP address, associated with the request. If the cookie-based authentication method is used, the rule would test for that specific identity.
AUTH_TRANSFER_EXPORT \
"FED_EX2 https://j2.example.net/cgi-bin/dacs/dacs_auth_transfer"
Note that this is the only required additional configuration at J1.
ACCEPT_ALIEN_CREDENTIALS "yes" <Transfer id="fed_ex1"> IMPORT_FROM "FED_EX1" SUCCESS_URL \
"https://j2.example.net/cgi-bin/dacs/dacs_current_credentials" </Transfer>
This configuration allows credentials to be imported from federation FED_EX1. As the default, after successful importation users will be redirected to a page that lists their identities in federation FED_EX2. In practice this might point to the site's home page, for example. The jurisdiction must be told to recognize credentials imported from FED_EX2 using the ACCEPT_ALIEN_CREDENTIALS directive.
You should be presented with a web page that displays the identity FED_EX1::J1:bob (and any others that happen to be in effect) and the target federation name FED_EX2 (and any other federations specified by a AUTH_TRANSFER_EXPORT directive). It might be instructive to view the source for the HTML page if you are still not clear about what the PRESENTATION operation does. Click on the Transfer button (if necessary, first selecting an identity and target federation).
One can bypass the PRESENTATION operation by directly invoking the URL:
https://j1.example.com/cgi-bin/dacs/dacs_auth_transfer?\ OPERATION=EXPORT&DACS_IDENTITY=FED_EX1::J1:bob
If the transfer is successful, your browser should now possess the original credentials for the identity FED_EX1::J1:bob, valid within FED_EX1, and credentials for the identity FED_EX1::J1:bob that are valid within FED_EX2; dacs_current_credentials, where your browser should be redirected to in this example, should display the latter. Note that though issued by different sites, the two cookies have the same cookie name.
The following example illustrates how an identity might be transferred from a non-DACS federation (SOME_FED) to a DACS federation (again, FED_EX2 via its jurisdiction J2). We will assume that an appropriate access control rule has been configured at J2.
As in the previous example, at J2, configure dacs_auth_transfer so that it will import credentials from SOME_FED by adding a Transfer clause to dacs.conf:
ACCEPT_ALIEN_CREDENTIALS "yes" <Transfer id="some_fed"> IMPORT_FROM "SOME_FED" REFEDERATE "YES" IMPORT_ROLES "NO" </Transfer>
This configuration allows credentials to be imported from federation SOME_FED.
A system administrator must write a small program, run somewhere within SOME_FED, that will invoke dacs_auth_transfer at J2 with appropriate arguments. The program might be run automatically as part of the login procedure at SOME_FED or explicitly by providing a link that a user can follow (e.g., labelled "Transfer Login To FED_EX2", or similar). The program simply invokes the TOKEN operation at J2 and, if successful, redirects the user to the URL that is returned to it by dacs_auth_transfer (which represents an IMPORT operation). If the IMPORT operation succeeds, the user will be issued an HTTP cookie bearing the DACS credentials. If desired, the URL that the user should visit after a successful transfer can be specified through the TRANSFER_SUCCESS_URL argument.
The program might initiate the transfer by constructing and invoking a URL (via the POST method) much like this:
import_url=`http -p INITIAL_FEDERATION "SOME_FED" \
-p DACS_IDENTITY "FED_EX2::J2:bobo" \
-p CLIENT_ADDR 127.0.0.1 \
-p TRANSFER_SUCCESS_URL \
"https://j2.example.net/cgi-bin/dacs/dacs_current_credentials" \
-p OPERATION TOKEN \
'https://j2.example.net/cgi-bin/dacs/dacs_auth_transfer'`
Here, the requested DACS identity is FED_EX2::J2:bobo. If the response looks like a URL, then the TOKEN operation succeeded; to continue the transfer, the program must redirect the user to the URL. In this example, if credentials are returned to the user, the user will be redirected to dacs_current_credentials by DACS (which is useful for testing but unlikely in actual use).
FILES¶
dacs_auth_transfer.css[4]
DIAGNOSTICS¶
The program exits 0 if everything was fine, 1 if an error occurred.
SEE ALSO¶
dacs_authenticate(8)[17], dacs_auth_agent(8)[18], dacs.conf(5)[19]
BUGS¶
The jurisdictional meta information should be extended to identify importing and exporting jurisdictions (e.g., as reported by dacs_list_jurisdictions(8)[20]).
It should be possible to optionally perform comparative checks on the IP address from which the EXPORT request was issued and the IP address from which the IMPORT request was issued. At present, if they are not identical a warning message is logged but importation is allowed.
The current implementation is stateless on the server side. By including a nonce in the token, the possibility of replay could be further reduced.
A mechanism for mapping imported names may be needed.
Although the credential's DACS role string is passed to the target federation, a flexible mechanism for optionally including them in the imported credentials should be added.
The protocol should be improved with respect to peer identification for the TOKEN operation.
AUTHOR¶
Distributed Systems Software (www.dss.ca[21])
COPYING¶
Copyright © 2003-2015 Distributed Systems Software. See the LICENSE[22] file that accompanies the distribution for licensing information.
NOTES¶
- 1.
- dacsoptions
- 2.
- ACCEPT_ALIEN_CREDENTIALS
- 3.
- dacs.acls(5)
- 4.
- dacs_auth_transfer.css
- 5.
- dacs_auth_transfer.dtd
- 6.
- AUTH_TRANSFER_EXPORT
- 7.
- SSL_PROG_CLIENT_CRT
- 8.
- dacscookie(1)
- 9.
- AUTH_TRANSFER_TOKEN_LIFETIME_SECS
- 10.
- user()
- 11.
- AUTH_CREDENTIALS_DEFAULT_LIFETIME_SECS
- 12.
- standard CGI arguments
- 13.
- dacs(1)
- 14.
- dacs(1)
- 15.
- AUTH_TRANSFER_SUCCESS_URL
- 16.
- AUTH_TRANSFER_ERROR_URL
- 17.
- dacs_authenticate(8)
- 18.
- dacs_auth_agent(8)
- 19.
- dacs.conf(5)
- 20.
- dacs_list_jurisdictions(8)
- 21.
- www.dss.ca
- 22.
- LICENSE
08/23/2020 | DACS 1.4.40 |