Loading Venafi Bearer Token from a Kubernetes Secret¶
This is the simplest authentication mechanism. In this case, the Venafi TPP access-token or Venafi-as-a-Service API Key are loaded from a Kubernetes secret.
-
Create a Kubernetes Secret that contains the Venafi Bearer Token:
apiVersion: v1 kind: Secret metadata: name: application-team-1-tpp-access-token namespace: venafi data: access-token: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
-
Give the venafi-connection service account the permission to read this secret.
-
Create a role that allows reading secrets for application-team-1:
apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: get-application-team-1-tpp-access-token namespace: venafi rules: - apiGroups: [ "" ] resources: [ "secrets" ] verbs: [ "get" ] resourceNames: [ "application-team-1-tpp-access-token" ]
-
Link the connection service account to the get-application-team-1-tpp-access-token role:
apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: application-team-1-secret-rolebinding namespace: venafi roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: get-application-team-1-tpp-access-token subjects: - kind: ServiceAccount name: venafi-connection namespace: venafi
-
-
Create the Venafi Connection certificate request that has a reference to the Venafi Control Plane server and to the Venafi Bearer Token:
apiVersion: jetstack.io/v1alpha1 kind: VenafiConnection metadata: name: application-team-1-connection namespace: venafi spec: tpp: url: https://tpp1.example.com accessToken: - secret: name: application-team-1-tpp-access-token fields: [ "access-token" ] # the field name in the Kubernetes Secret