diff --git a/proto/sbom/sbom.proto b/proto/sbom/sbom.proto index 3d61e5e5..9eca0c59 100644 --- a/proto/sbom/sbom.proto +++ b/proto/sbom/sbom.proto @@ -20,11 +20,13 @@ message SBOMPayload { message SBOMEntity { SBOMSourceType type = 1; string id = 2; // Unique identifier to be able to correlated and "deduplicate" SBOM - repeated string dd_tags = 7; // datadog tags that will be added by the agent depending of the SBOMSourceType optional google.protobuf.Timestamp generatedAt = 3; // the datetime of the SBOM generation repeated string repo_tags = 4; // the tags of the container image bool inUse = 5; // Whether the SBOM concerns a running entity (running container) or an inert entity (image not used by any container) optional google.protobuf.Duration generationDuration = 6; // SBOM generation duration (how long it took to generate the SBOM report) + repeated string dd_tags = 7; // datadog tags that will be added by the agent depending of the SBOMSourceType + bool heartbeat = 8; // Whether the SBOM is identical to the previously sent one + string hash = 9; // Hash of the SBOM oneof sbom { cyclonedx.v1_4.Bom cyclonedx = 10; // only cyclonedx will be supported initially but putting it optional will allow us to move to another format later // spdx.SBOM spdx = 13; // SPDX can be added later as any other format. diff --git a/sbom/sbom.pb.go b/sbom/sbom.pb.go index f311c9b0..1493530c 100644 --- a/sbom/sbom.pb.go +++ b/sbom/sbom.pb.go @@ -214,11 +214,13 @@ type SBOMEntity struct { Type SBOMSourceType `protobuf:"varint,1,opt,name=type,proto3,enum=datadog.sbom.SBOMSourceType" json:"type,omitempty"` Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` // Unique identifier to be able to correlated and "deduplicate" SBOM - DdTags []string `protobuf:"bytes,7,rep,name=dd_tags,json=ddTags,proto3" json:"dd_tags,omitempty"` // datadog tags that will be added by the agent depending of the SBOMSourceType GeneratedAt *timestamp.Timestamp `protobuf:"bytes,3,opt,name=generatedAt,proto3,oneof" json:"generatedAt,omitempty"` // the datetime of the SBOM generation RepoTags []string `protobuf:"bytes,4,rep,name=repo_tags,json=repoTags,proto3" json:"repo_tags,omitempty"` // the tags of the container image InUse bool `protobuf:"varint,5,opt,name=inUse,proto3" json:"inUse,omitempty"` // Whether the SBOM concerns a running entity (running container) or an inert entity (image not used by any container) GenerationDuration *duration.Duration `protobuf:"bytes,6,opt,name=generationDuration,proto3,oneof" json:"generationDuration,omitempty"` // SBOM generation duration (how long it took to generate the SBOM report) + DdTags []string `protobuf:"bytes,7,rep,name=dd_tags,json=ddTags,proto3" json:"dd_tags,omitempty"` // datadog tags that will be added by the agent depending of the SBOMSourceType + Heartbeat bool `protobuf:"varint,8,opt,name=heartbeat,proto3" json:"heartbeat,omitempty"` // Whether the SBOM is identical to the previously sent one + Hash string `protobuf:"bytes,9,opt,name=hash,proto3" json:"hash,omitempty"` // Hash of the SBOM // Types that are assignable to Sbom: // *SBOMEntity_Cyclonedx // *SBOMEntity_Error @@ -272,13 +274,6 @@ func (x *SBOMEntity) GetId() string { return "" } -func (x *SBOMEntity) GetDdTags() []string { - if x != nil { - return x.DdTags - } - return nil -} - func (x *SBOMEntity) GetGeneratedAt() *timestamp.Timestamp { if x != nil { return x.GeneratedAt @@ -307,6 +302,27 @@ func (x *SBOMEntity) GetGenerationDuration() *duration.Duration { return nil } +func (x *SBOMEntity) GetDdTags() []string { + if x != nil { + return x.DdTags + } + return nil +} + +func (x *SBOMEntity) GetHeartbeat() bool { + if x != nil { + return x.Heartbeat + } + return false +} + +func (x *SBOMEntity) GetHash() string { + if x != nil { + return x.Hash + } + return "" +} + func (m *SBOMEntity) GetSbom() isSBOMEntity_Sbom { if m != nil { return m.Sbom @@ -377,52 +393,55 @@ var file_proto_sbom_sbom_proto_rawDesc = []byte{ 0x79, 0x52, 0x08, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x06, 0x64, 0x64, 0x5f, 0x65, 0x6e, 0x76, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x05, 0x64, 0x64, 0x45, 0x6e, 0x76, 0x88, 0x01, 0x01, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x64, 0x64, 0x5f, 0x65, 0x6e, 0x76, 0x22, 0xdb, 0x03, + 0x63, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x64, 0x64, 0x5f, 0x65, 0x6e, 0x76, 0x22, 0x8d, 0x04, 0x0a, 0x0a, 0x53, 0x42, 0x4f, 0x4d, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x30, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x73, 0x62, 0x6f, 0x6d, 0x2e, 0x53, 0x42, 0x4f, 0x4d, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, - 0x0a, 0x07, 0x64, 0x64, 0x5f, 0x74, 0x61, 0x67, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x06, 0x64, 0x64, 0x54, 0x61, 0x67, 0x73, 0x12, 0x41, 0x0a, 0x0b, 0x67, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x01, 0x52, 0x0b, 0x67, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x88, 0x01, 0x01, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, - 0x70, 0x6f, 0x5f, 0x74, 0x61, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x72, - 0x65, 0x70, 0x6f, 0x54, 0x61, 0x67, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x55, 0x73, 0x65, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x12, 0x4e, 0x0a, - 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x75, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x02, 0x52, 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, - 0x09, 0x63, 0x79, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x64, 0x78, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x13, 0x2e, 0x63, 0x79, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x64, 0x78, 0x2e, 0x76, 0x31, 0x5f, - 0x34, 0x2e, 0x42, 0x6f, 0x6d, 0x48, 0x00, 0x52, 0x09, 0x63, 0x79, 0x63, 0x6c, 0x6f, 0x6e, 0x65, - 0x64, 0x78, 0x12, 0x16, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, - 0x09, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x64, 0x61, 0x74, - 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x73, 0x62, 0x6f, 0x6d, 0x2e, 0x53, 0x42, 0x4f, 0x4d, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x06, 0x0a, 0x04, - 0x73, 0x62, 0x6f, 0x6d, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x65, 0x64, 0x41, 0x74, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x7f, 0x0a, 0x0e, 0x53, - 0x42, 0x4f, 0x4d, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0f, 0x0a, - 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1a, - 0x0a, 0x16, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x49, 0x4d, 0x41, 0x47, - 0x45, 0x5f, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x53, 0x10, 0x01, 0x12, 0x19, 0x0a, 0x15, 0x43, 0x4f, - 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x5f, 0x53, 0x59, 0x53, - 0x54, 0x45, 0x4d, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x48, 0x4f, 0x53, 0x54, 0x5f, 0x46, 0x49, - 0x4c, 0x45, 0x5f, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4d, 0x10, 0x03, 0x12, 0x0f, 0x0a, 0x0b, 0x43, - 0x49, 0x5f, 0x50, 0x49, 0x50, 0x45, 0x4c, 0x49, 0x4e, 0x45, 0x10, 0x04, 0x2a, 0x32, 0x0a, 0x0a, - 0x53, 0x42, 0x4f, 0x4d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, - 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c, 0x45, - 0x44, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x02, - 0x42, 0x2a, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x44, - 0x61, 0x74, 0x61, 0x44, 0x6f, 0x67, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2d, 0x70, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x2f, 0x76, 0x35, 0x2f, 0x73, 0x62, 0x6f, 0x6d, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x41, + 0x0a, 0x0b, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, + 0x01, 0x52, 0x0b, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x88, 0x01, + 0x01, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x74, 0x61, 0x67, 0x73, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x54, 0x61, 0x67, 0x73, 0x12, 0x14, + 0x0a, 0x05, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, + 0x6e, 0x55, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x02, 0x52, 0x12, 0x67, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x88, 0x01, 0x01, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x64, 0x5f, 0x74, 0x61, 0x67, 0x73, 0x18, + 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x64, 0x64, 0x54, 0x61, 0x67, 0x73, 0x12, 0x1c, 0x0a, + 0x09, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x09, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x68, + 0x61, 0x73, 0x68, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, + 0x33, 0x0a, 0x09, 0x63, 0x79, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x64, 0x78, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x79, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x64, 0x78, 0x2e, 0x76, + 0x31, 0x5f, 0x34, 0x2e, 0x42, 0x6f, 0x6d, 0x48, 0x00, 0x52, 0x09, 0x63, 0x79, 0x63, 0x6c, 0x6f, + 0x6e, 0x65, 0x64, 0x78, 0x12, 0x16, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x30, 0x0a, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x64, + 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x73, 0x62, 0x6f, 0x6d, 0x2e, 0x53, 0x42, 0x4f, 0x4d, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x06, + 0x0a, 0x04, 0x73, 0x62, 0x6f, 0x6d, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x7f, 0x0a, + 0x0e, 0x53, 0x42, 0x4f, 0x4d, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, + 0x12, 0x1a, 0x0a, 0x16, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x49, 0x4d, + 0x41, 0x47, 0x45, 0x5f, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x53, 0x10, 0x01, 0x12, 0x19, 0x0a, 0x15, + 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x5f, 0x53, + 0x59, 0x53, 0x54, 0x45, 0x4d, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x48, 0x4f, 0x53, 0x54, 0x5f, + 0x46, 0x49, 0x4c, 0x45, 0x5f, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4d, 0x10, 0x03, 0x12, 0x0f, 0x0a, + 0x0b, 0x43, 0x49, 0x5f, 0x50, 0x49, 0x50, 0x45, 0x4c, 0x49, 0x4e, 0x45, 0x10, 0x04, 0x2a, 0x32, + 0x0a, 0x0a, 0x53, 0x42, 0x4f, 0x4d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, + 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x41, 0x49, + 0x4c, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, + 0x10, 0x02, 0x42, 0x2a, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x44, 0x61, 0x74, 0x61, 0x44, 0x6f, 0x67, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2d, 0x70, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2f, 0x76, 0x35, 0x2f, 0x73, 0x62, 0x6f, 0x6d, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var (