@@ -74,6 +74,9 @@ type FirewallSpec struct {
7474 // EgressRules contains egress rules configured for this firewall.
7575 EgressRules []EgressRuleSNAT `json:"egressRules,omitempty"`
7676
77+ // InitialRuleSet is the initial firewall ruleset applied before the firewall-controller starts running.
78+ InitialRuleSet * InitialRuleSet `json:"initialRuleSet,omitempty"`
79+
7780 // Interval on which rule reconciliation by the firewall-controller should happen.
7881 Interval string `json:"interval,omitempty"`
7982 // DryRun if set to true, firewall rules are not applied. For devel-purposes only.
@@ -122,6 +125,46 @@ type FirewallTemplateSpec struct {
122125 Spec FirewallSpec `json:"spec,omitempty"`
123126}
124127
128+ // InitialRuleSet is the initial rule set deployed on the firewall.
129+ type InitialRuleSet struct {
130+ // Egress rules to be deployed initially on the firewall.
131+ Egress []EgressRule `json:"egress,omitempty"`
132+ // Ingress rules to be deployed initially on the firewall.
133+ Ingress []IngressRule `json:"ingress,omitempty"`
134+ }
135+
136+ // NetworkProtocol represents the kind of network protocol.
137+ type NetworkProtocol string
138+
139+ const (
140+ // NetworkProtocolTCP represents tcp connections.
141+ NetworkProtocolTCP = "TCP"
142+ // NetworkProtocolUDP represents udp connections.
143+ NetworkProtocolUDP = "UDP"
144+ )
145+
146+ type EgressRule struct {
147+ // Comment provides a human readable description of this rule.
148+ Comment string `json:"comment,omitempty"`
149+ // Ports contains all affected network ports.
150+ Ports []int32 `json:"ports"`
151+ // Protocol constraints the protocol this rule applies to.
152+ Protocol NetworkProtocol `json:"protocol"`
153+ // To source address cidrs this rule applies to.
154+ To []string `json:"to"`
155+ }
156+
157+ type IngressRule struct {
158+ // Comment provides a human readable description of this rule.
159+ Comment string `json:"comment,omitempty"`
160+ // Ports contains all affected network ports.
161+ Ports []int32 `json:"ports"`
162+ // Protocol constraints the protocol this rule applies to.
163+ Protocol NetworkProtocol `json:"protocol"`
164+ // From source address cidrs this rule applies to.
165+ From []string `json:"from"`
166+ }
167+
125168// EgressRuleSNAT holds a Source-NAT rule
126169type EgressRuleSNAT struct {
127170 // NetworkID is the network for which the egress rule will be configured.
0 commit comments