Skip to content

Commit

Permalink
feat: added support for network policy
Browse files Browse the repository at this point in the history
Signed-off-by: VedRatan <vedratan8@gmail.com>
  • Loading branch information
VedRatan committed Sep 3, 2024
1 parent bddc225 commit 0230bed
Showing 1 changed file with 79 additions and 7 deletions.
86 changes: 79 additions & 7 deletions vp.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"image": "image2",
"image": "nginx:latest",
"cves": [
{
"cve": "CVE-2024-4439",
Expand Down Expand Up @@ -52,20 +52,21 @@
"resources": {
"kinds": [
"Pod"
]
},
"selector": {
"matchLabels": {
"app": "prod"
],
"selector": {
"matchLabels": {
"app": "test"
}
}
}

}
]
},
"preconditions": {
"all": [
{
"key": "nginx",
"key": "busybox",
"operator": "AnyIn",
"value": "{{ images.containers.*.name }}"
}
Expand All @@ -87,6 +88,77 @@
]
}
}
},
{
"netpol": {
"apiVersion": "networking.k8s.io/v1",
"kind": "NetworkPolicy",
"metadata": {
"name": "test-network-policy"
},
"spec": {
"podSelector": {
"matchLabels": {
"role": "db"
}
},
"policyTypes": [
"Ingress",
"Egress"
],
"ingress": [
{
"from": [
{
"ipBlock": {
"cidr": "172.17.0.0/16",
"except": [
"172.17.1.0/24"
]
}
},
{
"namespaceSelector": {
"matchLabels": {
"project": "myproject"
}
}
},
{
"podSelector": {
"matchLabels": {
"role": "frontend"
}
}
}
],
"ports": [
{
"protocol": "TCP",
"port": 6379
}
]
}
],
"egress": [
{
"to": [
{
"ipBlock": {
"cidr": "10.0.0.0/24"
}
}
],
"ports": [
{
"protocol": "TCP",
"port": 5978
}
]
}
]
}
}
}
]
}
Expand Down

0 comments on commit 0230bed

Please sign in to comment.