Changes between Initial Version and Version 1 of HttpAuthProposals/MutualAuth/LayeringDesigns

12/06/12 06:02:46 (10 years ago)



  • HttpAuthProposals/MutualAuth/LayeringDesigns

    v1 v1  
     1= Design Decisions regarding Layering of HTTP Mutual =
     3As you may see, the HTTP Mutual authentication proposal is completely
     4stay in HTTP layer.  This is not just a rationale of our design, but
     5also a '''result''' of several design decisions.
     6There are some discussions regarding layering designs, so it may be
     7worth clarifying our design considerations.
     9Throughout this document, "the user" means a real-world entity which
     10uses a browser (in usual cases, it is a human); "the client" is a
     11entity (usually software) which understands and uses HTTP and other electronic communication protocols.
     13= Design principles =
     15Our design goals regarding design of Mutual authentication is as follows:
     17 * (Mutual authentication) It gives strong Mutual authentication, which can be easily verified by users, with a help from clients.
     18   * To this purpose, it must be clear and easy for clients to decide the status of mutual authentication, which will be provided to users.
     19 * (Strong authentication) It will not leak user's any password credentials to any entities other than the client.  It should hold how ever the leaked informations are analyzed, compared, dictionary-attacked, of whatever.
     20 * (Simple for simple cases) For simple use cases of current HTTP authentication (Basic and Digest), it must be simple to deploy the new technology.
     21 * (More-or-less simple for current use cases) For most of the current use cases of HTTP (i.e. Cookie-based authorization with authentication forms), there will be a pre-designed transition paths from those.
     22 * (User authentication) The primary goal of the technology is to authenticate the user;  This goal might be clarified in the following picture:
     23   * Imagine that there is a Web application which "mashes up" contents from several external entities.
     24   * There will be two separate phases for authentication/authorization.
     25     * The first-phase authentication is to determine who is using the client, to determine which contents will be provided to the client.
     26     * The second-phase authentication is for acquiring the contents from externals.
     27   * If there is any contradicting design choices between them, the primary goal of the technique is to best-serve the first phase.
     28   * The technology can be used to the second-phase too, but there may be a different, co-existing technologies best fitted for the latter case (e.g. OAuth).
     30= Background =
     32== How HTTP servers will work on the authentication? ==
     34There are several models of HTTP server implementations regarding the authentication (more precisely, the handling of "Authorization:" header).
     36 * "no-passthrough": Some servers do not permit transferring of any authentication-related headers to the Web application software layer.  They instead handles all kinds of authentication in the server layer and pass the authentication result to the Web application software layer.  The famous instance of this is a CGI interface of Apache web server.  This is because there may be an information leakage problem with HTTP Basic authentication when the server provides multiple applications (for different authentication entity) within the same host.  For details, see the latest discussion (as of June 2012) in httpbis mailing list for ticket #348 ([ archived here]).
     37 * "app-passthrough": Some servers do not handle authentication and pass the whole header to the web application software layer.
     38 * "hyblid": Some servers do the both, depending on the configuration: the example is the embedded PHP handler for the Apache web server.
     40These three instances are referred by the latter discussions.
     42== Several different kinds of "layering" ==
     44In many cases, we use terms like "protocol layer" or "application layer" for referring "some" entities.  During our work of designing and implementing our proposal, we found that we need to distinguish several aspects of layered systems, which are usually thought as a single unified classifications.
     46We will use the following terms for specifying a specific "layer" of things.
     481. Terms for communication protocol layers
     49 * Transport layer: byte-stream protocols under the HTTP protocol; TLS and TCP.
     50 * HTTP layer: protocols specified within RFC 2616/2617
     51   and httpbis p1 to p7.
     52   This includes several headers like Host, WWW-Authenticate, Authorization,
     53   Pragma and etc.
     54 * Payload layer: all things above the HTTP layer: content body, Cookie, and so on.
     552. Terms for server-side software implementations
     56 * Server layer: software which communicate with clients using transport-layer protocols, understand and handle many aspect of HTTP layer. Server-layer software does not commonly understand application-specific details of behaviors.  Apache httpd is the common instance of server-layer software.
     57 * Application software layer: software which implements application-specific logics.  Commonly implemented using CGI-protocol clients, PHP, Ruby scripts, and so on.  Sometimes, they also have a "framework layer" within this layer, which handles application-specific but not resource- (page)-specific features such as session managements.
     59In many literature, HTTP layer and server layer are considered equivalent, and payload layer and application software layer are also combined to be "an application layer".  However, these are not necessarily true;  for example, OAuth Bearer token authentication is within the HTTP layer, but is usually handled in the application software layer.
     60Some web servers handles only messaging sublayer of HTTP layer (httpbis-p1) and delegates most per-resource HTTP-layer features (authentication, content negotiation, conditional request etc.) to be handled in application software layer.  This viewpoint is important for discussing applicability of protocol layer technologies in real software applications.
     62= Design Decisions (1): Why choose the HTTP layer? =
     64First important clarification here may be: Mutual authentication protocol is, from the protocol side, implemented in the HTTP layer;  however, from the implementation side, it '''DOES NOT''' mean that it is necessarily implemented in the Web server layer.  These two layering are related but not tightly-bounded things. We have a pure-Ruby authenticator implementation, which can be easily used in the Web application framework layer.
     66== 1. Strong authentication, credential protection ==
     68Three design principles are strongly related to this (active) choices.  First things are the Strong authentication and Mutual authentication. Until now, the passwords are really loosely handled in the Web environment.  Basic authentication does not provide any protocol-level protection of passwords, as everyone knows.  This gives many people a feeling that passwords are equivalently handled in both protocol and Web application layers.  Also they think passwords are better to be avoided for any cases for means of authentication.
     70However, these are not (at least not completely) true; security protocols can protect passwords from any externally-controlled entities (i.e. all but the client), and to do this, we should better keep passwords away from any external entities including HTML scripts.  (Hashing or salting is too weak for protecting the raw passwords in the current decade.)  Clients play a important role here, and the HTTP layer (and below) is under full control of the client.
     71It is natural choice here.
     73Avoiding passwords makes some senses.  However, we consider in this way:
     74 1. First, we will in any way need passwords, at least for recovery, revocation, and first-time establishment of any secret tokens used for authentication.  Password is the only thing which can be kept in person without storing it to any computers.  Only the replacement here is face-to-face human authentication.
     75 2. Federated identity management is good thing, and it need a conventional authentication for boot-strapping the authenticity;  it is a framework which ''transfers'' authenticity established with ID provider to relying parties with proper management of trust, privacy etc.  The mean of the ID-provider authentication may be either passwords or other means, and in the latter case Clause 1 applies.
     76 3. Client certificate or other cryptographic secrets might be deployed slowly, but it will not replace authentications for casual users in short periods. 
     78== 2. Mutual authentication ==
     80Mutual authentication is the key feature of the Mutual HTTP authentication proposal (sorry for any name confusion here :-).  Servers will give clients a proof of authenticity of them to clients, and clients will verify it and show the result to the users.  To ensure security of this procedues, we need two factors here: first, in the Web use-case, we need to authenticate the very top page of the Web contents (i.e. the resource whose URI is shown in the address bar of the browser).  In the security model of recent HTML (with many dynamic features) and Web browser UIs, ensuring the authenticity of the sub contents are almost meaningless.  Second, the client will again need full-control of whole protocol, because without that it is difficult for clients to decide which result is trustful enough to be shown to users.
     81Simplicity is required here.
     83== 3. Simplicity ==
     85HTTP use cases are vast:  there are many servers which have a complex control of authentications, and at the same time there are many servers which have just a fixed set of authenticated users.  There are servers which have a state-of-art application framework; or servers which implement all logics by hand; or servers with just a static pages.  There are clients which are capable of handling many complex high-layer protocols, and clients which are just simple implementation of HTTPs.
     87As far as it is possible, we need a simple, clear design of protocols.  I believe that, (again as far as it is possible,) every clients should not be required to understand five or more layers of data formats, frameworks and protocols, just to talk HTTP.  Every servers should not be required to implement five or more frameworks and API endpoints, just to authenticate users.  By sticking to the HTTP layer, we can capable of supporting many use cases from simpler ones to the complex ones.
     89Our proposal support previously-shown design criteria named "Simple for simple cases" and "More-or-less simple for current use cases".
     91Of course, I just said "as far as it is possible".  We will dig into details in the following separate section.
     93= Design Decisions (2): Is it OK to be HTTP-layer? =
     95== 1. Implementation layer choices ==
     97First question may be that "is it needed to be implemented in the Web server?", I guess.
     98We understand that in many deployment it is not likely to move authentication to the Web server layer, because at least user management will never be moved to the server-layer logic.
     99The short answer to this is "there are free choices, as long as many other technologies are implementable".
     101Recall that we had some classification of Web server implementations above: there are "no-passthrough", "apps-passthrough", and "hyblid".
     102Regarding the protocol side, we may have the following choices:
     103 * "http-only": whole protocol conversation lives in the HTTP layer.  Basic, Digest and Mutual are under this kind.
     104 * "mixed-layer": some kinds of initial authentication conversation lives in the payload-layer of HTTP, and the final access authorization lives in the HTTP layer.  Common example is OAuth 2.0 (Bearer authorization etc.).
     105 * "payload-only": all kinds of authentication/authorization conversation lives in the payload-layer (including Cookies here), without using any of HTTP Authorization-related headers.  Common HTML Form authentication lives in this layer, and some OAuth (usually 1.0) deployment also used (had used) Form fields to send an authorization-related tokens for resources accesses (This method is still defined in [ Section 2.2 of OAuth Bearer authentication]).
     107Let us also add the additional axis about authentication management entities, "web-server" or "applications".  These three axis are related but still independent ones.
     108We will not consider some implementation of payload-level authorization in the Web servers, as it is just "out-sourcing" application logic to the web-server layer, which is always possible from the protocol side.  We will also forbid any hidden channels between web servers and applications.
     110Then, let's fill the matrix.
     112|| || auth entity ||||||=web-server=||||||=applications=||
     113|| Protocol type \ || server type||=no-passthrough=||=hyblid=||=apps-passthrough=||=no-passthrough=||=hyblid=||=apps-passthrough=||
     114||||=http-only=||O||O||N||N^*3^||O (2a) ||O (2b)||
     115||||=mixed-layer=||N||N||N||N (1)||O||O||
     118You can see the following natural equations: "mixed-layer = http-only AND payload-only", and "hyblid = no-passthrough OR apps-passthrough".
     120I guess that people may surprise about (1) and (2) here.  However, we already have examples there.  PHP PEAR library implemented a Basic authentication within PHP layer (2a).  Also, OAuth needs Bearer tokens available to application layer, if token verification is performed in the application software layer (1).
     122Honestly speaking, when I saw OAuth for the first time, I was a bit surprised about their choice about using Authorization: header for access authorizations.  Of course, I had a concern about (1) case, and the reality assumes either "hyblid" or "apps-passthrough".  If this holds true, we have no difficulty to implement HTTP-layer authentication in the web application software level, with application-level control of user entities.
     124   Note: if you're curious about allowing sharing DB between servers and applications,
     125   a short notice about that: if it is possible, it will turn *3 to OK (do authentication
     126   server-side with information provided from applications), and (1) to become
     127   either OK or NG, depending on the detail of protocols (at least Bearer will be OK).
     129== 2. Lack of features ==
     131One big issue which people criticize about HTTP authentication is lack of features, especially status control from server application software layer.  For example, there is currently no standard way of log-out from HTTP-authenticated realm, you need separate pages for general unauthenticated guests and authenticated users, when application needs per-user customization of contents.
     133People tend to be lazy about solving this issue.  Until now, it has been justified because the security of Form authentication is almost as same as that of Basic authentication.  However, to enhance security of Web authentication, we need to solve this in some ways.
     135Our solution is to add a simple control features atop HTTP authentication, as summarized in [../../AuthExtension draft-oiwa-httpbis-auth-extension].  From the client's view, it is an additional pragma which slightly, only slightly change some of its behavior depending on various status of HTTP authentication.  For example, "location-when-unauthenticated" pragma almost work as same as 302 status code, only when users' response is needed for authentication.
     137From the application programmer's view, it is just a set of API commands to be sent to the application framework layer and client browsers, enabled by simply set the application-level HTTP headers. 
     138It is even simpler than implementing an own semantics wholly on the server side.
     139To this purpose, the extension is designed ''as a separate header from WWW-authenticate'' (see Note below).
     141People may wonder how it can be realized in the real applications.  Some sample tactics for such deployment is included in the draft.
     143   Note: As obviously, it could be designed alternatively as directives (parameters) on the WWW-Authenticate headers.  Such design is simpler when we only care about the protocol layer.  However, if we did such a way, we MUST have a tight communication channel between server-side authenticator and Web applications.  Server-side authenticator can be either in the web-server layer or in the application framework layer, but in either case it is difficult to deploy.  We cared this issue, avoided such shortcomings, and so we introduced it as an additional header.  It is also designed so that applications do not necessarily understand detailed authentication status.  This makes it possible to ''statically'' configure these headers when application requirement is simple, eliminating a need for CGI applications only for that header.
     145== 3. Multiple stage authentication in HTTP ==
     147There are some concerns argued about multiple-stage authentication (that using three or more messages) handling within HTTP protocol layer.  Basic was single-staged (only one message), and Digest was a bit special and had 1.5 stages (two messages: challenge and response).  We already had NTLM which is completely two-staged (three+ messages), although it was broken in other aspects (sharing authentication results for all requests in the same connections).  Our proposal, Mutual authentication is also two-staged (three messages + response authentication).
     149Important thing here is: with regards to the real communications, HTTP layer and payload-layer protocols are isomorphic; if we have an payload-layer protocol which are common to several resources (URIs), we can have a embedding of that protocol into an HTTP layer;  if we have an HTTP-layer protocol, we may have an trivial embedding of that into a payload-layer API (although that may be not quite beautiful).  There is no fundamental difference here.
     151We already proved that multiple-stage authentication ''is'' possible within HTTP layer by our reference implementations.  There are two possible implementation layers as mentioned before, and we took the harder approach, i.e. using the server-layer software technologies for implementations, and it succeeded.  If there is still any doubt, you can just handle authentication in the application software or application framework layers, so that you can use any technologies which enables multiple-stage payload-layer protocols.
     153During our stage of design Mutual authentication, one concern regarding the multiple-stage authentication was possible conflicts with load-balancing proxies.  As authentication statuses are shared between clients and server-side authenticator, if there are hidden multiple instances of server-side software, any server-side endpoint for single client should share the authentication status information.  However, you should also notice that, even with payload-layer protocols, the same problem arises.  Common approach is to use back-end information-sharing software (e.g. RDB), and it can be applied also to the http-layer protocol implemented in the application software layer.
     155In addition, the design of Mutual authentication protocol considers several methods of solving this within server-layer implementations (front-end authentication proxy, shared back-end authentication server, controlling load balancing proxy, and so on).  One of our testing environment was actually such a system, and we used a front-end authentication proxy to solve this (this method is also employed for wrapping existing applications to use Mutual authentications in our testing environment.)