[ norboten ]
rhcsa · lab rhcsa-04

The Site Nobody Can Reach

· about 50 minutes · runs on rocky-10 · unrated

An unrated lab. It runs on your machine with no account and no network, and everything about it — the faults, the checks, the hints and the reference solution — is in the repository. An attempt on it is recorded on your profile and never moves a rating: only rated labs do. Rated and unrated labs.

The briefing

The team moved the internal status site to this server. nginx now serves it from /srv/status on port 8090, and proxies /api/ to a small status service on 127.0.0.1:9100.

It does not work. nginx does not stay up, nothing is logged that makes sense to anyone, and when it did run for a moment the page was "403 Forbidden" and /api/ was "502 Bad Gateway".

The same change request also asked for this server to be known as web01.lab.example with an additional address 192.168.5.50/24 on eth0. Someone did that by hand. It did not survive the last reboot.

What is expected, and graded:

  1. http://127.0.0.1:8090/ serves the page from /srv/status.
  2. http://127.0.0.1:8090/api/status returns the status service's answer through nginx.
  3. The files in /srv/status have the right SELinux context — one that a full relabel keeps.
  4. Port 8090/tcp is open in the active firewalld zone, now and after reboot.
  5. The hostname and the extra address are configured persistently.
  6. SELinux stays in enforcing mode.

What is graded

The machine is checked, rebooted, and checked again. A check passes only if it passes both times.

CheckObjective
01_site_served_on_8090Manage SELinux port labels
02_api_reached_through_nginxUse Boolean settings to modify system SELinux settings
03_contexts_survive_relabelRestore default file contexts
04_firewall_open_persistentlyConfigure firewall settings using firewall-cmd/firewalld
05_network_config_persistentConfigure IPv4 and IPv6 addresses
06_selinux_enforcingSet enforcing and permissive modes for SELinux

Start it

  1. 2Labs
  2. rhcsa-04select this one
  3. udownload it
  4. sstart the machine

Reading

Where the lab's hints send you, level by level, as you ask for them (h, then l opens a journal section in the TUI).

Theory for this lab

4 questions on the same topic, in the lab's Theory tab. They never affect the lab's grade. Three of them, to answer here:

Question 1

Why is `chcon -t httpd_sys_content_t /srv/site` not a lasting fix?

Question 2

nginx cannot bind port 8090 and SELinux logs a denial. What is the fix that keeps SELinux enforcing?

Question 3

What does the -P in `setsebool -P httpd_can_network_connect on` do?