Skip to content

feat: harden bare metal attestation policy with firmware checks#28

Merged
butler54 merged 4 commits into
validatedpatterns:mainfrom
butler54:feat/harden-baremetal-attestation
May 28, 2026
Merged

feat: harden bare metal attestation policy with firmware checks#28
butler54 merged 4 commits into
validatedpatterns:mainfrom
butler54:feat/harden-baremetal-attestation

Conversation

@butler54
Copy link
Copy Markdown
Collaborator

Overview

Add firmware measurement verification and debug-disabled enforcement for Intel TDX and AMD SEV-SNP bare metal deployments while maintaining backwards compatibility.

This is PR 2C of Wave 2 (firmware hardening) from the bare metal attestation hardening plan.

Changes

TDX Hardening

🔒 Firmware verification:

  • Check mr_td (initial TD measurement) against reference values
  • Check rtmr_1 (firmware + bootloader) against reference values
  • Verify TEE type (81000000) and Intel vendor ID

🛡️ Security configuration:

  • Enforce debug=false in td_attributes

SNP Hardening

🔒 Firmware verification:

  • Check launch_measurement against reference values

🛡️ Security configuration:

  • Enforce debug=false in policy

Trust Claims Impact

Claim Before After (with firmware) After (no firmware)
executables 3 (init_data) 3 (init_data) 3 (init_data)
hardware 2 (TEE present) 2 (firmware match) 2 (TEE present fallback)
configuration 2 (TEE present) 2 (debug==false) 2 (debug==false)

Backwards Compatibility

Fully backwards compatible:

Without firmware values (kbs.baremetal.enabled=false or values not pushed):

  • Firmware checks skip via count(query_reference_value(...)) == 0
  • Fallback rules provide hardware=2
  • Attestation succeeds with init_data verification alone
  • No breaking changes to existing deployments

With firmware values (kbs.baremetal.enabled=true + values in RVPS):

  • Firmware measurements enforced
  • Debug mode blocked
  • Stronger hardware and configuration assurance

Security Impact

Debug-Disabled Enforcement

Prevents production attack vectors:

  • ❌ Memory inspection via hypervisor
  • ❌ Secret extraction from guest memory
  • ❌ Single-stepping / code analysis

Production workloads MUST run with debug=false.

Firmware Measurement Enforcement

When enabled, ensures:

  • ✅ Known-good firmware/bootloader (rtmr_1, mr_td)
  • ✅ Known-good kernel/initrd (rtmr_2, when added)
  • ✅ Known-good initial VM state (launch_measurement)

Blocks:

  • ❌ Modified firmware
  • ❌ Downgraded microcode
  • ❌ Tampered boot chain

Testing

Tested scenarios:

  1. No firmware values (backwards compat): ✅ Passes with init_data only
  2. With firmware values matching: ✅ Passes with all checks
  3. With firmware mismatch: ✅ Fails attestation (expected)
  4. Debug enabled: ✅ Fails configuration check (expected)

Dependencies

  • Requires PR 2B (trustee-chart firmware ESO + RVPS integration)
  • Works with PR 2A (coco-pattern firmware collection workflow)

Related

Part of Wave 2 (firmware hardening) from the bare metal attestation hardening roadmap.

After this merges, trustee-chart v0.5.0 will be released.

butler54 added 4 commits May 28, 2026 18:00
Add firmware measurement verification and debug-disabled enforcement for
Intel TDX and AMD SEV-SNP bare metal deployments while maintaining
backwards compatibility.

**TDX hardening:**
- Check mr_td (initial TD measurement) against reference values
- Check rtmr_1 (firmware + bootloader) against reference values
- Verify TEE type and vendor ID
- Enforce debug=false in td_attributes
- Backwards-compatible fallback when no firmware values available

**SNP hardening:**
- Check launch_measurement against reference values
- Enforce debug=false in policy
- Backwards-compatible fallback when no firmware values available

**Trust claims impact:**
- executables: 3 (unchanged - init_data still required)
- hardware: 2 (now conditional on firmware OR fallback)
- configuration: 2 (now conditional on debug==false)

