Skip to content

Commit 50ed80c

Browse files
datasecurity: add sdsresult proto (first step)
1 parent 05f56c5 commit 50ed80c

18 files changed

Lines changed: 537 additions & 6 deletions

File tree

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ linters:
162162
- "!**/comp/forwarder/eventplatform/impl/epforwarder.go"
163163
- "!**/comp/forwarder/eventplatform/impl/pipelines_container.go"
164164
- "!**/comp/forwarder/eventplatform/impl/pipelines_dataobservability.go"
165+
- "!**/comp/forwarder/eventplatform/impl/pipelines_datasecurity.go"
165166
- "!**/comp/forwarder/eventplatform/impl/pipelines_datastreams.go"
166167
- "!**/comp/forwarder/eventplatform/impl/pipelines_dbm.go"
167168
- "!**/comp/forwarder/eventplatform/impl/pipelines_eventmanagement.go"

comp/forwarder/eventplatform/def/component.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ const (
4747
EventTypeKubeActions = "kube-actions"
4848
// EventTypeAgentDiscovery represents an Agent Discovery configuration files event
4949
EventTypeAgentDiscovery = "agentdiscovery"
50+
// EventTypeSDSResult represents a sensitive-data-scanner result event
51+
EventTypeSDSResult = "sds-result"
5052
)
5153

5254
// Component is the interface of the event platform forwarder component.

comp/forwarder/eventplatform/impl/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ go_library(
99
"pipelines_agentdiscovery.go",
1010
"pipelines_container.go",
1111
"pipelines_dataobservability.go",
12+
"pipelines_datasecurity.go",
1213
"pipelines_datastreams.go",
1314
"pipelines_dbm.go",
1415
"pipelines_eventmanagement.go",

comp/forwarder/eventplatform/impl/epforwarder.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ func getPassthroughPipelines() []passthroughPipelineDesc {
8080
getDataObservabilityPipelines,
8181
getSoftwareInventoryPipelines,
8282
getAgentDiscoveryPipelines,
83+
getDataSecurityPipelines,
8384
}
8485
var descs []passthroughPipelineDesc
8586
for _, get := range getters {
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed
2+
// under the Apache License Version 2.0.
3+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
// Copyright 2016-present Datadog, Inc.
5+
6+
package eventplatformimpl
7+
8+
import (
9+
eventplatform "github.com/DataDog/datadog-agent/comp/forwarder/eventplatform/def"
10+
logshttp "github.com/DataDog/datadog-agent/comp/logs-library/client/http"
11+
pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup"
12+
)
13+
14+
func getDataSecurityPipelines() []passthroughPipelineDesc {
15+
return []passthroughPipelineDesc{
16+
{
17+
eventType: eventplatform.EventTypeSDSResult,
18+
category: "Data Security",
19+
contentType: logshttp.ProtobufContentType,
20+
endpointsConfigPrefix: "sds_result.forwarder.",
21+
hostnameEndpointPrefix: "sds-intake.",
22+
intakeTrackType: "sdsresult",
23+
defaultBatchMaxConcurrentSend: 10,
24+
defaultBatchMaxContentSize: pkgconfigsetup.DefaultBatchMaxContentSize,
25+
defaultBatchMaxSize: pkgconfigsetup.DefaultBatchMaxSize,
26+
defaultInputChanSize: pkgconfigsetup.DefaultInputChanSize,
27+
},
28+
}
29+
}

pkg/collector/sharedlibrary/rustchecks/Cargo.lock

Lines changed: 139 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/collector/sharedlibrary/rustchecks/checks/datasecurity/Cargo.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "datasecurity"
33
version = "0.1.0"
44
edition = "2024"
5+
build = "build.rs"
56

67
[features]
78
default = ["engine-postgres"]
@@ -11,13 +12,18 @@ engine-postgres = ["dep:postgres"]
1112

1213
[dependencies]
1314
anyhow = "1.0.100"
14-
core = { path = "../../core" }
15+
shlib_core = { path = "../../core", package = "core" }
1516
dd_sds = { package = "dd-sensitive-data-scanner", version = "=0.1.0-20260715-fcd8f9716b61", default-features = false, features = ["dd-sds"] }
1617
libc = "0.2.182"
1718
postgres = { version = "0.19", optional = true }
19+
prost = "0.14"
20+
prost-types = "0.14"
1821
serde = { version = "1", features = ["derive"] }
1922
serde_json = "1"
2023

24+
[build-dependencies]
25+
prost-build = "0.14"
26+
2127
[dev-dependencies]
2228
serde_yaml = "0.9.34"
2329

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed
2+
// under the Apache License Version 2.0.
3+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
// Copyright 2026-present Datadog, Inc.
5+
6+
// Compiles the canonical SDS result proto with prost-build so the check can
7+
// serialize `SdsResultPayload` messages. The crate is built with cargo.
8+
//
9+
// Canonical source: pkg/proto/datadog/sds/sds_result.proto
10+
// Requires `protoc` on PATH (e.g. `brew install protobuf`).
11+
12+
fn main() -> Result<(), Box<dyn std::error::Error>> {
13+
let proto_root = "../../../../../proto";
14+
let proto_file = "../../../../../proto/datadog/sds/sds_result.proto";
15+
16+
println!("cargo:rerun-if-changed={proto_file}");
17+
18+
prost_build::compile_protos(&[proto_file], &[proto_root])?;
19+
20+
Ok(())
21+
}

0 commit comments

Comments
 (0)