From d699377739969e37825d7511d8c1d011cf0a76ac Mon Sep 17 00:00:00 2001 From: Matthias Bertschy Date: Mon, 14 Oct 2024 15:01:46 +0200 Subject: [PATCH] add default deny test to ingress-and-egress-blocked Signed-off-by: Matthias Bertschy --- .../test/default-policy/expected.json | 1 + .../default-policy/input/networkpolicy.yaml | 10 ++++++++++ .../test/default-policy/input/pod.yaml | 17 +++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 rules/ingress-and-egress-blocked/test/default-policy/expected.json create mode 100644 rules/ingress-and-egress-blocked/test/default-policy/input/networkpolicy.yaml create mode 100644 rules/ingress-and-egress-blocked/test/default-policy/input/pod.yaml diff --git a/rules/ingress-and-egress-blocked/test/default-policy/expected.json b/rules/ingress-and-egress-blocked/test/default-policy/expected.json new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/rules/ingress-and-egress-blocked/test/default-policy/expected.json @@ -0,0 +1 @@ +[] diff --git a/rules/ingress-and-egress-blocked/test/default-policy/input/networkpolicy.yaml b/rules/ingress-and-egress-blocked/test/default-policy/input/networkpolicy.yaml new file mode 100644 index 000000000..8d9a12bb3 --- /dev/null +++ b/rules/ingress-and-egress-blocked/test/default-policy/input/networkpolicy.yaml @@ -0,0 +1,10 @@ +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: default-deny-all + namespace: my-ns +spec: + podSelector: {} + policyTypes: + - Ingress + - Egress diff --git a/rules/ingress-and-egress-blocked/test/default-policy/input/pod.yaml b/rules/ingress-and-egress-blocked/test/default-policy/input/pod.yaml new file mode 100644 index 000000000..78efe1dd9 --- /dev/null +++ b/rules/ingress-and-egress-blocked/test/default-policy/input/pod.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Pod +metadata: + name: test + namespace: my-ns +spec: + containers: + - args: + - server + env: + - name: BASE_HREF + value: /argo/ + image: test:latest + name: test + imagePullPolicy: Never + - name : test2 + image : test