Skip to content

Commit 0e4710f

Browse files
authored
Merge pull request #789 from snyk/feat/cloud-pak-linting
chore: update main README with IBM Cloud Pak suggestions
2 parents 6c38f3e + a918c67 commit 0e4710f

File tree

7 files changed

+97
-2
lines changed

7 files changed

+97
-2
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ opm
4646
.operator_version
4747
snyk-monitor-operator-source.yaml
4848
snyk-monitor-catalog-source.yaml
49+
scc.txt
4950

5051
# Linting and formatting
5152
.eslintrc.json

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,17 @@ Container to monitor Kubernetes clusters' security
99

1010
## Prerequisites ##
1111

12-
* 50 GB of storage in the form of [emptyDir](https://kubernetes.io/docs/concepts/storage/volumes/#emptydir).
13-
* External internet access from the Kubernetes cluster.
12+
* 50 GiB of storage in the form of [emptyDir](https://kubernetes.io/docs/concepts/storage/volumes/#emptydir).
13+
* External internet access from the Kubernetes cluster, specifically to `kubernetes-upstream.snyk.io`.
14+
* 1 CPU, 2 GiB RAM
15+
* 1 Kubernetes worker node of type `linux/amd64` - supported and tested only on the AMD64 CPU architecture
16+
17+
Supported Kubernetes distributions:
18+
19+
* Any Kubernetes Certified distribution, for example: GKE, AKS, EKS, OCP.
20+
* OCP 4.1+ if running on OpenShift - supported and tested on Generally Available versions
21+
22+
Tested with the following [Security Context Constraint](scc.txt) on OCP.
1423

1524
## Installing ##
1625

@@ -117,6 +126,12 @@ Finally, to launch the Snyk monitor in your cluster, run the following:
117126
kubectl apply -f snyk-monitor-deployment.yaml
118127
```
119128

129+
## Upgrades ##
130+
131+
You can apply the latest version of the YAML installation files to upgrade.
132+
133+
If running with Operator Lifecycle Manager (OLM) then OLM will handle upgrades for you when you request to install the latest version. This applies to OpenShift (OCP) and regular installations of OLM.
134+
120135
## Setting up proxying ##
121136

122137
Proxying traffic through a forwarding proxy can be achieved by modifying the `snyk-monitor-cluster-permissions.yaml` or `snyk-monitor-namespaced-permissions.yaml` (depending on which one was applied) and setting the following variables in the `ConfigMap`:

scc.txt

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Generated with "oc describe scc restricted"
2+
3+
Name: restricted
4+
Priority: <none>
5+
Access:
6+
Users: <none>
7+
Groups: system:authenticated
8+
Settings:
9+
Allow Privileged: false
10+
Allow Privilege Escalation: true
11+
Default Add Capabilities: <none>
12+
Required Drop Capabilities: KILL,MKNOD,SETUID,SETGID
13+
Allowed Capabilities: <none>
14+
Allowed Seccomp Profiles: <none>
15+
Allowed Volume Types: configMap,downwardAPI,emptyDir,persistentVolumeClaim,projected,secret
16+
Allowed Flexvolumes: <all>
17+
Allowed Unsafe Sysctls: <none>
18+
Forbidden Sysctls: <none>
19+
Allow Host Network: false
20+
Allow Host Ports: false
21+
Allow Host PID: false
22+
Allow Host IPC: false
23+
Read Only Root Filesystem: false
24+
Run As User Strategy: MustRunAsRange
25+
UID: <none>
26+
UID Range Min: <none>
27+
UID Range Max: <none>
28+
SELinux Context Strategy: MustRunAs
29+
User: <none>
30+
Role: <none>
31+
Type: <none>
32+
Level: <none>
33+
FSGroup Strategy: MustRunAs
34+
Ranges: <none>
35+
Supplemental Groups Strategy: RunAsAny
36+
Ranges: <none>

snyk-monitor/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ helm upgrade --install snyk-monitor snyk-charts/snyk-monitor --namespace snyk-mo
9898
To better organise the data scanned inside your cluster, the monitor requires a cluster name to be set.
9999
Replace the value of `clusterName` with the name of your cluster.
100100

101+
## Upgrades ##
102+
103+
You can apply the latest version of the YAML installation files to upgrade.
104+
105+
If running with Operator Lifecycle Manager (OLM) then OLM will handle upgrades for you when you request to install the latest version. This applies to OpenShift (OCP) and regular installations of OLM.
106+
101107
## Setting up proxying ##
102108

103109
Proxying traffic through a forwarding proxy can be achieved by setting the following values in the Helm chart:

snyk-monitor/templates/deployment.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,14 @@ spec:
106106
limits:
107107
cpu: {{ .Values.limits.cpu }}
108108
memory: {{ .Values.limits.memory }}
109+
livenessProbe:
110+
exec:
111+
command:
112+
- "true"
113+
readinessProbe:
114+
exec:
115+
command:
116+
- "true"
109117
securityContext:
110118
privileged: false
111119
runAsNonRoot: true
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: networking.k8s.io/v1
2+
kind: NetworkPolicy
3+
metadata:
4+
name: {{ include "snyk-monitor.name" . }}
5+
labels:
6+
app.kubernetes.io/name: {{ include "snyk-monitor.name" . }}
7+
helm.sh/chart: {{ include "snyk-monitor.chart" . }}
8+
app.kubernetes.io/instance: {{ .Release.Name }}
9+
app.kubernetes.io/managed-by: {{ .Release.Service }}
10+
spec:
11+
podSelector:
12+
matchLabels:
13+
app.kubernetes.io/name: {{ include "snyk-monitor.name" . }}
14+
app.kubernetes.io/instance: {{ .Release.Name }}
15+
policyTypes:
16+
- Ingress
17+
- Egress
18+
# Ingress is denied hence there is no "ingress" block.
19+
# Egress is allowed for any traffic.
20+
egress:
21+
- {}

snyk-operator/deploy/olm-catalog/snyk-operator/0.0.0/snyk-operator.v0.0.0.clusterserviceversion.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,14 @@ spec:
263263
limits:
264264
cpu: "500m"
265265
memory: "500Mi"
266+
livenessProbe:
267+
exec:
268+
command:
269+
- "true"
270+
readinessProbe:
271+
exec:
272+
command:
273+
- "true"
266274
securityContext:
267275
privileged: false
268276
runAsNonRoot: true

0 commit comments

Comments
 (0)