Skip to content

Commit 53856ec

Browse files
indrorairbysvenska-primekeyKeyfactor
authored
command-cert-manager-issuer 2.6.0: Optional CA, Updated Default Healthcheck Interval, Updated Service Account Token Lifecycle (#70) (#71)
* feat: Add volume and volume mount for service token * chore: fix sources and add changelog * feat(enrollment): make certificateAuthorityLogicalName be optional when using enrollment patterns * updated error messaging on csr enrollment * Update generated docs * chore: update docs + add e2e test for optional CA * Update generated docs * feat(healthcheck): bump default healthcheck interval from 1m to 10m * chore(deps): bump go version to 1.26 * Update generated docs * chore: address copilot feedback. update linter version * Update generated docs * chore(ci): bump controller tools version * chore(docs): document new Helm chart values for serviceAccount --------- Signed-off-by: Matthew H. Irby <matt.irby@keyfactor.com> Co-authored-by: Matthew H. Irby <irby@users.noreply.github.com> Co-authored-by: Sven Rajala <sven.rajala@keyfactor.com> Co-authored-by: Keyfactor <keyfactor@keyfactor.github.io>
1 parent b8b9709 commit 53856ec

22 files changed

Lines changed: 404 additions & 101 deletions

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
- name: Run linters
6161
uses: golangci/golangci-lint-action@v7
6262
with:
63-
version: v2.4.0
63+
version: v2.12.2
6464

6565
- name: Regenerate CRDs
6666
run: make generate manifests

.golangci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ linters:
3232
- third_party$
3333
- builtin$
3434
- examples$
35+
rules:
36+
# Exclude some linters from running on tests files.
37+
- path: _test\.go
38+
linters:
39+
- gocyclo
40+
- errcheck
41+
- dupl
42+
- gosec
3543
formatters:
3644
enable:
3745
- goimports

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
# v2.6.0
2+
## Features
3+
- Allow `certificateAuthorityLogicalName` to be optional when using an enrollment pattern.
4+
- The default healthcheck interval has been bumped from 1 minute to 10 minutes.
5+
6+
## Security
7+
- The Helm chart now defaults `serviceAccount.automountServiceAccountToken` to `false`,
8+
replacing the long-lived auto-mounted token with a short-lived projected token (~1 hour, automatically rotated by kubelet). The token is still mounted at the standard path `/var/run/secrets/kubernetes.io/serviceaccount` so no application changes are required.
9+
- Go version has been bumped from 1.24 to 1.26.2+ to fix CVE-2026-27143 (affects Go compiler versions below 1.25.9, and 1.26.0-1.26.1).
10+
11+
> [!IMPORTANT]
12+
>
13+
> ### Upgrade Notes
14+
>
15+
> - **Rolling restart**: Upgrading from v2.5.x will patch the ServiceAccount and update the Deployment spec, triggering an automatic rolling restart. Plan accordingly if downtime is a concern in your environment.
16+
> - **Bring-your-own ServiceAccount**: If you set `serviceAccount.create: false` and manage your own ServiceAccount, you must either set `automountServiceAccountToken: true` in your `values.yaml` to preserve the previous behavior, or manually add `automountServiceAccountToken: false` and the projected volume to your ServiceAccount and Deployment manifests.
17+
> - To restore the previous behavior explicitly, set in your `values.yaml`:
18+
> ```yaml
19+
> serviceAccount:
20+
> automountServiceAccountToken: true
21+
> ```
22+
123
# v2.5.3
224
## Security
325
- Updated dependencies to address various security vulnerabilities:

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the manager binary
2-
FROM golang:1.24 AS builder
2+
FROM golang:1.26 AS builder
33
ARG TARGETOS
44
ARG TARGETARCH
55

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,9 @@ CONFTEST = $(LOCALBIN)/conftest-$(CONFTEST_VERSION)
190190

191191
## Tool Versions
192192
KUSTOMIZE_VERSION ?= v5.3.0
193-
CONTROLLER_TOOLS_VERSION ?= v0.14.0
193+
CONTROLLER_TOOLS_VERSION ?= v0.17.3
194194
ENVTEST_VERSION ?= latest
195-
GOLANGCI_LINT_VERSION ?= v2.4.0
195+
GOLANGCI_LINT_VERSION ?= v2.12.2
196196
KUBE_LINTER_VERSION ?= v0.6.8
197197
CONFTEST_VERSION ?= v0.60.0
198198

README.md

Lines changed: 44 additions & 21 deletions
Large diffs are not rendered by default.

api/v1alpha1/issuer_types.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,11 @@ type IssuerSpec struct {
8585
// + optional
8686
OwnerRoleName string `json:"ownerRoleName,omitempty"`
8787

88-
// CertificateAuthorityLogicalName is the logical name of the certificate authority to use
88+
// CertificateAuthorityLogicalName is the logical name of the certificate authority to use. Not required if an enrollment pattern is specified,
89+
// except if the enrollment pattern targets a standalone CA. If empty, an eligible certificate authority within the enrollment pattern's configuration tenant
90+
// will be used.
8991
// E.g. "Keyfactor Root CA" or "Intermediate CA"
92+
// +optional
9093
CertificateAuthorityLogicalName string `json:"certificateAuthorityLogicalName,omitempty"`
9194

9295
// CertificateAuthorityHostname is the hostname associated with the Certificate Authority specified by
@@ -301,7 +304,7 @@ type HealthCheckConfig struct {
301304
// Determines whether to enable the health check when the issuer is healthy. Default: true
302305
Enabled bool `json:"enabled"`
303306

304-
// The interval at which to health check the issuer when healthy. Defaults to 1 minute. Must not be less than "30s".
307+
// The interval at which to health check the issuer when healthy. Defaults to 10 minutes. Must not be less than "30s".
305308
// +kubebuilder:validation:Optional
306309
Interval *metav1.Duration `json:"interval,omitempty"`
307310
}

cmd/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func main() {
8282
"If set the metrics endpoint is served securely")
8383
flag.BoolVar(&enableHTTP2, "enable-http2", false,
8484
"If set, HTTP/2 will be enabled for the metrics and webhook servers")
85-
flag.StringVar(&healthCheckInterval, "default-health-check-interval", "60s",
85+
flag.StringVar(&healthCheckInterval, "default-health-check-interval", "10m", // 10 minutes
8686
"If set, it is the default health check interval for issuers.")
8787
flag.StringVar(&clusterResourceNamespace, "cluster-resource-namespace", "", "The namespace for secrets in which cluster-scoped resources are found.")
8888
flag.BoolVar(&disableApprovedCheck, "disable-approved-check", false,

config/crd/bases/command-issuer.keyfactor.com_clusterissuers.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.14.0
6+
controller-gen.kubebuilder.io/version: v0.17.3
77
name: clusterissuers.command-issuer.keyfactor.com
88
spec:
99
group: command-issuer.keyfactor.com
@@ -79,7 +79,9 @@ spec:
7979
type: string
8080
certificateAuthorityLogicalName:
8181
description: |-
82-
CertificateAuthorityLogicalName is the logical name of the certificate authority to use
82+
CertificateAuthorityLogicalName is the logical name of the certificate authority to use. Not required if an enrollment pattern is specified,
83+
except if the enrollment pattern targets a standalone CA. If empty, an eligible certificate authority within the enrollment pattern's configuration tenant
84+
will be used.
8385
E.g. "Keyfactor Root CA" or "Intermediate CA"
8486
type: string
8587
certificateTemplate:
@@ -127,7 +129,8 @@ spec:
127129
type: boolean
128130
interval:
129131
description: The interval at which to health check the issuer
130-
when healthy. Defaults to 1 minute. Must not be less than "30s".
132+
when healthy. Defaults to 10 minutes. Must not be less than
133+
"30s".
131134
type: string
132135
required:
133136
- enabled

config/crd/bases/command-issuer.keyfactor.com_issuers.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.14.0
6+
controller-gen.kubebuilder.io/version: v0.17.3
77
name: issuers.command-issuer.keyfactor.com
88
spec:
99
group: command-issuer.keyfactor.com
@@ -79,7 +79,9 @@ spec:
7979
type: string
8080
certificateAuthorityLogicalName:
8181
description: |-
82-
CertificateAuthorityLogicalName is the logical name of the certificate authority to use
82+
CertificateAuthorityLogicalName is the logical name of the certificate authority to use. Not required if an enrollment pattern is specified,
83+
except if the enrollment pattern targets a standalone CA. If empty, an eligible certificate authority within the enrollment pattern's configuration tenant
84+
will be used.
8385
E.g. "Keyfactor Root CA" or "Intermediate CA"
8486
type: string
8587
certificateTemplate:
@@ -127,7 +129,8 @@ spec:
127129
type: boolean
128130
interval:
129131
description: The interval at which to health check the issuer
130-
when healthy. Defaults to 1 minute. Must not be less than "30s".
132+
when healthy. Defaults to 10 minutes. Must not be less than
133+
"30s".
131134
type: string
132135
required:
133136
- enabled

0 commit comments

Comments
 (0)