liveBook · Manning

Firewall rule

As explained in Cyber Threat Hunting

A firewall rule is a configuration that specifies network traffic conditions and the action a firewall takes when those conditions match.

A firewall rule specifies traffic conditions and the action taken when those conditions match. In practice, its direction, action, ports, sources, targets, and priority determine which connections are allowed or blocked. section 11.1.3 section 11.1.4

Treat unexpected allowed traffic as a configuration-change investigation. Compare normal and abnormal destination ports, locate the first change, identify the rule responsible, and verify whether the logs show attempts rather than established sessions. section 11.1.3

A repeatable investigation workflow is:

  • Chart allowed ingress connections by destination port, first over a broad time span and then around the suspected change. section 11.1.3
  • Count destination ports and compare the result before and after the change; a sudden increase can reveal an overly broad rule. section 11.1.3
  • Group events by rule reference to identify which rule allowed the traffic, then inspect its configuration and change history. section 11.1.3 section 11.1.4
  • Record the finding, disable an unauthorized permissive rule, and escalate the exposure for threat-hunting and incident-response follow-up. section 11.1.4 section 11.1.7
Listing 11.1 Charting for allowed inbound connections with 1-hour time span
@sourcetype = "gcp:firewall"                                     #1
| parseJson()                                                    #2
| "jsonPayload.rule_details.direction"="INGRESS" AND
 jsonPayload.rule_details.action="ALLOW"                         #3
| timeChart(span=1h, function=count(),
 series="jsonPayload.connection.dest_port")                      #4

Use the query listing to chart allowed GCP ingress connections by destination port and expose changes in the incoming traffic profile. section 11.1.3

The test-allow-all exposure

A junior administrator added the permissive GCP rule test-allow-all for testing and left it enabled. Around 12:05 UTC, unexpected incoming ports rose sharply; the rule allowed most of the traffic. The rule was disabled the next day, but exploitation could not be confirmed from firewall events alone. section 11.1.4 section 11.1.7

How Cyber Threat Hunting covers it

How deep it goes
Explains rule-based traffic attribution through timelines and fields, but stops short of proving that an allowed connection became an established session.
Examples
Uses GCP queries, destination-port charts, rule references, scanner findings, and the test-allow-all exposure case.
What you can do after
Diagnose with GCP firewall logs by locating unexpected ports, identifying the allowing rule, and documenting or escalating the exposure.
How it connects
Connects firewall rules with firewall logs, incoming connections, threat hunting, incident response, and internet scanner databases.

Also explained in

Compare how 2 books explain firewall rule →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Cyber Threat Hunting. The section links point to the parts of the book it draws on.