File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ syntax = "proto3" ;
2+ package firewall ;
3+
4+ // Describes target configuration of the firewall
5+ message FirewallConfig {
6+ FirewallPolicy default_policy = 1 ;
7+ repeated FirewallRule rules = 2 ;
8+ }
9+
10+ enum FirewallPolicy {
11+ ALLOW = 0 ;
12+ DENY = 1 ;
13+ }
14+
15+ message FirewallRule {
16+ IpVersion ip_version = 1 ;
17+ optional uint32 index = 2 ;
18+ repeated IpAddress source_addr = 3 ;
19+ repeated IpAddress destination_addr = 4 ;
20+ repeated Port destination_port = 5 ;
21+ repeated Protocol protocol = 6 ;
22+ FirewallPolicy verdict = 7 ;
23+ optional string comment = 8 ;
24+ }
25+
26+ enum IpVersion {
27+ IPV4 = 0 ;
28+ IPV6 = 1 ;
29+ }
30+
31+ // IPv4 or IPv6 address
32+ // expected type is determined by a given FirewallRule
33+ message IpAddress {
34+ oneof address {
35+ // single IP address
36+ string ip = 1 ;
37+ // range of IPs, e.g. 10.0.10.1-10.0.20.3
38+ IpRange ip_range = 2 ;
39+ // IP subnet using CIDR notation, e.g. 10.0.10.0/24
40+ string ip_subnet = 3 ;
41+ }
42+ }
43+
44+ // inclusive IP range
45+ message IpRange {
46+ string start = 1 ;
47+ string end = 2 ;
48+ }
49+
50+ // wrapper message since `oneof` itself cannot be repeated
51+ message Port {
52+ oneof port {
53+ uint32 single_port = 1 ;
54+ PortRange port_range = 2 ;
55+ }
56+ }
57+
58+ // inclusive port range
59+ message PortRange {
60+ uint32 start = 1 ;
61+ uint32 end = 2 ;
62+ }
63+
64+ enum Protocol {
65+ TCP = 0 ;
66+ UDP = 1 ;
67+ ICMP = 2 ;
68+ }
You can’t perform that action at this time.
0 commit comments