logo_kerberos.gif

Difference between revisions of "Projects/Authentication indicator"

From K5Wiki
Jump to: navigation, search
Line 1: Line 1:
{{project-early}}
+
{{project-rel|1.14}}
{{project-target|1.14}}
 
   
 
This project will implement a way to restrict access to services based on how the initial authentication was performed.
 
This project will implement a way to restrict access to services based on how the initial authentication was performed.

Revision as of 09:53, 30 July 2015

This project was completed in release 1.14.


This project will implement a way to restrict access to services based on how the initial authentication was performed.

Background

Kerberos deployments may support pre-authentication mechanisms, such as PKINIT or OTP, which may confer a higher level of confidence in the authentication than the use of a password alone. A deployment may wish to require that some resources can only be accessed using tickets which were obtained using high-confidence pre-authentication.

Currently, the most practical way to enforce this requirement is to make sure that certain principals can only authenticate using high-confidence pre-authentication, and then grant resource access only to those principals. Such principals may be separated from the principals used for day-to-day activities of the end-user by giving them different names (e.g. ghudson/root@ATHENA.MIT.EDU as opposed to ghudson@ATHENA.MIT.EDU), at the cost of complicating realm administration and auditing.

This project will implement a means of restricting access without requiring that a principal always authenticates using high-strength pre-authentication, by marking how the ticket was initially obtained. The Kerberos protocol defines several existing methods for doing this, none of which are sufficiently general:

  • The pre-authent ticket flag indicates that some form of prea-authentication was used, but does not indicate what it was.
  • The hw-authent ticket flag was intended to indicate that a hardware device was used during pre-authentication. It is rarely used, as the KDC usually cannot tell whether a client used a software or hardware device to produce a certificate or OTP token value. While it could be re-purposed to mean "high-confidence pre-authentication" in general, it would still be poorly defined and not very granular.
  • PKINIT (RFC 4556) defines the AD_INITIAL_VERIFIED_CAS authdata type, which shows the certification path of the client certificate. This type is specific to PKINIT, and would be cumbersome for an application server to use as it would have to be configured with specific knowledge about PKINIT certification authorities. There is no equivalent for FAST OTP.
  • RFC 6113 defines AD-authentication-strength, which contains the numeric codes of the pre-authentication types used to authenticate the client, and possibly additional information for each type (but no additional information is currently defined). Again, to use this element, an application server would have to be configured with specific knowledge about pre-authentication mechanisms and the confidence they confer.

Scope

This project will implement the AUTHENTICATION-INDICATOR element defined in draft-ietf-kitten-krb-auth-indicator. The KDC makes a determination about pre-authentication confidence at the time of initial authentication, and communicates this to services via one or more site-defined string values. The AUTHENTICATION-INDICATOR element is carried within a CAMMAC (draft-ietf-kitten-cammac), which allows it to be carried from the evidence ticket of an S4U2PROXY request into the delegated ticket.

Access restriction based on AUTHENTICATION-INDICATOR may take place either within a KDC through its ticket policy, or on the application server itself. The latter option allows more fine-grained access control, but also requires changes to application server code. This project will cover only enforcement on the KDC; enforcement on application servers will be a follow-on project.

This project must be useful with the built-in KDB modules. A third-party KDB module may provide additional input into the process, but basic functionality must be present in the core system.

Design

Structural improvements

The KDC authorization data facilities currently center around a private pluggable interface which predates Projects/Plugin support improvements. All internal operations are funneled through that interface's function signature. This interface will be converted to a new-style pluggable interface, which will remain private. Internal operations will be decoupled from the interface and will be directly invoked from handle_authdata(), using signatures tailored to the needs of the specific operation.

AS and TGS requests often load a krbtgt principal entry as part of their processing, but do not always. The current authorization data code makes the assumption that the AS server principal or TGS header ticket server principal are krbtgt principals, and that the principal loaded has the same current key data as for previous operations on the ticket. As a result, there are some obscure bugs in AD-SIGNTICKET processing, and there would be similar bugs in CAMMAC processing if we followed the same assumption. The KDC code will be augmented to load the server realm's local krbtgt principal if it was not already loaded, and the AD-SIGNTICKET code will use that principal entry for its checksums.

CAMMAC and indicator encoding

Private ASN.1 encoders and decoders for CAMMACs and sequences of UTF-8 strings (for auth indicators) will be added to lib/krb5/asn.1.

