feat(agent): add pure-Go attestation-agent library (agent-go)#99
Merged
Conversation
Collaborator
|
@jialez0 ,您好,您的请求已接收,请耐心等待结果。 |
Collaborator
|
@jialez0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start 。 |
Add attestation-agent/agent-go, a pure-Go re-implementation of the attestation-agent library crate (attestation-agent/attestation-agent), layered on top of attester-go. It exposes the AttestationAPIs surface to Go programs with no cgo and no external shared library. Implemented: - AttestationAgent / AttestationAPIs: GetEvidence, GetAdditionalEvidence, GetToken, ExtendRuntimeMeasurement, BindInitData, GetTeeType, GetAdditionalTees, plus New/Init/SetInitdataToml. - config: AA config parsing (TOML or JSON) with the same defaults, and aa_kbc_params resolution from env / kernel command line. - eventlog: the AA Event Log (AAEL) - TCG2 event encoding (digest byte-compatible with the Rust implementation, locked by test vectors), extend-into-register, and a write-ahead log making the extend+append pair crash-recoverable. - initdata: Initdata TOML parsing + digest. - token: CoCoAS token getter (fully implemented). Scope (following attester-go): default build is CGO_ENABLED=0; the instance_info feature is not ported; KBS token needs a Go port of kbs_protocol and is not implemented (returns ErrKbsNotImplemented); attester-go exposes no additional device attesters so GetAdditionalEvidence is empty. The only new module dependency is a pure-Go TOML parser (github.com/BurntSushi/toml); attester-go is consumed via a relative module replace. Signed-off-by: Jiale Zhang <zhangjiale@linux.alibaba.com>
Collaborator
|
@jialez0 ,您好,您的请求已接收,请耐心等待结果。 |
Collaborator
|
@jialez0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start 。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
attestation-agent/agent-go, a pure-Go re-implementation of the attestation-agent library crate (attestation-agent/attestation-agent), layered on top ofattester-go. It exposes the attestation-agent service API (AttestationAPIs) to Go programs with no cgo and no external shared library.Why
To let Go programs use the full attestation-agent flow — not just evidence collection (
attester-go) but also token retrieval, init-data binding and, most importantly, runtime measurement extension with AAEL recording — in-process, as a pure-Go module. The default build isCGO_ENABLED=0.What it implements
AttestationAgent/AttestationAPIs—GetEvidence,GetAdditionalEvidence,GetToken,ExtendRuntimeMeasurement,BindInitData,GetTeeType,GetAdditionalTees, plusNew/Init/SetInitdataToml.config— AA config parsing (TOML or JSON) with the same defaults, andaa_kbc_paramsresolution from the environment / kernel command line.eventlog— the AA Event Log (AAEL): TCG2 event encoding, extend-into-register through the attester, and a write-ahead log (WAL) that makes the "extend register + append log" pair crash-recoverable. The TCG2 event-data digest is byte-compatible with the Rust implementation (locked by the same unit-test vectors).initdata— parse the Initdata TOML and compute its digest.token— CoCoAS token getter (fully implemented).Scope / differences from the Rust crate
All following the scope already established by
attester-go:attester-go's native kernel interfaces.instance_infois not ported (AA instance info / heartbeat). An[aa_instance]section in an existing config file is ignored.kbs_protocolcrate: RCAR handshake + TEE key pair), which has no Go port yet;token.KbsTokenGetter.GetTokenreturnstoken.ErrKbsNotImplemented. The CoCoAS token is fully implemented.attester-goexposes none, soGetAdditionalEvidencereturns empty andGetAdditionalTeesis empty.Testing
go test ./...passes (incl.-race). Coverage:aa_kbc_params, Initdata digest, token dispatch and CoCoAS URL resolution.Notes
attestation-agent/agent-go; does not touch the existing Rust crates.attester-govia a relative modulereplace. The only new external dependency is a pure-Go TOML parser (github.com/BurntSushi/toml).