Firewalld Lab&Exercise
Firewalld Lab&Exercise
Guided Exercise
Outcomes
You should be able to configure firewall rules to control access to services.
1. From workstation, use SSH to log in to servera as student user. The systems are
configured to use SSH keys for authentication, so a password is not required.
2. On the servera system, ensure that both httpd and mod_ssl packages are installed. These
packages provide the Apache web server you will protect with a firewall, and the necessary
extensions for the web server to serve content over SSL.
534 RH199-RHEL8.2-en-1-20200928
Chapter 15 | Managing Network Security
6. From workstation, attempt to access your web server on servera using both the
cleartext port 80/TCP and the SSL encapsulated port 443/TCP. Both attempts should fail.
8. On servera, make sure that the nftables service is masked and the firewalld service
is enabled and running.
The results show that nftables is disabled and inactive but not masked. Run the
following command to mask the service.
RH199-RHEL8.2-en-1-20200928 535
Chapter 15 | Managing Network Security
8.3. Verify that the status of the firewalld service is enabled and running.
9. From workstation, open Firefox and log in to the Web Console running on servera to
add the httpd service to the public network zone.
9.2. Select the check box next to Reuse my password for privileged tasks to ensure
administrative privileges.
Log in as student user with student as the password.
9.5. Click the Add Services... button located in the upper right side of the Firewall page.
9.6. In the Add Services user interface, scroll down or use Filter Services to locate and
select the check box next to the Secure WWW (HTTPS) service.
536 RH199-RHEL8.2-en-1-20200928
Chapter 15 | Managing Network Security
9.7. Click the Add Services button located at the lower right side of the Add Services
user interface.
10. Return to a terminal on workstation and verify your work by attempting to view the web
server contents of servera.
Note
If you use Firefox to connect to the web server, it will prompt for verification of the
host certificate if it successfully gets past the firewall.
Finish
On workstation, run the lab netsecurity-firewalls finish script to complete this
exercise.
RH199-RHEL8.2-en-1-20200928 537
Chapter 15 | Managing Network Security
Lab
Outcomes
You should be able to configure firewall and SELinux settings on a web server host.
Your company has decided to run a new web app. This application listens on ports 80/TCP and
1001/TCP. Port 22/TCP for ssh access must also be available. All changes you make should
persist across a reboot.
Important: The graphical interface used in the Red Hat Online Learning environment needs
port 5900/TCP to remain available as well. This port is also known under the service name vnc-
server. If you accidentally lock yourself out from your serverb, you can either attempt to
recover by using ssh to your serverb machine from your workstation machine, or reset your
serverb machine. If you elect to reset your serverb machine, you must run the setup scripts for
this lab again. The configuration on your machines already includes a custom zone called ROL that
opens these ports.
1. From workstation, test access to the default web server at http://
serverb.lab.example.com and to the virtual host at http://
serverb.lab.example.com:1001.
2. Log in to serverb to determine what is preventing access to the web servers.
3. Configure SELinux to allow the httpd service to listen on port 1001/TCP.
4. From workstation, test access to the default web server at http://
serverb.lab.example.com and to the virtual host at http://
serverb.lab.example.com:1001.
5. Log in to serverb to determine whether the correct ports are assigned to the firewall.
6. Add port 1001/TCP to the permanent configuration for the public network zone. Confirm
your configuration.
538 RH199-RHEL8.2-en-1-20200928
Chapter 15 | Managing Network Security
Evaluation
On workstation, run the lab netsecurity-review grade command to confirm success of
this lab exercise.
Finish
On workstation, run the lab netsecurity-review finish script to complete this
exercise.
RH199-RHEL8.2-en-1-20200928 539