-
Notifications
You must be signed in to change notification settings - Fork 28
features: add runtime attestation page #161
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
Merged
fitzthum
merged 1 commit into
confidential-containers:main
from
fitzthum:runtime-attestation-feature
Feb 13, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| --- | ||
| title: Runtime Attestation | ||
| date: 2025-01-08 | ||
| description: Measurement from workload at runtime | ||
| categories: | ||
| - feature | ||
| tags: | ||
| - attestation | ||
| --- | ||
| Workloads can request runtime attestation of arbitrary data via a generic interface. | ||
| Not all hardware platforms support runtime attestation, but those that do | ||
| will fulfill the request. | ||
|
|
||
| On these platforms, the Attestation Agent maintains an event log, | ||
| which tracks attestation events. This log will be forwarded to Trustee | ||
| via the KBS protocol and compared to the hardware evidence. | ||
|
|
||
| ### Enabling | ||
|
|
||
| To enable this feature, set the following parameter in the guest kernel command line. | ||
| ```bash | ||
| agent.guest_components_rest_api=all | ||
| ``` | ||
| {{% alert title="Warning" color="primary" %}} | ||
| Note that this configuration will also allow the workload to fetch attestation | ||
| reports at runtime. In some configurations this can be dangerous. | ||
| See [attestation report](get-attestation) page for more information. | ||
| {{% /alert %}} | ||
|
|
||
| The Attestation Agent configuration must also have runtime attestation enabled. | ||
| This can be set via Init-Data, with the `[eventlog_config]` section below. | ||
| This configuration can also specify the measurement index that will be used. | ||
| On platforms with limited indices, the index will be mapped to the available | ||
| registers. For example, on TDX setting the measurement index to 17 will usually | ||
| result in extending RTMR 3. | ||
|
|
||
| ```toml | ||
| version = "0.1.0" | ||
| algorithm = "sha384" | ||
| [data] | ||
| "aa.toml" = ''' | ||
| [token_configs] | ||
| [token_configs.kbs] | ||
| url = "http://<trustee-uri>" | ||
|
|
||
| [eventlog_config] | ||
| init_pcr = 17 | ||
| enable_eventlog = true | ||
| ''' | ||
|
|
||
| "cdh.toml" = ''' | ||
| [kbc] | ||
| name = "cc_kbc" | ||
| url = "http://<trustee-uri>" | ||
| ''' | ||
| ``` | ||
|
|
||
| The above configurations can be added to a workload as annotations. | ||
| See the [Init-Data](initdata) page for more information on using Init-Data. | ||
| ```yaml | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: nginx | ||
| labels: | ||
| app: nginx | ||
| spec: | ||
| replicas: 1 | ||
| selector: | ||
| matchLabels: | ||
| app: nginx | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: nginx | ||
| annotations: | ||
| io.katacontainers.config.hypervisor.kernel_params: "agent.guest_components_rest_api=all" | ||
| io.katacontainers.config.hypervisor.cc_init_data: "H4sIAAAAAAAAA4WOwQ6DIBBE7/sVhos3xGpSa9IvMYQgUiEiGFz9/kLTHtpLjzO7M29OHXcbfHEvCKM1ZQSkm0O0aNbs7UY2XUtgmCRKDkRKimF1JN3KsoQBw6K9UME/7LzzH02XMXlHdLnJIG59VdWMXtqWMnpr+o51iQeDPrVHF+Z3joP1FsWmYsrVV9Bejk6Lz1cyMR4aMh+Imsz3omVUHLxcdYYqJZImfze8up7xdiRhCwEAAA==" | ||
| spec: | ||
| runtimeClassName: (...) | ||
| containers: | ||
| - name: nginx | ||
| (...) | ||
| ``` | ||
| ### Runtime Attestation | ||
|
|
||
| Once enabled, runtime attestation can be triggered via the rest API. | ||
| ```bash | ||
| curl -X POST http://127.0.0.1:8006/aa/aael \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{"domain":"test","operation":"test","content":"test"}' | ||
| ``` | ||
|
|
||
| The `domain` and `operation` are context fields that will be included in the event log. | ||
|
|
||
| You can check that the event log was updated by inspecting an attestation token. | ||
| ```bash | ||
| curl http://127.0.0.1:8006/aa/token\?token_type\=kbs | jq -r '.token |split(".") | .[1] | @base64d | fromjson' | ||
| ``` | ||
| The event log may contain boot-time entries, but at the end you should see your entry. | ||
|
|
||
| ```json | ||
| { | ||
| "details":{ | ||
| "data":{ | ||
| "content":"test", | ||
| "domain":"test", | ||
| "operation":"test" | ||
| }, | ||
| "string":"test test test", | ||
| "unicode_name":"AAEL" | ||
| }, | ||
| "digest_matches_event":true, | ||
| "digests":[ | ||
| { | ||
| "alg":"SHA-384", | ||
| "digest":"1495be3eb2120e59facb8f92447d64f..." | ||
| } | ||
| ], | ||
| "event":"TEVBQREAAAB0ZXN0IHRlc3QgdGVzenp6dA==", | ||
| "index":4, | ||
| "type_name":"EV_EVENT_TAG" | ||
| } | ||
| ``` | ||
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.
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.
since the example uses ASR, we could easily show how the token claims capture the events:
(a copy-paste I've used elsewhere and it does not match with
{"domain":"test","operation":"test","content":"test"}. it also assumedjqis installed.).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.
Good idea. Added.