From unknown Fri Jun 12 01:27:01 2026
X-Loop: owner@bugs.x2go.org
Subject: Bug#218: [X2Go-Dev] Bug#218: Bug#218: x2gobroker: Hostname is used instead of FQDN
Reply-To: Anders Bruun Olsen <abo@dsl.dk>, 218@bugs.x2go.org
Resent-From: Anders Bruun Olsen <abo@dsl.dk>
Resent-To: x2go-dev@lists.berlios.de
Resent-CC: X2Go Developers <x2go-dev@lists.berlios.de>
X-Loop: owner@bugs.x2go.org
Resent-Date: Mon, 27 May 2013 09:03:02 +0000
Resent-Message-ID: <handler.218.B218.136964532221067@bugs.x2go.org>
Resent-Sender: owner@bugs.x2go.org
X-X2Go-PR-Message: followup 218
X-X2Go-PR-Package: x2gobroker
X-X2Go-PR-Keywords: confirmed
Received: via spool by 218-submit@bugs.x2go.org id=B218.136964532221067
          (code B ref 218); Mon, 27 May 2013 09:03:02 +0000
Received: (at 218) by bugs.x2go.org; 27 May 2013 09:02:02 +0000
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on
	ymir.das-netzwerkteam.de
X-Spam-Level: 
X-Spam-Status: No, score=-2.3 required=5.0 tests=HTML_MESSAGE,
	RCVD_IN_DNSWL_MED,T_DKIM_INVALID,URIBL_BLOCKED autolearn=ham version=3.3.2
X-Greylist: delayed 432 seconds by postgrey-1.34 at ymir; Mon, 27 May 2013 11:02:01 CEST
Received: from eu1sys200aog111.obsmtp.com (eu1sys200aog111.obsmtp.com [207.126.144.131])
	by ymir (Postfix) with SMTP id 018925DB11
	for <218@bugs.x2go.org>; Mon, 27 May 2013 11:02:00 +0200 (CEST)
Received: from mail-ob0-f170.google.com ([209.85.214.170]) (using TLSv1) by eu1sys200aob111.postini.com ([207.126.147.11]) with SMTP
	ID DSNKUaMhCHQ5IWUSWgR//0A5EFxO0pXWnyyT@postini.com; Mon, 27 May 2013 09:02:01 UTC
Received: by mail-ob0-f170.google.com with SMTP id er7so7766046obc.15
        for <218@bugs.x2go.org>; Mon, 27 May 2013 02:01:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=dsl.dk; s=google;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :content-type;
        bh=AsYu46ZJXXk4s6V4pAlfBn+Zw2Uj7EyOb7gaIwV8aM4=;
        b=ZDJPldF27rU0MNqaaISK1w5Vq3X4emgGWbnh4s9rduKy+LpZgcBWV9Ntg1pYH3/Ihr
         psbxJIZHk3uFCSzyVCNVT0TFxMrHikxCGAu+B+jKqjx/HrpI+8U0rKir0XpQJacXwms6
         98lxFcyYiyc7o4xJaPa/FV+dt0lY27p327q7w=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20120113;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :content-type:x-gm-message-state;
        bh=AsYu46ZJXXk4s6V4pAlfBn+Zw2Uj7EyOb7gaIwV8aM4=;
        b=RERgC3iQNrHyIUy7QIMnfXCQ7w7cK3CBJrAdsTQ0Wlwc+MSWpPlYIDdpZD50b3xhb4
         mGi9DRJ7hqOBDZBIx9SQAK4kqO/xa8Et+PsVonQFfYPN15VFsYDKzng7LGU96aAYuFoP
         Cc5YASPbQRCzKbnOvVyjTI4/5wAglq8ngf5nqU7/cUL61n7yWWz0+eyGlHtHUQWh+vgh
         zTx/5ayrrQWKNOHOmXrQehsBBSu5/bm9bCHmHWdWJKUGtBRSOuTd1lygar7tw9vwceLy
         GkGv3Dy/YLxbsE6Au4gQb25WFKp7caR5pxVTL03z6l+VavlkerqoAARaRE9yz97OR4Mm
         2kZw==
X-Received: by 10.182.80.5 with SMTP id n5mr17630989obx.88.1369644886891;
        Mon, 27 May 2013 01:54:46 -0700 (PDT)
MIME-Version: 1.0
X-Received: by 10.182.80.5 with SMTP id n5mr17630976obx.88.1369644886639; Mon,
 27 May 2013 01:54:46 -0700 (PDT)
Received: by 10.182.0.45 with HTTP; Mon, 27 May 2013 01:54:46 -0700 (PDT)
In-Reply-To: <20130522175335.95934gesn8bjsbun@mail.das-netzwerkteam.de>
References: <CAFJm-UOuSiJTJY51JwFdTSGnU0hruyAHS-T1qGNmEyW181VBBw@mail.gmail.com>
	<20130522175335.95934gesn8bjsbun@mail.das-netzwerkteam.de>
