orcharhino Security Guide¶
orcharhino uses SELinux and firewalld.
Firewall Configuration¶
Note
This is not an exhaustive introduction or documentation of firewalld
.
Please refer to the official firewalld documentation or the firewalld documentation of your operating system vendor before making any changes to your firewall configuration.
orcharhino uses firewalld.
It’s enabled by default on every Kickstart installation and available on CentOS, Oracle Linux, and Red Hat Enterprise Linux version 7 or newer.
The firewall daemon can be enabled by running systemctl enable firewalld
and started/stopped via systemctl {start|stop} firewalld
.
Running systemctl status firewalld
shows whether the firewall service is currently running; firewall-cmd --help
shows the inbuilt documentation.
firewalld relies on zones and services:
Zones define the level of trust of a connection. One interface, source, or connection belongs to exactly one zone; one zone can be used by many interfaces, sources, or connections. By default, zone example files are located at
/usr/lib/firewalld/zones/
and describe an individual zone.firewall-cmd --list-all-zones
lists all available zones on your machine. Refer to the official documentation for more information about zones in firewalld or the firewalld documentation of your operating system vendor.Services bundle and allow traffic regarding certain ports and protocols. By default, SSH, DNS, HTTP, and HTTPS services are added to the public zone. An orcharhino tailor-made service is defined at
/usr/lib/firewalld/services/orcharhino.xml
and specifies several ports and protocols, e.g. port80
withtcp
protocol for the orcharhino web server.Warning
Do not overwrite
/usr/lib/firewalld/services/orcharhino.xml
as this file is being managed by orcharhino itself and will be overwritten with every upgrade.
Adding a Custom Service¶
firewall-cmd --zone=internal --list-all
lists all services of the internal zone.
firewall-cmd --permanent --zone=work --add-service=orcharhino
allows you to enable the orcharhino service for the work zone permanently, i.e. persistent after rebooting.
Make sure to reload the firewalld configuration afterwards: firewall-cmd --complete-reload
.
This can be reverted by running firewall-cmd --permanent --zone=work --remove-service=orcharhino
.
You can also add or disable arbitrary services like HTTP.
Refer to the official documentation for more information about services in firewalld or the firewalld documentation of your operating system vendor.
Opening a Custom Port¶
Specific ports on your orcharhino can be opened or closed by running the following command: firewall-cmd --permanent --remove-port=5000/tcp
(e.g. Katello for Docker registry).
Run firewall-cmd --complete-reload
to reload the firewalld configuration.
Revert removing a port by using the --add-port=PORT/PROTOCOL
option.
Altering the Firewall Configuration¶
You can change the firewall configuration by adding a custom service.
Write a custom service and save it in the /etc/firewalld/services/
directory.
Run firewall-cmd --permanent --zone=internal --new-service-from-file=my_service.xml
to add your service to the internal zone and reload the firewalld configuration: firewall-cmd --complete-reload
.
Warning
Make sure to not remove the SSH service unless you have other means of accessing your orcharhino.