-
Notifications
You must be signed in to change notification settings - Fork 6
/
5_Screens
231 lines (155 loc) · 5.84 KB
/
5_Screens
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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
#
# Example Screens configuration
#
#START
#
# Screens have ICMP, IP, SESSION-LIMIT, TCP and UDP after IDS-OPTIONS
#
#
# Case 1.1
#
# Recon screening
#
set security screen ids-option [SCREEN-NAME] icmp ip-sweep threshold 1000 #micro seconds
# Sweeps are measured based on the count of 10, above, a host outside the given zone can only generate 10 ICMP packets to
# 10 different destinations, means, 10 ICMP packets to 10 different destinations in 0.001 seconds ONLY.
set security screen ids-option [SCREEN-NAME] icmp ip-sweep threshold 1000000
# 10 ICMP packets to 10 different hosts in 1 second # tight
# Same goes for the TCP and UDP sweeps
set security screen ids-option [SCREEN-NAME] tcp tcp-sweep threshold 1000/1000000
set security screen ids-option [SCREEN-NAME] udp udp-sweep threshold 1000/1000000
#
# Case 1.2
#
# Port scan screening
#
set security screen ids-option [SCREEN-NAME] tcp port-scan threshold 1000000
# Meaning, a single source can send one SYN packet to 10 different ports in 1 second
set security screen ids-option [SCREEN-NAME] tcp fin-no-ack
# Blocks the FIN packets that may get RST as reply for port scans
set security screen ids-option [SCREEN-NAME] ip record-route-option
set security screen ids-option [SCREEN-NAME] ip timestamp-option
set security screen ids-option [SCREEN-NAME] ip security-option
set security screen ids-option [SCREEN-NAME] ip stream-option
set security screen ids-option [SCREEN-NAME] ip loose-source-route-option
set security screen ids-option [SCREEN-NAME] ip strict-source-route-option
set security screen ids-option [SCREEN-NAME] ip source-route-option
# IP Options are mostly not used for Ingress from untrust and are in many cases obsolete, but they can be used for reconn
#
# Case 1.3
#
# Basic IP screening
#
set security screen ids-option [SCREEN-NAME] ip bad-option
# Blocks malformed packets
set security screen ids-option [SCREEN-NAME] ip unknown-protocol
# Blocks the packets with unknow protocol ID field
set security screen ids-option [SCREEN-NAME] ip block-frag
# Blocks IP fragments, NOT RECOMMENDED
set security screen ids-option [SCREEN-NAME] ip spoofing
# (RPF) Reverse Path Forwarding block
#
# Case 1.4
#
# Basic ICMP Screening
#
set security screen ids-option [SCREEN-NAME] icmp fragment
# Blocks ICMP IP fragments
set security screen ids-option [SCREEN-NAME] icmp large
# Blocks huge ICMP payloads
# Case 1.5
#
# Basic TCP Screening
#
set security screen ids-option [SCREEN-NAME] tcp tcp-no-flag
# Blocks the TCP IP packets with no flags set
set security screen ids-option [SCREEN-NAME] tcp syn-fin
# Blocks the TCP IP packets with SYN and FIN flags set
set security screen ids-option [SCREEN-NAME] tcp syn-frag
# Blocks the TCP IP packet fragemts with SYN flag set
#
# Case 1.6
#
# Basic Denial-of-Service Screening
#
set security screen ids-option [SCREEN-NAME] ip tear-drop
# Blocks the Teardrop attack, IP packet fragments overlapping with each other
set security screen ids-option [SCREEN-NAME] ip land
# Blocks the Land attack, IP packet with Source IP/Port same as Destination IP/Port
#
# Case 1.7
#
# Advanced Denial-of-Service and Distributed Denail-of-Service Screening
#
# Service Floods and Bandwidth Floods
#
# 1.7.1
#
# ICMP
set security screen ids-option [SCREEN-NAME] icmp flood threshold 10000
# Allows 10,000 ICMP packets/second only
# 1.7.2
#
# UDP
set security screen ids-option [SCREEN-NAME] udp flood threshold 50000
# Allows 50,000 UDP packets/second. BETTER BE LONG!
# 1.7.3
#
# TCP - When we talk about TCP floods, basically it is about SYN Floods
set security screen ids-option [SCREEN-NAME] tcp syn-flood timeout 10
# Timeout value for the embryonic sessions
set security screen ids-options [SCREEN-NAME] tcp syn-flood attack-threshold 1500
# IMPORTANT
#
# This will limit the sessions to per destination and port number PER SECOND, once this threshold is reached
# SRX with proxy the connections to the destination or the port.
set security screen ids-options [SCREEN-NAME] tcp syn-flood source-threshold 500
# Limits the SYN packets FROM a single source to any destination/port to 500
set security screen ids-options [SCREEN-NAME] tcp syn-flood destination-threshold 10000
# Limits the SYN packets TO a single destination from any source to 10,000 # WARNING
#
# 1.8
#
# Session table Screening
#
set security flow syn-flood-protection-mode syn-cookie
# Enables SYN cookies for the session table policing, uses MD5 for fingerprint
set security screen ids-option [SCREEN-NAME] tcp syn-ack-ack-proxy threshold 500
# SYN ->
# <- SYN+ACK
# -> ACK
# -> ACK
# -> ACK
#
# Enabled proxy once the threshold is reached for a single source
set security screen ids-options [SCREEN-NAME] limit-session limit-session destination-ip-based 20000
# Limit sessions TO a destination to 20,000 # WARNING, this is EGRESS
set security screen ids-options [SCREEN-NAME] limit-session limit-session source-ip-based 500
# Limit sessions FROM a source to 500, INGRESS
set security flow aging early-ageout 20
set security flow aging high-watermark 90 low-watermark 70
# Aggresively drops the sessions after 20 seconds once the session table reaches 90% capacity, comes back to normal once
# the session table drops to 70%
#
# 1.9
#
# Alarming the screens for testing before moving to production
#
set security screen ids-options [SCREEN-NAME] alarm-without-drop
# Sends an alarm to the event logs rather than taking the action specified
#
# 1.10
#
# Applying the screen
#
set security security zones security-zone [ZONE-NAME] screen [SCREEN-NAME]
# This will be applied to the entire zone, to all the interfaces that are mapped to it
# All thresholds configured will act for the entire zone, for all the mapped interfaces as a whole.
#
# 1.11
#
# Viewing the screens
#
show security screen statistics zone [ZONE-NAME]
show security screen ids-option [SCREEN-NAME]
show security screen statistics interface [INTERFACE-NAME]