Skip to content

Commit e653aaa

Browse files
Merge pull request #1681 from wallrj/release-note-private-key-rotation-always
[release-1.18] [VC-39805] Document the change of PrivateKeyRotationPolicy to Always
2 parents 59e6296 + b624fa2 commit e653aaa

File tree

10 files changed

+61
-6
lines changed

10 files changed

+61
-6
lines changed

.spelling

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,7 @@ ulrichgi
543543
uncomment
544544
unencrypted
545545
uninstallation
546+
unintuitive
546547
unredacted
547548
unschedule
548549
untrusted

content/docs/contributing/api-compatibility.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ after an upgrade or downgrade of cert-manager.
1111
In some cases, we may need to require users to take actions before upgrading or may need to diverge from the API compatibility promise but we'll treat this as an absolute
1212
last resort. In general the main criteria by which we'd determine whether a change is acceptable would be user value.
1313

14-
For example in the event of a truly critical bug, a fix that breaks the API compatibility promise by changing the default behavior of an API field _might_ be acceptable. As of yet, though, there has never been a need for such a change.
14+
Here are the breaking changes we have made to the `v1` API:
15+
* [cert-manger 1.18](../releases/release-notes/release-notes-1.18.md): The default value of `Certificate.Spec.PrivateKey.RotationPolicy` changed from `Never` to `Always`.
1516

1617
## Alpha / Beta API Versions
1718

content/docs/releases/release-notes/release-notes-1.18.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,47 @@ cert-manager v1.18 includes:
99

1010
## Major Themes
1111

