-
Notifications
You must be signed in to change notification settings - Fork 1
/
iptablesfs.conf.py
44 lines (44 loc) · 1.19 KB
/
iptablesfs.conf.py
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
files = {
'rules': {
'exclude': r'^-[PN]',
'hide': [r'^-[AI] \w+ ']
},
'policy': {
'exists': lambda fs, table, chain: fs.chains[table][chain]['built-in'],
'match': r'^-P',
'chain_option': 'P',
'hide': [r'^-P \w+ ']
},
'tcp': {
'match': r'-p tcp',
'hide': [r'^-[AI] \w+ ', r'\s*-[pm] tcp\s*'],
'prepend': '-p tcp'
},
'udp': {
'match': r'-p udp',
'hide': [r'^-[AI] \w+ ', r'\s*-[pm] udp\s*'],
'prepend': '-p udp'
},
'DROP': {
'match': r'-j DROP',
'hide': [r'^-[AI] \w+ ', r'\s*-j DROP\s*'],
'append': '-j DROP'
},
'ACCEPT': {
'match': r'-j ACCEPT',
'hide': [r'^-[AI] \w+ ', r'\s*-j ACCEPT\s*'],
'append': '-j ACCEPT'
},
'REJECT': {
'match': r'-j REJECT',
'hide': [r'^-[AI] \w+ ', r'\s*-j REJECT\s*'],
'append': '-j REJECT'
},
'MASQUERADE': {
'exists': lambda fs, table, chain: table == 'nat' and chain == 'POSTROUTING',
'match': r'-j MASQUERADE',
'hide': [r'^-[AI] \w+ ', r'-j MASQUERADE\s*', r'-o\s*'],
'prepend': '-o ',
'append': '-j MASQUERADE'
},
}