mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-05 16:57:51 +08:00
NET-1784: Adv Acl Rules (#3239)
* define direction on acl req * define protocol types and rule model * get rules for node * fetch acl rule for a node * redine acl firewall model * add json tags * update port,protocol, and direction * add json tags to acl options * convert protocol to string * simplify acl map * add json tags to acl rules * add networks to fw update * add acls rules * NET-1784: add allow all field * add allow all field on fw udpate * remove debug logs * fix port and protocol types * migrate default acl policies * define constants for service types * add adv options for user rules on ingress gw * debug log * allow whole network * add static nodes to acl rules * replace peers on acl updates * initiliase rule map * add user acl rules on target node * revert acl check on extclient * handle static node rules on ingress gw * update multiple policies for users * check allowed direction * remove debug logs
This commit is contained in:
@@ -30,9 +30,11 @@ type HostPeerUpdate struct {
|
||||
}
|
||||
|
||||
type FwRule struct {
|
||||
SrcIP net.IPNet
|
||||
DstIP net.IPNet
|
||||
Allow bool
|
||||
SrcIP net.IPNet `json:"src_ip"`
|
||||
DstIP net.IPNet `json:"dst_ip"`
|
||||
AllowedProtocol Protocol `json:"allowed_protocols"` // tcp, udp, etc.
|
||||
AllowedPorts []string `json:"allowed_ports"`
|
||||
Allow bool `json:"allow"`
|
||||
}
|
||||
|
||||
// IngressInfo - struct for ingress info
|
||||
@@ -92,10 +94,13 @@ type KeyUpdate struct {
|
||||
|
||||
// FwUpdate - struct for firewall updates
|
||||
type FwUpdate struct {
|
||||
AllowAll bool `json:"allow_all"`
|
||||
Networks []net.IPNet `json:"networks"`
|
||||
IsEgressGw bool `json:"is_egress_gw"`
|
||||
IsIngressGw bool `json:"is_ingress_gw"`
|
||||
EgressInfo map[string]EgressInfo `json:"egress_info"`
|
||||
IngressInfo map[string]IngressInfo `json:"ingress_info"`
|
||||
AclRules map[string]AclRule `json:"acl_rules"`
|
||||
}
|
||||
|
||||
// FailOverMeReq - struct for failover req
|
||||
|
Reference in New Issue
Block a user