Skip to content

Add support for compute runtime quote policy#6474

Open
martintomazic wants to merge 10 commits intomartin/breaking/explicit-observer-modefrom
martin/feature/compute-policy
Open

Add support for compute runtime quote policy#6474
martintomazic wants to merge 10 commits intomartin/breaking/explicit-observer-modefrom
martin/feature/compute-policy

Conversation

@martintomazic
Copy link
Copy Markdown
Contributor

@martintomazic martintomazic commented Mar 16, 2026

Replaces #6471 closes #6387.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 16, 2026

Deploy Preview for oasisprotocol-oasis-core canceled.

Name Link
🔨 Latest commit 7466948
🔍 Latest deploy log https://app.netlify.com/projects/oasisprotocol-oasis-core/deploys/69df4a0d9a9e720008f48b54

@martintomazic martintomazic force-pushed the martin/feature/compute-policy branch from d0c991e to 859e7a8 Compare March 17, 2026 14:35
@martintomazic martintomazic force-pushed the martin/feature/compute-policy branch from 859e7a8 to b795a2e Compare March 18, 2026 08:55
Comment on lines +706 to +708
/// The compute runtime quote policy.
#[cbor(optional)]
compute_policy: sgx::QuotePolicy,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This field is ignored for now and only here to pass e2e test.

In practice we probably need new RHP method (similar to node identity), to signal whether compute policy should be respected or not. Technically not breaking?

The runtime should sign with its RAK whether the intention of this enclave is to be used as the one registering on the consensus (having access to keymanager) or is the intention to be used in the less constrained environments (default policy only). Similar solution to what is done for the node_id, i.e. make it part of the hash structure and sign with RAK and validate signature on the consensus side.
Do we really need this / what are possible attack vectors without it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would avoid this extra verification for now as I don't see what attack this would prevent. It is other runtimes and the consensus layer that are enforcing this policy.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree as long as we do 2 side verification on both enclave_rpc/consensus side (confirmed myself again) exploiting this is not possible. Moreover, currently the keymanager policy must be respected on both sides when interacting with it.

If however, at an point we change keymanager-RONL interaction, so that RONL must only satisfy its policy when querying keymanager for its secrets, we should be careful, not to accidentally use the default one, especially if we introduce remote RONLs. The problem there would be if the ROFL would want stricter policy then the default RONL, but again this would be mitigated by the enclave rpc using compute policy.

Having ROFL requiring stricter policy than the keymanager/compute nodes wouldn't make sense given it depends on them directly, so ignoring this corner case.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 18, 2026

Codecov Report

❌ Patch coverage is 88.98305% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.43%. Comparing base (76002fa) to head (b795a2e).
⚠️ Report is 11 commits behind head on master.

Files with missing lines Patch % Lines
go/common/node/node.go 78.57% 0 Missing and 3 partials ⚠️
go/common/node/sgx.go 91.66% 1 Missing and 1 partial ⚠️
go/common/sgx/pcs/pcs.go 0.00% 2 Missing ⚠️
go/oasis-node/cmd/node/node.go 75.00% 1 Missing and 1 partial ⚠️
go/worker/common/committee/node.go 92.30% 0 Missing and 2 partials ⚠️
go/consensus/cometbft/apps/scheduler/scheduler.go 88.88% 0 Missing and 1 partial ⚠️
go/worker/keymanager/worker.go 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6474      +/-   ##
==========================================
- Coverage   64.79%   64.43%   -0.36%     
==========================================
  Files         699      699              
  Lines       68206    68264      +58     
==========================================
- Hits        44193    43988     -205     
- Misses      18999    19205     +206     
- Partials     5014     5071      +57     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@martintomazic martintomazic marked this pull request as ready for review March 18, 2026 09:40
Comment on lines +706 to +708
/// The compute runtime quote policy.
#[cbor(optional)]
compute_policy: sgx::QuotePolicy,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would avoid this extra verification for now as I don't see what attack this would prevent. It is other runtimes and the consensus layer that are enforcing this policy.

// ComputePolicy is additional compute runtime quote policy.
//
// If not nil, it replaces (default) Policy for the compute and observer nodes.
ComputePolicy *quote.Policy `json:"compute_policy,omitempty"`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if "compute policy" is the best name for this given that both policies apply to compute runtimes, just different levels of access. Any other suggestions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not 100% fond of the name either.

StrictPolicy? and useStrictPolicy to configure runtime provisioner early validation?

Cons: now is less clearer why keymanager cannot have strict policy, also strictness is not actually enforced, e.g. with current code you can actually set looser policy for the compute one (but that would be violation of the intent making this name more suitable).

@martintomazic martintomazic force-pushed the martin/feature/compute-policy branch from 9675e14 to c342c74 Compare April 15, 2026 08:15
@martintomazic martintomazic force-pushed the martin/feature/compute-policy branch from c342c74 to b37e6f3 Compare April 15, 2026 08:18
See if we can trigger real quote verification. This will still
get rejected at local verification instead of consensus.
@martintomazic martintomazic force-pushed the martin/feature/compute-policy branch from b37e6f3 to 7466948 Compare April 15, 2026 08:19
@martintomazic martintomazic changed the base branch from master to martin/breaking/explicit-observer-mode April 15, 2026 08:24
@martintomazic martintomazic force-pushed the martin/breaking/explicit-observer-mode branch from 7904cf5 to 3a8941f Compare April 15, 2026 13:41
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.

Support for compute runtime quote policy

2 participants