summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorVincent Bernat <vincent@bernat.ch>2021-05-30 13:12:32 +0200
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2021-05-31 23:02:21 +0000
commitcbe0e663eced8d77ec8400d8e790845fcf3b0de5 (patch)
treed73adef3f9e67dad9ef309799e4ec3e0f493d93f /nixos
parent75f90eedcf94c8c795f1899c5def2f076aed76fa (diff)
nixos/acme: don't use --reuse-key
Reusing the same private/public key on renewal has two issues:

 - some providers don't accept to sign the same public key
   again (Buypass Go SSL)

 - keeping the same private key forever partly defeats the purpose of
   renewing the certificate often

Therefore, let's remove this option. People wanting to keep the same
key can set extraLegoRenewFlags to `[ --reuse-key ]` to keep the
previous behavior. Alternatively, we could put this as an option whose
default value is true.

(cherry picked from commit 632c8e1d54e299f656aa677f25552e1127f12849)
Diffstat (limited to 'nixos')
-rw-r--r--nixos/doc/manual/release-notes/rl-2105.xml10
-rw-r--r--nixos/modules/security/acme.nix2
2 files changed, 11 insertions, 1 deletions
diff --git a/nixos/doc/manual/release-notes/rl-2105.xml b/nixos/doc/manual/release-notes/rl-2105.xml
index 410d243278688..8abaae02b8a25 100644
--- a/nixos/doc/manual/release-notes/rl-2105.xml
+++ b/nixos/doc/manual/release-notes/rl-2105.xml
@@ -795,6 +795,16 @@ environment.systemPackages = [
      the deprecated <option>services.radicale.config</option> is used.
     </para>
    </listitem>
+   <listitem>
+    <para>
+     In the <option>security.acme</option> module, use of <literal>--reuse-key</literal>
+     parameter  for Lego has been removed. It was introduced for HKPK, but this security
+     feature is now deprecated. It is a better security practice to rotate key pairs
+     instead of always keeping the same. If you need to keep this parameter, you can add
+     it back using <literal>extraLegoRenewFlags</literal> as an option for the
+     appropriate certificate.
+    </para>
+   </listitem>
   </itemizedlist>
  </section>
 
diff --git a/nixos/modules/security/acme.nix b/nixos/modules/security/acme.nix
index eb3599b924d7f..c0250171109ff 100644
--- a/nixos/modules/security/acme.nix
+++ b/nixos/modules/security/acme.nix
@@ -152,7 +152,7 @@ let
     );
     renewOpts = escapeShellArgs (
       commonOpts
-      ++ [ "renew" "--reuse-key" ]
+      ++ [ "renew" ]
       ++ optionals data.ocspMustStaple [ "--must-staple" ]
       ++ data.extraLegoRenewFlags
     );