linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mimi Zohar <zohar@linux.ibm.com>
To: Jordan Hand <Jordan.Hand@microsoft.com>,
	"linux-integrity@vger.kernel.org"
	<linux-integrity@vger.kernel.org>
Cc: "Wiseman, Monty (GE Global Research, US)" <monty.wiseman@ge.com>,
	David Safford <david.safford@ge.com>
Subject: Re: [DISCUSSION] IMA measurement log format
Date: Sat, 29 Dec 2018 23:19:13 -0500	[thread overview]
Message-ID: <1546143553.4069.110.camel@linux.ibm.com> (raw)
In-Reply-To: <CY4PR21MB06311ED50B5A02F94AF307B0F0B70@CY4PR21MB0631.namprd21.prod.outlook.com>

[Cc'ing Monty Wiseman and David Safford)

Hi Jordan,

On Fri, 2018-12-28 at 19:25 +0000, Jordan Hand wrote:
> Hi folks,
> 
> I have a question about the format of the IMA measurement log
> (/sys/kernel/security/ima/binary_runtime_measurements).
> 
> The current IMA format uses the following structure:
> 
> struct ima_template_entry {
> 	int pcr;
> 	u8 digest[TPM_DIGEST_SIZE];	/* sha1 or md5 measurement hash */
> 	struct ima_template_desc *template_desc; /* template descriptor */
> 	u32 template_data_len;
> 	struct ima_field_data template_data[0];	/* template related data */
> };
> 
> My question is, why does the IMA log not use the same log format
> that is used for PCR events in the TCG EFI spec? This would allow
> the same parser to be used for binary_bios_measurements and
> binary_runtime_measurements, while still maintaining all information
> captured by the current template format simply as event data.
> 
> Here is the EFI structure that is logged for each event in
> binary_bios_measurements (it is similar the structure used by IMA
> but different enough to require different parsing).
> 
> typedef struct {
>     TCG_PCRINDEX PCRIndex;
>     TCG_EVENTTYPE EventType;
>     TCG_DIGEST digest;
>     UINT32 EventSize;
>     UINT8 Event[1];
> } TCG_PCR_EVENT;
> 
> From the TCG EFI Spec: https://trustedcomputinggroup.org/wp-content/
> uploads/EFI-Protocol-Specification-rev13-160330final.pdf
> Note the above structure is for the TPM1.2 speficiation. There is a
> slightly different crypto-agile TCG_PCR_EVENT2 structure for
> TPM2.0. 
> 
> I feel that, when possible, it is best that the kernel keep
> continuity with other components which will be measuring events into
> the TPM for ease of parsing when these logs are used for
> attestation.
> 
> I understand these may not be trivial changes (and log format
> changes may break existing applications) but I would like to get
> some thoughts on why some of these decisions were made and possible
> ways to get more continuity in Linux system attestation moving
> forward.

Although IMA was only upstreamed in 2009, some of the code dates back
to the early 2000's.  The first paper "Design and implementation of a
TCG-based integrity measurement architecture" was published in Usenix
2004.

You should probably look at Monty Wiseman's and David Safford's LSS-NA 
2018 talk titled "A Canonical Event Log Structure for IMA".  Slides
and recordings of LSS-NA 2018 can be found on the LF website.

Defining a new log format is definitely non trivial and may not break
existing userspace applications.

Mimi


      reply	other threads:[~2018-12-30  4:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-28 19:25 [DISCUSSION] IMA measurement log format Jordan Hand
2018-12-30  4:19 ` Mimi Zohar [this message]

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=1546143553.4069.110.camel@linux.ibm.com \
    --to=zohar@linux.ibm.com \
    --cc=Jordan.Hand@microsoft.com \
    --cc=david.safford@ge.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=monty.wiseman@ge.com \
    /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).