Server security / Stage 1 of 10 · step 6 of 7
Too much is visible from the network
Situation
node1 runs the Sever warehouse. nginx serves the customer site on port 80. The stock is kept in the
PostgreSQL database stock and edited in the admin panel, the lab-admin service. The admin panel is used only
from the server itself, through an SSH tunnel, and only the admin panel needs the database. A security scanner has
sent a report: more than the site and SSH is visible on node1 from the network.
node2 is a neighbouring machine on the same network. From there node1 looks the way it does to any outside
address: ssh node2 'command'. sudo works without a password on both machines.
Task
- From the network, node1 answers only on SSH (port
22) and the site (port80). Everything else is closed to node2 and to other addresses on the network, over IPv4 and over IPv6. - SSH and the site
http://node1/are open to node2 and to other addresses on the network. - On node1 itself the database and the admin panel work as before:
curl http://127.0.0.1:8080/shows the stock from thestockdatabase. - It stays so after node1 reboots.
The lab has no internet access, only the network between node1 and node2. Everything you need is installed on both machines. You reach node2 from node1 over SSH, and so does the check: don't close that path.
Lab goals
0 of 4-
Everything on node1 except SSH (22) and the site (80) is closed to the network — to node2 and other addresses, over IPv4 and IPv6 — not checked yet
-
SSH (22) and the site http://node1/ (80) are open to node2 and other addresses on the network — not checked yet
-
The database and the admin panel work on node1 — curl http://127.0.0.1:8080/ shows the stock from the stock database — not checked yet
-
It stays so after node1 reboots — the settings and rules are saved in files and the services are enabled — not checked yet