Date: Mon, 27 May 2013 10:54:46 +0200
Message-ID: <CAFJm-UP_YppXesMGWdmLZrq=g9j0bYP4x+xvugO3cG1crRhimw@mail.gmail.com>
From: Anders Bruun Olsen <abo@dsl.dk>
To: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>, 218@bugs.x2go.org, 
	x2go-dev <x2go-dev@lists.berlios.de>
Content-Type: multipart/alternative; boundary=047d7b2e4146efd88704ddaf4cfa
X-Gm-Message-State: ALoCoQnbw5xMzwLVLztHKNroU1eme8nx0QURM/E5KcLQx+sTceGwpSajGpNEXl7SilUPlG+fXv0MFCz8qAMjkVj8EkfS7dA3t1RUEMEBtno7XNvhCkQ+3GloJJl1X/8HsFXt6dtyPDNTYsYhFpvOsMrPZ+kQfnzQHQ==

--047d7b2e4146efd88704ddaf4cfa
Content-Type: text/plain; charset=UTF-8

I obviously don't know the algorithm used to figure out which server is
selected, but in my ignorance, I would think the way to do it should be
something like this:

1. Ask all servers if they have a running session for the user trying to
log in.
2. If any servers answer possitively, send the configured hostname to the
client.
3. Ask all servers for the needed information.
4. Do the math on the broker, to figure out which server to select.
5. Send the selected server to the client.

Every time the broker talks to a server, it would keep the information
about which server it is talking to, in memory and just associate the
returned information with that server. I really don't see why it is
neccesary for the servers to reply back with who they think they are, nor
who their counterparts in the cluster are.

The fact that the algorithm relies on the servers to identify themselves
also seems to me to be a potential security hole. What if a local user
achieved enough administrative rights to change the hostname. Couldn't he
then get the broker to send users to a server that he controls?



2013/5/22 Mike Gabriel <mike.gabriel@das-netzwerkteam.de>

> tag #218 confirmed
> thanks
>
> Hi Anders,
>
> On Mi 22 Mai 2013 15:30:29 CEST Anders Bruun Olsen wrote:
>
>  Package: x2gobroker
>> Version: 0.0.2.2
>>
>> I am setting up a loadbalanced cluster of x2go servers with a broker in
>> front. There are thinclients on the LAN accessing the broker/cluster and
>> there will be users logging on from outside. Users on the LAN are served
>> term1.example.lan and term2.example.lan, whereas users from outside get
>> term1.example.com and term2.example.com. So far everything has worked
>> fine,
>> but now I have started testing outside access, which does not work.
>> x2gobroker (with autologin) tells x2goclient to access term1 or term2 - it
>> leaves out the rest of the domain name. This works fine on the LAN,
>> because
>> the machines there have example.lan set as their searchdomain, but
>> machines
>> from outside can't resolve "term1" to "term1.example.com" and need to be
>> given the FQDN. Please note that the FQDNs is specified in the
>> sessionprofiles, but x2goclient still tries to resolve the short version
>> of
>> the name.
>>
>
> A fix for this is not so trivial, as it seems. The ,,wrong'' hostname is
> produced by x2golistsession on the server that the x2gobroker-agent gets
> executed on.
>
> Obviously, your external clients call the X2Go Session Broker. The session
> broker knows a list of possible hosts for sending the select_session query
> to. The server that gets asked responds with a hostname from the X2Go
> session DB, that is not necessarily what you configured in X2Go Session
> Broker's x2gobroker-sessionprofiles.**conf.
>
> So, what is needed is a backwards mapping between the result that gets
> returned by x2gobroker-agent (i.e. the returned server name / hostname)
> back to the FQDN hostnames configured in X2Go Session Broker. The mapping
> is not bijective here, it is more about guessing and shooting blindfolded.
>
> /me scratches his head on the best approach for this...
>
> Mike
>
>
>
>
> --
>
> DAS-NETZWERKTEAM
> mike gabriel, herweg 7, 24357 fleckeby
> fon: +49 (1520) 1976 148
>
> GnuPG Key ID 0x25771B31
> mail: mike.gabriel@das-netzwerkteam.**de<mike.gabriel@das-netzwerkteam.de>,
> http://das-netzwerkteam.de
>
> freeBusy:
> https://mail.das-netzwerkteam.**de/freebusy/m.gabriel%40das-**
> netzwerkteam.de.xfb<https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xfb>
>
> _______________________________________________
> X2Go-Dev mailing list
> X2Go-Dev@lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/x2go-dev
>



-- 
Anders Bruun Olsen
It-ansvarlig
Det Danske Sprog- og Litteraturselskab
(Society for Danish Language and Literature)

--047d7b2e4146efd88704ddaf4cfa
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I obviously don&#39;t know the algorithm used to figure ou=
t which server is selected, but in my ignorance, I would think the way to d=
o it should be something like this:<div><br></div><div style>1. Ask all ser=
vers if they have a running session for the user trying to log in.</div>
<div style>2. If any servers answer possitively, send the configured hostna=
me to the client.</div><div style>3. Ask all servers for the needed informa=
tion.</div><div style>4. Do the math on the broker, to figure out which ser=
ver to select.</div>
<div style>5. Send the selected server to the client.</div><div style><br><=
/div><div style>Every time the broker talks to a server, it would keep the =
information about which server it is talking to, in memory and just associa=
te the returned information with that server. I really don&#39;t see why it=
 is neccesary for the servers to reply back with who they think they are, n=
