From: Mimi Zohar <zohar@linux.ibm.com>
To: Tushar Sugandhi <tusharsu@linux.microsoft.com>,
noodles@fb.com, bauermann@kolabnow.com, ebiederm@xmission.com,
bhe@redhat.com, vgoyal@redhat.com, dyoung@redhat.com,
peterhuewe@gmx.de, jarkko@kernel.org, jgg@ziepe.ca,
kexec@lists.infradead.org, linux-integrity@vger.kernel.org
Cc: code@tyhicks.com, nramas@linux.microsoft.com, paul@paul-moore.com
Subject: Re: [PATCH 5/6] ima: measure TPM update counter at ima_init
Date: Thu, 03 Aug 2023 21:18:57 -0400 [thread overview]
Message-ID: <e9ab98a823c2e6c536fb2acbe86229a0085bd34a.camel@linux.ibm.com> (raw)
In-Reply-To: <da91b56a-83c8-d12e-71f8-887b6701f021@linux.microsoft.com>
On Thu, 2023-08-03 at 16:34 -0700, Tushar Sugandhi wrote:
> >> +++ b/security/integrity/ima/ima_init.c
> >> @@ -154,5 +154,8 @@ int __init ima_init(void)
> >> UTS_RELEASE, strlen(UTS_RELEASE), false,
> >> NULL, 0);
> >>
> >> + /* Measures TPM update counter at ima_init */
> >> + ima_measure_update_counter("ima_init_tpm_update_counter");
> >> +
> > With "ima_policy=critical_data" on the boot command line, the IMA
> > measurement list record looks like:
> >
> > 6e190cc643ff0b718485966a0300473baedface735 ima_init_tpm_update_counter 7570646174655f636f756e7465723d3330383b
> >
> > Please change the "ima_init_tpm_update_counter" to something shorter
> > and the hex encoded ascii string and pcr counter to something readable.
> I believe you are seeing the above line in ascill_runtime_measurements log.
Yes, the ascii_runtime_measurements are suppose to be readable to the
end user.
> The ascii logging format is consistent with other event data for
> critical_data event e.g. kernel_version.
Then you got it wrong.
> 10 8f449175bbf88bc55fc1127466628c39a3957d15 ima-buf
> sha1:4acab4fbb08db663b7b7b4528e8729187d726782 kernel_version
> 362e332e302d7263332b
> 10 f10678b63c4b2529339dff02282e63d9c6bb0385 ima-buf
> sha1:d8c187524412f74a961f2051a9529c009e700337
> ima_init_tpm_update_counter 7570646174655f636f756e7465723d3133303b
>
> Entries in the binary runtime measurements look readable to me.
You've inverted the meaning of the ascii and binary runtime measurement
lists. For comparison look at the ima-ng/ima-sig records.
> ima_init_tpm_update_counter update_counter=130;
> ...
> kexec_load_tpm_update_counte rupdate_counter=133;
>
> Please let me know if you still want me to change the format.
OI course the ascii measurement list should be human readable.
> > Perhaps name this critical-data "tpm" and "tpm-info", similar to the
> From patch 4/6:
> + result = ima_measure_critical_data("tpm_pcr_update_counter",
> event_name,
> + buf, buf_len, false, NULL, 0);
>
> The critical_data event_label value is currently set to
> "tpm_pcr_update_counter".
Why is the string so long? Long strings or variables don't make the
code or logs more understandable. Please shorten both the strings and
variables.
> I can rename event_label to "tpm-info", so that the admins can filter the
> event in IMA policy based on the label if needed.
The new record needs to be self containd and verifiable. The
additional info I suggested were just examples. Please take the time
to consider what needs to be included in the new record. Decide
whether this is a TPM security critical data record. Only then, decide
on the naming.
--
thanks,
Mimi
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2023-08-04 1:19 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-01 18:19 [PATCH 0/6] Measuring TPM update counter in IMA Tushar Sugandhi
2023-08-01 18:19 ` [PATCH 1/6] tpm: implement TPM2 function to get update counter Tushar Sugandhi
2023-08-01 19:02 ` Jarkko Sakkinen
2023-08-01 21:01 ` Tushar Sugandhi
2023-08-02 3:58 ` Jarkko Sakkinen
2023-08-02 21:04 ` Tushar Sugandhi
2023-08-03 8:43 ` Jarkko Sakkinen
2023-08-03 19:30 ` Tushar Sugandhi
2023-08-03 1:22 ` Mimi Zohar
2023-08-03 8:57 ` Jarkko Sakkinen
2023-08-03 19:33 ` Tushar Sugandhi
2023-08-03 19:31 ` Tushar Sugandhi
2023-08-01 18:19 ` [PATCH 2/6] tpm: provide functionality " Tushar Sugandhi
2023-08-01 18:19 ` [PATCH 3/6] ima: get TPM " Tushar Sugandhi
2023-08-01 18:19 ` [PATCH 4/6] ima: implement functionality to measure " Tushar Sugandhi
2023-08-03 21:42 ` Mimi Zohar
2023-08-03 23:01 ` Tushar Sugandhi
2023-08-04 1:22 ` Mimi Zohar
2023-08-04 17:13 ` Tushar Sugandhi
2023-08-01 18:19 ` [PATCH 5/6] ima: measure TPM update counter at ima_init Tushar Sugandhi
2023-08-03 22:15 ` Mimi Zohar
2023-08-03 23:34 ` Tushar Sugandhi
2023-08-04 1:18 ` Mimi Zohar [this message]
2023-08-04 17:11 ` Tushar Sugandhi
2023-08-01 18:19 ` [PATCH 6/6] kexec: measure TPM update counter in ima log at kexec load Tushar Sugandhi
2023-08-03 13:37 ` [PATCH 0/6] Measuring TPM update counter in IMA Stefan Berger
2023-08-03 21:45 ` Tushar Sugandhi
[not found] ` <cb2029b8-d585-1c06-a0ac-15624cf70e28@linux.microsoft.com>
2023-08-03 22:09 ` Stefan Berger
2023-08-03 22:36 ` Mimi Zohar
2023-08-03 22:55 ` Stefan Berger
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=e9ab98a823c2e6c536fb2acbe86229a0085bd34a.camel@linux.ibm.com \
--to=zohar@linux.ibm.com \
--cc=bauermann@kolabnow.com \
--cc=bhe@redhat.com \
--cc=code@tyhicks.com \
--cc=dyoung@redhat.com \
--cc=ebiederm@xmission.com \
--cc=jarkko@kernel.org \
--cc=jgg@ziepe.ca \
--cc=kexec@lists.infradead.org \
--cc=linux-integrity@vger.kernel.org \
--cc=noodles@fb.com \
--cc=nramas@linux.microsoft.com \
--cc=paul@paul-moore.com \
--cc=peterhuewe@gmx.de \
--cc=tusharsu@linux.microsoft.com \
--cc=vgoyal@redhat.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