You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+13-14
Original file line number
Diff line number
Diff line change
@@ -5,11 +5,12 @@ Container to monitor Kubernetes clusters' security
5
5
6
6
## Prerequisites ##
7
7
8
-
*Note that at present the monitor works only if using Docker as the container runtime.*
8
+
*Note that by default the monitor uses Docker to scan your cluster and requires Docker to be your container runtime.*
9
+
*Alternatively, you can enable static analysis, which allows the use of any container runtime.*
9
10
10
11
The Snyk monitor (`kubernetes-monitor`) requires some minimal configuration items in order to work correctly.
11
12
12
-
As with any k8s deployment, the `kubernetes-monitor` runs within a single namespace.
13
+
As with any Kubernetes deployment, the `kubernetes-monitor` runs within a single namespace.
13
14
If you do not already have access to a namespace where you want to deploy the monitor, you can run the following command to create one:
14
15
```shell
15
16
kubectl create namespace snyk-monitor
@@ -19,29 +20,29 @@ Notice our namespace is called _snyk-monitor_ and it is used for the following c
19
20
20
21
The Snyk monitor relies on using your Snyk Integration ID, and using a `dockercfg` file. The `dockercfg` file is necessary to allow the monitor to look up images in private registries. Usually a copy of the `dockercfg` resides in `$HOME/.docker/config.json`.
21
22
22
-
Both of these items must be provided by a k8s secret. The secret must be called _snyk-monitor_. The steps to create the secret are as such:
23
+
Both of these items must be provided from a Kubernetes secret. The secret must be called _snyk-monitor_. The steps to create the secret are as such:
23
24
24
25
1. Create a file named `dockercfg.json`. Store your `dockercfg` in there; it should look like this:
25
26
26
27
```json
27
28
{
28
29
"auths": {
29
30
"gcr.io": {
30
-
"auth": "<BASE64-ENCODED-AUTH-DETAILS>"
31
+
"auth": "BASE64-ENCODED-AUTH-DETAILS"
31
32
}
32
33
// Add other registries as necessary
33
34
}
34
35
}
35
36
```
36
37
37
38
2. Locate your Snyk Integration ID from the Snyk Integrations page (navigate to https://app.snyk.io/org/YOUR-ORGANIZATION-NAME/manage/integrations/kubernetes) and copy it.
38
-
The Snyk Integration ID looks similar to the following:
39
+
The Snyk Integration ID is a UUID and looks similar to the following:
39
40
```
40
41
abcd1234-abcd-1234-abcd-1234abcd1234
41
42
```
42
43
The Snyk Integration ID is used in the `--from-literal=integrationId=` parameter in the next step.
43
44
44
-
3. Finally, create the secret in k8s by running the following command:
45
+
3. Finally, create the secret in Kubernetes by running the following command:
@@ -50,7 +51,7 @@ Note that the secret _must_ be namespaced, and the namespace (which we configure
50
51
51
52
52
53
The `kubernetes-monitor` can run in one of two modes: constrained to a single namespace, or with access to the whole cluster.
53
-
In other words, the monitor can scan containers in the namespace, or it can scan all containers in your cluster.
54
+
In other words, the monitor can scan containers in one particular namespace, or it can scan all containers in your cluster.
54
55
The choice of which deployment to use depends on the permissions you have on your cluster.
55
56
56
57
For _cluster_-scoped deployment you can create the necessary `ServiceAccount`, `ClusterRole`, and `ClusterRoleBinding` required for the monitor's deployment.
@@ -75,11 +76,9 @@ Finally, to launch the Snyk monitor in your cluster, run the following:
75
76
kubectl apply -f snyk-monitor-deployment.yaml
76
77
```
77
78
78
-
## Using a local Docker image for testing ##
79
+
## Enabling static analysis ##
79
80
80
-
If you would like to use a locally-built image, then modify the following lines in `snyk-monitor-deployment.yaml` like this:
81
-
```yaml
82
-
containers:
83
-
- image: <your-local-image-name:tag>
84
-
imagePullPolicy: Never
85
-
```
81
+
Static analysis works with any container runtime and does not rely on Docker to scan the images in your cluster.
82
+
It works by pulling the image, unpacking it and inspecting the files directly. For this process it needs temporary storage, so the Snyk monitor uses 20 GB of storage in the form of [emptyDir](https://kubernetes.io/docs/concepts/storage/volumes/#emptydir).
83
+
84
+
To enable static analysis, modify one of the permissions files (`snyk-monitor-namespaced-permissions.yaml` for the Namespaced deployment or `snyk-monitor-cluster-permissions.yaml` for the Cluster-scoped deployment) and set the string value of `staticAnalysis` to `"true"`.
Copy file name to clipboardexpand all lines: snyk-monitor/README.md
+16-4
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,12 @@
1
1
# snyk/kubernetes-monitor-chart #
2
2
3
3
## Summary ##
4
-
A Helm chart for the Snyk Monitor
4
+
A Helm chart for the Snyk monitor
5
5
6
6
## Prerequisites ##
7
7
8
-
*Note that at present the monitor works only if using Docker as the container runtime.*
8
+
*Note that by default the monitor uses Docker to scan your cluster and requires Docker to be your container runtime.*
9
+
*Alternatively, you can enable static analysis, which removes the reliance on Docker completely and works with any container runtime.*
9
10
10
11
The Snyk monitor (`kubernetes-monitor`) requires some minimal configuration items in order to work correctly.
11
12
@@ -19,7 +20,7 @@ Notice our namespace is called _snyk-monitor_ and it is used for the following c
19
20
20
21
The Snyk monitor relies on using your Snyk Integration ID, and using a `dockercfg` file. The `dockercfg` file is necessary to allow the monitor to look up images in private registries. Usually a copy of the `dockercfg` resides in `$HOME/.docker/config.json`.
21
22
22
-
Both of these items must be provided by a k8s secret. The secret must be called _snyk-monitor_. The steps to create the secret are as such:
23
+
Both of these items must be provided by a Kubernetes secret. The secret must be called _snyk-monitor_. The steps to create the secret are as such:
23
24
24
25
1. Create a file named `dockercfg.json`. Store your `dockercfg` in there; it should look like this:
Static analysis works with any container runtime and does not rely on Docker to scan the images in your cluster.
77
+
It works by pulling the image, unpacking it and inspecting the files directly. For this process it needs temporary storage, so the Snyk monitor uses 20 GB of storage in the form of [emptyDir](https://kubernetes.io/docs/concepts/storage/volumes/#emptydir).
78
+
The Docker socket is _not_ mounted when static analysis is enabled.
79
+
80
+
To enable static analysis, set the `featureFlags.staticAnalysis` value to `true`:
0 commit comments