Skip to content

Commit de8417f

Browse files
fix(datasecurity): update datasecurty BUILD.bazel and format rust
1 parent 6519bbd commit de8417f

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

pkg/collector/sharedlibrary/rustchecks/checks/datasecurity/BUILD.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ load("@rules_rust//rust:defs.bzl", "rust_shared_library", "rust_test")
33
# Rust shared-library checks are Linux-only.
44
_LINUX = ["@platforms//os:linux"]
55

6+
# Backend engines to compile in.
7+
_FEATURES = ["engine-postgres"]
8+
69
# cdylib loaded by the shared-library check loader.
710
rust_shared_library(
811
name = "datasecurity",
@@ -11,6 +14,7 @@ rust_shared_library(
1114
aliases = {
1215
"@crates//:dd-sensitive-data-scanner": "dd_sds",
1316
},
17+
crate_features = _FEATURES,
1418
crate_name = "datasecurity",
1519
edition = "2024",
1620
target_compatible_with = _LINUX,
@@ -20,6 +24,7 @@ rust_shared_library(
2024
"@crates//:anyhow",
2125
"@crates//:dd-sensitive-data-scanner",
2226
"@crates//:libc",
27+
"@crates//:postgres",
2328
"@crates//:serde",
2429
"@crates//:serde_json",
2530
],
@@ -29,6 +34,7 @@ rust_shared_library(
2934
rust_test(
3035
name = "datasecurity_test",
3136
crate = ":datasecurity",
37+
crate_features = _FEATURES,
3238
edition = "2024",
3339
target_compatible_with = _LINUX,
3440
)

pkg/collector/sharedlibrary/rustchecks/checks/datasecurity/src/check.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ fn run_sub_task(
4949
// than aborting the check, so every sub task produces exactly one event.
5050
let (status, failure_reason, matches) = match run_scan(scanner, sub_task) {
5151
Ok(matches) => {
52-
println!("datasecurity: sub task succeeded ({} match(es))", matches.len());
52+
println!(
53+
"datasecurity: sub task succeeded ({} match(es))",
54+
matches.len()
55+
);
5356
(ScanStatus::Success, String::new(), matches)
5457
}
5558
Err(err) => {

0 commit comments

Comments
 (0)