Skip to content

Commit 43d5787

Browse files
committed
Bump webpki crates and pin cacert 3.131.1 for the eMudhra CA compromise
rustls-webpki 0.103.3 -> 0.103.16 (RUSTSEC-2026-0382), webpki-roots 1.0.1 -> 1.0.10 (RUSTSEC-2026-0381) and webpki-root-certs 1.0.7 -> 1.0.10 (RUSTSEC-2026-0383). rustls-webpki 0.103.16 requires the aws-lc-rs 1.18.2 / aws-lc-sys 0.46.0 bump. The API host now serves its system CA bundle from cacert 3.131.1, taken from a separate nixpkgs pin so the rainix nixpkgs input does not move.
1 parent fdf4f19 commit 43d5787

4 files changed

Lines changed: 59 additions & 12 deletions

File tree

‎Cargo.lock‎

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

‎flake.lock‎

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

‎flake.nix‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
deploy-rs.url = "github:serokell/deploy-rs";
1010
crane.url = "github:ipetkov/crane";
1111

12+
# Pinned separately so the API host can take a newer CA bundle
13+
# (cacert >= 3.131.1) without moving the rainix nixpkgs input.
14+
nixpkgs-cacert.url = "github:NixOS/nixpkgs/f903b88037954e42a165c27b686201c2f242ae28";
15+
1216
disko.url = "github:nix-community/disko";
1317
disko.inputs.nixpkgs.follows = "rainix/nixpkgs";
1418

@@ -27,6 +31,7 @@
2731
crane,
2832
disko,
2933
nixos-anywhere,
34+
nixpkgs-cacert,
3035
...
3136
}:
3237
let
@@ -36,6 +41,7 @@
3641
{
3742
nixosConfigurations.raindex-api = rainix.inputs.nixpkgs.lib.nixosSystem {
3843
system = "x86_64-linux";
44+
specialArgs.cacert = nixpkgs-cacert.legacyPackages.x86_64-linux.cacert;
3945
specialArgs.raindexEnv = {
4046
name = "prod";
4147
virtualHost = apiHostname;

‎os.nix‎

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
pkgs,
33
lib,
44
modulesPath,
5+
# CA bundle for the host, from its own nixpkgs pin (see flake.nix).
6+
cacert,
57
raindexEnv ? { },
68
...
79
}:
@@ -178,6 +180,23 @@ in
178180
defaults.email = "ops@raindex.finance";
179181
};
180182

183+
# Serve the pinned CA bundle at the paths security.pki would populate from
184+
# the rainix nixpkgs cacert. Overriding the etc entries avoids an overlay,
185+
# which would rebuild everything that depends on cacert.
186+
environment.etc =
187+
lib.genAttrs
188+
[
189+
"ssl/certs/ca-certificates.crt"
190+
"ssl/certs/ca-bundle.crt"
191+
"pki/tls/certs/ca-bundle.crt"
192+
]
193+
(_: {
194+
source = lib.mkForce "${cacert}/etc/ssl/certs/ca-bundle.crt";
195+
})
196+
// {
197+
"ssl/trust-source".source = lib.mkForce "${cacert.p11kit}/etc/ssl/trust-source";
198+
};
199+
181200
networking.firewall = {
182201
enable = true;
183202
allowedTCPPorts = [
@@ -235,7 +254,11 @@ in
235254
"d ${env.dataDir} 0775 root raindex -"
236255
"d ${env.dataDir}/logs 0775 raindex-api raindex -"
237256
];
238-
systemd.services = lib.mapAttrs mkService enabledServices;
257+
systemd.services = lib.mapAttrs mkService enabledServices // {
258+
# nix-daemon reads the read-only security.pki.caBundle, which still points
259+
# at the rainix cacert.
260+
nix-daemon.environment.CURL_CA_BUNDLE = lib.mkForce "/etc/ssl/certs/ca-certificates.crt";
261+
};
239262

240263
environment.systemPackages = with pkgs; [
241264
bat

0 commit comments

Comments
 (0)