Skip to content

Commit fce0e34

Browse files
authored
Merge 2.3.0 to main
2 parents 8a14a72 + d07421e commit fce0e34

File tree

12 files changed

+1186
-184
lines changed

12 files changed

+1186
-184
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# v2.3.0
2+
## Features
3+
- Added support for `OwnerRoleName` and `OwnerRoleId` to Issuer specification, which will specify the owner of the enrolling certificate.
4+
5+
## Chores
6+
- Update e2e tests to test ClusterIssuer resource
7+
- Refactor code for better unit testability
8+
19
# v2.2.0
210
## Features
311
- Added support for enrolling CSRs with [Enrollment Patterns](https://software.keyfactor.com/Core-OnPrem/Current/Content/ReferenceGuide/Enrollment-Patterns.htm), a new feature introduced in Keyfactor Command 25.1. [Release notes](https://software.keyfactor.com/Core-OnPrem/Current/Content/ReleaseNotes/Release2511.htm)

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@ For example, ClusterIssuer resources can be used to issue certificates for resou
231231
export CERTIFICATE_TEMPLATE_SHORT_NAME="<certificateTemplateShortName>"
232232
export ENROLLMENT_PATTERN_NAME="<enrollmentPatternName>"
233233
export ENROLLMENT_PATTERN_ID="<enrollmentPatternId>"
234+
export OWNER_ROLE_ID="<ownerRoleId>"
235+
export OWNER_ROLE_NAME="<ownerRoleName>"
234236
```
235237

236238
The `spec` field of both the Issuer and ClusterIssuer resources use the following fields:
@@ -245,6 +247,8 @@ For example, ClusterIssuer resources can be used to issue certificates for resou
245247
| enrollmentPatternId | The ID of the [Enrollment Pattern](https://software.keyfactor.com/Core-OnPrem/Current/Content/ReferenceGuide/Enrollment-Patterns.htm) to use when this Issuer/ClusterIssuer enrolls CSRs. **Supported by Keyfactor Command 25.1 and above**. If `certificateTemplate` and `enrollmentPatternId` are both specified, the enrollment pattern parameter will take precedence. If `enrollmentPatternId` and `enrollmentPatternName` are both specified, `enrollmentPatternId` will take precedence. Enrollment will fail if the specified certificate template is not compatible with the enrollment pattern. |
246248
| enrollmentPatternName | The Name of the [Enrollment Pattern](https://software.keyfactor.com/Core-OnPrem/Current/Content/ReferenceGuide/Enrollment-Patterns.htm) to use when this Issuer/ClusterIssuer enrolls CSRs. **Supported by Keyfactor Command 25.1 and above**. If `certificateTemplate` and `enrollmentPatternName` are both specified, the enrollment pattern parameter will take precedence. If `enrollmentPatternId` and `enrollmentPatternName` are both specified, `enrollmentPatternId` will take precedence. Enrollment will fail if the specified certificate template is not compatible with the enrollment pattern. If using `enrollmentPatternName`, your security role must have `/enrollment_pattern/read/` permission. |
247249
| certificateTemplate | The Short Name of the Certificate Template to use when this Issuer/ClusterIssuer enrolls CSRs. **Deprecated in favor of [Enrollment Patterns](https://software.keyfactor.com/Core-OnPrem/Current/Content/WebAPI/KeyfactorAPI/Enrollment-Patterns.htm) as of Keyfactor Command 25.1**. If `certificateTemplate` and either `enrollmentPatternName` or `enrollmentPatternId` are specified, the enrollment pattern parameter will take precedence. Enrollment will fail if the specified certificate template is not compatible with the enrollment pattern. |
250+
| ownerRoleId | The ID of the security role assigned as the certificate owner. The security role must be assigned to the identity context of the issuer. If `ownerRoleId` and `ownerRoleName` are both specified, `ownerRoleId` will take precedence. This field is **required** if the enrollment pattern, certificate template, or system-wide setting requires it. |
251+
| ownerRoleName | The name of the security role assigned as the certificate owner. The security role must be assigned to the identity context of the issuer. If `ownerRoleId` and `ownerRoleName` are both specified, `ownerRoleId` will take precedence. This field is **required** if the enrollment pattern, certificate template, or system-wide setting requires it. |
248252
| scopes | (Optional) Required if using ambient credentials with Azure AKS. If using ambient credentials, these scopes will be put on the access token generated by the ambient credentials' token provider, if applicable. |
249253
| audience | (Optional) If using ambient credentials, this audience will be put on the access token generated by the ambient credentials' token provider, if applicable. Google's ambient credential token provider generates an OIDC ID Token. If this value is not provided, it will default to `command`. |
250254
@@ -274,6 +278,8 @@ For example, ClusterIssuer resources can be used to issue certificates for resou
274278
enrollmentPatternId: "$ENROLLMENT_PATTERN_ID" # Only supported on Keyfactor Command 25.1 and above.
275279
certificateTemplate: "$CERTIFICATE_TEMPLATE_SHORT_NAME" # Required if using Keyfactor Command 24.4 and below.
276280
# enrollmentPatternName: "$ENROLLMENT_PATTERN_NAME" # Only supported on Keyfactor Command 25.1 and above.
281+
# ownerRoleId: "$OWNER_ROLE_ID" # Uncomment if required
282+
# ownerRoleName: "$OWNER_ROLE_NAME" # Uncomment if required
277283
# scopes: "openid email https://example.com/.default" # Uncomment if required
278284
# audience: "https://your-command-url.com" # Uncomment if desired
279285
EOF
@@ -302,6 +308,8 @@ For example, ClusterIssuer resources can be used to issue certificates for resou
302308
enrollmentPatternId: "$ENROLLMENT_PATTERN_ID" # Only supported on Keyfactor Command 25.1 and above.
303309
certificateTemplate: "$CERTIFICATE_TEMPLATE_SHORT_NAME" # Required if using Keyfactor Command 24.4 and below.
304310
# enrollmentPatternName: "$ENROLLMENT_PATTERN_NAME" # Only supported on Keyfactor Command 25.1 and above.
311+
# ownerRoleId: "$OWNER_ROLE_ID" # Uncomment if required
312+
# ownerRoleName: "$OWNER_ROLE_NAME" # Uncomment if required
305313
# scopes: "openid email https://example.com/.default" # Uncomment if required
306314
# audience: "https://your-command-url.com" # Uncomment if desired
307315
EOF
@@ -372,13 +380,15 @@ kubectl get secret command-certificate -o jsonpath='{.data.tls\.crt}' | base64 -
372380
373381
## Overriding the Issuer/ClusterIssuer `spec` using Kubernetes Annotations on CertificateRequest Resources
374382
375-
Command Issuer allows you to override the `certificateAuthorityHostname`, `certificateAuthorityLogicalName`, `certificateTemplate`, `enrollmentPatternName`, and `enrollmentPatternId` by setting Kubernetes Annotations on CertificateRequest resources. This may be useful if certain enrollment scenarios require a different Certificate Authority or Certificate Template, but you don't want to create a new Issuer/ClusterIssuer.
383+
Command Issuer allows you to override the `certificateAuthorityHostname`, `certificateAuthorityLogicalName`, `certificateTemplate`, `enrollmentPatternName`,`enrollmentPatternId`, `ownerRoleId`, and `ownerRoleName` by setting Kubernetes Annotations on CertificateRequest resources. This may be useful if certain enrollment scenarios require a different Certificate Authority or Certificate Template, but you don't want to create a new Issuer/ClusterIssuer.
376384

377385
- `command-issuer.keyfactor.com/certificateAuthorityHostname` overrides `certificateAuthorityHostname`
378386
- `command-issuer.keyfactor.com/certificateAuthorityLogicalName` overrides `certificateAuthorityLogicalName`
379387
- `command-issuer.keyfactor.com/certificateTemplate` overrides `certificateTemplate`
380388
- `command-issuer.keyfactor.com/enrollmentPatternName` overrides `enrollmentPatternName`
381389
- `command-issuer.keyfactor.com/enrollmentPatternId` overrides `enrollmentPatternId`. Needs to be in string format.
390+
- `command-issuer.keyfactor.com/ownerRoleId` overrides `ownerRoleId`. Needs to be in string format.
391+
- `command-issuer.keyfactor.com/ownerRoleName` overrides `ownerRoleName`.
382392

383393
> cert-manager copies Annotations set on Certificate resources to the corresponding CertificateRequest.
384394

@@ -392,6 +402,8 @@ Command Issuer allows you to override the `certificateAuthorityHostname`, `certi
392402
> kind: Certificate
393403
> metadata:
394404
> annotations:
405+
> command-issuer.keyfactor.com/ownerRoleId: "1234"
406+
> command-issuer.keyfactor.com/ownerRoleName: "Certificate Admin"
395407
> command-issuer.keyfactor.com/enrollmentPatternId: "1234"
396408
> command-issuer.keyfactor.com/enrollmentPatternName: "Kubernetes Enrollment Pattern"
397409
> command-issuer.keyfactor.com/certificateTemplate: "Ephemeral2day"

api/v1alpha1/issuer_types.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,20 @@ type IssuerSpec struct {
6666
// Refer to the Keyfactor Command documentation for more information.
6767
CertificateTemplate string `json:"certificateTemplate,omitempty"`
6868

69+
// OwnerRoleId is the ID of the security role assigned as the certificate owner.
70+
// The specified security role must be assigned to the authorized identity context.
71+
// If OwnerRoleId and OwnerRoleName are both specified, OwnerRoleId will take precedence.
72+
// This field is required if the enrollment pattern, certificate template, or system-wide settings has been configured as Required.
73+
// + optional
74+
OwnerRoleId int32 `json:"ownerRoleId,omitempty"`
75+
76+
// OwnerRoleName is the name of the security role assigned as the certificate owner. This name must match the existing name of the security role.
77+
// The specified security role must be assigned to the authorized identity context.
78+
// If OwnerRoleId and OwnerRoleName are both specified, OwnerRoleId will take precedence.
79+
// This field is required if the enrollment pattern, certificate template, or system-wide settings has been configured as Required.
80+
// + optional
81+
OwnerRoleName string `json:"ownerRoleName,omitempty"`
82+
6983
// CertificateAuthorityLogicalName is the logical name of the certificate authority to use
7084
// E.g. "Keyfactor Root CA" or "Intermediate CA"
7185
CertificateAuthorityLogicalName string `json:"certificateAuthorityLogicalName,omitempty"`

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,21 @@ spec:
8585
Enrollment will fail if the specified template is not compatible with the enrollment pattern.
8686
Refer to the Keyfactor Command documentation for more information.
8787
type: string
88+
ownerRoleId:
89+
description: |-
90+
OwnerRoleId is the ID of the security role assigned as the certificate owner.
91+
The specified security role must be assigned to the authorized identity context.
92+
If OwnerRoleId and OwnerRoleName are both specified, OwnerRoleId will take precedence.
93+
This field is required if the enrollment pattern, certificate template, or system-wide settings has been configured as Required.
94+
type: integer
95+
format: int32
96+
ownerRoleName:
97+
description: |-
98+
OwnerRoleName is the name of the security role assigned as the certificate owner. This name must match the existing name of the security role.
99+
The specified security role must be assigned to the authorized identity context.
100+
If OwnerRoleId and OwnerRoleName are both specified, OwnerRoleId will take precedence.
101+
This field is required if the enrollment pattern, certificate template, or system-wide settings has been configured as Required.
102+
type: string
88103
certificateTemplate:
89104
description: |-
90105
CertificateTemplate is the name of the certificate template to use. Deprecated in favor of EnrollmentPattern as of Keyfactor Command 25.1.

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,21 @@ spec:
8585
Enrollment will fail if the specified template is not compatible with the enrollment pattern.
8686
Refer to the Keyfactor Command documentation for more information.
8787
type: string
88+
ownerRoleId:
89+
description: |-
90+
OwnerRoleId is the ID of the security role assigned as the certificate owner.
91+
The specified security role must be assigned to the authorized identity context.
92+
If OwnerRoleId and OwnerRoleName are both specified, OwnerRoleId will take precedence.
93+
This field is required if the enrollment pattern, certificate template, or system-wide settings has been configured as Required.
94+
type: integer
95+
format: int32
96+
ownerRoleName:
97+
description: |-
98+
OwnerRoleName is the name of the security role assigned as the certificate owner. This name must match the existing name of the security role.
99+
The specified security role must be assigned to the authorized identity context.
100+
If OwnerRoleId and OwnerRoleName are both specified, OwnerRoleId will take precedence.
101+
This field is required if the enrollment pattern, certificate template, or system-wide settings has been configured as Required.
102+
type: string
88103
certificateTemplate:
89104
description: |-
90105
CertificateTemplate is the name of the certificate template to use. Deprecated in favor of EnrollmentPattern as of Keyfactor Command 25.1.

deploy/charts/command-cert-manager-issuer/templates/crds/clusterissuers.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,21 @@ spec:
7979
Enrollment will fail if the specified template is not compatible with the enrollment pattern.
8080
Refer to the Keyfactor Command documentation for more information.
8181
type: string
82+
ownerRoleId:
83+
description: |-
84+
OwnerRoleId is the ID of the security role assigned as the certificate owner.
85+
The specified security role must be assigned to the authorized identity context.
86+
If OwnerRoleId and OwnerRoleName are both specified, OwnerRoleId will take precedence.
87+
This field is required if the enrollment pattern, certificate template, or system-wide settings has been configured as Required.
88+
type: integer
89+
format: int32
90+
ownerRoleName:
91+
description: |-
92+
OwnerRoleName is the name of the security role assigned as the certificate owner. This name must match the existing name of the security role.
93+
The specified security role must be assigned to the authorized identity context.
94+
If OwnerRoleId and OwnerRoleName are both specified, OwnerRoleId will take precedence.
95+
This field is required if the enrollment pattern, certificate template, or system-wide settings has been configured as Required.
96+
type: string
8297
certificateTemplate:
8398
description: |-
8499
CertificateTemplate is the name of the certificate template to use. Deprecated in favor of EnrollmentPattern as of Keyfactor Command 25.1.

deploy/charts/command-cert-manager-issuer/templates/crds/issuers.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,21 @@ spec:
7979
Enrollment will fail if the specified template is not compatible with the enrollment pattern.
8080
Refer to the Keyfactor Command documentation for more information.
8181
type: string
82+
ownerRoleId:
83+
description: |-
84+
OwnerRoleId is the ID of the security role assigned as the certificate owner.
85+
The specified security role must be assigned to the authorized identity context.
86+
If OwnerRoleId and OwnerRoleName are both specified, OwnerRoleId will take precedence.
87+
This field is required if the enrollment pattern, certificate template, or system-wide settings has been configured as Required.
88+
type: integer
89+
format: int32
90+
ownerRoleName:
91+
description: |-
92+
OwnerRoleName is the name of the security role assigned as the certificate owner. This name must match the existing name of the security role.
93+
The specified security role must be assigned to the authorized identity context.
94+
If OwnerRoleId and OwnerRoleName are both specified, OwnerRoleId will take precedence.
95+
This field is required if the enrollment pattern, certificate template, or system-wide settings has been configured as Required.
96+
type: string
8297
certificateTemplate:
8398
description: |-
8499
CertificateTemplate is the name of the certificate template to use. Deprecated in favor of EnrollmentPattern as of Keyfactor Command 25.1.

0 commit comments

Comments
 (0)