forked from dpiquet/mypve-firewall
-
Notifications
You must be signed in to change notification settings - Fork 0
/
macros
211 lines (165 loc) · 4.26 KB
/
macros
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
##########################################################
#
# DEFINE HERE YOUR OWN FUNCTIONS
#
##########################################################
#
# This file can be used to define user functions.
# It is sourced by the bash script, so write it carefully,
# and protect it !
#
#
# The following functions are available for defining macros:
#
# - BRIDGED_VM_ALLOW_TCP_PORT ip_addr port
# - BRIDGED_VM_ALLOW_UDP_PORT ip_addr port
# - BRIDGED_VM_ALLOW_PORT ip_addr
#
#
# - COMMON_BRIDGED_VM_ALLOW_TCP_PORT port
# - COMMON_BRIDGED_VM_ALLOW_UDP_PORT port
# - COMMON_BRIDGED_VM_ALLOW_PORT port
#
#
# - HYPERVISOR_ALLOW_TCP_PORT port
# - HYPERVISOR_ALLOW_UDP_PORT port
# - HYPERVISOR_ALLOW_PORT port
#
#######################################
# BRIDGED Virtual Machines Macros
#######################################
function BRIDGED_VM_ALLOW_HTTP {
BRIDGED_VM_ALLOW_TCP_PORT $1 80
}
function BRIDGED_VM_ALLOW_HTTPS {
BRIDGED_VM_ALLOW_TCP_PORT $1 443
}
function BRIDGED_VM_ALLOW_FTP {
BRIDGED_VM_ALLOW_TCP_PORT $1 21
BRIDGED_VM_ALLOW_UDP_PORT $1 20
}
function BRIDGED_VM_ALLOW_SNMP {
BRIDGED_VM_ALLOW_UDP_PORT $1 161
}
function BRIDGED_VM_ALLOW_SSH {
BRIDGED_VM_ALLOW_TCP_PORT $1 22
}
function BRIDGED_VM_PROTECTED_HTTP {
BRIDGED_VM_PROTECTED_TCP_PORT $1 80
}
function BRIDGED_VM_PROTECTED_HTTPS {
BRIDGED_VM_PROTECTED_TCP_PORT $1 443
}
function BRIDGED_VM_PROTECTED_FTP {
BRIDGED_VM_PROTECTED_TCP_PORT $1 21
BRIDGED_VM_PROTECTED_UDP_PORT $1 20
}
function BRIDGED_VM_PROTECTED_SNMP {
BRIDGED_VM_PROTECTED_UDP_PORT $1 161
}
function BRIDGED_VM_PROTECTED_SSH {
BRIDGED_VM_PROTECTED_TCP_PORT $1 22
}
###########################################
# COMMON BRIDGED VIRTUAL MACHINES MACROS
###########################################
function COMMON_BRIDGED_VM_ALLOW_HTTP {
COMMON_BRIDGED_VM_ALLOW_TCP_PORT 80
}
function COMMON_BRIDGED_VM_ALLOW_HTTPS {
COMMON_BRIDGED_VM_ALLOW_TCP_PORT 443
}
function COMMON_BRIDGED_VM_ALLOW_FTP {
COMMON_BRIDGED_VM_ALLOW_TCP_PORT 21
COMMON_BRIDGED_VM_ALLOW_UDP_PORT 20
}
function COMMON_BRIDGED_VM_ALLOW_SNMP {
COMMON_BRIDGED_VM_ALLOW_UDP_PORT 161
}
function COMMON_BRIDGED_VM_ALLOW_SSH {
COMMON_BRIDGED_VM_ALLOW_TCP_PORT 22
}
function COMMON_BRIDGED_VM_PROTECTED_HTTP {
COMMON_BRIDGED_VM_PROTECTED_TCP_PORT 80
}
function COMMON_BRIDGED_VM_PROTECTED_HTTPS {
COMMON_BRIDGED_VM_PROTECTED_TCP_PORT 443
}
function COMMON_BRIDGED_VM_PROTECTED_FTP {
COMMON_BRIDGED_VM_PROTECTED_TCP_PORT 21
COMMON_BRIDGED_VM_PROTECTED_UDP_PORT 20
}
function COMMON_BRIDGED_VM_PROTECTED_SNMP {
COMMON_BRIDGED_VM_PROTECTED_UDP_PORT 161
}
function COMMON_BRIDGED_VM_PROTECTED_SSH {
COMMON_BRIDGED_VM_PROTECTED_TCP_PORT 22
}
#####################################
# ROUTED VIRTUAL MACHINES MACROS
#####################################
function ROUTED_VM_ALLOW_HTTP {
ROUTED_VM_ALLOW_TCP_PORT $1 80
}
function ROUTED_VM_ALLOW_HTTPS {
ROUTED_VM_ALLOW_TCP_PORT $1 443
}
function ROUTED_VM_ALLOW_SNMP {
ROUTED_VM_ALLOW_UDP_PORT $1 161
}
function ROUTED_VM_ALLOW_SSH {
ROUTED_VM_ALLOW_TCP_PORT $1 22
}
function ROUTED_VM_PROTECTED_HTTP {
ROUTED_VM_PROTECTED_TCP_PORT $1 80
}
function ROUTED_VM_PROTECTED_HTTPS {
ROUTED_VM_PROTECTED_TCP_PORT $1 443
}
function ROUTED_VM_PROTECTED_SNMP {
ROUTED_VM_PROTECTED_UDP_PORT $1 161
}
function ROUTED_VM_PROTECTED_SSH {
ROUTED_VM_PROTECTED_TCP_PORT $1 22
}
######################################
# HYPERVISOR MACROS
######################################
function HYPERVISOR_ALLOW_HTTP {
HYPERVISOR_ALLOW_TCP_PORT 80
}
function HYPERVISOR_ALLOW_HTTPS {
HYPERVISOR_ALLOW_TCP_PORT 443
}
function HYPERVISOR_ALLOW_FTP {
HYPERVISOR_ALLOW_TCP_PORT 21
HYPERVISOR_ALLOW_UDP_PORT 20
}
function HYPERVISOR_ALLOW_SNMP {
HYPERVISOR_ALLOW_UDP_PORT 161
}
function HYPERVISOR_ALLOW_NRPE {
HYPERVISOR_ALLOW_TCP_PORT 5666
}
function HYPERVISOR_ALLOW_SSH {
HYPERVISOR_ALLOW_TCP_PORT 22
}
function HYPERVISOR_PROTECTED_HTTP {
HYPERVISOR_PROTECTED_TCP_PORT 80
}
function HYPERVISOR_PROTECTED_HTTPS {
HYPERVISOR_PROTECTED_TCP_PORT 443
}
function HYPERVISOR_PROTECTED_FTP {
HYPERVISOR_PROTECTED_TCP_PORT 21
HYPERVISOR_PROTECTED_UDP_PORT 22
}
function HYPERVISOR_PROTECTED_NRPE {
HYPERVISOR_PROTECTED_TCP_PORT 5666
}
function HYPERVISOR_PROTECTED_SNMP {
HYPERVISOR_PROTECTED_UDP_PORT 161
}
function HYPERVISOR_PROTECTED_SSH {
HYPERVISOR_PROTECTED_TCP_PORT 22
}