linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Adamson <androsadamson@gmail.com>
To: NFS list <linux-nfs@vger.kernel.org>
Subject: Fwd: RFC rpc.gssd enhancement
Date: Fri, 2 Dec 2016 09:23:30 -0500	[thread overview]
Message-ID: <CAHVgHyVWqNZv55dH3hhZ-0XDsd4c79OW_R6Ze02uhv-nqePpPQ@mail.gmail.com> (raw)
In-Reply-To: <20161202134638.4ghyb5wnnwata4ec@ics.muni.cz>

'cc the kerne list


-->Andy

On Fri, Dec 2, 2016 at 8:46 AM, Lukas Hejtmanek <xhejtman@gmail.com> wrote:
> On Fri, Dec 02, 2016 at 08:26:33AM -0500, Andy Adamson wrote:
>> That is not saying much. AUTH_SYS is _completely_ insecure. RPCSEC_GSS
>> with Kerberos is as secure as we get. Watering down Kerberos security
>> is silly. AFAICS, the only reason kinit of the user to re-establish
>> the Kerberos GSS context for NFS is the fact that the result of the
>> kinit is stored in NFS under Kerberos. That is a silly design!
>
> no, it is not, that is misunderstanding. kinit does not store anything in
> $HOME. Tickets are in /tmp (or maybe in $TMPDIR). However, knit searches =
for
> ~/.krb5/config at start and ~ is Kerberzied. Maybe silly design, but not =
mine
> but kerberos guys (MIT ones).

So, how does sshd allow the user to kinit on login?
Here are the steps to allow the user to access the NFS kerberized share:

1) machine has NFS mounted /home using kerberos authentication
2) user logs in, sshd creates krb ticket ($HOME/.k5login needs to be world
readable to allow kerberized access, e.g., using kerberos ticket)

Why does the user kinit (e.g. the user logs in) allow sshd to create
the initial krb ticket in $HOME/<whatever> yet the user kinit to renew
said krb ticket fail?

>
>>
>> >> True.
>> >
>> > So, I was asking, if I provide such patch, will it be accepted into ma=
inline
>> > nfs-utils?
>>
>> It shouldn't be. I strongly object. Just to be clear, here is what you
>> are asking:
>>
>> >>So, I think in this case, I would like to see rpc.gssd uses host keyta=
b while
>> >>user's ticket is not available, which maps to nobody/nogroup,

Maybe the NFS client machine key maps to nobody/nogroup in your
environment, but it does not in others. Other environments can (and
do) map the machine cred to any UID they want - including root.

user ssh's into the NFS client machine.


>>  but kinit should succeed.
>>
>> If the above were implemented - an attacker that has rooted the  NFS
>> client machine, or got control of gssd in some way - which means the
>> attacker has the NFS client machine key, can kinit as _any_ user at
>> _any_ time and access _any_ users kerberos NFS share accessible from
>> the client machine.
>>
>> That is a huge security hole and a very large security degradation!!
>
> again, huge misunderstanding. The thing I want is that user without his/h=
er
> ticket is mapped to nobody/nogroup identity.

In your environment, UID 0 on the client machine (the machine
credential in the host keytab) is mapped to nobody/nobody when
accessing the NFS server.



> I do not want any shortcut to
> fake user ticket or something. I just want the user without ticket to be
> allowed access kerberized home with nfs/$HOSTNAME identity, i.e., the sam=
e
> identity as root user uses. So potential attacker gets nothing more than
> already has if he escalates root access. And yes, the attacker has limite=
d
> access to kerberized share if only user account is compromised. But this =
is
> the decision of NFS client machine administrator. If root access is
> compromised (still, it is gssd specific and nothing prevents the attacker=
 to
> build such patch on his own), there is nothing that attackers get.
>
> --
> Luk=C3=A1=C5=A1 Hejtm=C3=A1nek

  parent reply	other threads:[~2016-12-02 14:23 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-28 18:37 RFC rpc.gssd enhancement Lukas Hejtmanek
2016-11-29 18:37 ` Steve Dickson
2016-11-29 18:48   ` Lukas Hejtmanek
2016-11-29 19:28     ` Steve Dickson
2016-12-02 11:41       ` Lukas Hejtmanek
     [not found]         ` <CAHVgHyU6LQak3O4ybR0H3whWCKUdfz2bxLvEGi9uFM1EX+e=Eg@mail.gmail.com>
2016-12-02 14:00           ` Fwd: " Andy Adamson
     [not found]           ` <20161202134638.4ghyb5wnnwata4ec@ics.muni.cz>
2016-12-02 14:23             ` Andy Adamson [this message]
2016-12-02 14:28               ` Lukas Hejtmanek
2016-12-02 15:09                 ` Andy Adamson
2016-12-08 12:36                   ` Lukas Hejtmanek
2016-12-08 13:18                     ` Andy Adamson
2016-12-08 13:23                       ` Lukas Hejtmanek
2016-12-08 13:40                         ` Andy Adamson
2016-12-08 21:11                     ` Olga Kornievskaia
2016-12-08 21:22                       ` Lukas Hejtmanek
2016-12-08 21:50                         ` Olga Kornievskaia
2016-12-08 21:58                           ` Olga Kornievskaia
2016-11-29 20:04 ` Olga Kornievskaia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHVgHyVWqNZv55dH3hhZ-0XDsd4c79OW_R6Ze02uhv-nqePpPQ@mail.gmail.com \
    --to=androsadamson@gmail.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).