Skip to content

Commit b13255e

Browse files
Add sbom targets (#2232)
1 parent 8f0e19c commit b13255e

2 files changed

Lines changed: 202 additions & 0 deletions

File tree

BUILD

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,179 @@ filegroup(
3232
srcs = ["README.md"],
3333
visibility = ["//visibility:public"],
3434
)
35+
36+
# ============================================================================
37+
# SBOM Generation Targets
38+
# ============================================================================
39+
load("@score_tooling//sbom:defs.bzl", "sbom")
40+
41+
# SBOM for orchestrator + persistency example
42+
sbom(
43+
name = "sbom_orch_per",
44+
targets = ["//feature_showcase/rust:orch_per_example"],
45+
module_lockfile = "@score_crates//:MODULE.bazel.lock",
46+
component_name = "orch_per_example",
47+
component_version = "0.5.0-beta",
48+
auto_crates_cache = True,
49+
auto_cdxgen = True,
50+
sbom_authors = ["Eclipse SCORE Team"],
51+
generation_context = "build",
52+
)
53+
54+
# SBOM for kyron example
55+
sbom(
56+
name = "sbom_kyron",
57+
targets = ["//feature_showcase/rust:kyron_example"],
58+
module_lockfile = "@score_crates//:MODULE.bazel.lock",
59+
component_name = "kyron_example",
60+
component_version = "0.5.0-beta",
61+
auto_crates_cache = True,
62+
auto_cdxgen = True,
63+
sbom_authors = ["Eclipse SCORE Team"],
64+
generation_context = "build",
65+
)
66+
67+
# SBOM for score_baselibs
68+
sbom(
69+
name = "sbom_baselibs",
70+
targets = [
71+
"@score_baselibs//score/concurrency:concurrency",
72+
"@score_baselibs//score/memory/shared:shared",
73+
],
74+
module_lockfile = "@score_crates//:MODULE.bazel.lock",
75+
component_name = "score_baselibs",
76+
auto_crates_cache = True,
77+
auto_cdxgen = True,
78+
sbom_authors = ["Eclipse SCORE Team"],
79+
generation_context = "build",
80+
)
81+
82+
# SBOM for score_communication
83+
sbom(
84+
name = "sbom_communication",
85+
targets = [
86+
"@score_communication//score/mw/com:com",
87+
],
88+
module_lockfile = "@score_crates//:MODULE.bazel.lock",
89+
component_name = "score_communication",
90+
auto_crates_cache = True,
91+
auto_cdxgen = True,
92+
sbom_authors = ["Eclipse SCORE Team"],
93+
generation_context = "build",
94+
)
95+
96+
# SBOM for score_persistency
97+
sbom(
98+
name = "sbom_persistency",
99+
targets = [
100+
"@score_persistency//src/rust/rust_kvs:rust_kvs",
101+
],
102+
module_lockfile = "@score_crates//:MODULE.bazel.lock",
103+
component_name = "score_persistency",
104+
auto_crates_cache = True,
105+
auto_cdxgen = True,
106+
sbom_authors = ["Eclipse SCORE Team"],
107+
generation_context = "build",
108+
)
109+
110+
# SBOM for score_kyron
111+
sbom(
112+
name = "sbom_kyron_module",
113+
targets = [
114+
"@score_kyron//src/kyron:libkyron",
115+
"@score_kyron//src/kyron-foundation:libkyron_foundation",
116+
],
117+
module_lockfile = "@score_crates//:MODULE.bazel.lock",
118+
component_name = "score_kyron",
119+
auto_crates_cache = True,
120+
auto_cdxgen = True,
121+
sbom_authors = ["Eclipse SCORE Team"],
122+
generation_context = "build",
123+
)
124+
125+
# SBOM for score_orchestrator
126+
sbom(
127+
name = "sbom_orchestrator",
128+
targets = [
129+
"@score_orchestrator//src/orchestration:liborchestration",
130+
],
131+
module_lockfile = "@score_crates//:MODULE.bazel.lock",
132+
component_name = "score_orchestrator",
133+
auto_crates_cache = True,
134+
auto_cdxgen = True,
135+
sbom_authors = ["Eclipse SCORE Team"],
136+
generation_context = "build",
137+
)
138+
139+
# SBOM for score_test_scenarios
140+
sbom(
141+
name = "sbom_test_scenarios",
142+
targets = [
143+
"@score_test_scenarios//test_scenarios_rust:test_scenarios_rust",
144+
"@score_test_scenarios//test_scenarios_cpp:test_scenarios_cpp",
145+
],
146+
module_lockfile = "@score_crates//:MODULE.bazel.lock",
147+
component_name = "score_test_scenarios",
148+
auto_crates_cache = True,
149+
auto_cdxgen = True,
150+
sbom_authors = ["Eclipse SCORE Team"],
151+
generation_context = "build",
152+
)
153+
154+
# SBOM for score_feo
155+
sbom(
156+
name = "sbom_feo",
157+
targets = [
158+
"@score_feo//feo:libfeo_rust",
159+
"@score_feo//feo:libfeo_recording_rust",
160+
"@score_feo//feo-com:libfeo_com_rust",
161+
"@score_feo//feo-log:libfeo_log_rust",
162+
"@score_feo//feo-time:libfeo_time_rust",
163+
"@score_feo//feo-tracing:libfeo_tracing_rust",
164+
],
165+
module_lockfile = "@score_crates//:MODULE.bazel.lock",
166+
component_name = "score_feo",
167+
auto_crates_cache = True,
168+
auto_cdxgen = True,
169+
sbom_authors = ["Eclipse SCORE Team"],
170+
generation_context = "build",
171+
)
172+
173+
# SBOM for score_logging
174+
sbom(
175+
name = "sbom_logging",
176+
targets = [
177+
"@score_logging//score/datarouter:log",
178+
],
179+
module_lockfile = "@score_crates//:MODULE.bazel.lock",
180+
component_name = "score_logging",
181+
auto_crates_cache = True,
182+
auto_cdxgen = True,
183+
sbom_authors = ["Eclipse SCORE Team"],
184+
generation_context = "build",
185+
)
186+
187+
# Combined SBOM for all modules
188+
sbom(
189+
name = "sbom_all",
190+
targets = [
191+
"//feature_showcase/rust:orch_per_example",
192+
"//feature_showcase/rust:kyron_example",
193+
"@score_baselibs//score/concurrency:concurrency",
194+
"@score_communication//score/mw/com:com",
195+
"@score_persistency//src/rust/rust_kvs:rust_kvs",
196+
"@score_kyron//src/kyron:libkyron",
197+
"@score_orchestrator//src/orchestration:liborchestration",
198+
"@score_test_scenarios//test_scenarios_rust:test_scenarios_rust",
199+
"@score_test_scenarios//test_scenarios_cpp:test_scenarios_cpp",
200+
"@score_feo//feo:libfeo_rust",
201+
"@score_logging//score/datarouter:log",
202+
],
203+
module_lockfile = "@score_crates//:MODULE.bazel.lock",
204+
component_name = "score_reference_integration",
205+
component_version = "0.5.0-beta",
206+
auto_crates_cache = True,
207+
auto_cdxgen = True,
208+
sbom_authors = ["Eclipse SCORE Team"],
209+
generation_context = "build",
210+
)

MODULE.bazel

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,29 @@ git_override(
6565
bazel_dep(name = "rules_rust", version = "0.67.0")
6666
bazel_dep(name = "score_itf", version = "0.1.0")
6767
bazel_dep(name = "score_crates", version = "0.0.6")
68+
local_path_override(
69+
module_name = "score_crates",
70+
path = "../score-crates",
71+
)
72+
73+
# ============================================================================
74+
# SBOM Metadata Collection
75+
# ============================================================================
76+
# Enable SBOM metadata collection from all modules in the dependency graph
77+
sbom_ext = use_extension(
78+
"@score_tooling//sbom:extensions.bzl",
79+
"sbom_metadata",
80+
)
81+
82+
# Track score dependency modules for automatic version extraction from their MODULE.bazel
83+
sbom_ext.track_module(name = "score_baselibs")
84+
sbom_ext.track_module(name = "score_communication")
85+
sbom_ext.track_module(name = "score_orchestrator")
86+
sbom_ext.track_module(name = "score_logging")
87+
sbom_ext.track_module(name = "score_persistency")
88+
sbom_ext.track_module(name = "score_kyron")
89+
sbom_ext.track_module(name = "score_feo")
90+
sbom_ext.track_module(name = "score_test_scenarios")
91+
sbom_ext.track_module(name = "score_tooling")
92+
93+
use_repo(sbom_ext, "sbom_metadata")

0 commit comments

Comments
 (0)