forked from aws-samples/aws-secure-environment-accelerator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirewall-example.txt
More file actions
702 lines (702 loc) · 17.2 KB
/
Copy pathfirewall-example.txt
File metadata and controls
702 lines (702 loc) · 17.2 KB
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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
config system global
set hostname ${Hostname}
set admintimeout 60
set vdom-mode split-vdom
set pre-login-banner enable
set admin-maintainer disable
set admin-https-ssl-versions tlsv1-2 tlsv1-3
set admin-ssh-grace-time 30
set fds-statistics disable
set security-rating-result-submission disable
set admin-lockout-duration 1800
set admin-telnet disable
set admintimeout 15
set timezone 12
end
config system settings
set allow-subnet-overlap enable
end
config global
config system interface
edit port1
set vdom FG-traffic
set alias public
set mode static
set ip ${PublicIp1} ${PublicMask}
set allowaccess ping https ssh fgfm
set secondary-IP enable
set mtu-override enable
set mtu 9001
set allowaccess ping https ssh probe-response
set role wan
next
edit port2
set vdom FG-traffic
set alias private
set mode static
set ip ${OnPremiseIp1} ${OnPremiseMask}
set allowaccess ping
set mtu-override enable
set mtu 9001
set role lan
next
edit port3
set vdom root
set alias mgmt
set mode static
set ip ${FWMgmtIp1} ${FWMgmtMask}
set allowaccess ping https ssh fgfm
set mtu-override enable
set mtu 9001
set role dmz
next
edit port4
set vdom FG-traffic
set alias DMZ
set mode static
set ip ${ProxyIp1} ${ProxyMask}
set allowaccess ping
set mtu-override enable
set mtu 9001
set role dmz
next
end
config system accprofile
edit "Read Only Admin"
set secfabgrp read
set ftviewgrp read
set authgrp read
set sysgrp read
set netgrp read
set loggrp read
set fwgrp read
set vpngrp read
set utmgrp read
set wanoptgrp read
set wifi read
next
end
config system password-policy
set status enable
set min-lower-case-letter 1
set min-upper-case-letter 1
set min-non-alphanumeric 1
set min-number 1
set expire-status enable
set reuse-password disable
end
config system dns
set primary 169.254.169.253
set secondary 169.254.169.253
end
config system autoupdate push-update
set status enable
end
config ips sensor
edit "g-default"
set scan-botnet-connections block
next
edit "g-wifi-default"
set scan-botnet-connections block
next
end
config system probe-response
set mode http-probe
end
config log syslogd setting
set facility user
set port 514
set server "future-rsyslog.nlb-domainname.com"
set status disable
set format default
set mode reliable
end
end
config vdom
edit FG-traffic
config router static
edit 1
set device port1
set gateway ${PublicRouterIp}
next
edit 2
set dst ${VpcNetworkIp} ${VpcMask}
set device port2
set gateway ${OnPremiseRouterIp}
next
edit 3
set dst ${FWMgmtNetworkIp} ${FWMgmtMask}
set device port2
set gateway ${OnPremiseRouterIp}
next
end
next
edit root
config router static
edit 1
set device port3
set gateway ${FWMgmtRouterIp}
next
end
config log disk setting
set full-first-warning-threshold 70
end
config log setting
set log-invalid-packet enable
end
end
config vdom
edit FG-traffic
config vpn ipsec phase1-interface
edit "tgw-vpn1"
set interface "port1"
set dpd enable
set local-gw ${PublicIp1}
set keylife 28800
set peertype any
set proposal aes256-sha256
set dhgrp 2
set remote-gw ${PublicVpnTunnelOutsideAddress1}
set psksecret ${PublicPreSharedSecret1}
set dpd-retryinterval 10
next
end
config vpn ipsec phase2-interface
edit "tgw-vpn1"
set phase1name "tgw-vpn1"
set proposal aes256-sha256
set dhgrp 2
set keylifeseconds 3600
next
end
config system interface
edit "tgw-vpn1"
set ip ${PublicCgwTunnelInsideAddress1} 255.255.255.255
set remote-ip ${PublicVpnTunnelInsideAddress1} 255.255.255.255
set explicit-web-proxy enable
set allowaccess ping
set type tunnel
set tcp-mss 1379
set mtu 1427
next
end
config firewall ippool
edit "cluster-ippool"
set startip ${PublicIp1}
set endip ${PublicIp1}
next
end
config firewall internet-service-group
edit "GROUP-Fortinet-ISDB"
set direction destination
set member 1245187 1245326 1245324 1245325 1245191 1245186 1245193 1245198 1245208 1245199 1245192 1245184 1245188 1245200 1245190 1245185
next
end
config system settings
set gui-dns-database enable
set gui-explicit-proxy enable
set gui-wireless-controller disable
set gui-waf-profile enable
end
config firewall address
edit "Dev1-ALB-FQDN"
set type fqdn
set associated-interface "tgw-vpn1"
set fqdn "Future-Manual-Dev1-alb-FQN.ca-central-1.elb.amazonaws.com"
next
edit "Dev2-ALB-FQDN"
set type fqdn
set associated-interface "tgw-vpn1"
set fqdn "Future-Manual-Dev2-alb-FQN.ca-central-1.elb.amazonaws.com"
next
edit "Test1-ALB-FQDN"
set type fqdn
set associated-interface "tgw-vpn1"
set fqdn "Future-Manual-Test1-alb-FQN.ca-central-1.elb.amazonaws.com"
next
edit "Test2-ALB-FQDN"
set type fqdn
set associated-interface "tgw-vpn1"
set fqdn "Future-Manual-Test2-alb-FQN.ca-central-1.elb.amazonaws.com"
next
edit "Prod1-ALB-FQDN"
set type fqdn
set associated-interface "tgw-vpn1"
set fqdn "Future-Manual-Prod1-alb-FQN.ca-central-1.elb.amazonaws.com"
next
edit "Prod2-ALB-FQDN"
set type fqdn
set associated-interface "tgw-vpn1"
set fqdn "Future-Manual-Prod2-alb-FQN.ca-central-1.elb.amazonaws.com"
next
edit "Public-Prod-ALB-FQDN"
set type fqdn
set fqdn "Future-Manual-PubProd-alb-FQN.ca-central-1.elb.amazonaws.com"
next
edit "Public-DevTestALB-FQDN"
set type fqdn
set fqdn "Future-Manual-PubDevTest-alb-FQN.ca-central-1.elb.amazonaws.com"
next
end
config ips sensor
edit "FG-Traffic-Baseline-IPS"
set comment "IPS baseline"
set block-malicious-url enable
set scan-botnet-connections block
config entries
edit 1
set os Windows
next
edit 2
set application IIS
next
edit 3
set application Apache
next
edit 4
set os Linux
next
end
next
end
config web-proxy explicit
set ipv6-status enable
end
config application list
edit "FG-Traffic-Baseline-App-Ctrl"
set comment "App Control Baseline"
set other-application-log enable
set unknown-application-action pass
set unknown-application-log enable
config entries
edit 1
set category 2 3 5 6 7 8 12 15 17 21 22 23 25 26 28 29 30 31 32
next
end
next
end
config antivirus profile
edit "FG-Traffic-Baseline-AV"
set comment "AV Baseline"
config http
set options scan
end
config ftp
set options scan
end
config imap
set options scan
set executables virus
end
config pop3
set options scan
set executables virus
end
config smtp
set options scan
set executables virus
end
config mapi
set options scan
set executables virus
end
next
end
config webfilter profile
edit "FG-Traffic-Baseline-Web-Filter"
set comment "Web Filter baseline"
set log-all-url enable
set web-filter-referer-log enable
config ftgd-wf
set options error-allow
config filters
edit 12
set category 12
set action warning
next
edit 2
set category 2
set action warning
next
edit 7
set category 7
set action warning
next
edit 8
set category 8
set action warning
next
edit 9
set category 9
set action warning
next
edit 11
set category 11
set action warning
next
edit 13
set category 13
set action warning
next
edit 14
set category 14
set action warning
next
edit 15
set category 15
set action warning
next
edit 16
set category 16
set action warning
next
edit 57
set category 57
set action warning
next
edit 63
set category 63
set action warning
next
edit 64
set category 64
set action warning
next
edit 65
set category 65
set action warning
next
edit 66
set category 66
set action warning
next
edit 67
set category 67
set action warning
next
edit 26
set category 26
set action block
next
edit 61
set category 61
set action block
next
edit 86
set category 86
set action block
next
edit 88
set category 88
set action block
next
edit 90
set category 90
set action block
next
edit 91
set category 91
set action block
next
edit 23
set action warning
next
end
end
next
end
config firewall vip
edit "Dev1-ALB"
set type fqdn
set extip ${PublicIp1}
set extintf "port1"
set portforward enable
set mapped-addr "Dev1-ALB-FQDN"
set extport 7002
set mappedport 443
next
edit "Dev2-ALB"
set type fqdn
set extip ${PublicIp1}
set extintf "port1"
set portforward enable
set mapped-addr "Dev2-ALB-FQDN"
set extport 7003
set mappedport 443
next
edit "Test1-ALB"
set type fqdn
set extip ${PublicIp1}
set extintf "port1"
set portforward enable
set mapped-addr "Test1-ALB-FQDN"
set extport 7004
set mappedport 443
next
edit "Test2-ALB"
set type fqdn
set extip ${PublicIp1}
set extintf "port1"
set portforward enable
set mapped-addr "Test2-ALB-FQDN"
set extport 7005
set mappedport 443
next
edit "Prod1-ALB"
set type fqdn
set extip ${PublicIp1}
set extintf "port1"
set portforward enable
set mapped-addr "Prod1-ALB-FQDN"
set extport 7001
set mappedport 443
next
edit "Prod2-ALB"
set type fqdn
set extip ${PublicIp1}
set extintf "port1"
set portforward enable
set mapped-addr "Prod2-ALB-FQDN"
set extport 7007
set mappedport 443
next
end
config firewall ssl-ssh-profile
edit "FG-Traffic-Baseline-SSL"
set comment "Baseline SSL deep Server Inspection"
config https
set ports 443
set status deep-inspection
end
config ftps
set ports 990
set status deep-inspection
end
config imaps
set ports 993
set status deep-inspection
end
config pop3s
set ports 995
set status deep-inspection
end
config smtps
set ports 465
set status deep-inspection
end
config ssh
set ports 22
set status disable
end
next
end
config firewall policy
edit 3
set name "in-vpn"
set srcintf "tgw-vpn1"
set dstintf "port2"
set srcaddr "all"
set dstaddr "all"
set action accept
set schedule "always"
set service "ALL"
set logtraffic all
set fsso disable
set logtraffic-start enable
next
edit 2
set name "out-vpn"
set srcintf "port2"
set dstintf "tgw-vpn1"
set srcaddr "all"
set dstaddr "all"
set action accept
set schedule "always"
set service "ALL"
set logtraffic all
set fsso disable
set logtraffic-start enable
next
edit 1
set name "outbound-all"
set srcintf "port2"
set dstintf "port1"
set srcaddr "all"
set dstaddr "all"
set action accept
set schedule "always"
set service "ALL"
set logtraffic all
set ippool enable
set poolname "cluster-ippool"
set nat enable
set logtraffic-start enable
next
edit 4
set name "Fortinet-activation-traffic"
set srcintf "port2"
set dstintf "port1"
set srcaddr "all"
set internet-service enable
set internet-service-group "GROUP-Fortinet-ISDB"
set action accept
set schedule "always"
set nat enable
next
edit 5
set name "Outbound Internet-All-Ports"
set srcintf "tgw-vpn1"
set dstintf "port1"
set srcaddr "all"
set dstaddr "all"
set action accept
set schedule "always"
set service "ALL"
set utm-status enable
set ssl-ssh-profile "certificate-inspection"
set av-profile "g-default"
set webfilter-profile "g-default"
set dnsfilter-profile "default"
set ips-sensor "g-default"
set application-list "g-default"
set logtraffic all
set nat enable
set fsso disable
set comments "DISABLED - Only allow outbound http/https traffic"
set status disable
next
edit 6
set name "in-TGW-out-internet-ALL-HTTP"
set srcintf "tgw-vpn1"
set dstintf "port1"
set srcaddr "all"
set dstaddr "all"
set action accept
set schedule "always"
set service "HTTPS" "HTTP"
set utm-status enable
set inspection-mode proxy
set http-policy-redirect enable
set ssl-ssh-profile "certificate-inspection"
set webfilter-profile "FG-Traffic-Baseline-Web-Filter"
set logtraffic all
set logtraffic-start enable
set auto-asic-offload disable
set fsso disable
set comments "All outbound cloud HTTP/HTTPS to Internet - Proxy"
set nat enable
next
edit 7
set name "in-internet-out-TGW-HTTP-PROD"
set srcintf "port1"
set dstintf "tgw-vpn1"
set srcaddr "all"
set dstaddr "Prod1-ALB" "Prod2-ALB"
set action accept
set schedule "always"
set service "HTTP" "HTTPS"
set utm-status enable
set ssl-ssh-profile "FG-Traffic-Baseline-SSL"
set av-profile "FG-Traffic-Baseline-AV"
set ips-sensor "FG-Traffic-Baseline-IPS"
set logtraffic all
set logtraffic-start enable
set ippool enable
set poolname "cluster-ippool"
set fsso disable
set comments "Inbound HTTP / HTTPS Traffic to Production cloud ALBs"
set nat enable
next
edit 8
set name "in-internet-out-TGW-HTTP-Dev-Test"
set srcintf "port1"
set dstintf "tgw-vpn1"
set srcaddr "all"
set dstaddr "Dev1-ALB" "Dev2-ALB" "Test1-ALB" "Test2-ALB"
set action accept
set schedule "always"
set service "HTTP" "HTTPS"
set utm-status enable
set ssl-ssh-profile "FG-Traffic-Baseline-SSL"
set av-profile "FG-Traffic-Baseline-AV"
set ips-sensor "FG-Traffic-Baseline-IPS"
set logtraffic all
set logtraffic-start enable
set ippool enable
set poolname "cluster-ippool"
set fsso disable
set comments "Inbound HTTP / HTTPS Traffic to Dev/Test/Ops cloud ALBs"
set nat enable
next
end
config firewall proxy-policy
edit 2
set proxy transparent-web
set srcintf "tgw-vpn1"
set dstintf "port1"
set srcaddr "all"
set dstaddr "all"
set service "webproxy"
set action accept
set schedule "always"
set logtraffic all
set utm-status enable
set ssl-ssh-profile "certificate-inspection"
set webfilter-profile "FG-Traffic-Baseline-Web-Filter"
next
end
config router prefix-list
edit "pflist-default-route"
config rule
edit 1
set prefix 0.0.0.0 0.0.0.0
unset ge
unset le
next
end
next
edit "pflist-port1-ip"
config rule
edit 1
set prefix ${PublicIp1} 255.255.255.255 # 100.96.251.69
unset ge
unset le
next
end
next
end
config router route-map
edit "rmap-outbound"
config rule
edit 1
set match-ip-address "pflist-default-route"
next
edit 2
set match-ip-address "pflist-port1-ip"
next
end
next
end
config router bgp
set as ${PublicCgwBgpAsn1}
set router-id ${PublicIp1}
set ebgp-multipath enable
set network-import-check disable
config neighbor
edit ${PublicVpnTunnelInsideAddress1}
set capability-default-originate enable
set remote-as ${PublicVpnBgpAsn1}
set route-map-out "rmap-outbound"
set link-down-failover enable
next
end
config network
edit 1
set prefix ${PublicIp1} 255.255.255.255
next
edit 2
set prefix ${OnPremiseNetworkIp} ${OnPremiseMask}
next
end
end
end