or who their counterparts in the cluster are.</div>
<div style><br></div><div style>The fact that the algorithm relies on the s=
ervers to identify themselves also seems to me to be a potential security h=
ole. What if a local user achieved enough administrative rights to change t=
he hostname. Couldn&#39;t he then get the broker to send users to a server =
that he controls?</div>
<div style><br></div></div><div class=3D"gmail_extra"><br><br><div class=3D=
"gmail_quote">2013/5/22 Mike Gabriel <span dir=3D"ltr">&lt;<a href=3D"mailt=
o:mike.gabriel@das-netzwerkteam.de" target=3D"_blank">mike.gabriel@das-netz=
werkteam.de</a>&gt;</span><br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">tag #218 confirmed<br>
thanks<br>
<br>
Hi Anders,<br>
<br>
On Mi 22 Mai 2013 15:30:29 CEST Anders Bruun Olsen wrote:<br>
<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
Package: x2gobroker<br>
Version: 0.0.2.2<br>
<br>
I am setting up a loadbalanced cluster of x2go servers with a broker in<br>
front. There are thinclients on the LAN accessing the broker/cluster and<br=
>
there will be users logging on from outside. Users on the LAN are served<br=
>
term1.example.lan and term2.example.lan, whereas users from outside get<br>
<a href=3D"http://term1.example.com" target=3D"_blank">term1.example.com</a=
> and <a href=3D"http://term2.example.com" target=3D"_blank">term2.example.=
com</a>. So far everything has worked fine,<br>
but now I have started testing outside access, which does not work.<br>
x2gobroker (with autologin) tells x2goclient to access term1 or term2 - it<=
br>
leaves out the rest of the domain name. This works fine on the LAN, because=
<br>
the machines there have example.lan set as their searchdomain, but machines=
<br>
from outside can&#39;t resolve &quot;term1&quot; to &quot;<a href=3D"http:/=
/term1.example.com" target=3D"_blank">term1.example.com</a>&quot; and need =
to be<br>
given the FQDN. Please note that the FQDNs is specified in the<br>
sessionprofiles, but x2goclient still tries to resolve the short version of=
<br>
the name.<br>
</blockquote>
<br>
A fix for this is not so trivial, as it seems. The ,,wrong&#39;&#39; hostna=
me is produced by x2golistsession on the server that the x2gobroker-agent g=
ets executed on.<br>
<br>
Obviously, your external clients call the X2Go Session Broker. The session =
broker knows a list of possible hosts for sending the select_session query =
to. The server that gets asked responds with a hostname from the X2Go sessi=
on DB, that is not necessarily what you configured in X2Go Session Broker&#=
39;s x2gobroker-sessionprofiles.<u></u>conf.<br>

<br>
So, what is needed is a backwards mapping between the result that gets retu=
rned by x2gobroker-agent (i.e. the returned server name / hostname) back to=
 the FQDN hostnames configured in X2Go Session Broker. The mapping is not b=
ijective here, it is more about guessing and shooting blindfolded.<br>

<br>
/me scratches his head on the best approach for this...<span class=3D"HOEnZ=
b"><font color=3D"#888888"><br>
<br>
Mike<br>
<br>
<br>
<br>
<br>
-- <br>
<br>
DAS-NETZWERKTEAM<br>
mike gabriel, herweg 7, 24357 fleckeby<br>
fon: <a href=3D"tel:%2B49%20%281520%29%201976%20148" value=3D"+491520197614=
8" target=3D"_blank">+49 (1520) 1976 148</a><br>
<br>
GnuPG Key ID 0x25771B31<br>
mail: <a href=3D"mailto:mike.gabriel@das-netzwerkteam.de" target=3D"_blank"=
>mike.gabriel@das-netzwerkteam.<u></u>de</a>, <a href=3D"http://das-netzwer=
kteam.de" target=3D"_blank">http://das-netzwerkteam.de</a><br>
<br>
freeBusy:<br>
<a href=3D"https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwe=
rkteam.de.xfb" target=3D"_blank">https://mail.das-netzwerkteam.<u></u>de/fr=
eebusy/m.gabriel%40das-<u></u>netzwerkteam.de.xfb</a><br>
</font></span><br>_______________________________________________<br>
X2Go-Dev mailing list<br>
<a href=3D"mailto:X2Go-Dev@lists.berlios.de">X2Go-Dev@lists.berlios.de</a><=
br>
<a href=3D"https://lists.berlios.de/mailman/listinfo/x2go-dev" target=3D"_b=
lank">https://lists.berlios.de/mailman/listinfo/x2go-dev</a><br></blockquot=
e></div><br><br clear=3D"all"><div><br></div>-- <br>Anders Bruun Olsen<br>I=
t-ansvarlig<br>
Det Danske Sprog- og Litteraturselskab<br>(Society for Danish Language and =
Literature)<br>
</div>

--047d7b2e4146efd88704ddaf4cfa--
