Skip to content

Commit

Permalink
migrate network tests to NetworkNeighborhoods
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Bertschy <[email protected]>
  • Loading branch information
matthyx committed Aug 23, 2024
1 parent 3b0f773 commit 180149c
Show file tree
Hide file tree
Showing 22 changed files with 636 additions and 576 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
kind: NetworkNeighbors
kind: NetworkNeighborhood
apiVersion: spdx.softwarecomposition.kubescape.io/v1beta1
spec:
matchLabels:
app: nginx
ingress:
egress:
containers:
- name: nginx
ingress:
egress:
metadata:
name: deployment-nginx
labels:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"kind": "NetworkNeighborhood",
"apiVersion": "spdx.softwarecomposition.kubescape.io/v1beta1",
"metadata": {
"name": "deployment-busybox-deployment",
"namespace": "systest-ns-myoi",
"uid": "3ca77764-ca27-492f-b752-ef4560887a28",
"resourceVersion": "1",
"creationTimestamp": "2024-07-03T15:37:19Z",
"labels": {
"kubescape.io/workload-api-group": "apps",
"kubescape.io/workload-api-version": "v1",
"kubescape.io/workload-kind": "Deployment",
"kubescape.io/workload-name": "busybox-deployment"
},
"annotations": {
"kubescape.io/completion": "complete",
"kubescape.io/status": "ready"
}
},
"spec": {
"containers": [
{
"name": "busybox",
"egress": [
{
"identifier": "238053dc2e1cbe8820de562678e8cde84593e95d41e6f1a58bb987741f9e30a3",
"type": "external",
"dns": "",
"ports": [
{
"name": "TCP-80",
"protocol": "TCP",
"port": 80
}
],
"podSelector": null,
"namespaceSelector": null,
"ipAddress": "185.199.108.153"
},
{
"identifier": "e5e8ca3d76f701a19b7478fdc1c8c24ccc6cef9902b52c8c7e015439e2a1ddf3",
"type": "internal",
"dns": "",
"ports": [
{
"name": "UDP-53",
"protocol": "UDP",
"port": 53
}
],
"podSelector": {
"matchLabels": {
"k8s-app": "kube-dns"
}
},
"namespaceSelector": {
"matchLabels": {
"kubernetes.io/metadata.name": "kube-system"
}
},
"ipAddress": ""
},
{
"identifier": "35d62fc884ab3d8896d6be5bad0176619aa60756d33dfa47c9de024902a720c5",
"type": "external",
"dns": "www.google.com.",
"dnsNames": [
"www.google.com."
],
"ports": [
{
"name": "TCP-80",
"protocol": "TCP",
"port": 80
}
],
"podSelector": null,
"namespaceSelector": null,
"ipAddress": "142.250.179.68"
}
],
"ingress": []
}
],
"matchLabels": {
"app": "busybox"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
"kind": "NetworkNeighborhood",
"apiVersion": "spdx.softwarecomposition.kubescape.io/v1beta1",
"metadata": {
"name": "deployment-busybox-deployment",
"namespace": "systest-ns-rxrl",
"uid": "07e74b42-8ba2-46b1-9de9-f6c33e3b180c",
"resourceVersion": "1",
"creationTimestamp": "2024-07-03T15:30:40Z",
"labels": {
"kubescape.io/workload-api-group": "apps",
"kubescape.io/workload-api-version": "v1",
"kubescape.io/workload-kind": "Deployment",
"kubescape.io/workload-name": "busybox-deployment"
},
"annotations": {
"kubescape.io/completion": "complete",
"kubescape.io/status": "ready"
}
},
"spec": {
"containers": [
{
"name": "busybox",
"egress": [
{
"identifier": "66c89b9fd8bd51e9c16c2eb568c64285e1bf89a98e5eb878c7cfb123246857a6",
"type": "external",
"dns": "google.com.",
"dnsNames": [
"google.com."
],
"ports": [
{
"name": "TCP-80",
"protocol": "TCP",
"port": 80
}
],
"podSelector": null,
"namespaceSelector": null,
"ipAddress": "142.250.179.78"
},
{
"identifier": "35d62fc884ab3d8896d6be5bad0176619aa60756d33dfa47c9de024902a720c5",
"type": "external",
"dns": "www.google.com.",
"dnsNames": [
"www.google.com."
],
"ports": [
{
"name": "TCP-80",
"protocol": "TCP",
"port": 80
}
],
"podSelector": null,
"namespaceSelector": null,
"ipAddress": "142.250.179.68"
},
{
"identifier": "e5e8ca3d76f701a19b7478fdc1c8c24ccc6cef9902b52c8c7e015439e2a1ddf3",
"type": "internal",
"dns": "",
"ports": [
{
"name": "UDP-53",
"protocol": "UDP",
"port": 53
}
],
"podSelector": {
"matchLabels": {
"k8s-app": "kube-dns"
}
},
"namespaceSelector": {
"matchLabels": {
"kubernetes.io/metadata.name": "kube-system"
}
},
"ipAddress": ""
}
],
"ingress": []
}
],
"matchLabels": {
"app": "busybox"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"kind": "NetworkNeighbors",
"kind": "NetworkNeighborhood",
"apiVersion": "spdx.softwarecomposition.kubescape.io/v1beta1",
"metadata": {
"name": "deployment-mariadb",
Expand All @@ -22,27 +22,32 @@
"matchLabels": {
"app": "mariadb"
},
"ingress": [
"containers": [
{
"identifier": "ee5c5b2f07834fa64174c3d2ad0505366e4b26777174906b91e83dcd163f8ec2",
"type": "internal",
"dns": "",
"ports": [
"name": "mariadb",
"ingress": [
{
"name": "TCP-3306",
"protocol": "TCP",
"port": 3306
"identifier": "ee5c5b2f07834fa64174c3d2ad0505366e4b26777174906b91e83dcd163f8ec2",
"type": "internal",
"dns": "",
"ports": [
{
"name": "TCP-3306",
"protocol": "TCP",
"port": 3306
}
],
"podSelector": {
"matchLabels": {
"app": "wikijs"
}
},
"namespaceSelector": null,
"ipAddress": ""
}
],
"podSelector": {
"matchLabels": {
"app": "wikijs"
}
},
"namespaceSelector": null,
"ipAddress": ""
"egress": []
}
],
"egress": []
]
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"kind": "NetworkNeighbors",
"kind": "NetworkNeighborhood",
"apiVersion": "spdx.softwarecomposition.kubescape.io/v1beta1",
"metadata": {
"name": "deployment-mariadb",
Expand All @@ -19,26 +19,31 @@
}
},
"spec": {
"egress": [],
"ingress": [
"containers": [
{
"identifier": "ee5c5b2f07834fa64174c3d2ad0505366e4b26777174906b91e83dcd163f8ec2",
"type": "internal",
"dns": "",
"ports": [
"name": "mariadb",
"egress": [],
"ingress": [
{
"name": "TCP-3306",
"protocol": "TCP",
"port": 3306
"identifier": "ee5c5b2f07834fa64174c3d2ad0505366e4b26777174906b91e83dcd163f8ec2",
"type": "internal",
"dns": "",
"ports": [
{
"name": "TCP-3306",
"protocol": "TCP",
"port": 3306
}
],
"podSelector": {
"matchLabels": {
"app": "wikijs"
}
},
"namespaceSelector": null,
"ipAddress": ""
}
],
"podSelector": {
"matchLabels": {
"app": "wikijs"
}
},
"namespaceSelector": null,
"ipAddress": ""
]
}
],
"matchLabels": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"kind": "NetworkNeighborhood",
"apiVersion": "spdx.softwarecomposition.kubescape.io/v1beta1",
"metadata": {
"name": "deployment-nginx",
"namespace": "systest-ns-hvt7",
"uid": "389bed91-3f2d-464d-9b70-7d29309162a5",
"resourceVersion": "1",
"creationTimestamp": "2024-07-03T15:42:51Z",
"labels": {
"kubescape.io/workload-api-group": "apps",
"kubescape.io/workload-api-version": "v1",
"kubescape.io/workload-kind": "Deployment",
"kubescape.io/workload-name": "nginx"
},
"annotations": {
"kubescape.io/completion": "complete",
"kubescape.io/status": "ready"
}
},
"spec": {
"matchLabels": {
"app": "nginx"
},
"containers": [
{
"name": "nginx",
"ingress": [],
"egress": [
{
"identifier": "e5e8ca3d76f701a19b7478fdc1c8c24ccc6cef9902b52c8c7e015439e2a1ddf3",
"type": "internal",
"dns": "",
"ports": [
{
"name": "UDP-53",
"protocol": "UDP",
"port": 53
}
],
"podSelector": {
"matchLabels": {
"k8s-app": "kube-dns"
}
},
"namespaceSelector": {
"matchLabels": {
"kubernetes.io/metadata.name": "kube-system"
}
},
"ipAddress": ""
}
]
}
]
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"kind": "NetworkNeighbors",
"kind": "NetworkNeighborhood",
"apiVersion": "spdx.softwarecomposition.kubescape.io/v1beta1",
"metadata": {
"name": "deployment-nginx",
Expand All @@ -19,8 +19,13 @@
}
},
"spec": {
"egress": [],
"ingress": [],
"containers": [
{
"name": "nginx",
"egress": [],
"ingress": []
}
],
"matchLabels": {
"app": "nginx"
}
Expand Down
Loading

0 comments on commit 180149c

Please sign in to comment.