Skip to content

feat(nitro-verifier): add revoker role for automated cert revocation#241

Merged
leopoldjoy merged 2 commits intomainfrom
leopoldjoy/chain-3890-add-revoker-role-to-nitroenclaveverifier-for-automated-cert
Apr 7, 2026
Merged

feat(nitro-verifier): add revoker role for automated cert revocation#241
leopoldjoy merged 2 commits intomainfrom
leopoldjoy/chain-3890-add-revoker-role-to-nitroenclaveverifier-for-automated-cert

Conversation

@leopoldjoy
Copy link
Copy Markdown
Contributor

Summary

  • Adds a dedicated revoker address to NitroEnclaveVerifier that can call revokeCert() without needing the owner multisig key
  • Enables an automated service (the registrar) to revoke compromised intermediate certificates with minimal latency
  • Settable in the constructor and via setRevoker() (owner-only)

Problem

NitroEnclaveVerifier.revokeCert() is currently onlyOwner (a multisig). If AWS revokes an intermediate cert early (key compromise while still valid), the only mechanism is a manual revokeCert() call by the owner multisig, adding human latency to incident response.

Risk Assessment

A compromised revoker key can only delete cached certs (DoS — increased proving costs since the ZK guest must re-verify more of the certificate chain), not forge attestations. Low blast radius.

Changes

NitroEnclaveVerifier.sol

  • State: address public revoker
  • Error: CallerNotOwnerOrRevoker()
  • Event: RevokerUpdated(address indexed newRevoker)
  • Modifier: onlyOwnerOrRevoker — allows either owner() or revoker
  • Constructor: Added initialRevoker parameter (can be address(0) to disable)
  • setRevoker(address): Owner-only setter, emits RevokerUpdated
  • revokeCert(): Changed from onlyOwner to onlyOwnerOrRevoker
  • Semver: 0.2.00.3.0

INitroEnclaveVerifier.sol

  • Added revoker() external view returns (address)
  • Added setRevoker(address) external
  • Updated revokeCert natspec

DeployRiscZeroStack.s.sol

  • Updated constructor call with address(0) for initialRevoker

Tests (NitroEnclaveVerifier.t.sol)

9 new tests (72 total, all passing):

  • testConstructorSetsRevoker — constructor sets revoker correctly
  • testConstructorAcceptsZeroRevoker — address(0) disables the role
  • testRevokerCanRevokeCert — revoker can call revokeCert
  • testOwnerCanStillRevokeCert — owner retains revokeCert access
  • testSetRevoker — owner can update revoker
  • testSetRevokerToZeroDisablesRole — setting to zero prevents old revoker
  • testSetRevokerEmitsEvent — RevokerUpdated event emitted
  • testSetRevokerRevertsIfNotOwner — non-owner cannot set revoker
  • testSetRevokerRevertsIfCalledByRevoker — revoker cannot set itself
  • testRevokeCertRevertsIfNotOwnerOrRevoker — unauthorized caller gets CallerNotOwnerOrRevoker

Related

  • CHAIN-3890
  • Stacked on #240 (Step 2: expiry-aware caching)
  • Part 3 of the intermediate certificate expiry tracking initiative

@linear
Copy link
Copy Markdown

linear bot commented Apr 6, 2026

@leopoldjoy leopoldjoy force-pushed the leopoldjoy/chain-3890-add-revoker-role-to-nitroenclaveverifier-for-automated-cert branch 2 times, most recently from 8230502 to 2e5c7cb Compare April 7, 2026 01:07
Base automatically changed from leopoldjoy/chain-3889-add-expiry-aware-intermediate-certificate-caching-to to main April 7, 2026 13:18
An error occurred while trying to automatically change base from leopoldjoy/chain-3889-add-expiry-aware-intermediate-certificate-caching-to to main April 7, 2026 13:18
@cb-heimdall
Copy link
Copy Markdown
Collaborator

cb-heimdall commented Apr 7, 2026

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

Add a dedicated revoker address to NitroEnclaveVerifier that can call
revokeCert() without needing the owner multisig key. This enables an
automated service (the registrar) to revoke compromised intermediate
certificates with minimal latency.

A compromised revoker key can only delete cached certs (DoS - increased
proving costs), not forge attestations. Low blast radius.

Changes:
- Add revoker state variable, CallerNotOwnerOrRevoker error,
  RevokerUpdated event, onlyOwnerOrRevoker modifier
- Add initialRevoker parameter to constructor (can be address(0))
- Add setRevoker() owner-only setter
- Change revokeCert from onlyOwner to onlyOwnerOrRevoker
- Update interface with revoker(), setRevoker(), event, error
- 9 new tests for revoker role semantics
- Semver: 0.2.0 -> 0.3.0

CHAIN-3890
@leopoldjoy leopoldjoy force-pushed the leopoldjoy/chain-3890-add-revoker-role-to-nitroenclaveverifier-for-automated-cert branch from 2e5c7cb to 81a2372 Compare April 7, 2026 13:45
@leopoldjoy leopoldjoy merged commit 3d69d36 into main Apr 7, 2026
8 checks passed
@leopoldjoy leopoldjoy deleted the leopoldjoy/chain-3890-add-revoker-role-to-nitroenclaveverifier-for-automated-cert branch April 7, 2026 14:48
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.

3 participants