Documentation ¶
Index ¶
- Constants
- Variables
- func AggregateHTTPRules(mergedSrcPerMergedDst map[string][]MergedPortDst)
- func AggregatePaths(treeMap map[string]*Node, paths []string) []string
- func DeduplicatePolicies(existingPolicies []types.KnoxNetworkPolicy, ...) []types.KnoxNetworkPolicy
- func DiscoverNetworkPolicies(namespace string, cidrBits int, networkLogs []types.NetworkLog, ...) []types.KnoxNetworkPolicy
- func GetDomainNameFromMap(ipAddr string, dnsToIPs map[string][]string) string
- func GetFQDNFromDomainName(domainName string, fqdnPolicies []types.KnoxNetworkPolicy) (types.KnoxNetworkPolicy, bool)
- func GetLastedFQDNPolicy(existingPolicies []types.KnoxNetworkPolicy, policy types.KnoxNetworkPolicy) []types.KnoxNetworkPolicy
- func GetLastedHTTPPolicy(existingPolicies []types.KnoxNetworkPolicy, policy types.KnoxNetworkPolicy) []types.KnoxNetworkPolicy
- func GetLatestCIDRPolicy(existingPolicies []types.KnoxNetworkPolicy, policy types.KnoxNetworkPolicy) []types.KnoxNetworkPolicy
- func GetLatestEntityPolicy(existingPolicies []types.KnoxNetworkPolicy, policy types.KnoxNetworkPolicy) []types.KnoxNetworkPolicy
- func GetLatestMatchLabelsPolicy(existingPolicies []types.KnoxNetworkPolicy, policy types.KnoxNetworkPolicy) []types.KnoxNetworkPolicy
- func GetLatestServicePolicy(existingPolicies []types.KnoxNetworkPolicy, policy types.KnoxNetworkPolicy) []types.KnoxNetworkPolicy
- func GetToFQDNsFromNewDiscoveredPolicies(policy types.KnoxNetworkPolicy, newPolicies []types.KnoxNetworkPolicy) []types.KnoxNetworkPolicy
- func HandleErr()
- func HandleErrRet(ret *bool)
- func IsExistingPolicy(existingPolicies []types.KnoxNetworkPolicy, newPolicy types.KnoxNetworkPolicy) bool
- func ReplaceDuplcatedName(existingPolicies []types.KnoxNetworkPolicy, policy types.KnoxNetworkPolicy) types.KnoxNetworkPolicy
- func StartCronJob()
- func StartToDiscoverNetworkPolicies()
- func UpdateEntity(newPolicy types.KnoxNetworkPolicy, existingPolicies []types.KnoxNetworkPolicy) (types.KnoxNetworkPolicy, bool)
- func UpdateHTTP(newPolicy types.KnoxNetworkPolicy, existingPolicies []types.KnoxNetworkPolicy) (types.KnoxNetworkPolicy, bool)
- func UpdateLabeledSrcsPerDst(labeledSrcsPerDst map[Dst][]SrcSimple) map[Dst][]SrcSimple
- func UpdateMatchLabels(newPolicy types.KnoxNetworkPolicy, existingPolicies []types.KnoxNetworkPolicy) (types.KnoxNetworkPolicy, bool)
- func UpdateService(newPolicy types.KnoxNetworkPolicy, existingPolicies []types.KnoxNetworkPolicy) (types.KnoxNetworkPolicy, bool)
- func UpdateToPorts(newPolicy types.KnoxNetworkPolicy, existingPolicies []types.KnoxNetworkPolicy) (types.KnoxNetworkPolicy, bool)
- type Dst
- type DstSimple
- type HTTPDst
- type LabelCount
- type LabeledSrcsPerDstMap
- type MergedNode
- type MergedPortDst
- type Node
- type SrcSimple
Constants ¶
const ( Egress = 1 Ingress = 2 EgressIngress = 3 )
discovery mode type
Variables ¶
var DNSToIPs map[string][]string
DNSToIPs map
var DiscoveryMode int
DiscoveryMode int
var ExposedSCTPPorts = []int{}
ExposedSCTPPorts ...
var ExposedTCPPorts = []int{}
ExposedTCPPorts ...
var ExposedUDPPorts = []int{}
ExposedUDPPorts ...
var HTTPUrlThreshold int = 3
HTTPUrlThreshold int
var LabeledSrcsPerDst map[string]LabeledSrcsPerDstMap
LabeledSrcsPerDst map --> key: namespace, value: LabeledSrcsPerDstMap
var MergedSrcPerMergedDstForHTTP map[string][]*HTTPDst
MergedSrcPerMergedDstForHTTP ...
var NetworkLogFrom string
NetworkLogFrom string
var StopChan chan struct{}
StopChan Channel
var WaitG sync.WaitGroup
WaitG Handler
var WildPathChar string = "/.+"
WildPathChar ...
var WildPathCharLeaf string = "/.[^/]+"
WildPathCharLeaf ...
var WildPathDigit string = "/[0-9]+"
WildPathDigit ...
var WildPathDigitLeaf string = "/[0-9^/]+"
WildPathDigitLeaf ...
var WildPaths []string
WildPaths ...
Functions ¶
func AggregateHTTPRules ¶
func AggregateHTTPRules(mergedSrcPerMergedDst map[string][]MergedPortDst)
AggregateHTTPRules function
func AggregatePaths ¶
AggregatePaths ...
func DeduplicatePolicies ¶
func DeduplicatePolicies(existingPolicies []types.KnoxNetworkPolicy, discoveredPolicies []types.KnoxNetworkPolicy, dnsToIPs map[string][]string) []types.KnoxNetworkPolicy
DeduplicatePolicies function
func DiscoverNetworkPolicies ¶
func DiscoverNetworkPolicies( namespace string, cidrBits int, networkLogs []types.NetworkLog, services []types.Service, endpoints []types.Endpoint, pods []types.Pod) []types.KnoxNetworkPolicy
DiscoverNetworkPolicies Function
func GetDomainNameFromMap ¶
GetDomainNameFromMap function
func GetFQDNFromDomainName ¶
func GetFQDNFromDomainName(domainName string, fqdnPolicies []types.KnoxNetworkPolicy) (types.KnoxNetworkPolicy, bool)
GetFQDNFromDomainName function
func GetLastedFQDNPolicy ¶
func GetLastedFQDNPolicy(existingPolicies []types.KnoxNetworkPolicy, policy types.KnoxNetworkPolicy) []types.KnoxNetworkPolicy
GetLastedFQDNPolicy function
func GetLastedHTTPPolicy ¶
func GetLastedHTTPPolicy(existingPolicies []types.KnoxNetworkPolicy, policy types.KnoxNetworkPolicy) []types.KnoxNetworkPolicy
GetLastedHTTPPolicy function
func GetLatestCIDRPolicy ¶
func GetLatestCIDRPolicy(existingPolicies []types.KnoxNetworkPolicy, policy types.KnoxNetworkPolicy) []types.KnoxNetworkPolicy
GetLatestCIDRPolicy function
func GetLatestEntityPolicy ¶
func GetLatestEntityPolicy(existingPolicies []types.KnoxNetworkPolicy, policy types.KnoxNetworkPolicy) []types.KnoxNetworkPolicy
GetLatestEntityPolicy function
func GetLatestMatchLabelsPolicy ¶
func GetLatestMatchLabelsPolicy(existingPolicies []types.KnoxNetworkPolicy, policy types.KnoxNetworkPolicy) []types.KnoxNetworkPolicy
GetLatestMatchLabelsPolicy function
func GetLatestServicePolicy ¶
func GetLatestServicePolicy(existingPolicies []types.KnoxNetworkPolicy, policy types.KnoxNetworkPolicy) []types.KnoxNetworkPolicy
GetLatestServicePolicy function
func GetToFQDNsFromNewDiscoveredPolicies ¶
func GetToFQDNsFromNewDiscoveredPolicies(policy types.KnoxNetworkPolicy, newPolicies []types.KnoxNetworkPolicy) []types.KnoxNetworkPolicy
GetToFQDNsFromNewDiscoveredPolicies function
func IsExistingPolicy ¶
func IsExistingPolicy(existingPolicies []types.KnoxNetworkPolicy, newPolicy types.KnoxNetworkPolicy) bool
IsExistingPolicy function
func ReplaceDuplcatedName ¶
func ReplaceDuplcatedName(existingPolicies []types.KnoxNetworkPolicy, policy types.KnoxNetworkPolicy) types.KnoxNetworkPolicy
ReplaceDuplcatedName function
func StartToDiscoverNetworkPolicies ¶
func StartToDiscoverNetworkPolicies()
StartToDiscoverNetworkPolicies function
func UpdateEntity ¶
func UpdateEntity(newPolicy types.KnoxNetworkPolicy, existingPolicies []types.KnoxNetworkPolicy) (types.KnoxNetworkPolicy, bool)
UpdateEntity function
func UpdateHTTP ¶
func UpdateHTTP(newPolicy types.KnoxNetworkPolicy, existingPolicies []types.KnoxNetworkPolicy) (types.KnoxNetworkPolicy, bool)
UpdateHTTP function
func UpdateLabeledSrcsPerDst ¶
UpdateLabeledSrcsPerDst function
func UpdateMatchLabels ¶
func UpdateMatchLabels(newPolicy types.KnoxNetworkPolicy, existingPolicies []types.KnoxNetworkPolicy) (types.KnoxNetworkPolicy, bool)
UpdateMatchLabels function
func UpdateService ¶
func UpdateService(newPolicy types.KnoxNetworkPolicy, existingPolicies []types.KnoxNetworkPolicy) (types.KnoxNetworkPolicy, bool)
UpdateService function
func UpdateToPorts ¶
func UpdateToPorts(newPolicy types.KnoxNetworkPolicy, existingPolicies []types.KnoxNetworkPolicy) (types.KnoxNetworkPolicy, bool)
UpdateToPorts function
Types ¶
type Dst ¶
type Dst struct { Namespace string PodName string Additional string MatchLabels string Protocol int DstPort int Action string }
Dst Structure
type HTTPDst ¶
type HTTPDst struct { Namespace string MatchLabels string ToPorts []types.SpecPort HTTPTree map[string]map[string]*Node }
HTTPDst Structure
type LabeledSrcsPerDstMap ¶
LabeledSrcsPerDstMap map --> key: simple Dst, value: simple Src
type MergedNode ¶
type MergedNode struct {
// contains filtered or unexported fields
}
MergedNode ...