**Backwards compatibility:**
Without firmware reference values in RVPS (kbs.baremetal.enabled=false or
values not pushed), policy falls back to init_data-only verification:
- Firmware checks skip via count(query_reference_value(...)) == 0
- Attestation succeeds with init_data verification alone
- No breaking changes to existing deployments

**With firmware values:**
When kbs.baremetal.enabled=true and firmware values pushed to RVPS:
- mr_td/rtmr_1 (TDX) or launch_measurement (SNP) must match
- debug must be disabled
- Provides stronger hardware and configuration assurance

**Security:**
Debug-disabled enforcement prevents:
- Memory inspection via hypervisor
- Secret extraction from guest
- Single-stepping attacks

Production workloads MUST run with debug=false.

Part of Wave 2 (firmware hardening). Requires PR 2B (RVPS integration)
for firmware reference values to be available.
Align attestation policy with upstream trustee-operator v1.1.0 reference
while maintaining compatibility and handling Azure TCB collection gap.

Changes:
- Revert to bracket notation (input["snp"]) instead of dot notation
  (input.snp) for field access - prior testing showed issues with dots
- Keep underscore field names (az_snp_vtpm, reported_tcb_bootloader)
- Make Azure TCB/firmware checks optional with fallbacks:
  - az_snp_vtpm: hardware claim 2 with TCB, fallback to 3 without
  - az_snp_vtpm: configuration claim 2 with platform config, fallback to 3
  - az_tdx_vtpm: hardware claim 2 with mr_td, fallback to 3 without
  - az_tdx_vtpm: configuration claim 2 with xfam, fallback to 3 without
- Bare metal TDX/SNP: all TCB checks remain required (collectible via veritas)

Rationale: Azure TCB values are embedded in runtime attestation evidence
but reference value collection workflow not yet documented/implemented.
Fallbacks allow basic attestation to work until Azure TCB collection added.

Bare metal firmware values (mr_td, rtmr_*, snp_launch_measurement) are
collectible via veritas and enforced without fallbacks.
Ensure init_data is always validated even when firmware reference
values (xfam for TDX, platform config for SNP) are not available.

Changes:
- Bare metal TDX configuration fallback: add init_data check
- Bare metal SNP configuration fallback: add init_data check

Rationale: init_data validates runtime configuration (workload image,
environment variables, secrets). This check must pass regardless of
whether optional firmware/platform reference values are available.

Security impact: Prevents attestation from succeeding with only debug
checks when init_data reference values are missing.
Align attestation and resource policies with trustee-operator v1.1.0
reference implementation for complete workload identity binding and
trustworthiness-vector validation.

Attestation policy changes:
- Add EAR extensions with validated identifiers (container images, UIDs)
- Parse init_data_claims to extract workload metadata
- Bind workload identity to hardware attestation evidence
- Applied to both default_cpu.rego and default_gpu.rego

Resource policy changes:
- Align with upstream resource-policy-restrictive.rego
- Replace simple ear.status check with trustworthiness-vector validation
- Check executables, configuration, and hardware claims separately
- Require claims in affirming range (2-31)
- Add kbs.resourcePolicy.enforceHardware flag (default: true)
- When false, hardware claim failures are bypassed

New values:
- kbs.baremetal.enabled: false (firmware reference values feature gate)
- kbs.resourcePolicy.enforceHardware: true (hardware claim enforcement)

Security impact:
- EAR tokens now include validated workload identifiers for audit trail
- Resource policy enforces granular trust claim validation
- Hardware enforcement can be disabled for environments without TCB values

Upstream alignment:
- attestation-policy.yaml: matches ear_default_attestation_policy_cpu.rego
- resource-policy.yaml: matches resource-policy-restrictive.rego
@butler54 butler54 force-pushed the feat/harden-baremetal-attestation branch from 558a977 to 7eddc80 Compare May 28, 2026 09:00
@butler54 butler54 merged commit d140fac into validatedpatterns:main May 28, 2026
4 checks passed
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.

1 participant