Firewalls, services and configuration

Unit 4 of 5 in Testing networks and hosts.

You will be able to test a firewall policy against what you expected, read cleartext and exposed services as an assessor, and write each finding with its fix.

Lesson

Review the rules as well as the traffic

NIST's ruleset review looks at firewall and intrusion detection rulesets and router access control lists to find gaps, policy violations and unintended communication paths. For router access lists, its example checks are that each rule is still required, that rules added temporarily are removed when no longer needed, and that only traffic authorized by policy is permitted with everything else denied by default.

For firewalls, the same section lists checks such as: each rule is still required, rules enforce least privilege by naming only required addresses and ports, more specific rules are triggered before general ones, there are no unnecessary open ports and the ruleset does not allow traffic to bypass other defenses. The lab approach is to write the policy and the expected results first, then measure, then compare. A rule that is too broad shows up as a mismatch between the expected and the actual column.

Read the result, not the rule

A scan from each side of the firewall is how you see what the rules do. The Nmap guide says a closed port is reachable but has nothing listening, and that an administrator who blocks it with a firewall will see it appear as filtered. A filtered port gives so little information that the guide says it frustrates attackers: many filters drop probes silently, which makes Nmap retry and slows the scan down.

For an assessor that means the matrix has to record the state and where the probe came from, and a filtered result is the evidence that a rule is working. Network sniffing behind the firewall is a second check: NIST lists assessing that rulesets are accurately filtering traffic among the reasons for placing a sniffer behind a firewall.

Cleartext services are findings you can show

NIST describes network sniffing as a passive technique that monitors communication, decodes protocols and examines headers and payloads. Among its uses are identifying unsecured protocols such as telnet and collecting unencrypted usernames and passwords. It adds the limits: encryption hides the contents, and a sniffer sees only the segment it is connected to.

That is the evidence for a cleartext-login finding: a short capture of your own lab traffic, kept as a file, shows what anyone on the segment could read. The fix is to replace the service, not to hide it, and the proof is a re-scan showing the port closed. The telnet lab walks the whole path and uses only a documented account on a machine in your sealed lab.

System configuration review

NIST's system configuration review looks for security configuration weaknesses such as unnecessary services and applications, improper account and password settings, and improper logging and backup settings. Manual review compares a device's settings with a security configuration guide or checklist and flags what does not meet it. NIST says it is generally preferable to use automated checks where feasible, because they are fast and give consistent, repeatable results, whereas checking hundreds or thousands of settings by hand is tedious and error-prone, and that both approaches need administrator access to see some settings.

Remote exposure and weak accounts are separate questions and should be separate findings. A database that listens on every network interface and a database account with no password are two problems with two fixes: bind it to the loopback interface or block the port at the router, and give every account a real password and least privilege. The MySQL lab practises exactly that split, and the SSH and SNMP labs apply the same idea to remote login and device management: look at what is offered, rate it, change the configuration, and re-test with the same commands.

Key points

Sources

Lecture

Hardening baselines as code: Secure settings written down, applied and checked: the target state you compare services and configuration against.

Practice in the labs

Test a rule set against a written policy, show why a cleartext service is a finding, and assess and fix exposed services in your sealed lab.

Also try, in the simulators

Knowledge check

  1. Which of these is a ruleset-review check NIST lists for router access control lists? Answer: Only traffic authorized by policy is permitted and all other traffic is denied by default. NIST lists deny by default and removal of rules added for temporary purposes among its router ACL checks.
  2. A port that was closed now shows filtered after a firewall rule is added. What happened? Answer: The rule is blocking probes, so Nmap can no longer tell whether anything is listening. Nmap's guide says a filtered port is one where packet filtering prevents its probes from reaching it, and that blocking a closed port makes it appear filtered.
  3. Why is a short capture of your own Telnet login good evidence for a finding? Answer: It shows what anyone on the same segment could read, and it is a file you can keep with a hash. NIST lists collecting unencrypted usernames and passwords among uses of sniffing, and notes encryption is what limits it.
  4. Why should a database that listens on all interfaces and has an account with no password be two findings? Answer: They have different fixes: restrict where it listens, and give accounts passwords and least privilege. Exposure and weak accounts are separate weaknesses; fixing one does not fix the other, and each needs its own re-test.

Back to the syllabus or see all classes.

Related