Skip to content

feat: add firmware reference values workflow for bare metal attestation#89

Open
butler54 wants to merge 5 commits into
validatedpatterns:mainfrom
butler54:feat/wave2-firmware-refvals
Open

feat: add firmware reference values workflow for bare metal attestation#89
butler54 wants to merge 5 commits into
validatedpatterns:mainfrom
butler54:feat/wave2-firmware-refvals

Conversation

@butler54
Copy link
Copy Markdown
Collaborator

@butler54 butler54 commented May 28, 2026

Overview

Add comprehensive tooling and documentation for collecting and managing firmware reference values (TDX/SNP measurements) used in bare metal attestation policies.

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

Changes

Full Lifecycle Automation

🛠️ scripts/collect-firmware-refvals.sh - Complete pod lifecycle automation:

  • Launches kata pod with specified RuntimeClass (default: kata-cc)
  • Installs pip + veritas inside pod
  • Collects firmware measurements from TEE
  • Transforms veritas output to RVPS format (JSON with arrays)
  • Saves to ~/.coco-pattern/firmware-reference-values.json
  • Cleanup pod via trap handlers (EXIT/ERR/SIGINT/SIGTERM)
  • Supports --merge for multi-OCP-version reference values
  • Options: --namespace, --output, --runtime-class, --pod-image

Pattern A Integration (Local File → values-secret → Vault)

  • values-secret.yaml.template: Single JSON blob with path: reference (commented out, like PCCS secrets)
  • Makefile: make collect-firmware-refvals and make collect-firmware-refvals-merge targets
  • scripts/gen-secrets.sh: Add firmware collection messaging for bare metal deployments

Documentation

📘 docs/firmware-reference-values.md - Complete workflow guide:

  • Step-by-step automated collection via make collect-firmware-refvals
  • Multi-OCP-version support workflow
  • Architecture of TDX (mr_td, rtmr_1/2, xfam) and SNP measurements
  • SHA-256 vs SHA-384 algorithm clarification (different layers, both correct)
  • Known veritas gaps (TCB versions, SNP policy bits, image measurements)
  • Security considerations and policy trade-offs

Usage

# On bare metal cluster with kata-cc RuntimeClass:
make collect-firmware-refvals

# Verify output
cat ~/.coco-pattern/firmware-reference-values.json

# Uncomment firmwareReferenceValues in ~/values-secret-coco-pattern.yaml
# Then load to Vault:
make load-secrets

# For multi-OCP-version support (merge with existing):
make collect-firmware-refvals-merge

Output Format

Single JSON object with arrays (supports multiple valid values per field):

{
  "mr_td": ["<sha384-hex>"],
  "rtmr_1": ["<sha384-hex>"],
  "rtmr_2": ["<sha384-hex>"],
  "xfam": ["<hex>"],
  "snp_launch_measurement": ["<sha384-hex>"]
}

Dependencies

Requires trustee-chart PR #30 (change RVPS to consume single JSON blob instead of multi-key secret).

Testing

This PR only adds documentation and tooling. The actual attestation policy enforcement comes in subsequent PRs:

  • PR 2B (trustee-chart): firmware ESO + RVPS integration
  • PR 2C (trustee-chart): attestation policy hardening
  • PR 2D (coco-pattern): baremetal profile wiring

Related

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

Aligns firmware reference value management with established patterns (pcrStash, KBS keys) - eliminates manual Vault interaction.

Add comprehensive tooling and documentation for collecting and managing
firmware reference values (TDX/SNP measurements) used in bare metal
attestation policies.

**New documentation:**
- docs/firmware-reference-values.md: Complete workflow guide covering:
  - Architecture of TDX (mr_td, rtmr_1/2, xfam) and SNP measurements
  - SHA-256 vs SHA-384 algorithm clarification (different layers, both correct)
  - Step-by-step collection using veritas tool
  - Multi-OCP-version support via merged arrays
  - Known veritas gaps (TCB versions, SNP policy bits, image measurements)
  - Security considerations and policy trade-offs

**New script:**
- scripts/collect-firmware-refvals.sh: Automated wrapper that:
  - Extracts measurements from veritas JSON output
  - Transforms to KBS/RVPS expected format (arrays of hex strings)
  - Merges with existing Vault values to support multi-version
  - Pushes to secret/data/hub/firmwareReferenceValues

**Integration:**
- Makefile: Add `make push-firmware-refvals REFVALS_FILE=<path>` target
- values-secret.yaml.template: Document firmwareReferenceValues structure

This is PR 2A of Wave 2 (firmware hardening). The actual attestation
policy enforcement and ESO integration come in subsequent PRs.

Part of the bare metal attestation hardening roadmap.
butler54 and others added 4 commits May 28, 2026 18:14
Add blank lines before lists and code blocks to comply with markdownlint
rules MD031 (blanks-around-fences) and MD032 (blanks-around-lists).
Add blank lines before all lists and code blocks to comply with markdownlint
rules MD031 (blanks-around-fences) and MD032 (blanks-around-lists).

Fixed warnings at lines: 138, 178, 187, 195, 221, 230, 238, 248
Add blank lines before code block (line 265) and list (line 300).
…cycle

Replace direct Vault push script with full lifecycle automation following
the established Pattern A (local file → values-secret.yaml → Vault):

- Rewrite collect-firmware-refvals.sh to manage complete pod lifecycle:
  launch kata pod, install veritas, collect measurements, save locally,
  cleanup pod via trap handlers
- Change output format from multi-key Vault secret to single JSON blob
  saved to ~/.coco-pattern/firmware-reference-values.json
- Add --merge option to support multi-OCP-version reference values
- Add --namespace, --output, --runtime-class, --pod-image options
- Update values-secret.yaml.template to reference local JSON file
- Update Makefile targets: collect-firmware-refvals and
  collect-firmware-refvals-merge
- Update gen-secrets.sh bare metal messaging
- Rewrite docs/firmware-reference-values.md for automated workflow

This aligns firmware reference value management with pcrStash and KBS
keys patterns, eliminating manual Vault interaction.

Requires trustee-chart PR validatedpatterns#30 (single JSON blob consumption).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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