Re: [Dime] Question on realm validity in answer messages

Marco Stura <mstura@ooredoo.com> Fri, 09 May 2014 06:31 UTC

Return-Path: <mstura@ooredoo.com>
X-Original-To: dime@ietfa.amsl.com
Delivered-To: dime@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id BCF7D1A01E7 for <dime@ietfa.amsl.com>; Thu, 8 May 2014 23:31:57 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.601
X-Spam-Level:
X-Spam-Status: No, score=-2.601 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2aWBuDWWt965 for <dime@ietfa.amsl.com>; Thu, 8 May 2014 23:31:54 -0700 (PDT)
Received: from panda.qtel.com.qa (panda.qtel.com.qa [213.130.113.100]) by ietfa.amsl.com (Postfix) with ESMTP id 305E11A01E5 for <dime@ietf.org>; Thu, 8 May 2014 23:31:51 -0700 (PDT)
X-IronPort-AV: E=Sophos;i="4.97,1016,1389733200"; d="scan'208";a="27802072"
Received: from Rock5.qtel.ad.pri ([169.254.1.2]) by SEEMA2.qtel.ad.pri ([172.16.224.86]) with mapi id 14.02.0347.000; Fri, 9 May 2014 09:31:45 +0300
From: Marco Stura <mstura@ooredoo.com>
To: Jouni Korhonen <jouni.nospam@gmail.com>, "dime@ietf.org" <dime@ietf.org>
Thread-Topic: [Dime] Question on realm validity in answer messages
Thread-Index: AQHPavDnc4yzThGtZUG/jh6IrWDEHJs3p3pg
Date: Fri, 09 May 2014 06:31:44 +0000
Message-ID: <0EFE155B2AF9B44A9537DA67801704F96B334D22@ROCK5.qtel.ad.pri>
References: <0EFE155B2AF9B44A9537DA67801704F96B3341E2@ROCK5.qtel.ad.pri> <536BD60A.6070202@gmail.com>
In-Reply-To: <536BD60A.6070202@gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [172.16.99.103]
x-exclaimer-md-config: e2f59e9d-2ace-4eb8-ad46-dee98c3fdea5
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Archived-At: http://mailarchive.ietf.org/arch/msg/dime/VN5SBysdTV5ubfCMmh_01QcnXRo
Subject: Re: [Dime] Question on realm validity in answer messages
X-BeenThere: dime@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Diameter Maintanence and Extentions Working Group <dime.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dime>, <mailto:dime-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/dime/>
List-Post: <mailto:dime@ietf.org>
List-Help: <mailto:dime-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dime>, <mailto:dime-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 09 May 2014 06:31:57 -0000

Thank you Jouni and all folks that replied.

I wanted to hear opinions without giving mine first. I agree that we cannot find any explicit specification language, but I think this kind of configurations are not really standard and are against the spirit of AAA.

If we think what AAA was invented for, it is all about communicating with the home server that is authoritative to authenticate/authorize the user. The home server shall match the user's home realm.  If we look at the definition of realm in RFC 6733:

Realm

      The string in the NAI that immediately follows the '@' character.
      NAI realm names are required to be unique and are piggybacked on
      the administration of the DNS namespace.  Diameter makes use of
      the realm, also loosely referred to as domain, to determine
      whether messages can be satisfied locally or whether they must be
      routed or redirected.  In RADIUS, realm names are not necessarily
      piggybacked on the DNS namespace but may be independent of it.

Then further on in the RFC it is said that the ream may be derived from the NAI and then populated in the Destination-Realm. Alternatively one could use other mechanisms in the client to determine what realm is authoritative for the user, but whatever mechanism must not be dictated by the implementation of the server or servers composition, it must be a standard mechanism. Otherwise it will never be possible to implement things like roaming. One example is the NAI, another example is the IMSI derived home realm as defined in 3gpp TS 23.003.

By definition there is only one realm that is authoritative, not many different realms (or domains). In my example the realm that is authoritative for the user is "sprealm", as the user belong to that. Therefore a configuration with servers belonging each to a different realm (none of the realm is actually matching the home realm) it's not what I would call a Diameter compliant implementation, as none of the servers can actually be said to serve the user's home realm. Furthermore, again in the spirit of AAA, the Destination-Realm AVP shall not be changed by agents as per diameter request routing processing defined in section 6.1.

IMHO a Diameter compliant implementation would exactly look as the one described by David, which I report below:

