Re: [TLS] TLS and hardware security modules - some issues related to PKCS11

Michael StJohns <msj@nthpermutation.com> Tue, 24 September 2013 18:52 UTC

Return-Path: <msj@nthpermutation.com>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E2FCF11E8160 for <tls@ietfa.amsl.com>; Tue, 24 Sep 2013 11:52:56 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.424
X-Spam-Level:
X-Spam-Status: No, score=-3.424 tagged_above=-999 required=5 tests=[AWL=-0.140, BAYES_00=-2.599, RCVD_IN_DNSWL_LOW=-1, SARE_MILLIONSOF=0.315]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3z6u1Ud8cRrw for <tls@ietfa.amsl.com>; Tue, 24 Sep 2013 11:52:51 -0700 (PDT)
Received: from mail-qc0-f174.google.com (mail-qc0-f174.google.com [209.85.216.174]) by ietfa.amsl.com (Postfix) with ESMTP id CD27B11E8158 for <tls@ietf.org>; Tue, 24 Sep 2013 11:52:50 -0700 (PDT)
Received: by mail-qc0-f174.google.com with SMTP id n9so3359508qcw.5 for <tls@ietf.org>; Tue, 24 Sep 2013 11:52:50 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=hb92/HngNotZSgZFnFIYbCMvYyGAwAfz80/TrNh8NtA=; b=AMTEl6EDKZyOXkO6fPPfnELYjtzWEagJ8SGRTuP7BNYUt0iMRd2qN2eW+Rrh7xzTEA cjVnIIM1vbvbZf/fgNJ2O4rQU09LxnSaS1MuihXV60yOfNwACtzYo8juAQKv0YXdLocH viR/JnkclCg4K8aYaPDwf0fwGDSJRyhZJG1dQkca200JAMr7vOgaAnhYb/3c0+HMZtU7 jqQ3lYV0168y7D7GIxndJmV4kY/lCS7wvDijLCSf71m3TUiDErsCnx74xY+PFL5nqdsc feKuVxEEj5hXW1Wh0AZPAZu9V1tTxwGcefrOP6TWcjO4xzt9W9V6HhIl6A24kn1H2/kx w0mA==
X-Gm-Message-State: ALoCoQnxsMWfYoB7RMJ2FOleQui0xkzWu41jLN7d8vF3Te9IS4FnzMHIHKb8fIr3GTNuAccq6HLz
X-Received: by 10.224.50.208 with SMTP id a16mr8268600qag.89.1380048770069; Tue, 24 Sep 2013 11:52:50 -0700 (PDT)
Received: from [192.168.1.112] (c-68-83-212-126.hsd1.md.comcast.net. [68.83.212.126]) by mx.google.com with ESMTPSA id x8sm2745317qam.2.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 24 Sep 2013 11:52:49 -0700 (PDT)
Message-ID: <5241DF82.1020601@nthpermutation.com>
Date: Tue, 24 Sep 2013 14:52:50 -0400
From: Michael StJohns <msj@nthpermutation.com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8
MIME-Version: 1.0
To: Nico Williams <nico@cryptonector.com>
References: <20130917124948.8DEFB1A974@ld9781.wdf.sap.corp> <52387927.4030007@nthpermutation.com> <CAK3OfOjeDm=shFqjHwJP6AW-0+keKc-px+jwkUVUqWeVmkyqBA@mail.gmail.com> <5240A8F0.2020001@nthpermutation.com> <20130923230057.GB15037@gmail.com>
In-Reply-To: <20130923230057.GB15037@gmail.com>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
Cc: "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] TLS and hardware security modules - some issues related to PKCS11
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <tls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tls>, <mailto:tls-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/tls>
List-Post: <mailto:tls@ietf.org>
List-Help: <mailto:tls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tls>, <mailto:tls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 24 Sep 2013 18:52:57 -0000

On 9/23/2013 7:00 PM, Nico Williams wrote:
> On Mon, Sep 23, 2013 at 04:47:44PM -0400, Michael StJohns wrote:
>> On 9/23/2013 4:00 PM, Nico Williams wrote:
>>> On Tue, Sep 17, 2013 at 10:45 AM, Michael StJohns
>>> <msj@nthpermutation.com> wrote:
>>>
>>> But evidently you must care about the application plaintext.  Why not
>>> move the application into the HSM as well then?
>>>
>>> That deserves a tongue-in-cheek smiley, of course :^)
>> There are SSL/TLS accelerators that move a whole bunch more of the
>> crypto stuff inside the HSM, but PKCS11 is designed to be useful for
>> more than just TLS.
> That's not responsive though.  The fundamental question is: why should
> anyone treat session keys as more valuable than the plaintext they are
> used to protect?

1) Smuggling out the keys is easier than smuggling out the whole plaintext.
    a) Consider a web site running TLS, it extracts the session keys and 
posts them as a stego picture on the self same website (e.g. the photo 
of the company headquarters?).
2) We generally assume (for design purposes) that ciphertext may be 
captured without detection.
3) Attacker gathers picture and ciphertext together, extracts the keys 
and then extracts the plain text.

I generally assume that targets of value (e.g. banks, etc) have decent 
self-monitoring capabilities both at the network and system level.  That 
tends to suggest that less is more when it comes to exporting data from 
an attack.

>
> I think there is an acceptable answer, namely: where the TLS (or
> whatever) channel carries some data that is not trusted and where you
> want privilege separation, and where you really just don't trust the
> hardware furnishing the plaintext.  But you kinda have to say that
> that's what you're after, and then consider other issues that come up as
> a result.  For example, you might actually need a significant part of
> your application to live in the HSM.

Its not that I don't trust the "hardware" furnishing the plaintext, I 
don't trust any general purpose computer system to be immune from 
hacking attacks (and I'm of the firm belief that any one that does is 
delusional).  I would like to use HSM policy and security guarantees to 
reduce the impact of those attacks.  For TLS, this may ultimately come 
down to doing everything inside a HSM purpose built for TLS, but that's 
not the problem I'm trying to solve.

  I'm trying to get the policy controls of PKCS11 to do the correct 
things with derived keys (general problem, not just TLS).  The current 
TLS KDF math has holes in it that are inconsistent with this goal (e.g. 
any policy control absent doing all of the TLS negotiations inside the 
secure perimeter of an HSM [NOT a PKCS11 possibility] may be trivially 
defeated due to the way the key expansion step is defined).  I'd like to 
revise that math in a fairly straightforward way to close those holes 
and make it possible to apply appropriate policy controls.

Mike


>
>> Consider a specific field of use - 10s of Millions of smart grid
>> capable electric power meters.  Consider that I have a back office
>> system that talks to each and every one of them securely.  Consider
>> that I'm worried about insider threats with respect to reading and
>> controlling (e.g. remote disconnection of the meters) these devices.
>> Consider that I never ever ever want a control key to be present
>> outside of an HSM in plaintext form.  Consider that some smart grid
>> technologies are using TLS as the sole credential layer for
>> controlling substantial amounts of power.
> I've considered these things.  See above.
>
>> TLS should be designed so this is possible.  I believe it currently
>> has a limitation that makes this goal difficult or impossible to
>> achieve.
> Or you could design a better HSM.  Why isn't that an answer?  PKCS#11
> may not be the hammer that you're looking for.
>
> Nico