Skip to content

relay: enforce pre-hook secret restrictions from signed WorkflowExecution (PRIV-537)#23203

Closed
nadahalli wants to merge 1 commit into
developfrom
tejaswi/priv-537-relay-restrictions
Closed

relay: enforce pre-hook secret restrictions from signed WorkflowExecution (PRIV-537)#23203
nadahalli wants to merge 1 commit into
developfrom
tejaswi/priv-537-relay-restrictions

Conversation

@nadahalli

@nadahalli nadahalli commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

The Workflow-DON-signed PublicData carries the workflow's pre-hook Restrictions (chainlink-protos #441). After the PRIV-433 quorum check, the relay now filters the requested secrets against the signed restriction membership (exact and prefix rules, vault ""->"main" namespace normalization on both sides) and binds the quorum to the request's execution_id, so a breached enclave cannot replay an older execution's looser restriction set.

Membership only: counting budgets (max_secrets, per-prefix budgets) stay enclave-side, since the relay serves each request statelessly. Semantics mirror chainlink-common's in-TEE executionRestrictions wrapper, including zero-budget denials.

Capability-path filtering is out of scope: CapabilityRequestParams has no SignedComputeRequests carrier yet.

…tion (PRIV-537)

The Workflow-DON-signed PublicData carries the workflow's pre-hook
Restrictions. After the PRIV-433 quorum check, filter the requested
secrets against the signed restriction membership (exact and prefix
rules, vault namespace normalization), and bind the quorum to the
request's execution_id so a breached enclave cannot replay an older
execution's looser restrictions. Counting budgets stay enclave-side;
the relay serves each request statelessly and enforces membership only.
@github-actions

Copy link
Copy Markdown
Contributor

✅ No conflicts with other open PRs targeting develop

@github-actions

Copy link
Copy Markdown
Contributor

I see you updated files related to core. Please run make gocs in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

@nadahalli
nadahalli marked this pull request as ready for review July 22, 2026 14:09
@nadahalli
nadahalli requested a review from a team as a code owner July 22, 2026 14:09
@nadahalli
nadahalli requested a review from nolag July 22, 2026 14:11
Comment on lines +276 to +285
execution, err := h.verifyWorkflowAuthorization(localNode.WorkflowDON, params)
if err != nil {
return h.errorResponse(ctx, gatewayID, req, jsonrpc.ErrInvalidParams, err)
}

// Filter the requested secrets against the workflow's pre-hook restrictions carried in
// the same signed WorkflowExecution (PRIV-537). The enclave enforces these itself, so a
// violation reaching the relay implies a breached TEE: reject the whole request rather
// than serving a partial result.
if err = enforceSecretsRestrictions(execution.GetRestrictions(), params.Secrets); err != nil {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's already done by the execution handler :)

return h.errorResponse(ctx, gatewayID, req, jsonrpc.ErrInvalidParams, err)
}

handler, ok := h.executionHandlers.GetExecution(params.WorkflowID, params.ExecutionID)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The execution handler here already imposes the restrictions.

@nolag nolag left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No need, work was already done wired into the execution handler.

@cl-sonarqube-production

Copy link
Copy Markdown

@trunk-io

trunk-io Bot commented Jul 22, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@nadahalli

Copy link
Copy Markdown
Contributor Author

Withdrawn: the relay already enforces the pre-hook restrictions through the execution helper registered by ConfidentialModule (restriction-wrapped node-side, with working budgets, for both secrets and capability calls). See discussion with Ryan.

@nadahalli nadahalli closed this Jul 22, 2026
@nadahalli
nadahalli deleted the tejaswi/priv-537-relay-restrictions branch July 22, 2026 14:25
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