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

Differential Attestation reports generation #3

Merged
merged 6 commits into from
Dec 9, 2024

Conversation

dimstav23
Copy link

This PR performs the following:

  • Introduce ProcessMasurements structure in the ProcessContext. It currently includes the init (pal) measurement, the manifest measurement and the libos measurement that are calculated when a Zygote is loaded and inherited by the derived Trustlets.
  • Add and set the parent_id field in the Trusted Process so that we know from which Zygote each Trustlet is derived.
  • Enhance the call_handler of the monitor with the DIFF_ATTEST operation
  • Implement the functions for getting the measurements.
    • The measure function takes a starting address and a size and returns the digest of this memory region
    • The monitor_report generates, stores and returns the SNP report
    • The zygote_report retrieves the Zygote measurements based on the zygote_id and returns the SNP report and the zygote measurement fields in a guest provided buffer
    • The trustlet_report retrieves the Trustlet measurements based on the trustlet_id and returns the SNP report and the trustlet measurement fields in a guest provided buffer
    • The function_report deserializes the struct with the trustlet id, function input and output provided from the guest, retrieves the Trustlet measurements and measures the input and output. Then, it returns the SNP report and the trustlet measurement fields as well as the function data measurements in a guest provided buffer
    • The diff_attestation determines which function to be called for each attestation type. It is mostly there for convenience as the user should call only the function attestation eventually.
  • Add two getters for the report address and size in the SnpReportResponse struct
  • Minor changes to satisfy the compiler checker
  • Add monitor report generation in the monitor_init() step

Test

To test it, you need to use the update t.c test provided in the Wallet-VMPL repo.
Versions:

  • Wallet-VMPL: Branch: dimstav23/update_test_with_attestation, commit: 78f073bf832eea9939362e7595da9665fbcb156d
  • gramine-svsm: Branch: dev commit: 66b537682590c96d1e0f923e6dfadadd6197ac2d

Steps:

  1. Boot a VM
  2. Log in via SSH
  3. cd module && make vmpl.ko && make reload && make t
  4. ./test 10

This will do the following:

  • init the monitor and retrieve its report
  • create one Zygote and get its report
  • create one Trustlet and get its report
  • create one function with input and output data and get its report
  • the reports are parsed and stored in the module directory with descriptive names and structure for better readability
    Note:

mmisono and others added 6 commits December 6, 2024 07:44
This commit performs the following:
- Introduce ProcessMasurements structure in the ProcessContext. It currently includes the init (pal) measurement, the manifest measurement and the libos measurement that are calculated when a Zygote is loaded and inherited by the derived Trustlets.
- Add and set the parent_id field in the Trusted Process so that we know from which Zygote each Trustlet is derived.
- Enhance the call_handler of the monitor with the DIFF_ATTEST operation
- Implement the functions for getting the measurements.
	- The measure function takes a starting address and a size and returns the digest of this memory region
	- The monitor_report is WIP (has to generate, store and return the SNP report)
	- The zygote_report retrieves the Zygote measurements based on the zygote_id. TODO: return the SNP report + the zygote measurement fields in a guest provided buffer
	- The trustlet_report retrieves the Trustlet measurements based on the trustlet_id. TODO: return the SNP report + the trustlet measurement fields in a guest provided buffer
	- The function_report deserializes the struct with the trustlet id, function input and output provided from the guest, retrieves the trustlet measurements and measures the input and output. TODO: return the SNP report + the trustlet measurement fields + the function data measurements in a guest provided buffer
	- The diff_attestation determines which function to be called for each attestation type. It is mostly there for convenience as the user should call only the function attestation eventually.

Signed-off-by: dimstav23 <[email protected]>
…rieval and append the measurements to that when a report is requested

Signed-off-by: dimstav23 <[email protected]>
This commit performs the following:
- Better handling of the report response storing its actual size and removing the response-related metadata fields from the stored report
- Add two getters for the report address and size in the SnpReportResponse struct
- Minor changes to satisfy the compiler checker

Signed-off-by: dimstav23 <[email protected]>
@dimstav23 dimstav23 assigned dimstav23 and Sabanic-P and unassigned dimstav23 Dec 7, 2024
@Sabanic-P Sabanic-P merged commit f1eb2a6 into dev Dec 9, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants