-
Notifications
You must be signed in to change notification settings - Fork 141
Add some debug logs and change some log messages #764
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
base: main
Are you sure you want to change the base?
Add some debug logs and change some log messages #764
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @gauravkuredhat , thanks a lot for this contribution!
Sorry for a late reviewing. This would do great help for debugging and logging. Do you have any plan to keep on this?
btw, you might need a DCO and take a rebase.
| Self { | ||
| eventlog_algorithm: HashAlgorithm::Sha384, | ||
| init_pcr: DEFAULT_PCR_INDEX, | ||
| enable_eventlog: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now only tdx platform supports eventlog recording thus this defaulting to true might cause bugs on other platforms.
| .add_source(config::File::with_name(config_path)) | ||
| .set_default("eventlog_config.eventlog_algorithm", DEFAULT_EVENTLOG_HASH)? | ||
| .set_default("eventlog_config.init_pcr", DEFAULT_PCR_INDEX)? | ||
| .set_default("eventlog_config.enable_eventlog", "false")? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as before
| /// Attestation Agent (AA for short) is a rust library crate for attestation procedure | ||
| /// in confidential containers. It provides kinds of service APIs related to attestation, | ||
| /// including the following | ||
| /// - `get_token`: get attestation token from remote services, e.g. attestation services. | ||
| /// - `get_evidence`: get hardware TEE signed evidence due to given runtime_data, s.t. | ||
| /// report data. | ||
| /// - `extend_runtime_measurement`: extend the runtime measurement. This will extend the | ||
| /// current hardware runtime measurement register (if any) or PCR for (v)TPM (under | ||
| /// development) platforms | ||
| /// with a runtime event. | ||
| /// - `check_init_data`: check if the given data slice matches the current confidential | ||
| /// computing environment's host data field, e.g. MRCONFIGID for TDX, HOSTDATA for SNP. | ||
| /// | ||
| /// # Example | ||
| /// | ||
| /// ```no_run | ||
| /// use attestation_agent::AttestationAgent; | ||
| /// use attestation_agent::AttestationAPIs; | ||
| /// | ||
| /// // initialize with empty config | ||
| /// let mut aa = AttestationAgent::new(None).unwrap(); | ||
| /// | ||
| /// let _quote = aa.get_evidence(&[0;64]); | ||
| /// ``` | ||
| /// `AttestationAPIs` defines the service APIs of attestation agent that need to make requests | ||
| /// to the Relying Party (Key Broker Service) in Confidential Containers. | ||
| /// | ||
| /// For every service API, the `kbc_name` and `kbs_uri` is necessary, `kbc_name` tells | ||
| /// attestation agent which KBC module it should use and `kbs_uri` specifies the KBS address. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why deleting these inlined documents?
|
|
||
| build: | ||
| cd attestation-agent && $(RUST_FLAGS) cargo build $(release) --no-default-features --features "$(features)" $(binary) $(LIBC_FLAG) | ||
| cd attestation-agent && RUST_LOG=debug $(RUST_FLAGS) cargo build $(release) --no-default-features --features "$(features)" $(binary) $(LIBC_FLAG) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect that RUST_LOG=debug only works for runtime rather than building time. https://rust-lang-nursery.github.io/rust-cookbook/development_tools/debugging/config_log.html?highlight=rust_log#enable-log-levels-per-module
This PR is for testing purpose. I have added some debug logs on some of rust files.
Merging is not required.