The KDC will contain functions to generate and verify CAMMACs and to manage lists of authentication indicators. Public interfaces for these data types are not required for the current phase of the project.

The CAMMAC specification allows the kdc-verifier and svc-verifier to be omitted in certain cases. The initial implementation will not include those space optimizations.

Deciding on indicators

The kdcpreauth interface will receive a new callback which allows a module to assert an authentication indicator. The OTP and PKINIT kdcpreauth modules will read configuration options which cause them to assert indicators.

In the future, the KDB module (or a future KDC module type) could participate in this decision based on parameters generated by the kdcpreauth module. Such a facility is not in scope for the initial implementation.

AS and TGS requests

During AS request processing, indicators may be asserted by kdcpreauth modules. These indicators will be passed to handle_authdata(), encoded as sequence of UTF-8 strings, and wrapped in CAMMAC and IF-RELEVANT containers for the issued ticket.

During TGS request processing, indicators will be extracted from the header ticket for normal TGS requests, from the evidence ticket for S4U2Proxy requests, and not at all for S4U2Self requests. Any extracted indicators will be included in the issued ticket.

Cross-realm support requires a certain measure of trust in the remote realm to accurately represent how that realm's clients authenticated. It may also be necessary to translate indicator values if the two realms do not use the same naming semantics. For the initial implementation, indicators will not be accepted from cross-realm TGS header tickets. In the future a string attribute may be added to authorize a cross-realm TGS principal to propagate specific indicator values. Translation of values will probably need to be performed by a plugin module (perhaps the KDB module); this feature is also deferred to the future.

Indicator enforcement

For either an AS or TGS request, if the server principal has the require_auth string attribute set, one of the indicators listed in the attribute value must have been asserted or the KDC will reject the request with a policy error.

A service with a required indicator will currently fail all S4U2Self operations, because the real client did not authenticate and therefore no indicator was asserted. In the future, we may develop a simple protocol for services to request indicators to be asserted during S4U2Self operations, and a simple authorization framework for the KDC to decide what indicators a service is allowed to assert (probably the same authorization framework as for cross-realm indicator suport).

In the future the KDB module (or perhaps a future KDC policy module) could participate in this decision. This feature is not part of the initial implementation.

Testing

As part of the KDC authdata refactoring work, a C harness will be written for the tests directory which obtains a service ticket with optional request authdata, decrypts it, and displays the leaf authdata contained in the ticket with annotations for any authdata container along the path to the leaf. Tests will be written to verify most of the existing logic for including authdata in the ticket.

Currently, test scripts cannot easily simulate successful S4U2Proxy operations as the default KDB module always rejects constrained delegation requests. A read-only test KDB module will be written which can be used to exercise this and other KDC behavior. The module will read all of its results from the profile, making it easy to control them from the test script.

A test preauth module will be written so that test scripts can easily control the authenticated indicators asserted during an AS request without having to set up PKINIT or OTP. The clpreauth module will transmit the desired indicators (specified using kinit -X) to the kdcpreauth module, which will assert them without performing any meaningful preauthentication.

Currently S4U2Proxy can only be tested by using the GSSAPI harnesses in tests/gssapi, or by using kvno -P which requires also performing S4U2Self. A simple S4U2Proxy test harness will be written for the tests/ directory.

Tests will be written to cover the major cases: AS requests to the local TGS, cross TGS, and service principals; regular TGS requests to the local TGS, cross TGS, and service principals; ticket modifications requests; S4U2Self requests; and S4U2Proxy requests.

Documentation

A new page admin/auth_indicator.rst will document how to use auth indicators within a realm. The new kdcpreauth callback, configuration variables, and string attributes will be documented in the appropriate places.

References

  • [krbdev.mit.edu #8157]

CAMMAC discussions on the kitten working group list:

Authentication indicator discussions on the kitten working group list:

(TBD list discussions, probably mostly on kitten)

Commits

Test KDB module:

   c8608c52646a10503b1a950f8df5072d0a583604 Add test KDB module
   e732d9dc3f2e7b01ff3c8305d58a3a754c9e9ec5 Add successful S4U2Proxy test cases

KDC authdata refactoring: [TBD]

Loading local TGT: [TBD]

CAMMAC and authentication indicator support: [TBD]

Release notes

Administrator experience:

  • Access to specific services can be restricted to clients which authenticated using stronger preauthentication mechanisms such as OTP or PKINIT, by making use of authentication indicators.