-
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.
ingress support in the ingress analyzer (#175)
* ingress support in the ingress analyzer
- Loading branch information
1 parent
daf7353
commit 9b5ee36
Showing
80 changed files
with
2,325 additions
and
548 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,6 +105,7 @@ issues: | |
- revive | ||
- goconst | ||
- funlen | ||
- errcheck | ||
|
||
run: | ||
timeout: 5m |
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
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,16 @@ | ||
# List command - connectivity analysis output | ||
|
||
Resource manifests considered for a connectivity analysis: | ||
- workload resources (such as Kubernetes Pod / Deployment) | ||
- Kubernetes NetworkPolicy | ||
- Kubernetes Ingress | ||
- Openshift Route | ||
|
||
The connectivity output consists of lines of the form: `src` => `dst` : `connections` | ||
|
||
For connections inferred from network policy resources only, the `src` and `dst` are workloads or external IP-blocks. | ||
|
||
For Ingress/Route analysis, the `src` is specified as `{ingress-controller}`, representing the cluster's ingress controller Pod. | ||
Its connectivity lines are of the form: `{ingress-controller}` => `dst` : `connections`, where `dst` is a workload in the cluster. | ||
This analysis is currently activated only with `--dir-path` flag, and not on a live cluster. | ||
It assumes that the ingress controller Pod is unknown, and thus using this notation of `{ingress-controller}`. |
2 changes: 1 addition & 1 deletion
2
...eval/internal/k8s/CanonicalIntervalSet.go → pkg/netpol/common/CanonicalIntervalSet.go
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package k8s | ||
package common | ||
|
||
import ( | ||
"fmt" | ||
|
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,26 @@ | ||
package common | ||
|
||
import ( | ||
v1 "k8s.io/api/core/v1" | ||
) | ||
|
||
// Connection represents a set of allowed connections between two peers | ||
type Connection interface { | ||
// ProtocolsAndPortsMap returns the set of allowed connections | ||
ProtocolsAndPortsMap() map[v1.Protocol][]PortRange | ||
// AllConnections returns true if all ports are allowed for all protocols | ||
AllConnections() bool | ||
// IsEmpty returns true if no connection is allowed | ||
IsEmpty() bool | ||
} | ||
|
||
// PortRange describes a port or a range of ports for allowed traffic | ||
// If start port equals end port, it represents a single port | ||
type PortRange interface { | ||
// Start is the start port | ||
Start() int64 | ||
// End is the end port | ||
End() int64 | ||
// String returns a string representation of the PortRange object | ||
String() string | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...etpol/eval/internal/k8s/intervals_test.go → pkg/netpol/common/intervals_test.go
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package k8s | ||
package common | ||
|
||
import ( | ||
"testing" | ||
|
2 changes: 1 addition & 1 deletion
2
pkg/netpol/eval/internal/k8s/portset.go → pkg/netpol/common/portset.go
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package k8s | ||
package common | ||
|
||
import ( | ||
"reflect" | ||
|
Oops, something went wrong.