Skip to content

Commit

Permalink
better policy and rules naming (#491)
Browse files Browse the repository at this point in the history
  • Loading branch information
shireenf-ibm authored Jan 28, 2025
1 parent 1f69f44 commit b6d6085
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions tests/exposure_test_with_anp_10_with_real_pod/policies.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: policy.networking.k8s.io/v1alpha1
kind: AdminNetworkPolicy
metadata:
name: exposure-deny-peer-allow-entire-cluster-all-conns
name: exposure-example-10-exclude-real-pod-from-entire-cluster-conn
spec:
priority: 10
subject:
Expand All @@ -13,7 +13,7 @@ spec:
matchLabels:
app: a-app
egress:
- name: "deny-all-egress-to-slytherin"
- name: "deny-all-egress-to-workload-b"
action: "Deny"
to:
- pods:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: policy.networking.k8s.io/v1alpha1
kind: AdminNetworkPolicy
metadata:
name: exposure-deny-peer-allow-entire-cluster-all-conns
name: exposure-allow-entire-cluster
spec:
priority: 10
subject:
Expand Down
8 changes: 4 additions & 4 deletions tests/exposure_test_with_anp_12/policies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
matchLabels:
app: a-app
egress:
- name: "allow-some-to-all-pods-in-existing-ns"
- name: "allow-tcp9090-to-all-pods-in-existing-ns"
action: "Allow"
to:
- pods:
Expand All @@ -25,7 +25,7 @@ spec:
port: 9090
protocol: TCP
ingress:
- name: "allow-some-from-pods-in-existing-namespace"
- name: "allow-tcp9090-from-pods-in-existing-namespace"
action: "Allow"
from:
- pods:
Expand All @@ -51,7 +51,7 @@ spec:
matchLabels:
app: a-app
ingress:
- name: "deny-all-internal-connections-on-port"
- name: "deny-all-internal-connections-on-port-tcp9090"
action: "Deny"
from:
- pods:
Expand All @@ -62,7 +62,7 @@ spec:
port: 9090
protocol: TCP
egress:
- name: "deny-all-internal-connections-egress-on-port"
- name: "deny-all-internal-connections-egress-on-port-tcp9090"
action: "Deny"
to:
- pods:
Expand Down
8 changes: 4 additions & 4 deletions tests/exposure_test_with_anp_13/policies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ spec:
matchLabels:
app: a-app
egress:
- name: "deny-all-to-networks"
- name: "deny-all-to-all-networks"
action: "Deny"
to:
- networks:
- 0.0.0.0/0
- name: "allow-some-to-labeled-pods-in-new-ns"
- name: "allow-tcp80-to-labeled-pods-in-new-ns"
action: "Allow"
to:
- pods:
Expand All @@ -33,7 +33,7 @@ spec:
port: 80
protocol: TCP
ingress:
- name: "allow-some-from-pods-in-existing-namespace"
- name: "allow-tcp9090-from-pods-in-existing-namespace"
action: "Allow"
from:
- pods:
Expand All @@ -59,7 +59,7 @@ spec:
matchLabels:
app: a-app
ingress:
- name: "deny-all-internal-connections"
- name: "deny-all-internal-connections-ingress"
action: "Deny"
from:
- pods:
Expand Down
8 changes: 4 additions & 4 deletions tests/exposure_test_with_anp_15/policies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
matchLabels:
app: a-app
egress:
- name: "allow-some-to-all-pods-in-same-ns"
- name: "allow-tcp9090-to-all-pods-in-same-ns"
action: "Allow"
to:
- pods:
Expand All @@ -25,7 +25,7 @@ spec:
port: 9090
protocol: TCP
ingress:
- name: "allow-some-from-pods-in-same-namespace"
- name: "allow-tcp9090-from-pods-in-same-namespace"
action: "Allow"
from:
- pods:
Expand Down Expand Up @@ -80,7 +80,7 @@ spec:
matchLabels:
kubernetes.io/metadata.name: hello-world
egress:
- name: "pass-some-to-labeled-pods-in-labeled-ns"
- name: "pass-udp53-to-labeled-pods-in-labeled-ns"
action: "Pass"
to:
- pods:
Expand All @@ -94,7 +94,7 @@ spec:
- portNumber:
port: 53
protocol: UDP
- name: "allow-some-to-labeled-pods-in-labeled-ns"
- name: "allow-udp58-to-labeled-pods-in-labeled-ns"
action: "Allow"
to:
- pods:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
matchLabels:
kubernetes.io/metadata.name: hello-world
ingress:
- name: "allow-some-ingress-from-entire-cluster" # exposed to entire-cluster on ingress
- name: "allow-tcp80-ingress-from-entire-cluster" # exposed to entire-cluster on ingress
action: "Allow"
from:
- namespaces: {}
Expand All @@ -18,7 +18,7 @@ spec:
port: 80
protocol: TCP
egress:
- name: "allow-some-egress-to-entire-cluster" # exposed to entire-cluster on egress
- name: "allow-tcp80-egress-to-entire-cluster" # exposed to entire-cluster on egress
action: "Allow"
to:
- namespaces: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
matchLabels:
kubernetes.io/metadata.name: hello-world
ingress:
- name: "deny-some-ingress-from-entire-cluster" # exposed to entire-cluster on ingress
- name: "deny-tcp80-ingress-from-entire-cluster" # exposed to entire-cluster on ingress
action: "Deny"
from:
- namespaces: {}
Expand All @@ -18,7 +18,7 @@ spec:
port: 80
protocol: TCP
egress:
- name: "deny-some-egress-to-entire-cluster" # exposed to entire-cluster on egress
- name: "deny-tcp80-egress-to-entire-cluster" # exposed to entire-cluster on egress
action: "Deny"
to:
- namespaces: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
matchLabels:
kubernetes.io/metadata.name: hello-world
ingress:
- name: "pass-some-ingress-from-entire-cluster" # exposed to entire-cluster on ingress
- name: "pass-tcp80-ingress-from-entire-cluster" # exposed to entire-cluster on ingress
action: "Pass"
from:
- namespaces: {}
Expand All @@ -18,7 +18,7 @@ spec:
port: 80
protocol: TCP
egress:
- name: "pass-some-egress-to-entire-cluster" # exposed to entire-cluster on egress
- name: "pass-tcp80-egress-to-entire-cluster" # exposed to entire-cluster on egress
action: "Pass"
to:
- namespaces: {}
Expand Down
2 changes: 1 addition & 1 deletion tests/exposure_test_with_anp_8/policies.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: policy.networking.k8s.io/v1alpha1
kind: AdminNetworkPolicy
metadata:
name: exposure-deny-peer-allow-entire-cluster-all-conns
name: exposure-deny-partial-to-peer-allow-entire-cluster-all-conns
spec:
priority: 10
subject:
Expand Down
2 changes: 1 addition & 1 deletion tests/exposure_test_with_anp_9/policies.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: policy.networking.k8s.io/v1alpha1
kind: AdminNetworkPolicy
metadata:
name: exposure-deny-peer-allow-entire-cluster-all-conns
name: exposure-exclude-representative-peer-allow-from-cluster-all-conns
spec:
priority: 10
subject:
Expand Down

0 comments on commit b6d6085

Please sign in to comment.