Skip to content

Evaluate alternatives to gramine-sealing-key-provider #1453

@pbeza

Description

@pbeza

Background

The current design relies on gramine-sealing-key-provider to derive the key for CVM encryption (and possibly for encrypting the backed-up keyshares in the TEE-based migration service), but it’s starting to feel like a code smell for several reasons:

  1. Gramine itself is no longer actively maintained.
    The project name suggests it uses Gramine under the hood, and based on first-hand info, Gramine is effectively unmaintained.
  2. TDX deprecated storage sealing
    TDX dropped support for sealing (which gramine-sealing-key-provider essentially tries to re-implement) after multiple potential replay-attack surfaces were identified. See:
  3. gramine-sealing-key-provider repo looks like a PoC rather than a production component.
    It has 13 stars, 9 forks, and 3 followers, and appears tightly tied to a blog post rather than a mature, maintained project.
  4. It’s probably unaudited, yet we treat it as a security-critical part of our system.
    This situation feels very “XKCD 2347” — the entire system leaning on a tiny, fragile package.

Given all that, we should evaluate whether to continue relying on gramine-sealing-key-provider. A more robust long-term option might be a fully-fledged KMS running inside the TEE.

Since we already depend on gramine-sealing-key-provider for MPC node disk encryption, we can probably keep using it for the migration service for now, but ideally replace it after the hard launch.

User Story

As an MPC network user, I don’t want to rely on sketchy projects that play a security-critical role in the system.

Acceptance Criteria

  • A clear proposal is written outlining alternatives to gramine-sealing-key-provider (e.g. TEE-based KMS, deterministic CKD-derived encryption keys, or other TDX-native approaches).
  • The proposal includes:
    • Pros/cons of each alternative.
    • Security implications (e.g. replay-attack resistance, reliance on attestation, auditability).
    • Operational complexity and migration costs.
  • The team reaches a decision on whether to:
    • Continue using gramine-sealing-key-provider temporarily and replace it later, or
    • Replace it before hard launch.
  • If we decide to replace it:
    • A follow-up issue is created describing the implementation plan.
  • If we decide to keep it temporarily:
    • Risks, assumptions, and the timeline for replacing it post-launch are documented.

Resources & Additional Notes

https://nearone.slack.com/archives/C07UW93JVQ8/p1763031771847869?thread_ts=1763028955.961159&cid=C07UW93JVQ8

Metadata

Metadata

Assignees

No one assigned

    Labels

    designThe primary purpose of this issue is to design something new rather than implementing it.investigationsecurity

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions