pfsense:install_pfsense:create_firewall_rules
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
pfsense:install_pfsense:create_firewall_rules [2021/01/05 17:12] – [CLEAR Firewall Rules] peter | pfsense:install_pfsense:create_firewall_rules [2022/10/20 09:12] (current) – [IOT Firewall Rules] peter | ||
---|---|---|---|
Line 12: | Line 12: | ||
====== LAN Firewall Rules ====== | ====== LAN Firewall Rules ====== | ||
+ | |||
+ | Navigate to **Firewall -> Rules -> LAN**. | ||
LAN Firewall rules will cover: | LAN Firewall rules will cover: | ||
Line 17: | Line 19: | ||
* Anti-Lockout to ensure you can always gain access to pfSense. | * Anti-Lockout to ensure you can always gain access to pfSense. | ||
* Allow ICMP pings to facilitate debugging. | * Allow ICMP pings to facilitate debugging. | ||
- | * Allow traffic to the local networks on approved ports. | + | * Allow all other traffic, internal |
- | * Allow internet traffic on approved ports. | + | |
- | * Redirect any non-local DNS lookups back to the pfSense DNS server. | + | |
- | * Redirect any non-local NTP time lookups back to the pfSense time server. | + | |
- | * Reject any other traffic. <WRAP info> | + | |
- | **NOTE: | + | |
- | </ | + | |
---- | ---- | ||
===== Anti-Lockout ===== | ===== Anti-Lockout ===== | ||
- | |||
There should be a default **Anti-Lockout** rule already created on this page. | There should be a default **Anti-Lockout** rule already created on this page. | ||
Line 35: | Line 29: | ||
{{: | {{: | ||
- | There should also be Permit Traffic Rules. | ||
- | |||
- | {{: | ||
- | |||
- | <WRAP info> | ||
- | **NOTE: | ||
- | |||
- | This may be too Open, as they allow all traffic. | ||
- | |||
- | To secure this better, these default rules we will blocked and replaced with only allowing specific traffic. | ||
- | |||
- | </ | ||
---- | ---- | ||
Line 52: | Line 34: | ||
===== Allow ICMP Pings ===== | ===== Allow ICMP Pings ===== | ||
- | * Click **Add (up arrow)**. | + | * Click **Add (up arrow)**. Add this above the default **Permit Traffic Rules**. |
* Action: | * Action: | ||
* Disabled: | * Disabled: | ||
Line 66: | Line 48: | ||
{{: | {{: | ||
- | ---- | + | <WRAP info> |
+ | **NOTE: | ||
- | ===== Allow local traffic from LAN interface | + | The reason this is included here separately is that we log any pings, and to cater for future changes. |
- | <WRAP center round todo 60%> | ||
- | TODO: Not currently used. Check this out and update etc. | ||
</ | </ | ||
- | |||
- | |||
- | Navigate to **Firewall -> Rules**. | ||
- | |||
- | Select **LAN**. | ||
- | |||
- | * Click **Add (up arrow)**. | ||
- | * Action: | ||
- | * Disabled: | ||
- | * Interface: | ||
- | * Address Family: | ||
- | * Protocol: **TCP/ | ||
- | * Source: | ||
- | * Destination: | ||
- | * Invert Match: | ||
- | * Single Host or alias: | ||
- | * Destination Port Range: | ||
- | * From: **Other** | ||
- | * Custom: | ||
- | * To: **Other**. | ||
- | * Custom: | ||
- | * Log: **Not Checked**. | ||
- | * Description: | ||
---- | ---- | ||
- | ===== Allow traffic from LAN interface to Internet | + | ===== Permit Traffic Rules ===== |
- | <WRAP center round todo 60%> | + | There should already be default Permit Traffic Rules. |
- | TODO: Not currently used. Check this out and update etc. | + | |
- | </ | + | |
- | We identify traffic destined for the internet as to an interface which is NOT a LOCAL_SUBNETS. | + | {{:pfsense:install_pfsense:pfsense_-_firewall_-_rules_-_lan_-_permit_traffic_rules.png?800|}} |
- | + | ||
- | Navigate to **Firewall -> Rules**. | + | |
- | + | ||
- | Select **LAN**. | + | |
- | + | ||
- | * Click **Add (up arrow)**. | + | |
- | * Action: | + | |
- | * Disabled: **Not Checked**. | + | |
- | * Interface: | + | |
- | * Address Family: | + | |
- | * Protocol: **TCP/ | + | |
- | * Source: | + | |
- | * Destination: | + | |
- | * Invert Match: | + | |
- | * Single Host or alias: | + | |
- | * Destination Port Range: | + | |
- | * From: **Other** | + | |
- | * Custom: | + | |
- | * To: **Other**. | + | |
- | * Custom: | + | |
- | * Log: **Not Checked**. | + | |
- | * Description: | + | |
- | + | ||
- | + | ||
- | ---- | + | |
- | + | ||
- | ===== Block unknown IPv4 ===== | + | |
- | + | ||
- | <WRAP center round todo 60%> | + | |
- | TODO: Not currently used. Check this out and update etc. | + | |
- | </ | + | |
- | + | ||
- | * Click **↴+Add** | + | |
- | * Action: | + | |
- | * Disabled: | + | |
- | * Interface: | + | |
- | * Address Family: | + | |
- | * Protocol: | + | |
- | * Source = **Any**. | + | |
- | * Destination: | + | |
- | * Log: **Checked**. | + | |
- | * Description: | + | |
- | * Click **Save**. | + | |
<WRAP info> | <WRAP info> | ||
- | **NOTE: | + | **NOTE: |
- | </ | + | |
- | ---- | + | This may be too Open, as they allow all traffic. |
- | ===== Block unknown IPv6 ===== | + | To secure this better, these default rules could be blocked and replaced with only allowing specific traffic. |
- | <WRAP center round todo 60%> | ||
- | TODO: Not currently used. Check this out and update etc. | ||
- | </ | ||
- | |||
- | * Click **↴+Add**. | ||
- | * Action: | ||
- | * Disabled: | ||
- | * Interface: | ||
- | * Address Family: | ||
- | * Protocol: | ||
- | * Source: | ||
- | * Destination: | ||
- | * Log: **Not Checked**. | ||
- | * Description: | ||
- | * Click **Save**. | ||
- | |||
- | <WRAP info> | ||
- | **NOTE: | ||
</ | </ | ||
---- | ---- | ||
- | ===== Disable the Permit Traffic Rules ===== | + | The final ruleset for the LAN will be: |
- | + | ||
- | <WRAP center round todo 60%> | + | |
- | TODO: Not currently used. Check this out and update etc. | + | |
- | </ | + | |
- | + | ||
- | The default Permit Traffic Rules rules should be right at the bottom. | + | |
- | + | ||
- | They will never be reached, as the **Block unknown IPv4** and **Block unknown IPv6** rules would have blocked anything else. | + | |
- | + | ||
- | However, to be safe it is suggested these be disabled. | + | |
- | + | ||
- | Click the Tick Mark against these rules to disable them for now. | + | |
- | + | ||
- | <WRAP info> | + | |
- | **NOTE:** These firewall rules can also be deleted. | + | |
- | + | ||
- | But safer to keep them in for now, to quickly re-enable if needed. | + | |
- | + | ||
- | For now, ensure that both these rules are right at the bottom of all other firewall rules against the LAN, | + | |
- | + | ||
- | </ | + | |
+ | {{: | ||
---- | ---- | ||
Line 208: | Line 82: | ||
====== CLEAR Firewall Rules ====== | ====== CLEAR Firewall Rules ====== | ||
- | + | Navigate to **Firewall -> Rules -> CLEAR**. | |
- | + | ||
- | + | ||
- | + | ||
- | <WRAP center round todo 60%> | + | |
- | TODO: Not currently used. Check this out and update etc. | + | |
- | </ | + | |
The requirements for this interface are: | The requirements for this interface are: | ||
- | * Allow ICMP pings to facilitate debugging. | + | * Allow access |
- | * Allow traffic to local networks on approved ports. | + | * Allow internet traffic. |
- | * Allow internet | + | |
- | * Allow non-local DNS lookups. | + | |
- | * Allow non-local NTP time lookups. | + | |
- | * Reject any other traffic. | + | |
---- | ---- | ||
- | ===== Allow ICMP Pings ===== | + | ===== Allow traffic from CLEAR interface to Printers |
- | + | ||
- | <WRAP center round todo 60%> | + | |
- | TODO: Not currently used. Check this out and update etc. | + | |
- | </ | + | |
Navigate to **Firewall -> Rules**. | Navigate to **Firewall -> Rules**. | ||
Line 239: | Line 97: | ||
Select **CLEAR**. | Select **CLEAR**. | ||
- | * Click **↴+Add**. | + | * Click **Add (up arrow)**. |
- | * Action: | + | |
- | * Disabled: | + | |
- | * Interface: | + | |
- | * Address Family: | + | |
- | * Protocol: | + | |
- | * ICMP subtype: | + | |
- | * Source: | + | |
- | * Destination: | + | |
- | * Log: **Not Checked**. | + | |
- | * Description: | + | |
- | + | ||
- | ---- | + | |
- | + | ||
- | ===== Allow local traffic from CLEAR interface to all other subnets ===== | + | |
- | + | ||
- | <WRAP center round todo 60%> | + | |
- | TODO: Not currently used. Check this out and update etc. | + | |
- | </ | + | |
- | + | ||
- | Navigate to **Firewall -> Rules**. | + | |
- | + | ||
- | Select **CLEAR**. | + | |
- | + | ||
- | * Click **↴+Add**. | + | |
* Action: | * Action: | ||
* Disabled: | * Disabled: | ||
Line 272: | Line 106: | ||
* Destination: | * Destination: | ||
* Invert Match: | * Invert Match: | ||
- | * Single Host or alias: | + | * Single Host or alias: |
- | * Destination Port Range: | + | * Log: **Checked**. |
- | * From: **Other** | + | * Description: |
- | * Custom: | + | |
- | * To: **Other**. | + | |
- | * Custom: | + | |
- | * Log: **Not Checked**. | + | |
- | * Description: | + | |
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | </ | ||
---- | ---- | ||
- | ===== Allow traffic from CLEAR interface to Internet ===== | + | ===== Allow traffic from CLEAR interface to the Internet ===== |
- | + | ||
- | <WRAP center round todo 60%> | + | |
- | TODO: Not currently used. Check this out and update etc. | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | We identify traffic destined for the internet as to an interface which is NOT a LOCAL_SUBNETS. | + | |
Navigate to **Firewall -> Rules**. | Navigate to **Firewall -> Rules**. | ||
Line 297: | Line 122: | ||
Select **CLEAR**. | Select **CLEAR**. | ||
- | * Click **↴+Add**. | + | * Click **Add (up arrow)**. |
* Action: | * Action: | ||
* Disabled: | * Disabled: | ||
* Interface: | * Interface: | ||
* Address Family: | * Address Family: | ||
- | * Protocol: **TCP/UDP**. | + | * Protocol: **ANY**. |
* Source: | * Source: | ||
- | | + | * Destination: |
- | * Invert Match: | + | |
- | * Single Host or alias: | + | |
- | * Destination Port Range: | + | |
- | * From: **Other** | + | |
- | * Custom: | + | |
- | * To: **Other**. | + | |
- | * Custom: | + | |
- | * Log: **Not Checked**. | + | |
- | * Description: | + | |
- | + | ||
- | <WRAP info> | + | |
- | **NOTE: | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | ---- | + | |
- | + | ||
- | ===== Block unknown IPv4 ===== | + | |
- | + | ||
- | <WRAP center round todo 60%> | + | |
- | TODO: Not currently used. Check this out and update etc. | + | |
- | </ | + | |
- | + | ||
- | * Click **↴+Add** | + | |
- | * Action: | + | |
- | * Disabled: | + | |
- | * Interface: | + | |
- | * Address Family: | + | |
- | * Protocol: | + | |
- | * Source: | + | |
- | | + | |
* Log: **Checked**. | * Log: **Checked**. | ||
- | * Description: | + | * Description: |
- | * Click **Save**. | + | |
<WRAP info> | <WRAP info> | ||
- | **NOTE: | + | **NOTE: |
</ | </ | ||
---- | ---- | ||
- | ===== Block unknown IPv6 ===== | + | The final ruleset for the CLEAR will be: |
- | <WRAP center round todo 60%> | + | {{:pfsense:install_pfsense:pfsense_-_firewall_-_rules_-_clear.png?800|}} |
- | TODO: Not currently used. Check this out and update etc. | + | |
- | </ | + | |
- | + | ||
- | * Click **↴+Add**. | + | |
- | * Action: | + | |
- | * Disabled: **Not Checked**. | + | |
- | * Interface: | + | |
- | * Address Family: | + | |
- | * Protocol: | + | |
- | * Source: | + | |
- | * Destination: | + | |
- | * Log: **Not Checked**. | + | |
- | * Description: | + | |
- | * Click **Save**. | + | |
- | + | ||
- | <WRAP info> | + | |
- | **NOTE: | + | |
- | </ | + | |
---- | ---- | ||
====== IOT Firewall Rules ====== | ====== IOT Firewall Rules ====== | ||
+ | |||
+ | Navigate to **Firewall -> Rules -> IOT**. | ||
IOT devices should be prevented from accessing anything that is not-essential to them. | IOT devices should be prevented from accessing anything that is not-essential to them. | ||
Line 377: | Line 154: | ||
* Allow ICMP pings to facilitate debugging. | * Allow ICMP pings to facilitate debugging. | ||
+ | * Redirect any non-local DNS lookups. | ||
+ | * Redirect any non-local NTP time lookups. | ||
* Deny traffic to other internal interfaces. | * Deny traffic to other internal interfaces. | ||
* Deny traffic to any local networks. | * Deny traffic to any local networks. | ||
* Allow internet traffic via default gateway. | * Allow internet traffic via default gateway. | ||
- | * Redirect any non-local DNS lookups. | ||
- | * Redirect any non-local NTP time lookups. | ||
* Reject any other traffic. | * Reject any other traffic. | ||
Line 399: | Line 176: | ||
* Log: **Not Checked**. | * Log: **Not Checked**. | ||
* Description: | * Description: | ||
- | |||
- | ---- | ||
- | |||
- | ===== Deny traffic to other internal interfaces ===== | ||
- | |||
- | Navigate to **Firewall -> Rules**. | ||
- | |||
- | Click **IOT**. | ||
- | |||
- | * Click **↴+Add**. | ||
- | * Action: | ||
- | * Disabled: | ||
- | * Interface: | ||
- | * Address Family: | ||
- | * Protocol: | ||
- | * Source: | ||
- | * Destination: | ||
- | * Invert match: | ||
- | * **Single host or alias**. | ||
- | * Address: | ||
- | * Destination Port Range: | ||
- | * From: **Any**. | ||
- | * To: **Any**. | ||
- | * Log: **Not Checked**. | ||
- | * Description: | ||
- | * Click **Save**. | ||
---- | ---- | ||
Line 501: | Line 252: | ||
There should be two rules created for the NTP and DNS redirects at the bottom. | There should be two rules created for the NTP and DNS redirects at the bottom. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Reject traffic to other internal interfaces ===== | ||
+ | |||
+ | Navigate to **Firewall -> Rules**. | ||
+ | |||
+ | Click **IOT**. | ||
+ | |||
+ | * Click **↴+Add**. | ||
+ | * Action: | ||
+ | * Disabled: | ||
+ | * Interface: | ||
+ | * Address Family: | ||
+ | * Protocol: | ||
+ | * Source: | ||
+ | * Destination: | ||
+ | * Invert match: | ||
+ | * **Single host or alias**. | ||
+ | * Address: | ||
+ | * Destination Port Range: | ||
+ | * From: **Any**. | ||
+ | * To: **Any**. | ||
+ | * Log: **Not Checked**. | ||
+ | * Description: | ||
+ | * Click **Save**. | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | </ | ||
---- | ---- | ||
Line 521: | Line 302: | ||
* To: **Any**. | * To: **Any**. | ||
* Log: **Not Checked**. | * Log: **Not Checked**. | ||
- | * Description: | + | * Description: |
* Click **Save**. | * Click **Save**. | ||
Line 563: | Line 344: | ||
**NOTE: | **NOTE: | ||
</ | </ | ||
+ | |||
+ | |||
+ | ---- | ||
+ | |||
+ | The final ruleset for the IOT will be: | ||
+ | |||
+ | {{: | ||
---- | ---- | ||
Line 613: | Line 401: | ||
* Source: | * Source: | ||
* Destination: | * Destination: | ||
- | * Invert match: | + | * Invert match: |
* **Single host or alias**. | * **Single host or alias**. | ||
* Address: | * Address: | ||
Line 619: | Line 407: | ||
* From: **Any**. | * From: **Any**. | ||
* To: **Any**. | * To: **Any**. | ||
- | * Log: **Not Checked**. | + | * Log: **Checked**. |
* Description: | * Description: | ||
* Click **Save**. | * Click **Save**. | ||
Line 634: | Line 422: | ||
* Interface: | * Interface: | ||
* Address Family: | * Address Family: | ||
- | * Protocol: | + | * Protocol: |
* Source: | * Source: | ||
- | * Destination | + | * Destination: |
- | * Invert match: | + | |
- | * **Single host or alias**. | + | |
- | * Address: | + | |
- | * Destination Port Range: | + | |
- | * From: **Any**. | + | |
- | * To: **Any**. | + | |
* Log: **Not Checked**. | * Log: **Not Checked**. | ||
- | * Description: | + | * Description: |
* Click **Save**. | * Click **Save**. | ||
Line 654: | Line 436: | ||
---- | ---- | ||
- | ===== Block unknown IPv4 ===== | + | The final ruleset for the GUEST will be: |
- | * Click **↴+Add** | + | {{:pfsense:install_pfsense:pfsense_-_firewall_-_rules_-_guest.png?800|}} |
- | * Action: | + | |
- | * Disabled: **Not Checked**. | + | |
- | * Interface: | + | |
- | * Address Family: | + | |
- | * Protocol: | + | |
- | * Source = **Any**. | + | |
- | * Destination: | + | |
- | * Log: **Checked**. | + | |
- | * Description: | + | |
- | * Click **Save**. | + | |
- | + | ||
- | <WRAP info> | + | |
- | **NOTE: | + | |
- | </ | + | |
- | + | ||
- | ---- | + | |
- | + | ||
- | ===== Block unknown IPv6 ===== | + | |
- | + | ||
- | * Click **↴+Add**. | + | |
- | * Action: | + | |
- | * Disabled: | + | |
- | * Interface: | + | |
- | * Address Family: | + | |
- | * Protocol: | + | |
- | * Source: | + | |
- | * Destination: | + | |
- | * Log: **Not Checked**. | + | |
- | * Description: | + | |
- | * Click **Save**. | + | |
- | + | ||
- | <WRAP info> | + | |
- | **NOTE: | + | |
- | </ | + | |
---- | ---- |
pfsense/install_pfsense/create_firewall_rules.1609866736.txt.gz · Last modified: 2021/01/05 17:12 by peter