cyberark / conjur-authn-k8s-client

Authentication sidecar for Conjur Kubernetes integration.
https://www.conjur.org
Apache License 2.0
12 stars 14 forks source link

There is an initial namespace prep Helm chart #249

Closed diverdane closed 3 years ago

diverdane commented 3 years ago

Overview

The proposed simple Kubernetes authenticator client configuration workflow requires the implementation of a Helm chart to create objects in an application Namespace as required for any Conjur Kubernetes authenticators that will reside in that application Namespace.

Desired Implementation

Objects to be Created

When helm install ... is invoked on this Helm chart, there should be two Kubernetes objects created in the application Namespace:

Required Chart values

This chart will require the following values to be set by the user:

Introspection using Helm lookup function

This Helm chart needs to create objects using content from a "golden" ConfigMap that contains reference Conjur connection information. This golden ConfigMap will reside in a separate (centralized) Conjur or authn-k8s Namespace.

Values that will need to be introspected from this golden ConfigMap:

Sample Conjur Connect ConfigMap Manifest

When helm install ... is invoked using this Helm chart, Helm should render a manifest for a ConfigMap that looks similar to the following:

apiVersion: v1 
kind: ConfigMap 
metadata: 
  name: conjur-connect-configmap 
  labels: 
    app.kubernetes.io/name: <authnK8s.Namespace from chart values>-authn-k8s 
    app.kubernetes.io/component: conjur-conn-configmap 
    app.kubernetes.io/instance: <application namespace>-authn-k8s 
    app.kubernetes.io/part-of: app-namespace-config 
    app.kubernetes.io/managed-by: helm 
    helm.sh/chart: authn-k8s-namespace-prep-1.0.0   <--- Note: This chart's name and version
data: 
  CONJUR_ACCOUNT: myConjurAccount  
  CONJUR_APPLIANCE_URL: https://conjur.conjur-ns.svc.cluster.local 
  CONJUR_AUTHN_URL: https://conjur.conjur-ns.svc.cluster.local/authn-k8s/my-authenticator-id 
  CONJUR_SSL_CERTIFICATE: <unencoded Conjur SSL certificate>

Sample RoleBinding Manifest

apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: <authenticator namespace>-conjur-authenticator-role-binding
  labels: 
    app.kubernetes.io/name: <authnK8s.Namespace from chart values>-authn-k8s
    app.kubernetes.io/component: rolebinding
    app.kubernetes.io/instance: <application namespace>-authn-k8s 
    app.kubernetes.io/part-of: app-namespace-config 
    app.kubernetes.io/managed-by: helm
    helm.sh/chart: authn-k8s-namespace-prep-1.0.0   <--- Note: This chart's name and version
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: <authnK8sClusterRole from golden ConfigMap>
subjects:
- kind: ServiceAccount
  name: <authnK8sServiceAccount from golden ConfigMap>
  namespace: <authnK8s.Namespace from chart values>

Helm chart Files to be created

This Helm chart requires the creation of the following files in the chart subdirectory:

Out of Scope:

values.yaml requirements

Required Values:

The following values are required, and must be set in a values.yaml file or with a --set <key>=<value> command line setting (written in dotted path syntax):

Fields with defaults:

Other control knobs:

For future-proofing, we should have knobs to individually enable/disable creation of ConfigMap and RoleBinding (just in case these objects are already being created somewhere else):

Template manifests requirements

The template manifests must enforce that required values have been explicitly defined.

README.md requirements

The README.md must include:

NOTES.txt requirements

NOTES.txt should announce completion, maybe listing objects that have been deployed

Environments on Which to Test

For initial implementation, it should be sufficient to test this Helm chart on:

Describe alternatives you have considered

Additional context

DoD:

izgeri commented 3 years ago

We rolled 1 pt into the next sprint