-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
don't remove representative peers in any-namespace (#352)
* always keep representative peers which match all-namespaces * update test output after merge * examples with rules exposing pod to an existing ns * Update pkg/netpol/eval/exposure.go Co-authored-by: Adi Sosnovich <[email protected]> * don't refine rep. peers matching any pod in a namespace + changing some tests to keep initial purpose+updating results of existing tests * adding same test with nil podSelector instead of empty one * adding test with inaccurate output * fixing comment syntax * Update pkg/netpol/connlist/connlist_test.go Co-authored-by: Adi Sosnovich <[email protected]> * gofmt * updating comments in yaml * tiny fix --------- Co-authored-by: Adi Sosnovich <[email protected]>
- Loading branch information
1 parent
83a1b78
commit f930f3c
Showing
43 changed files
with
1,283 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions
25
test_outputs/connlist/exposure_test_conn_to_all_pods_in_an_existing_ns_connlist_output.dot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
digraph { | ||
subgraph "cluster_backend" { | ||
color="black" | ||
fontcolor="black" | ||
"all pods_in_backend" [label="all pods" color="red2" fontcolor="red2"] | ||
"backend/backend-app[Deployment]" [label="backend-app[Deployment]" color="blue" fontcolor="blue"] | ||
label="backend" | ||
} | ||
subgraph "cluster_hello_world" { | ||
color="black" | ||
fontcolor="black" | ||
"hello-world/workload-a[Deployment]" [label="workload-a[Deployment]" color="blue" fontcolor="blue"] | ||
label="hello-world" | ||
} | ||
"0.0.0.0-255.255.255.255" [label="0.0.0.0-255.255.255.255" color="red2" fontcolor="red2"] | ||
"entire-cluster" [label="entire-cluster" color="red2" fontcolor="red2" shape=diamond] | ||
"0.0.0.0-255.255.255.255" -> "backend/backend-app[Deployment]" [label="All Connections" color="gold2" fontcolor="darkgreen"] | ||
"all pods_in_backend" -> "hello-world/workload-a[Deployment]" [label="TCP 8050" color="gold2" fontcolor="darkgreen" weight=1] | ||
"backend/backend-app[Deployment]" -> "0.0.0.0-255.255.255.255" [label="All Connections" color="gold2" fontcolor="darkgreen"] | ||
"backend/backend-app[Deployment]" -> "entire-cluster" [label="All Connections" color="gold2" fontcolor="darkgreen" weight=0.5] | ||
"backend/backend-app[Deployment]" -> "hello-world/workload-a[Deployment]" [label="TCP 8050" color="gold2" fontcolor="darkgreen"] | ||
"entire-cluster" -> "backend/backend-app[Deployment]" [label="All Connections" color="gold2" fontcolor="darkgreen" weight=1] | ||
"hello-world/workload-a[Deployment]" -> "backend/backend-app[Deployment]" [label="All Connections" color="gold2" fontcolor="darkgreen"] | ||
"hello-world/workload-a[Deployment]" -> "entire-cluster" [label="All Connections" color="gold2" fontcolor="darkgreen" weight=0.5] | ||
} |
Binary file added
BIN
+48.1 KB
...nnlist/exposure_test_conn_to_all_pods_in_an_existing_ns_connlist_output.dot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
108 changes: 108 additions & 0 deletions
108
...nnlist/exposure_test_conn_to_all_pods_in_an_existing_ns_connlist_output.dot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions
19
test_outputs/connlist/exposure_test_conn_to_all_pods_in_an_existing_ns_connlist_output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
0.0.0.0-255.255.255.255 => backend/backend-app[Deployment] : All Connections | ||
backend/backend-app[Deployment] => 0.0.0.0-255.255.255.255 : All Connections | ||
backend/backend-app[Deployment] => hello-world/workload-a[Deployment] : TCP 8050 | ||
hello-world/workload-a[Deployment] => backend/backend-app[Deployment] : All Connections | ||
|
||
Exposure Analysis Result: | ||
Egress Exposure: | ||
backend/backend-app[Deployment] => 0.0.0.0-255.255.255.255 : All Connections | ||
backend/backend-app[Deployment] => entire-cluster : All Connections | ||
hello-world/workload-a[Deployment] => entire-cluster : All Connections | ||
|
||
Ingress Exposure: | ||
backend/backend-app[Deployment] <= 0.0.0.0-255.255.255.255 : All Connections | ||
backend/backend-app[Deployment] <= entire-cluster : All Connections | ||
hello-world/workload-a[Deployment] <= backend/[all pods] : TCP 8050 | ||
|
||
Workloads not protected by network policies: | ||
backend/backend-app[Deployment] is not protected on Egress | ||
backend/backend-app[Deployment] is not protected on Ingress |
25 changes: 25 additions & 0 deletions
25
...xposure_test_conn_to_all_pods_in_an_existing_ns_with_ns_selector_only_connlist_output.dot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
digraph { | ||
subgraph "cluster_backend" { | ||
color="black" | ||
fontcolor="black" | ||
"all pods_in_backend" [label="all pods" color="red2" fontcolor="red2"] | ||
"backend/backend-app[Deployment]" [label="backend-app[Deployment]" color="blue" fontcolor="blue"] | ||
label="backend" | ||
} | ||
subgraph "cluster_hello_world" { | ||
color="black" | ||
fontcolor="black" | ||
"hello-world/workload-a[Deployment]" [label="workload-a[Deployment]" color="blue" fontcolor="blue"] | ||
label="hello-world" | ||
} | ||
"0.0.0.0-255.255.255.255" [label="0.0.0.0-255.255.255.255" color="red2" fontcolor="red2"] | ||
"entire-cluster" [label="entire-cluster" color="red2" fontcolor="red2" shape=diamond] | ||
"0.0.0.0-255.255.255.255" -> "backend/backend-app[Deployment]" [label="All Connections" color="gold2" fontcolor="darkgreen"] | ||
"all pods_in_backend" -> "hello-world/workload-a[Deployment]" [label="TCP 8050" color="gold2" fontcolor="darkgreen" weight=1] | ||
"backend/backend-app[Deployment]" -> "0.0.0.0-255.255.255.255" [label="All Connections" color="gold2" fontcolor="darkgreen"] | ||
"backend/backend-app[Deployment]" -> "entire-cluster" [label="All Connections" color="gold2" fontcolor="darkgreen" weight=0.5] | ||
"backend/backend-app[Deployment]" -> "hello-world/workload-a[Deployment]" [label="TCP 8050" color="gold2" fontcolor="darkgreen"] | ||
"entire-cluster" -> "backend/backend-app[Deployment]" [label="All Connections" color="gold2" fontcolor="darkgreen" weight=1] | ||
"hello-world/workload-a[Deployment]" -> "backend/backend-app[Deployment]" [label="All Connections" color="gold2" fontcolor="darkgreen"] | ||
"hello-world/workload-a[Deployment]" -> "entire-cluster" [label="All Connections" color="gold2" fontcolor="darkgreen" weight=0.5] | ||
} |
Binary file added
BIN
+48.1 KB
...onn_to_all_pods_in_an_existing_ns_with_ns_selector_only_connlist_output.dot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.