Skip to content

Commit 581a377

Browse files
committed
Keep our own copy of cacert.pem
- Replace omnibus fetch from upstream with that static copy. - Include text in the BUILD file about how we check for new upstream versions. - Add explanation of why we have this. https://datadoghq.atlassian.net/browse/ABLD-169
1 parent 266036c commit 581a377

File tree

9 files changed

+4042
-21
lines changed

9 files changed

+4042
-21
lines changed

MODULE.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ bazel_dep(name = "bazel_features", version = "1.34.0")
66
bazel_dep(name = "bazel_skylib", version = "1.8.1")
77
bazel_dep(name = "rules_license", version = "1.0.0")
88
bazel_dep(name = "rules_pkg", version = "1.1.0")
9+
bazel_dep(name = "rules_shell", version = "0.6.1")
910

1011
#########################
1112
## Prebuilt binaries ##

MODULE.bazel.lock

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deps/cacerts/BUILD.bazel

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
"""cacert provides the list of trusted root SSL signing certificates.
2+
3+
Here be dragons.
4+
5+
This list is used by our python integrations, and possibly other bits.
6+
It forms the root of the web of trust. From a reliability, and security
7+
point of view, it is best if our code uses a set that we have veted
8+
ourselves, rather than relying on what might happen to be on the
9+
customer's machine.
10+
"""
11+
12+
load("@rules_license//rules:license.bzl", "license")
13+
load("@rules_pkg//pkg:install.bzl", "pkg_install")
14+
load("@rules_pkg//pkg:mappings.bzl", "pkg_files")
15+
load("@rules_shell//shell:sh_test.bzl", "sh_test")
16+
17+
package(
18+
default_applicable_licenses = [":license"],
19+
default_visibility = ["//visibility:private"],
20+
)
21+
22+
license(
23+
name = "license",
24+
license_kinds = ["@rules_license//licenses/spdx:MPL-2.0"],
25+
license_text = "MPL-2.0.txt",
26+
visibility = ["//visibility:public"],
27+
)
28+
29+
# There is a cron job that watches for changes to the header for the file.
30+
# It alerts on the team-agent-build slack channel. When we get the message,
31+
# update cacert.pem and the alert. There should be no need to rush a new
32+
# Agent release. New keys are generally phased in, so an old root cert
33+
# still works for a long period before its replacement is needed.
34+
# https://app.datadoghq.com/synthetics/details/pya-ptn-xnv
35+
36+
# Last update from upstream: cacert-2025-08-12.pem
37+
filegroup(
38+
name = "cacerts",
39+
srcs = ["cacert.pem"],
40+
visibility = ["//visibility:public"],
41+
)
42+
43+
# One might argue that this test is redundant with careful code review.
44+
# It is included as a speed bump to make it a little harder to accidentally
45+
# update the certs.
46+
sh_test(
47+
name = "check_sha_test",
48+
size = "medium",
49+
srcs = ["check_sha_test.sh"],
50+
data = [
51+
"cacert.pem",
52+
"cacert.sha256",
53+
],
54+
# sha256sum only exists on linux, and we only need to test on a single
55+
# platform anyway.
56+
target_compatible_with = [
57+
"@platforms//os:linux",
58+
],
59+
)
60+
61+
# Omnibus glue rules: The rest of this file is temporary until we no longer
62+
# have Omnibus as the high level controller for the build.
63+
# These are used only from /omnibus/config/software/cacerts.rb
64+
65+
pkg_files(
66+
name = "ssl",
67+
srcs = [
68+
":cacert.pem",
69+
],
70+
prefix = "ssl",
71+
)
72+
73+
pkg_files(
74+
name = "ssl_certs",
75+
srcs = [
76+
":cacert.pem",
77+
],
78+
prefix = "ssl/cacerts",
79+
)
80+
81+
pkg_install(
82+
name = "install",
83+
srcs = [
84+
":ssl",
85+
":ssl_certs",
86+
],
87+
)

0 commit comments

Comments
 (0)