Skip to content

feat: query RVPS reference values from attestation policies - #208

Open
jialez0 wants to merge 7 commits into
openanolis:mainfrom
jialez0:agent/rvps-policy-query
Open

feat: query RVPS reference values from attestation policies#208
jialez0 wants to merge 7 commits into
openanolis:mainfrom
jialez0:agent/rvps-policy-query

Conversation

@jialez0

@jialez0 jialez0 commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

Sync the Confidential Containers policy-to-RVPS query model into Anolis Trustee:

  • expose query_reference_value(key) to Regorus policies;
  • query RVPS by key on demand instead of always loading the full reference map;
  • support JSON scalar, array, object and boolean policy values;
  • migrate the bundled Simple, OIDC and EAR policies to keyed queries;
  • keep existing Anolis deployments and custom data.reference policies working.

The implementation is based on CoCo Trustee 9829257a and Anolis Trustee 6cc322d9.

Anolis compatibility and hardening

This deliberately adapts rather than copies the CoCo behavior:

  • The protobuf uses a wire-compatible dual mode: an empty key retains the old bulk query, while a non-empty key selects one value. The response stays in field 1.
  • Missing or expired keyed values become Rego null; RVPS errors and the 10-second timeout fail policy evaluation.
  • Existing hash-list, audit proof, merge and expiry semantics are preserved. Both keyed and bulk queries filter expired values.
  • One resolver is shared by all policies and token brokers within an attestation. It caches values and misses and lazily fetches the legacy bulk snapshot only when a policy references data.reference.
  • Regorus evaluation runs in Tokio's blocking pool while the extension bridges to the asynchronous RVPS client.

Commit sequence

  1. document the design and compatibility contract;
  2. add compatible keyed RVPS protocol, storage and clients;
  3. add the shared per-attestation resolver and cache;
  4. add the Regorus query extension and lazy legacy compatibility;
  5. migrate bundled policies and operator documentation;
  6. add built-in and standalone-gRPC RVPS end-to-end tests;
  7. keep policy hashing clean under the repository Clippy gate.

Validation

  • Rust 1.76 RVPS tests: no-default and all-features paths passed (15 and 19 tests; 2 existing ignored).
  • Rust 1.76 AS/verifier tests passed, including 24 AS unit tests, 2 new policy/RVPS integration tests, 50 verifier tests and pure-Rust TDX verifier cache tests.
  • Exact repository Clippy and rustfmt gates passed for AS, verifier and RVPS.
  • AS no-default library, REST all-verifier-rust, KBS default/coco-as-builtin/coco-as-grpc, and gRPC AS all-verifier builds passed.
  • OPA 1.18.2 validation passed for all bundled policies with the custom builtin declared in capabilities.
  • Trustee Gateway go test ./... and go vet ./... passed.
  • Process-level REST AS + standalone gRPC RVPS E2E passed: keyed JSON values, missing null, legacy bulk query, JWT issuance, allow and reject paths.
  • Real Intel TDX E2E passed with a freshly generated quote: the policy queried the registered MR_TD from RVPS and issued a JWT; a mismatched reference value was rejected; restoring the value passed again; a legacy data.reference policy also passed. The test used side ports and all temporary services/data were removed afterward.
  • Release Dockerfiles built and smoke-tested locally for RVPS, RESTful AS and Trustee Gateway; the gRPC AS binary also built successfully.

Signed-off-by: Jiale Zhang zhangjiale@linux.alibaba.com

jialez0 added 7 commits July 30, 2026 13:49
Signed-off-by: Jiale Zhang <zhangjiale@linux.alibaba.com>
Signed-off-by: Jiale Zhang <zhangjiale@linux.alibaba.com>
Signed-off-by: Jiale Zhang <zhangjiale@linux.alibaba.com>
Signed-off-by: Jiale Zhang <zhangjiale@linux.alibaba.com>
Signed-off-by: Jiale Zhang <zhangjiale@linux.alibaba.com>
Signed-off-by: Jiale Zhang <zhangjiale@linux.alibaba.com>
Signed-off-by: Jiale Zhang <zhangjiale@linux.alibaba.com>
@ostest-bot

Copy link
Copy Markdown

@jialez0 ,您好,您的请求已接收,请耐心等待结果。

@ostest-bot

Copy link
Copy Markdown

@jialez0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start

@jialez0
jialez0 marked this pull request as ready for review July 31, 2026 02:52
@ostest-bot

Copy link
Copy Markdown

@jialez0 ,您好,您的请求已接收,请耐心等待结果。

@ostest-bot

Copy link
Copy Markdown

@jialez0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start

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.

2 participants