Add some debug logs and change some log messages#764
Conversation
There was a problem hiding this comment.
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.
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")? |
| /// 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.
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.
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.