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

Use cases n4k with venafi for image verification #46

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
80 changes: 80 additions & 0 deletions Use-cases/N4K-for-Image-Verification.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
## Steps for image verification

Below are the steps to verify images before deployment to Kubernetes runtime environments -

1. Download the certified N4K Kyverno and adapter images to the customer's private repo.
2. Customize Kyverno and adapter deployment as required for the customer's environment via Helm values file (docker-registry credentials, custom CA, Proxy etc.).
3. Deploy Kyverno using the Helm Chart.
4. Deploy the adapters using the Helm Chart.
5. Leverage cosign or Venafi workflow to sign the images.
6. Deploy the image verification Kyverno policy.
7. Confirm image verification based on policy pass/fail.



## Location and Credentials to access N4K images

Please download the Kyverno and adapter images below -

ghcr.io/nirmata/kyverno:v1.8.1-n4kbuild.1
ghcr.io/nirmata/kyvernopre:v1.8.1-n4kbuild.1
ghcr.io/nirmata/kube-rbac-proxy:v0.13.1
ghcr.io/nirmata/nirmata-imagekey-controller:v0.1
Comment on lines +19 to +22

Choose a reason for hiding this comment

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

Do we really want to specify which exact tags to use in these instructions? When we upgrade, we'll have to come back and maintain this list.



Please use the below credentials provided to you to access N4K images -

Username: nirmata-enterprise-for-kyverno
Password: xx

Choose a reason for hiding this comment

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

Maybe something else other than "xx" here. Do they know where/how they'll obtain the password? Maybe put that as a sentence.


## Kyverno Installation


Install the Helm charts by following the instructions [here](https://github.com/nirmata/kyverno-charts/tree/main/charts/nirmata#installing-the-chart). The necessary credentials for the image repo must be passed during installation of the Helm repo to authenticate with the customer’s container registry. Set the image registry using the parameters below

Choose a reason for hiding this comment

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

"...during installation of the Helm chart..."

```
--set image.repository=<registry_name>>
--set image.pullSecrets.registry=<<registry_name>>

Choose a reason for hiding this comment

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

Only one set of angle brackets.

--set image.pullSecrets.username=<user>
--set image.pullSecrets.password=<password>
```


For custom certs, follow the custom cert section in the [installation](https://github.com/nirmata/kyverno-charts/tree/main/charts/venafi-adapter#installation) guide and use the parameters below to set the right ca bundle path and configmap.

Choose a reason for hiding this comment

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

"Certificates"
"CA" (acronyms are capitalized)

```
--set systemCertPath=/etc/pki/tls/certs
--set customCAConfigMap=<<configmap_name>>

Choose a reason for hiding this comment

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

One set of angled brackets.

```

## Nirmata Venafi Adapter installation


Install the Helm charts by following the instructions [here](https://github.com/nirmata/kyverno-charts/tree/main/charts/venafi-adapter). The necessary credentials for the image repo must be passed during installation of the Helm repo to authenticate with the customer’s container registry. Set the image registry using the parameters below

Choose a reason for hiding this comment

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

Credentials are for the image registry.

"Helm chart"





```
--set venafiAdapterImage=<<nirmata-imagekey-controller_image_full_path>>
--set imagePullSecret.registry=<<registry_name>>
--set imagePullSecret.username=<<user>>
--set imagePullSecret.password=<<password>>
Comment on lines +57 to +60

Choose a reason for hiding this comment

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

Angle brackets comment again.

```


For custom certs, follow the custom cert section in the [installation](https://github.com/nirmata/kyverno-charts/tree/main/charts/venafi-adapter#installation) guide and use the parameters below to set the right ca bundle path and configmap.

Choose a reason for hiding this comment

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

"Certificates"
"CA"



```
--set systemCertPath=/etc/pki/tls/certs
--set customCAConfigMap=<<configmap_name>>

Choose a reason for hiding this comment

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

brackets

```



## Validate signed images with Venafi adapter


Refer the steps [here](https://github.com/nirmata/kyverno-charts/tree/main/charts/venafi-adapter#test-a-sample-policy) to create a password secret and CR yaml imagekey.yaml
Ensure the first job runs and downloads the specified key to configmap specified
Refer the sample [policy](https://github.com/dolisss/kyverno_policies/blob/main/supply-chain/verify_image_venafi.yaml) to create a Kyverno imageverify policy referring to the configmap field
Validate whether pods are blocked or allowed based on whether they are signed with Venafi keys.