Status Update:
- Phase 1 (Crypto Foundation): COMPLETE
- Phase 2 (Security Layer): COMPLETE (Verified via
tests/test_security.py)- Phase 3 (Protocol): PARTIAL (Metadata structures exist, client logic needing refinement)
- Phase 4 (Backend): PENDING
This plan outlines the steps to complete the Protocol layer and build the Backend Services (Director and Image Repository).
Important
Key Management: The current implementation uses ephemeral keys for E2E encryption. For the full Uptane flow, we need to implement the Key Management Service / persistent key storage for the Director and Image Repo to sign metadata. We will use local file-based keystores for this development phase.
The current uptane_enhanced.py contains mock logic. we need to formalize the verification and handling.
- Refine
request_updateto handle real metadata verification failures. - Implement proper key lookup from
trusted_keys. - Add
SecondaryECUlogic support.
We need a FastAPI based server to act as the Director and Image Repository.
- Pydantic models for API requests/responses (Vehicle Check-in, Manifest).
- FastAPI App: The "Director" service.
- Endpoint:
POST /vehicle/checkin- Receives VIN and basic telemetry.
- Determines if an update is needed.
- Generates and signs
root.jsonortargets.json(Director metadata).
- Integration: Uses
src.security.dos_protectionmiddleware.
- FastAPI App: The "Image Repository" service.
- Endpoint:
GET /metadata/{role}- Serves signed metadata (
snapshot.json,timestamp.json,targets.json).
- Serves signed metadata (
- Endpoint:
GET /targets/{filename}- Serves the encrypted firmware images.
- Uses
src.security.e2e_encryptionto encrypt blobs on disk (or on-the-fly).
- Entry point to run both services (or mount them together) for development.
- Create
tests/test_protocol.pyto testuptane_enhanced.pylogic with mocked network. - Create
tests/test_server.pyusingTestClient(FastAPI) to verify endpoints.
- Run the server:
python -m src.server.main - Run a simulation script (Phase 5) to connect and download an update.