conjur-oss
by papanito
A Helm chart for CyberArk Conjur
About this chart
Conjur Open Source Helm Chart
CyberArk Conjur Open Source is a powerful secrets management solution, tailored specifically to the unique infrastructure requirements of native cloud, containers, and DevOps environments. Conjur Open Source is part of the CyberArk Privileged Access Security Solution which is widely used by enterprises across the globe.
Table of Contents
- Prerequisites and Guidelines
- Installing the Chart
- Simple Install
- Installation on OCP
- Custom Installation
- Example: Installation Using Command Line Arguments
- Example: Installation Using Custom YAML File
- Configuring Conjur Accounts
- Accessing account credentials via a Kubernetes Secret
- Installing Conjur with an External Postgres Database
- Auto-Generated Configuration
- Upgrading, Modifying, or Migrating a Conjur Open Source Helm Deployment
- Modifying environment variables for an existing Conjur Open Source Helm Deployment
- Example: Changing Log Level
- Modifying environment variables for an existing Conjur Open Source Helm Deployment
- Configuration
- Deploying Without Persistent Volume Support (e.g. for MiniKube, KataCoda)
- Deploying Without LoadBalancer Support (e.g. for KinD, MiniKube, KataCoda)
- Debugging
- PostgreSQL Database Password Restrictions
- What's Next? Deploy an Example Application That Uses Conjur Secrets
- Deleting the Conjur Deployment
- Uninstalling the Chart via Helm Delete
- Cleaning Up Kubernetes Secrets Not Managed by Helm
- Contributing
Prerequisites and Guidelines
- Installation to an isolated Kubernetes cluster or namespace is highly
recommended in order to facilitate limiting of direct access to Conjur
Kubernetes resources to security administrators. Here, the term isolated
refers to:
- No workloads besides Conjur and its backend database running in the Kubernetes cluster/namespace.
- Kubernetes and Helm access to the cluster/namespace is limited to security administrators via Role-Based Access Control (RBAC).
- Kubernetes 1.7+
- OCP 4.6
- Helm v3+. The chart may work with older versions of Helm but that deployment isn't specifically supported.
- It is recommended that auto-upgrades of Kubernetes version not be used in the Kubernetes platform in which Conjur is deployed. Kubernetes version upgrades should be done in concert with Conjur version upgrades to ensure compatibility between Conjur and Kubernetes.
Installing the Chart
The Chart can be installed from a GitHub release Chart tarball or by cloning this GitHub repository.
All releases: https://github.com/cyberark/conjur-oss-helm-chart/releases
Simple Install
To install Conjur with an integrated Postgres database:
$ CONJUR_NAMESPACE=<conjur-namespace>
$ kubectl create namespace "$CONJUR_NAMESPACE"
$ DATA_KEY="$(docker run --rm cyberark/conjur data-key generate)"
$ HELM_RELEASE=<helm-release>
$ VERSION=<conjur-oss-version>
$ helm install \
-n "$CONJUR_NAMESPACE" \
--set dataKey="$DATA_KEY" \
"$HELM_RELEASE" \
https://github.com/cyberark/conjur-oss-helm-chart/releases/download/v$VERSION/conjur-oss-$VERSION.tgz
Note: The configured data key will be used to encrypt sensitive information in Conjur's database. This must be archived in a safe place.
Note: These commands require Helm v3+ as-written. If using Helm v2, use
arguments --name conjur-oss in place of conjur-oss.
_Note: It is highly recommended that custom, signed SSL certificates be used rather than using auto-generated certificates for external Conjur access and for integrated Postgres database access (see Custom Installation below).
Conjur is running HTTPS on port 443 (9443 within the cluster) with a self-signed certificate. A PostgreSQL deployment is created to store Conjur state.
Note that you can also install from source by cloning this repository and running:
$ CONJUR_NAMESPACE=<conjur-namespace>
$ kubectl create namespace "$CONJUR_NAMESPACE"
$ DATA_KEY="$(docker run --rm cyberark/conjur data-key generate)"
$ HELM_RELEASE=<helm-release>
$ helm install \
-n "$CONJUR_NAMESPACE" \
--set dataKey="$DATA_KEY" \
"$HELM_RELEASE" \
./conjur-oss
Installation on OCP
To install Conjur on OCP, use the openshift.enabled=true value, and
use images for Conjur, NGINX, and Postgres that are appropriate for an
OpenShift platform. The following Helm install example includes the default
values for Conjur, NGINX, Postgres images for deploying on OpenShift:
$ CONJUR_NAMESPACE=<conjur-namespace>
$ oc create namespace "$CONJUR_NAMESPACE"
$ DATA_KEY="$(docker run --rm cyberark/conjur data-key generate)"
$ HELM_RELEASE=<helm-release>
$ helm install \
-n "$CONJUR_NAMESPACE" \
--set image.repository=registry.connect.redhat.com/cyberark/conjur \
--set image.tag=latest \
--set nginx.image.repository=registry.connect.redhat.com/cyberark/conjur-nginx \
--set nginx.image.tag=latest \
--set postgres.image.repository=registry.redhat.io/rhel8/postgresql-15 \
--set postgres.image.tag=latest \
--set openshift.enabled=true \
--set dataKey="$DATA_KEY" \
"$HELM_RELEASE" \
https://github.com/cyberark/conjur-oss-helm-chart/releases/download/v<VERSION>/conjur-oss-<VERSION>.tgz
Custom Installation
All important chart values can be customized. The table in the Configuration section below describes customizable chart values.
Values can be customized either by:
- By including
helm installcommand line arguments of the form--set <key>=<value>for any non-default configuration values (see the Example: Installation Using Command Line Arguments section below. - Creating a custom version of the
values.yamlfile (see the Example: Installation Using Custom YAML File section below).
Note: When using non-default values for Helm install or upgrade, the user is advised:
- Setting configurable parameters to non-default values may result in a combination of settings that may not have been tested.
- Using component images other than the defaults may introduce security vulnerabilities.
Note: It is recommended that any custom chart values that are sensitive in
nature should be set on the Helm command line rather than in a custom values
file (to avoid the risk of the custom values file not getting deleted after
use). An example of how to do this for database.url is shown below.
Example: Installation Using Command Line Arguments
The following shows how to install a Conjur deployment with:
- A specific version of Conjur
- A custom domain name to use for accessing Conjur from outside of the cluster
$ CONJUR_NAMESPACE=my-conjur-namespace
$ kubectl create namespace "$CONJUR_NAMESPACE"
$ DATA_KEY="$(docker run --rm cyberark/conjur data-key generate)"
$ HELM_ARGS="--set dataKey=$DATA_KEY \
--set image.tag=1.11.0 \
--set image.pullPolicy=IfNotPresent \
--set ssl.hostname=custom.domainname.com
$ helm install \
-n "$CONJUR_NAMESPACE" \
$HELM_ARGS \
conjur-oss \
https://github.com/cyberark/conjur-oss-helm-chart/releases/download/v<VERSION>/conjur-oss-<VERSION>.tgz
Example: Installation Using Custom YAML File
The following shows how to install a Conjur deployment with:
- A specific version of Conjur
- Additional Kubernetes-API authenticators enabled
- A custom domain name to use for accessing Conjur from outside of the cluster
First, create a custom values file:
$ DATA_KEY="$(docker run --rm cyberark/conjur data-key generate)"
$ cat >custom-values.yaml <<EOT
authenticators: "authn-k8s/minikube,authn"
dataKey: $DATA_KEY
image:
tag: "1.11.0"
pullPolicy: IfNotPresent
ssl:
hostname: custom.domainname.com
EOT
Next, deploy Conjur using the custom-values.yaml file as follows:
$ CONJUR_NAMESPACE=my-conjur-namespace
$ kubectl create namespace "$CONJUR_NAMESPACE"
$ helm install \
-n "$CONJUR_NAMESPACE" \
-f custom-values.yaml \
conjur-oss \
https://github.com/cyberark/conjur-oss-helm-chart/releases/download/v<VERSION>/conjur-oss-<VERSION>.tgz
NOTE: If using the Kubernetes authenticator for Conjur, the account.name value
(see Configuration) must match the initial Conjur account
created.
Configuring Conjur Accounts
By setting account.create to true, you can direct your Conjur
container to create an account during startup. To retrieve the credentials
for this account, perform the following commands:
CONJUR_ACCOUNT=<conjur-account-name>
CONJUR_NAMESPACE=<conjur-namespace>
HELM_RELEASE=<helm-release>
POD_NAME=$(kubectl get pods --namespace "$CONJUR_NAMESPACE" \
-l "app=conjur-oss,release=$HELM_RELEASE" \
-o jsonpath="{.items[0].metadata.name}")
kubectl exec --namespace "$CONJUR_NAMESPACE" \
"$POD_NAME" \
--container=conjur-oss \
-- conjurctl role retrieve-key "$CONJUR_ACCOUNT":user:admin | tail -1
Note: If you have
logLevelset todebug, thetail -1command will truncate the output. To see all output, remove this additional command from the end.
If you set account.create to false, or did not provide a value, an admin account will
need to be created. To create an account, use the following commands:
CONJUR_ACCOUNT=<Name for Conjur account to be created>
POD_NAME=$(kubectl get pods --namespace "$CONJUR_NAMESPACE" \
-l "app=conjur-oss,release=$HELM_RELEASE" \
-o jsonpath="{.items[0].metadata.name}")
kubectl exec --namespace $CONJUR_NAMESPACE \
$POD_NAME \
--container=conjur-oss \
-- conjurctl account create $CONJUR_ACCOUNT | tail -1
The credentials for this account will be provided after the account has been created. Store these in a safe location.
Accessing account credentials via a Kubernetes Secret
This chart includes the ability to automatically generate a short-lived token that can be used to programmatically authenticate to the Conjur service. The token is stored as a json file (token.json) in a Secret (conjur-oss-conjur-admin-token) in the same namespace as the Conjur service. The main use-case for this feature is to enable full automation of bootstrapping Conjur with initial policies, i.e. ones that provide further authenticators and hosts. For example, Conjur's Go SDK provides a method NewClientFromTokenFile which accepts the token.json file.
NOTE: Be aware that this token is for the admin account created when the Conjur service first starts and, thus, has full privileges over the service. It is intended to enable the Conjur service to be bootstrapped with further, less privileged authenticators and hosts. With this in mind the token, by default, expires 10 minutes after being created. Although this value can be increased we recommend that you do not.
Installing Conjur with an External Postgres Database
You can configure Conjur to use an external (non-integrated) Postgres database
by running helm install with the following command line argument (or
setting the equivalent field in a custom values.yaml file):
--set database.url=<your-database-connection-string>
The format of a Postgres database connection string is documented here.
If this chart value is not explicitly set, then an integrated Postgres database will be deployed along with Conjur.
Auto-Generated Configuration
By default, a helm install of the Conjur Open Source helm chart will include
automatic generation of the following configuration:
-
Postgres database password (for integrated Postgres database only).
Note: The database password configuration is not used when an external Postgres database is configured.
The database password for an integrated Postgres database is automatically generated if it is not set explicitly. Alternatively, the database password can be set explicitly by including the following
helm installcommand line argument (or by setting the equivalent field in a custom values.yaml file):--set database.password=<your-database-password> -
Postgres database SSL certificate and key (for integ
Deploy conjur-oss with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has conjur-oss on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartconjur-oss is pinned at v2.1.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply