|
| 1 | +# Release Sync Kafka Event Schema Documentation |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +This schema defines a unified event contract for the PDVD system. It combines software release metadata, storage references for SBOMs, and deployment endpoint information into a single message. This structure ensures that events processed via Kafka trigger the same validation, deduplication, and automated CVE linking logic as the REST API. |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## Top-Level Properties |
| 10 | + |
| 11 | +* **event_type** (string, Required): Unique identifier for the event logic (e.g., `release.sync.created`). |
| 12 | +* **event_id** (string, Required): A unique UUID for message tracking and deduplication. |
| 13 | +* **event_time** (string, Required): The ISO 8601 timestamp when the event was generated. |
| 14 | +* **synced_at** (string, Optional): The ISO 8601 timestamp of the actual deployment. If omitted, the system defaults to the current processing time. |
| 15 | + |
| 16 | +--- |
| 17 | + |
| 18 | +## 1. Release Object |
| 19 | + |
| 20 | +Contains core metadata for the software component. |
| 21 | + |
| 22 | +* **name** (string, Required): The full name of the release (e.g., "org/repo"). |
| 23 | +* **version** (string, Required): The version string, automatically cleaned and parsed into SemVer components during ingestion. |
| 24 | +* **projecttype** (string, Optional): The category of project (e.g., `docker`, `container`, `git`). |
| 25 | +* **gitcommit** (string, Optional): The Git SHA associated with the release. |
| 26 | +* **dockersha** (string, Optional): The Docker Image Digest. |
| 27 | +* **is_public** (boolean, Default: `true`): Visibility flag for the release. |
| 28 | + |
| 29 | +--- |
| 30 | + |
| 31 | +## 2. SBOM Reference Object |
| 32 | + |
| 33 | +Describes how to retrieve the SBOM content for security analysis. |
| 34 | + |
| 35 | +* **cid** (string, Required): The IPFS Content Identifier where the JSON SBOM is stored. |
| 36 | +* **storage_type** (string, Required): The backend storage provider. Allowed values: `["ipfs", "s3"]`. |
| 37 | +* **content_sha** (string, Optional): A SHA256 hash of the SBOM content for integrity verification. |
| 38 | +* **uploaded_at** (string, Optional): Timestamp when the SBOM was persisted to the storage backend. |
| 39 | + |
| 40 | +--- |
| 41 | + |
| 42 | +## 3. Endpoint Object |
| 43 | + |
| 44 | +Defines the deployment target for MTTR and lifecycle tracking. |
| 45 | + |
| 46 | +* **name** (string, Required): Unique name of the environment or cluster (e.g., "prod-us-east-1"). |
| 47 | +* **endpoint_type** (string, Required): The infrastructure category. Supported types include `eks`, `lambda`, `gke`, `fargate`, `iot`, and `mission_asset`. |
| 48 | +* **environment** (string, Required): The environment designation (e.g., `production`, `staging`). |
| 49 | +* **is_public** (boolean, Default: `true`): Visibility flag for the endpoint. |
| 50 | + |
| 51 | +--- |
| 52 | + |
| 53 | +## Example JSON Payload |
| 54 | + |
| 55 | +```json |
| 56 | +{ |
| 57 | + "event_type": "release.sync.created", |
| 58 | + "event_id": "550e8400-e29b-41d4-a716-446655440000", |
| 59 | + "event_time": "2023-10-27T10:00:00Z", |
| 60 | + "synced_at": "2023-10-27T09:55:00Z", |
| 61 | + "release": { |
| 62 | + "name": "ortelius/reporting-service", |
| 63 | + "version": "v1.2.3", |
| 64 | + "projecttype": "docker", |
| 65 | + "gitcommit": "af32c1b", |
| 66 | + "dockersha": "sha256:45b34006...77a", |
| 67 | + "is_public": true |
| 68 | + }, |
| 69 | + "sbom_ref": { |
| 70 | + "cid": "QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco", |
| 71 | + "storage_type": "ipfs", |
| 72 | + "content_sha": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", |
| 73 | + "uploaded_at": "2023-10-27T09:50:00Z" |
| 74 | + }, |
| 75 | + "endpoint": { |
| 76 | + "name": "production-cluster-01", |
| 77 | + "endpoint_type": "eks", |
| 78 | + "environment": "production", |
| 79 | + "is_public": true |
| 80 | + } |
| 81 | +} |
| 82 | +``` |
0 commit comments