Skip to content

Commit 15886a9

Browse files
author
Keyfactor
committed
Update generated docs
1 parent c00253a commit 15886a9

File tree

1 file changed

+87
-6
lines changed

1 file changed

+87
-6
lines changed

README.md

Lines changed: 87 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,6 @@ Before starting, ensure that the following requirements are met:
5151
- [Supported cert-manager release](https://cert-manager.io/docs/releases/) installed in your cluster. Please see the [cert-manager installation](https://cert-manager.io/docs/installation/) for details.
5252
- [Supported version of Helm](https://helm.sh/docs/topics/version_skew/) for your Kubernetes version
5353

54-
# Badges
55-
56-
<a href="https://github.com/keyfactor/command-cert-manager-issuer/releases/latest"><img src="https://img.shields.io/github/v/release/keyfactor/command-cert-manager-issuer?style=flat-square" alt="Latest Release"></a>
57-
<a href="https://goreportcard.com/report/github.com/keyfactor/command-cert-manager-issuer"><img src="https://goreportcard.com/badge/github.com/keyfactor/command-cert-manager-issuer" alt="Go Report Card"></a>
58-
<a href="https://img.shields.io/badge/License-Apache%202.0-blue.svg"><img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="License Apache 2.0"></a>
59-
6054
# Getting Started
6155

6256
## Configuring Command
@@ -175,6 +169,93 @@ kubectl -n command-issuer-system create secret generic command-secret \
175169
176170
> Audience and Scopes are optional
177171
172+
## Managed Identity Using Azure Entra ID Workload Identity (AKS)
173+
174+
Azure Entra ID workload identity in Azure Kubernetes Service (AKS) allows Command Issuer to exchange a Kubernetes ServiceAccount Token for an Azure Entra ID access token, which is then used to authenticate to Command.
175+
176+
1. Reconfigure the AKS cluster to enable workload identity federation.
177+
178+
```shell
179+
az aks update \
180+
--name ${CLUSTER} \
181+
--enable-oidc-issuer \
182+
--enable-workload-identity
183+
```
184+
185+
> The [Azure Workload Identity extension can be installed on non-AKS or self-managed clusters](https://azure.github.io/azure-workload-identity/docs/installation.html) if you're not using AKS.
186+
>
187+
> Refer to the [AKS documentation](https://learn.microsoft.com/en-us/azure/aks/workload-identity-deploy-cluster) for more information on the `--enable-workload-identity` feature.
188+
189+
2. Reconfigure or deploy Command Issuer with extra labels for the Azure Workload Identity webhook, which will result in the Command Issuer controller Pod having an extra volume containing a Kubernetes ServiceAccount token which it will exchange for a token from Azure.
190+
191+
```shell
192+
helm install command-cert-manager-issuer command-issuer/command-cert-manager-issuer \
193+
--namespace command-issuer-system \
194+
--create-namespace \
195+
--set "fullnameOverride=$chart_name" \
196+
--set-string "podLabels.azure\.workload\.identity/use=true" \
197+
--set-string "serviceAccount.labels.azure\.workload\.identity/use=true"
198+
# --set-string "serviceAccount.annotations.azure\.workload\.identity/client-id=<managed identity client ID>" # May be necessary, but is usually not.
199+
```
200+
201+
If successful, the Command Issuer Pod will have new environment variables and the Azure WI ServiceAccount token as a projected volume:
202+
203+
```shell
204+
kubectl -n command-issuer-system describe pod
205+
```
206+
207+
```shell
208+
Containers:
209+
command-cert-manager-issuer:
210+
...
211+
Environment:
212+
AZURE_CLIENT_ID: <GUID>
213+
AZURE_TENANT_ID: <GUID>
214+
AZURE_FEDERATED_TOKEN_FILE: /var/run/secrets/azure/tokens/azure-identity-token
215+
AZURE_AUTHORITY_HOST: https://login.microsoftonline.com/
216+
Mounts:
217+
/var/run/secrets/azure/tokens from azure-identity-token (ro)
218+
/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-6rmzz (ro)
219+
...
220+
Volumes:
221+
...
222+
azure-identity-token:
223+
Type: Projected (a volume that contains injected data from multiple sources)
224+
TokenExpirationSeconds: 3600
225+
```
226+
227+
> Refer to [Azure Workload Identity docs](https://azure.github.io/azure-workload-identity/docs/installation/mutating-admission-webhook.html) more information on the role of the Mutating Admission Webhook.
228+
229+
3. Create a User Assigned Managed Identity in Azure.
230+
231+
```shell
232+
export IDENTITY_NAME=command-issuer
233+
az identity create --name "${IDENTITY_NAME}"
234+
```
235+
236+
> Read more about [the `az identity` command](https://learn.microsoft.com/en-us/cli/azure/identity?view=azure-cli-latest).
237+
238+
4. Associate a Federated Identity Credential (FIC) with the User Assigned Managed Identity. The FIC allows Command Issuer to act on behalf of the Managed Identity by telling Azure to expect:
239+
- The `iss` claim of the ServiceAccount token to match the cluster's OIDC Issuer. Azure will also use the Issuer URL to download the JWT signing certificate.
240+
- The `sub` claim of the ServiceAccount token to match the ServiceAccount's name and namespace.
241+
242+
```shell
243+
export SERVICE_ACCOUNT_NAME=command-cert-manager-issuer # This is the default Kubernetes ServiceAccount used by the Command Issuer controller.
244+
export SERVICE_ACCOUNT_NAMESPACE=command-issuer-system # This is the default namespace for Command Issuer used in this doc.
245+
export SERVICE_ACCOUNT_ISSUER=$(az aks show --resource-group $AZURE_DEFAULTS_GROUP --name $CLUSTER --query "oidcIssuerProfile.issuerUrl" -o tsv)
246+
az identity federated-credential create \
247+
--name "command-issuer" \
248+
--identity-name "${IDENTITY_NAME}" \
249+
--issuer "${SERVICE_ACCOUNT_ISSUER}" \
250+
--subject "system:serviceaccount:${SERVICE_ACCOUNT_NAMESPACE}:${SERVICE_ACCOUNT_NAME}"
251+
```
252+
253+
> Read more about [Workload Identity federation](https://learn.microsoft.com/en-us/entra/workload-id/workload-identity-federation) in the Entra ID documentation.
254+
>
255+
> Read more about [the `az identity federated-credential` command](https://learn.microsoft.com/en-us/cli/azure/identity/federated-credential?view=azure-cli-latest).
256+
257+
5. Add Microsoft Entra ID as an [Identity Provider in Command](https://software.keyfactor.com/Core-OnPrem/Current/Content/ReferenceGuide/IdentityProviders.htm?Highlight=identity%20provider), and [add the Managed Identity's Client ID as an `oid` claim to the Security Role](https://software.keyfactor.com/Core-OnPrem/Current/Content/ReferenceGuide/SecurityOverview.htm?Highlight=Security%20Roles) created/identified earlier.
258+
178259
# CA Bundle
179260
180261
If the Command API is configured to use a self-signed certificate or with a certificate whose issuer isn't widely trusted, the CA certificate must be provided as a Kubernetes secret.

0 commit comments

Comments
 (0)