|
| 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