|
| 1 | +# |
| 2 | +# Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. |
| 3 | +# |
| 4 | +# |
| 5 | +# /etc/firewall/pf.conf |
| 6 | +# |
| 7 | +# |
| 8 | +# This is a sample PF firewall configuration file. Solaris currently ships with |
| 9 | +# PF firewall alternate to current IPF. PF is meant to replace IPF in future |
| 10 | +# Solaris releases. We encourage customers with customized IPF configuration to |
| 11 | +# try to migrate their firewall rules to PF. See our release notes/documentation |
| 12 | +# for hints how to migrate your custom configuration. |
| 13 | +# |
| 14 | +# There is no action for you if you are using default IPF configuration (a.k.a. |
| 15 | +# host based firewall). See svc.ipfd(1M) to find out how to check if you are |
| 16 | +# affected. |
| 17 | +# |
| 18 | + |
| 19 | +# |
| 20 | +# PF does IP reassembly by default. We also use 'no-df' option on Solaris |
| 21 | +# to ensure IP reassembly working with broken stacks which can send packets |
| 22 | +# with invalid flag combination 'MF|DF'. |
| 23 | +# |
| 24 | +set reassemble yes no-df |
| 25 | + |
| 26 | +# |
| 27 | +# We don't want PF to filter on loopback traffic by default. |
| 28 | +# |
| 29 | +# Filtering on loopback can interfere with zone installation and other |
| 30 | +# operations due to Solaris loopback optimizations. See the pf.conf(5) |
| 31 | +# manpage for guidance on how to enable it for your application. |
| 32 | +set skip on lo0 |
| 33 | + |
| 34 | +## block everything unless told otherwise |
| 35 | +## and send TCP-RST/ICMP unreachable |
| 36 | +## for every packet which gets blocked |
| 37 | +block return log |
| 38 | + |
| 39 | +## accept incoming icmp pkts e.g. ping |
| 40 | +pass in proto icmp from any to any |
| 41 | + |
| 42 | +## accept incoming SSH connections |
| 43 | +pass in proto tcp to any port 22 flags any keep state (sloppy) |
| 44 | + |
| 45 | +## accept connections for rsyslog |
| 46 | +pass in proto tcp from any to any port = 6514 |
| 47 | + |
| 48 | +## includes |
| 49 | +; walk each instance and extract all properties from the config PG |
| 50 | +;$%/(svc:/$%s:(.*)/:properties)/{ |
| 51 | +$%/(svc:/$%s:(.*)/:properties)/{$%/$%1/include/(.*)/{include "$%{$%1/include/$%3}" |
| 52 | +}} |
| 53 | + |
| 54 | +## allow all connections initiated from this system, |
| 55 | +## including DHCP requests |
| 56 | +pass out |
0 commit comments