# azure/project-cerberus architecture

> Architecture diagram of the GitHub repository azure/project-cerberus, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/azure/project-cerberus
- Repository: https://github.com/azure/project-cerberus

## Overview

Project Cerberus is platform-agnostic hardware-root-of-trust firmware for secure boot and device attestation. A management client enters through the command interface; device management coordinates device records and attestation, while firmware protection relies on manifest verification, host-state tracking, and flash access. The tree also identifies recovery-image handling, SPDM secure sessions, PCR-backed state, intrusion response, and cryptographic services as distinct capabilities. Some subsystem links are dashed because the relevant implementation was not sampled; the graph does not infer calls from directory names alone.

Main entry points: [`core/flash/flash_util.c`](https://github.com/azure/project-cerberus/blob/master/core/flash/flash_util.c) (Flash access), [`core/cmd_interface/device_manager.c`](https://github.com/azure/project-cerberus/blob/master/core/cmd_interface/device_manager.c) (Device manager), [`core/attestation/pcr_store.c`](https://github.com/azure/project-cerberus/blob/master/core/attestation/pcr_store.c) (PCR store), [`core/crypto/hash.h`](https://github.com/azure/project-cerberus/blob/master/core/crypto/hash.h) (Crypto engines)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_management["Management and Attestation"]
  node_commands["Command interface<br/>[cmd_interface.c]"]
  node_devices["Device manager<br/>[device_manager.c]"]
  node_att_request["Attestation requester"]
  node_att_response["Attestation responder"]
end

subgraph group_firmware["Firmware Integrity"]
  node_manifests["Manifest managers"]
  node_cfm["CFM manager<br/>[cfm_manager.c]"]
  node_pcd["PCD manager<br/>[pcd_manager.c]"]
  node_pfm["PFM manager<br/>[pfm_manager.c]"]
  node_firmware_update["Firmware update"]
  node_recovery["Recovery images"]
  node_host_state["Host state"]
end

subgraph group_security["Security Services"]
  node_pcr[("PCR store<br/>[pcr_store.c]")]
  node_state["System state<br/>[state_manager.c]"]
  node_intrusion["Intrusion manager"]
  node_keystore["Key management"]
  node_crypto["Crypto engines<br/>[hash.h]"]
end

subgraph group_storage["Platform Storage"]
  node_flash["Flash access<br/>[flash_util.c]"]
end

subgraph group_protocols["Secure Protocols"]
  node_spdm_sessions["SPDM sessions"]
  node_spdm_transcripts["SPDM transcripts"]
end

node_client(("Management peer"))

node_client -.->|"sends commands"| node_commands
node_commands -.->|"dispatches"| node_devices
node_devices -.->|"supports attestation"| node_att_request
node_devices -->|"reads component data"| node_pcd
node_manifests -->|"uses flash"| node_flash
node_manifests -->|"uses ECC"| node_crypto
node_cfm -.->|"records measurements"| node_pcr
node_pcd -.->|"records measurements"| node_pcr
node_pfm -.->|"uses manifest services"| node_manifests
node_firmware_update -.->|"updates flash"| node_flash
node_recovery -->|"reads and writes"| node_flash
node_recovery -->|"checks host state"| node_host_state
node_host_state -->|"uses state manager"| node_state
node_host_state -->|"reads flash"| node_flash
node_state -->|"persists state"| node_flash
node_intrusion -->|"uses PCR store"| node_pcr
node_intrusion -->|"uses hashing"| node_crypto
node_keystore -->|"generates keys"| node_crypto
node_spdm_sessions -->|"derives secrets"| node_crypto
node_spdm_transcripts -.->|"serves sessions"| node_spdm_sessions
node_att_response -.->|"reads measurements"| node_pcr
node_att_request -.->|"updates device status"| node_devices

click node_commands "https://github.com/azure/project-cerberus/blob/master/core/cmd_interface/cmd_interface.c"
click node_devices "https://github.com/azure/project-cerberus/blob/master/core/cmd_interface/device_manager.c"
click node_att_request "https://github.com/azure/project-cerberus/blob/master/core/attestation/attestation_requester.c"
click node_att_response "https://github.com/azure/project-cerberus/blob/master/core/attestation/attestation_responder.c"
click node_pcr "https://github.com/azure/project-cerberus/blob/master/core/attestation/pcr_store.c"
click node_manifests "https://github.com/azure/project-cerberus/blob/master/core/manifest/manifest_manager_flash.c"
click node_cfm "https://github.com/azure/project-cerberus/blob/master/core/manifest/cfm/cfm_manager.c"
click node_pcd "https://github.com/azure/project-cerberus/blob/master/core/manifest/pcd/pcd_manager.c"
click node_pfm "https://github.com/azure/project-cerberus/blob/master/core/manifest/pfm/pfm_manager.c"
click node_firmware_update "https://github.com/azure/project-cerberus/blob/master/core/firmware/firmware_update_handler.c"
click node_recovery "https://github.com/azure/project-cerberus/blob/master/core/recovery/recovery_image_manager.c"
click node_host_state "https://github.com/azure/project-cerberus/blob/master/core/host_fw/host_state_manager.c"
click node_flash "https://github.com/azure/project-cerberus/blob/master/core/flash/flash_util.c"
click node_state "https://github.com/azure/project-cerberus/blob/master/core/state_manager/state_manager.c"
click node_intrusion "https://github.com/azure/project-cerberus/blob/master/core/intrusion/intrusion_manager.c"
click node_keystore "https://github.com/azure/project-cerberus/blob/master/core/keystore/ephemeral_key_manager.c"
click node_crypto "https://github.com/azure/project-cerberus/blob/master/core/crypto/hash.h"
click node_spdm_sessions "https://github.com/azure/project-cerberus/blob/master/core/spdm/spdm_secure_session_manager.c"
click node_spdm_transcripts "https://github.com/azure/project-cerberus/blob/master/core/spdm/spdm_transcript_manager.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_commands,node_devices,node_att_request,node_att_response toneBlue
class node_manifests,node_cfm,node_pcd,node_pfm,node_firmware_update,node_recovery,node_host_state toneAmber
class node_pcr,node_state,node_intrusion,node_keystore,node_crypto toneMint
class node_flash toneRose
class node_spdm_sessions,node_spdm_transcripts,node_client toneIndigo
```

## Components

### Management and Attestation

- [Command interface](https://github.com/azure/project-cerberus/blob/master/core/cmd_interface/cmd_interface.c): `core/cmd_interface/cmd_interface.c`
- [Device manager](https://github.com/azure/project-cerberus/blob/master/core/cmd_interface/device_manager.c): `core/cmd_interface/device_manager.c`
- [Attestation requester](https://github.com/azure/project-cerberus/blob/master/core/attestation/attestation_requester.c): `core/attestation/attestation_requester.c`
- [Attestation responder](https://github.com/azure/project-cerberus/blob/master/core/attestation/attestation_responder.c): `core/attestation/attestation_responder.c`

### Firmware Integrity

- [Manifest managers](https://github.com/azure/project-cerberus/blob/master/core/manifest/manifest_manager_flash.c): `core/manifest/manifest_manager_flash.c`
- [CFM manager](https://github.com/azure/project-cerberus/blob/master/core/manifest/cfm/cfm_manager.c): `core/manifest/cfm/cfm_manager.c`
- [PCD manager](https://github.com/azure/project-cerberus/blob/master/core/manifest/pcd/pcd_manager.c): `core/manifest/pcd/pcd_manager.c`
- [PFM manager](https://github.com/azure/project-cerberus/blob/master/core/manifest/pfm/pfm_manager.c): `core/manifest/pfm/pfm_manager.c`
- [Firmware update](https://github.com/azure/project-cerberus/blob/master/core/firmware/firmware_update_handler.c): `core/firmware/firmware_update_handler.c`
- [Recovery images](https://github.com/azure/project-cerberus/blob/master/core/recovery/recovery_image_manager.c): `core/recovery/recovery_image_manager.c`
- [Host state](https://github.com/azure/project-cerberus/blob/master/core/host_fw/host_state_manager.c): `core/host_fw/host_state_manager.c`

### Security Services

- [PCR store](https://github.com/azure/project-cerberus/blob/master/core/attestation/pcr_store.c): `core/attestation/pcr_store.c`
- [System state](https://github.com/azure/project-cerberus/blob/master/core/state_manager/state_manager.c): `core/state_manager/state_manager.c`
- [Intrusion manager](https://github.com/azure/project-cerberus/blob/master/core/intrusion/intrusion_manager.c): `core/intrusion/intrusion_manager.c`
- [Key management](https://github.com/azure/project-cerberus/blob/master/core/keystore/ephemeral_key_manager.c): `core/keystore/ephemeral_key_manager.c`
- [Crypto engines](https://github.com/azure/project-cerberus/blob/master/core/crypto/hash.h): `core/crypto/hash.h`

### Platform Storage

- [Flash access](https://github.com/azure/project-cerberus/blob/master/core/flash/flash_util.c): `core/flash/flash_util.c`

### Secure Protocols

- [SPDM sessions](https://github.com/azure/project-cerberus/blob/master/core/spdm/spdm_secure_session_manager.c): `core/spdm/spdm_secure_session_manager.c`
- [SPDM transcripts](https://github.com/azure/project-cerberus/blob/master/core/spdm/spdm_transcript_manager.c): `core/spdm/spdm_transcript_manager.c`

### Other components

- **Management peer**

## Connections

- Management peer → Command interface: sends commands
- Command interface → Device manager: dispatches
- Device manager → Attestation requester: supports attestation
- Device manager → PCD manager: reads component data (evidence: `core/cmd_interface/device_manager.c`)
- Manifest managers → Flash access: uses flash (evidence: `core/manifest/manifest_manager_flash.c`)
- Manifest managers → Crypto engines: uses ECC (evidence: `core/manifest/manifest_manager_flash.c`)
- CFM manager → PCR store: records measurements
- PCD manager → PCR store: records measurements
- PFM manager → Manifest managers: uses manifest services
- Firmware update → Flash access: updates flash
- Recovery images → Flash access: reads and writes (evidence: `core/recovery/recovery_image_manager.c`)
- Recovery images → Host state: checks host state
- Host state → System state: uses state manager
- Host state → Flash access: reads flash (evidence: `core/host_fw/host_state_manager.c`)
- System state → Flash access: persists state (evidence: `core/state_manager/state_manager.c`)
- Intrusion manager → PCR store: uses PCR store
- Intrusion manager → Crypto engines: uses hashing
- Key management → Crypto engines: generates keys
- SPDM sessions → Crypto engines: derives secrets (evidence: `core/spdm/spdm_secure_session_manager.c`)
- SPDM transcripts → SPDM sessions: serves sessions
- Attestation responder → PCR store: reads measurements
- Attestation requester → Device manager: updates device status
