This section will cover both network firewalls outside of Security Onion and the host-based firewall built into Security Onion.
This first sub-section will discuss network firewalls outside of Security Onion.
When configuring network firewalls for Internet-connected deployments (non-:ref:`airgap`), you'll want to ensure that the deployment can connect outbound (TCP/443) to the following:
- raw.githubusercontent.com (Security Onion public key)
- sigs.securityonion.net (Signature files for Security Onion containers)
- ghcr.io (Container downloads)
- pkg-containers.githubusercontent.com (Container downloads)
- rules.emergingthreatspro.com (Emerging Threats IDS rules)
- rules.emergingthreats.net (Emerging Threats IDS open rules)
- github.com (Strelka and Sigma rules updates)
- objects.githubusercontent.com (Strelka and Sigma rules updates)
If you are using our ISO image, you will also need access to the following:
- repo.securityonion.net (primary repo for Oracle Linux package updates)
- repo-alt.securityonion.net (secondary repo for Oracle Linux package updates)
- so-repo-east.s3.us-east-005.backblazeb2.com (secondary repo for Oracle Linux package updates)
If you are not using our ISO image and are instead performing a :ref:`network-installation`, you will also need access to the following:
- update repo for whatever base OS you're installing on (OS packages)
- download.docker.com (:ref:`docker` packages)
- repo.saltstack.com (:ref:`salt` packages)
If you choose to enable GeoIP updates for :ref:`elasticsearch`, you will also need access to the following:
- geoip.elastic.co
- storage.googleapis.com
If you choose to enable the Snort Talos ruleset, you will also need access to the following:
When configuring network firewalls for distributed deployments, you'll want to ensure that nodes can connect as shown below.
All nodes to Manager:
- TCP/443 - Sensoroni
- TCP/5000 - Docker registry
- TCP/8086 - influxdb
- TCP/4505 - Salt
- TCP/4506 - Salt
Elastic Agent:
- TCP/8220 (All nodes to Manager, Fleet nodes) - Elastic Agent management
- TCP/8443 (All nodes to Manager) - Elastic Agent binary updates
- TCP/5055 (All nodes to Manager, Fleet nodes, Receiver nodes) - Elastic Agent data
Elastic cluster nodes (manager and all search nodes) to all other Elastic cluster nodes (manager and all search nodes):
- TCP/9200 - Logstash connecting to :ref:`elasticsearch`
- TCP/9300 - Node-to-node for :ref:`elasticsearch`
Search nodes to Manager:
- TCP/9696 - :ref:`redis`
Elastic Fleet nodes to Manager:
- TCP/9200 - Node-to-node for :ref:`elasticsearch`
- TCP/5056 - Logstash-to-Logstash for Elastic Agent data ingest
Elastic Fleet nodes to Receiver nodes:
- TCP/5056 - Logstash-to-Logstash for Elastic Agent data ingest
The remainder of this section will cover the host firewall built into Security Onion.
Note
Security Onion locks down the firewall by default.
You can configure the firewall by going to :ref:`administration` --> Configuration --> firewall --> hostgroups.
If for some reason you can't access :ref:`soc` at all, you can use the so-firewall command to allow the IP address of your web browser to connect (replacing <IP ADDRESS>
with the actual IP address of your web browser):
sudo so-firewall includehost analyst <IP ADDRESS>
You can view the entire firewall configuration from the command line using the iptables
command like this:
sudo iptables -nvL
Warning
You can use this command to view the iptables configuration, but please do not modify the firewall manually using iptables as it is managed by :ref:`salt`. You should only make changes via the Configuration screen as shown above.
Port groups are a way of grouping together ports similar to a firewall port/service alias. For example, if you have a web server you might add ports 80 and 443 into a port group.
Host groups are similar to port groups but for storing lists of hosts that will be allowed to connect to the associated port groups.
The firewall state is designed with the idea of creating port groups and host groups, each with their own alias or name, and associating the two in order to create an allow rule. A node that has a port group and host group association assigned to it will allow those hosts to connect to those ports on that node.
The default allow rules for each node are defined by its role (manager, searchnode, sensor, heavynode, etc) in the grid. Host groups and port groups can be created or modified from the manager node by going to :ref:`administration` --> Configuration --> firewall --> hostgroups. When setup is run on a new node, it will ask the manager to add itself to the appropriate host groups. All node types are added to the minion host group to allow :ref:`salt` communication. If you were to add a search node, you would see its IP appear in both the minion
and the search_node
host groups.
When you go to :ref:`administration` --> Configuration --> firewall, you will only see hostgroups
by default. If you need to modify port groups, then you will need to click the Options
menu and then enable the Show advanced settings
option.
The analyst hostgroup is allowed access to the nginx ports which are 80 and 443 by default. In this example, we will extend the default nginx port group to include a custom port.
- At the top of the page, click the
Options
menu and then enable theShow advanced settings
option. - On the left side, go to
firewall
, selectportgroups
, locate thenginx
portgroup, and then selecttcp
. - On the right side, select the manager node, specify your custom port to be added, and then click the checkmark to save the value.
- If you would like to apply the rules immediately, click the
SYNCHRONIZE GRID
button under theOptions
menu at the top of the page.
In this example, we will add a new custom hostgroup to allow a custom set of hosts to connect to a custom port on an IDH node.
- At the top of the page, click the
Options
menu and then enable theShow advanced settings
option. - On the left side, go to
firewall
, selecthostgroups
, and then selectcustomhostgroup0
. - On the right side, select the IDH node that you want to allow access to, add the list of hosts that require access, and then click the checkmark to save the value.
- On the left side, go to
firewall
, selectportgroups
, selectcustomportgroup0
, and then select the appropriate protocol. - On the right side, select the IDH node that you want to allow access to, add your custom port, and then click the checkmark to save the value.
- On the left side, go to
firewall
,role
, and then selectidh
,chain
,DOCKER-USER
,hostgroups
,customhostgroup0
,portgroups
. - On the right side, select the IDH node that you want to allow access to, add the portgroup
customportgroup0
, and then click the checkmark to save the value. - The next time the IDH node checks in, it should get the appropriate firewall rules.