Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Venafi username/password authentication section #1618

Merged
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 47 additions & 35 deletions content/docs/configuration/venafi.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ credentials.

3. [Create a new application integration](https://docs.venafi.com/Docs/24.3/TopNav/Content/API-ApplicationIntegration/t-APIAppIntegrations-creating.php)

Create an application integration with name and ID `cert-manager`.
Set the "Base Access Settings" to `certificate: manage,revoke`.
Create an application integration with name and ID `cert-manager.io`.
Set the "Base Access Settings" to `certificate: manage`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't remember whether recent versions of TPP include the cert-manager.io API integration by default.
@hawksight do you know?
If so, we can add a note to explain that this step might be optional with recent versions of TPP.

Optional: Here, or in a followup PR we should make sure we're using accurate terminology.

For example, "application integration" should be "API integration".
And "Base Access Settings" should be "Scope".

image image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is my understanding the cert-manager.io API integration is standard in recent versions at least yes. We can add that in a follow up PR I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wallrj agrees with @hawksight , we can open a followup PR on this .

Venafi has updated its terminology starting from the recent version, and we need to ensure alignment with it. However, I currently do not have the ability to instantiate Venafi test environment to check it.


"Edit Access" to the new application integration, and allow it to be used by the user you created earlier.

Expand All @@ -163,7 +163,7 @@ credentials.
--username k8s-xyz-automation \
--password somepassword \
-u https://tpp.example.com/vedsdk \
--client-id cert-manager \
--client-id cert-manager.io \
ilyesAj marked this conversation as resolved.
Show resolved Hide resolved
--scope "certificate:manage,revoke"
```

Expand All @@ -177,43 +177,48 @@ credentials.

5. Save the access-token to a Secret in the Kubernetes cluster

```bash
$ kubectl create secret generic \
tpp-secret \
--namespace=<NAMESPACE OF YOUR ISSUER RESOURCE> \
--from-literal=access-token='YOUR_TPP_ACCESS_TOKEN'
```
```bash
$ kubectl create secret generic \
tpp-secret \
--namespace=<NAMESPACE OF YOUR ISSUER RESOURCE> \
--from-literal=access-token='YOUR_TPP_ACCESS_TOKEN'
```

### Username / Password Authentication

> ⚠️ When you supply a Venafi TPP username and password,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we should now be fine to remove this warning as API keys are old and these docs only affect current and future. So previous version users can still adhear to the warning. Please shout out if anyone things we need to keep this warning on API Keys for TPP.

> cert-manager uses an older authentication method which is called "API Keys",
> which has been deprecated since Venafi TPP `19.2`.
>
> Beginning in Venafi TPP `22.2`, "API Keys" are disabled by default.
> You will need to contact Venafi customer support for a special license key which will allow you to re-enable the "API Keys" feature,
> so that you can continue to use username and password authentication with cert-manager.
>
> In Venafi TPP `22.3`, the "API Keys" feature will be permanently removed,
> and you will need to use access-token authentication instead.
>
> 📖 Read [Deprecated functionality from Venafi Platform](https://docs.venafi.com/22.3/deprecation-list-current)
> and [Functionality Scheduled for Deprecation](https://support.venafi.com/hc/en-us/articles/115001662292) for more information.
> **Note**: when using username/password authentification, cert-manager will manage the generation of access token for you . As of now we don't use refresh tokens to renew access token, Make sure that the venafi application is appropriately configured.

```bash
$ kubectl create secret generic \
tpp-secret \
--namespace=<NAMESPACE OF YOUR ISSUER RESOURCE> \
--from-literal=username='YOUR_TPP_USERNAME_HERE' \
--from-literal=password='YOUR_TPP_PASSWORD_HERE'
```
1. Create a new user with sufficient privileges to manage certificates in a particular policy folder (zone).

> Note: If you are configuring your issuer as a `ClusterIssuer` resource in
> order to issue `Certificates` across your whole cluster, you must set the
> `--namespace` parameter to `cert-manager`, which is the default `Cluster
> Resource Namespace`. The `Cluster Resource Namespace` can be configured
> through the `--cluster-resource-namespace` flag on the cert-manager controller
> component.
E.g. `k8s-xyz-automation`

2. [Create a new application integration](https://docs.venafi.com/Docs/24.3/TopNav/Content/API-ApplicationIntegration/t-APIAppIntegrations-creating.php)

Create an application integration with name and ID `cert-manager.io`.
Set the "Base Access Settings" to `certificate: manage`.
ilyesAj marked this conversation as resolved.
Show resolved Hide resolved

"Edit Access" to the new application integration, and allow it to be used by the user you created earlier.

3. Save the credentials to a Secret in the Kubernetes cluster

```bash
$ kubectl create secret generic \
tpp-secret \
--namespace=<NAMESPACE OF YOUR ISSUER RESOURCE> \
--from-literal=username='YOUR_TPP_USERNAME_HERE' \
--from-literal=password='YOUR_TPP_PASSWORD_HERE'
```


> Note: By default cert-manager uses `cert-manager.io` as client ID when authentificating to venafi. You can customize this by adding `client-id` key to the secret:
>```bash
ilyesAj marked this conversation as resolved.
Show resolved Hide resolved
>$ kubectl create secret generic \
> tpp-secret \
> --namespace=<NAMESPACE OF YOUR ISSUER RESOURCE> \
> --from-literal=username='YOUR_TPP_USERNAME_HERE' \
> --from-literal=password='YOUR_TPP_PASSWORD_HERE' \
> --from-literal=client-id='YOUR_TPP_CLIENT-ID_HERE'
>```
ilyesAj marked this conversation as resolved.
Show resolved Hide resolved

These credentials will be used by cert-manager to interact with your Venafi TPP
instance. Username attribute must be adhere to the `<identity
ilyesAj marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -224,6 +229,13 @@ Once the Secret containing credentials has been created, you can create your
resource, you must change the `kind` field to `ClusterIssuer` and remove the
`metadata.namespace` field.

> Note: If you are configuring your issuer as a `ClusterIssuer` resource in
> order to issue `Certificates` across your whole cluster, you must set the
> `--namespace` parameter to `cert-manager`, which is the default `Cluster
> Resource Namespace`. The `Cluster Resource Namespace` can be configured
> through the `--cluster-resource-namespace` flag on the cert-manager controller
> component.
ilyesAj marked this conversation as resolved.
Show resolved Hide resolved

Save the below content after making your amendments to a file named
`tpp-issuer.yaml`.

Expand Down
Loading