12+
### The default value of `Certificate.Spec.PrivateKey.RotationPolicy` is now `Always`
13+
14+
> ⚠️ Breaking change
15+
16+
We have changed the default value of `Certificate.Spec.PrivateKey.RotationPolicy` from `Never` to `Always`.
17+
18+
Why? Because the old default was unintuitive and insecure.
19+
For example, if a private key is exposed, users may (reasonably) assume that
20+
re-issuing a certificate (e.g. using `cmctl renew`) will generate a new private
21+
key, but it won't unless the user has explicitly set `rotationPolicy: Always` on the Certificate resource.
22+
23+
This change is feature gated and is enabled by default, because it has been fast-tracked to beta status.
24+
25+
Users who want to preserve the old default have two options:
26+
1. Explicitly set `rotationPolicy: Never` on your Certificate resources.
27+
2. Turn off the feature gate in this release and explicitly set
28+
`rotationPolicy: Never` on your Certificates before release 1.19.
29+
In release 1.19, the feature will be marked as GA and it will no longer be
30+
possible to turn off the feature.
31+
32+
The following Helm chart values can be used to turn off the feature gate:
33+
34+
```yaml
35+
# values.yaml
36+
config:
37+
featureGates:
38+
DefaultPrivateKeyRotationPolicyAlways: false
39+
```
40+
41+
> ℹ️ The old default value `Never` was always intended to be changed before API `v1`, as can be seen in the description of the [original PR](https://github.com/cert-manager/cert-manager/pull/2814):
42+
> > For backward compatibility, the empty value is treated as 'Never' which matches the behavior we have today.
43+
> > In a future API version, we can flip this default to be Always.
44+
>
45+
> 📖 See [Issue: 7601: Change `PrivateKey.RotationPolicy` to default to Always](https://github.com/cert-manager/cert-manager/issues/7601) to read the proposal for this change and the discussion around it.
46+
>
47+
> 📖 Read [cert-manager component configuration](../../installation/configuring-components.md) to learn more about feature gates.
48+
>
49+
> 📖 Read our updated [API compatibility statement](../../contributing/api-compatibility.md) which now reflects our new, more flexible, approach to changing API defaults, with a view to introducing other "sane" default API values in future releases.
50+
>
51+
> 📖 Read [Issuance behavior: Rotation of the private key](../../usage/certificate.md#issuance-behavior-rotation-of-the-private-key) to learn more about private key rotation in cert-manager.
52+
1253
### Copy annotations from Ingress or Gateway to the Certificate
1354

1455
We've added a new configuration option to the cert-manager controller: `--extra-certificate-annotations`, which allows you to specify annotation keys to be copied from an Ingress or Gateway resource to the resulting Certificate object.

content/docs/releases/upgrading/upgrading-1.17-1.18.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ description: 'cert-manager installation: Upgrading v1.17 to v1.18'
55

66
Before upgrading cert-manager from 1.17 to 1.18, please read the following important notes about breaking changes in 1.18:
77

8-
1. TODO
8+
1. We have changed the default value of `Certificate.Spec.PrivateKey.RotationPolicy` from `Never` to `Always`.
9+
10+
> 📖 Read [Release 1.18 notes](../release-notes/release-notes-1.18.md) for more information..
911
1012
## Next Steps
1113

content/docs/tutorials/certificate-defaults/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ These rules will:
159159
160160
- Set a default value of: `revisionHistoryLimit: 2`.
161161
- Set a [default value of `Always` under `spec.privateKey.rotationPolicy`](../../usage/certificate.md#the-rotationpolicy-setting).
162+
> ℹ️ This is not necessary if you use cert-manager `>=v1.18.0`, because the default value was changed from `Never` to `Always`.
162163
- Set defaults for all `spec.privateKey` fields.
163164
164165
> ℹ️ Note how these rules tackle the first two of our [uses cases](#use-cases).

content/docs/usage/certificate.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,15 @@ Adding the following annotation on an ingress will automatically set "issue-temp
377377
<a id="rotation-private-key"></a>
378378
## Issuance behavior: Rotation of the private key
379379

380-
By default, the private key won't be rotated automatically. Using the setting
381-
`rotationPolicy: Always`, the private key Secret associated with a Certificate
380+
> ⚠️ In cert-manager v1.18.0, the default `rotationPolicy` was changed.
381+
>
382+
> In cert-manager `>= v1.18.0` the default is `rotationPolicy: Always`;
383+
> the private key **is** rotated automatically.
384+
>
385+
> In cert-manager `< v1.18.0` the default is `rotationPolicy: Never`;
386+
> the private key **is not** rotated automatically.
387+
388+
With the setting `rotationPolicy: Always`, the private key Secret associated with a Certificate
382389
object can be configured to be rotated as soon as an the Certificate is reissued (see
383390
[Issuance triggers](#issuance-triggers)).
384391

content/docs/usage/gateway.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ Certificate resources:
436436

437437
- `cert-manager.io/private-key-rotation-policy`: (optional) this annotation allows you to
438438
configure `spec.privateKey.rotationPolicy` field to set the rotation policy of the private key for a Certificate.
439-
Valid values are `Never` and `Always`. If unset a rotation policy `Never` will be used.
439+
Valid values are `Never` and `Always`. If unset a rotation policy `Always` will be used.
440440

441441
## Copy annotations to the Certificate
442442

content/docs/usage/ingress.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ trigger Certificate resources to be automatically created:
175175

176176
- `cert-manager.io/private-key-rotation-policy`: (optional) this annotation allows you to
177177
configure `spec.privateKey.rotationPolicy` field to set the rotation policy of the private key for a Certificate.
178-
Valid values are `Never` and `Always`. If unset a rotation policy `Never` will be used.
178+
Valid values are `Never` and `Always`. If unset a rotation policy `Always` will be used.
179179

180180
## Copying annotations to the Certificate
181181

public/docs/tutorials/certificate-defaults/cpol-mutate-certificates-0.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ spec:
1818
# +(...) This is the clever syntax for if not already set
1919
+(revisionHistoryLimit): 2
2020
# Set rotation to always if not already set
21+
# ℹ️ This is not necessary if you use cert-manager `>=v1.18.0`, because the default value was changed from `Never` to `Always`.
2122
- name: set-privateKey-rotationPolicy
2223
match:
2324
any:

public/docs/tutorials/certificate-defaults/cpol-mutate-certificates-1.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ spec:
1818
# +(...) This is the clever syntax for if not already set
1919
+(revisionHistoryLimit): 2
2020
# Set rotation to always if not already set
21+
# ℹ️ This is not necessary if you use cert-manager `>=v1.18.0`, because the default value was changed from `Never` to `Always`.
2122
- name: set-privateKey-rotationPolicy
2223
match:
2324
any:

0 commit comments

Comments
 (0)