If all of the servers were in the same realm (say realmX), a conversation would work like this:
- client sends message to Dest-Realm=realmX, (Dest-Host unspecified)
- client realm-routing indicates the proxy can handle it and forwards to proxy.
- based on lack of Dest-Host, proxy realm-routing table determines any of Servers 1-3 (all of realmX) can handle it.
- the proxy selects a host in realmX (e.g., Server1) by any appropriate algorithm
- e.g., Server1 answers the message with Origin-Host=Server1 and Origin-Realm=realmX
- proxy transparently passes the Origin-Host=Server1 and Origin-Realm=realmX
- if client needs to continue the session, the client makes subsequent requests to Dest-Host=Server1 and Dest-Realm=realmX

What I described in my original email it's actually an horrible hack of Diameter :-) Do you agree?

BR,
Marco

-----Original Message-----
From: DiME [mailto:dime-bounces@ietf.org] On Behalf Of Jouni Korhonen
Sent: Thursday, May 08, 2014 10:08 PM
To: dime@ietf.org
Subject: Re: [Dime] Question on realm validity in answer messages


Your load balancer is misbehaving. Unfortunately you don't find any exact specification language to prohibit the proxy vendor doing this.

- Jouni



5/8/2014 8:44 AM, Marco Stura kirjoitti:
> Dear all,
>
> I'm facing the following situation.
>
> |----------------------------
> SPrealm--------------------------------------------------|
>
>
> _----------- Server 1(realm a)
>
>
>                                   _
>
>
> _
>
> Client ------------------ Proxy(SPrealm) ---------------- Server
> 2(realm b)
>
>
> _
>
>
>                                                        _
>
>
> _
>
>
> ---------- Sever 3 (realm c)
>
> The implementation is such that the Proxy is load balancing by
> selecting the internal Server where the subscriber data are
> provisioned, based on user identity.
>
> The Client is sending an application specific authorization request to
> the Proxy for NAI user@SPrealm, Destination-Realm == SPrealm.
>
> The Proxy selects e.g. Server 2 based on user@SPrealm and send the
> request there changing the Destination-Realm to realm b.
>
> Server 2 processes the request generates an answer and send it to the
> Proxy with Origin-Host == server2@realm b, Origin-Realm == realm b.
>
> The Proxy forward the answer to the Client, that receives a successful
> authorization answer from a realm that is different from the one
> supposed to serve the user (as in the NAI).
>
> The client terminates the session with STR to Destination-Host ==
> server2@realm b, Destination-Realm == realm b, Termination-Cause ==
> Diameter_bad_answer
>
> The Proxy and the Servers are part of the same implementation, which
> apparently requires this kind of configuration to work.
>
> In RFC 6733 (or RFC 3388) it is not explicitly stated how to deal with
> cases where a successful authorization answer is coming from a server
> located in a different realm than the home realm of the user (as per NAI).
>
> However, to say the least, this configuration is quite bizarre and the
> client IMHO is right to terminate the session as this behavior may
> looks to the client like an answer from a malicious node. But I don't
> remember any discussion on this aspects back at the Diameter protocol
> development time.....
>
> Any opinion on this scenario?
>
> BR,
>
> Marco
>
>
> ----------------------------------------------------------------------
> --
>
> The information in this email and any attachments thereto may contain
> information that is confidential, protected by intellectual property
> rights, and may be legally privileged. It is intended solely for the
> addressee(s). Access to this email by anyone else is unauthorized. Any
> use, disclosure, copying, or distribution of the information contained
> herein by persons other than the designated addressee is unauthorized
> and may be unlawful. If you are not the intended recipient, you should
> delete the message immediately from your system. If you believe that
> you have received this email in error, please contact the sender. Any
> views expressed in this email and its attachments are those of the
> individual sender except where the sender expressly states them to be
> the views of Ooredoo.
>
>
> _______________________________________________
> DiME mailing list
> DiME@ietf.org
> https://www.ietf.org/mailman/listinfo/dime
>

_______________________________________________
DiME mailing list
DiME@ietf.org
https://www.ietf.org/mailman/listinfo/dime

________________________________

The information in this email and any attachments thereto may contain information that is confidential, protected by intellectual property rights, and may be legally privileged. It is intended solely for the addressee(s). Access to this email by anyone else is unauthorized. Any use, disclosure, copying, or distribution of the information contained herein by persons other than the designated addressee is unauthorized and may be unlawful. If you are not the intended recipient, you should delete the message immediately from your system. If you believe that you have received this email in error, please contact the sender. Any views expressed in this email and its attachments are those of the individual sender except where the sender expressly states them to be the views of Ooredoo.