Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only send IMA logs if the PCR#10 is set on mask #468

Open
lkatalin opened this issue Oct 19, 2022 · 3 comments
Open

Only send IMA logs if the PCR#10 is set on mask #468

lkatalin opened this issue Oct 19, 2022 · 3 comments

Comments

@lkatalin
Copy link
Contributor

lkatalin commented Oct 19, 2022

We probably want this to be optional for certain use cases, testing.

@ansasaki
Copy link
Contributor

@maugustosilva

If I see the code correctly, the measured boot log is only read if the PCR#0 is included in the mask:

// If PCR 0 is included in the mask, obtain the measured boot
let mut mb_measurement_list = None;
match tpm::check_mask(&param.mask, &PcrSlot::Slot0) {
Ok(true) => {
if let Some(measuredboot_ml_file) = &data.measuredboot_ml_file {
let mut ml = Vec::<u8>::new();
let mut f = measuredboot_ml_file.lock().unwrap(); //#[allow_ci]
if let Err(e) = f.rewind() {
debug!("Failed to rewind measured boot file: {}", e);
return HttpResponse::InternalServerError().json(
JsonWrapper::error(
500,
"Unable to retrieve quote".to_string(),
),
);
}
mb_measurement_list = match f.read_to_end(&mut ml) {
Ok(_) => Some(base64::encode(ml)),
Err(e) => {
warn!("Could not read TPM2 event log: {}", e);
None
}
};
}
}

For the IMA measurements, there is the possibility to provide the index from where to start reading the log to not send the whole log in every request. I think that the verifier default behavior is to request only the missing part (meaning, providing the index from the last received entry).

@maugustosilva
Copy link

I have re-checked my experiments, and you're right, MB LOG is disabled unless you pass --mb_refstate on keylime_tenant CLI, but IMA is "always on", and perhaps we should apply the very same principle there (i.e., unless PCR 10 is included on the mask, skip it)

@ansasaki ansasaki changed the title Check if reading mb log is optional Only send IMA logs if the PCR#10 is set on mask Sep 7, 2023
@ansasaki
Copy link
Contributor

ansasaki commented Sep 7, 2023

It is necessary to verify the impact of this change before implementing/merging: look out for the expectations from the verifier. If it expects to always receive the IMA logs, then it will need changes there too.

@ansasaki ansasaki added the Keylime general Involves Python codebase label Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants