1
+ <div align =" center " >
2
+ <p align =" center " >
3
+ <img width =" 960 " height =" 309 " alt =" final-k8s " src =" https://github.com/user-attachments/assets/e5ef535e-a07a-4cd5-9fbd-926a0c62cf39 " />
4
+ </p >
5
+ </div >
6
+
7
+ [ ![ Watch the demo video] ( https://github.com/user-attachments/assets/4ba51960-d9d2-4ac4-9272-c4ee3c5cf262 )] ( https://www.youtube.com/watch?v=mAr62XBVbmg )
8
+ > 📽️ Click the image above to watch the full 25-minute walkthrough on YouTube.
9
+ > It includes setup, explanation, CVE scan demo, and auto resource creation.
10
+
1
11
# 🛡️ Kubernetes CVE Scanner with Custom Controller + Admission Webhook
2
12
3
13
This project includes a ** Kubernetes custom controller** that:
@@ -13,7 +23,6 @@ This project includes a **Kubernetes custom controller** that:
13
23
14
24
Make sure you have a running Kubernetes cluster (like KinD, Minikube, or EKS).
15
25
16
- ---
17
26
18
27
### 2️⃣ Install ` cert-manager `
19
28
@@ -28,6 +37,7 @@ kubectl apply -f docs/trivy-manifest/deployment.yml
28
37
kubectl apply -f docs/trivy-manifest/service.yml
29
38
```
30
39
Trivy will act as the backend scanner for your webhook.
40
+ > Note: We are running using trivy client you can see the command [ here] ( https://github.com/aquasecurity/trivy/discussions/2119 )
31
41
32
42
### 4️⃣ Create Cluster Role & Bindings
33
43
* Grant required permissions for:
@@ -49,24 +59,24 @@ kubectl apply -f manifest/cluster-permission.yaml
49
59
- TLS Issuers + Certs
50
60
- ValidatingWebhookConfiguration
51
61
52
- ``` bash
62
+ ``` ts
53
63
kubectl apply - f manifest / k8s - controller - webhook .yaml
54
64
```
55
65
### 6️⃣ Test Webhook
56
- ``` bash
66
+ ``` ts
57
67
# contain cve
58
- kubectl apply -f manifest/webhook-example/initContainerDeployment.yml
68
+ $ kubectl apply - f manifest / webhook - example / initContainerDeployment .yml
59
69
# look for first time it might fail (look at the logs of the application (k8s - custom - controller ) and
60
70
# see if they return a long list of CVE - > then start creating again (Working on to optimize )
61
71
62
72
# pure zero cve (does not contain cve )
63
- kubectl apply -f manifest/webhook-example/pureZeroCVE.yml
73
+ $ kubectl apply - f manifest / webhook - example / pureZeroCVE .yml
64
74
65
75
# contain cve but bypass (i mean create the deployment even after having CVE )
66
76
# due to this parameter ` name: BYPASS_CVE_DENIED ` set as yes or true
67
- kubectl apply -f manifest/webhook-example/ZeroInitCVE.yml
77
+ $ kubectl apply - f manifest / webhook - example / ZeroInitCVE .yml
68
78
` ` `
69
79
### Todo:
70
80
- Better docs and guide
71
81
72
- Happy Scan-ing!
82
+ Happy Scan-ing!
0 commit comments