top of page

Firewall Automation - Part 1

6 days ago
1 min read

Define and Validate the Policy

Security Policy in Infrahub

Before we start looking at rules, let's define the policy. The policy states which IP flows are permited. The firewalls will likely only have a subset of these flows in the rule set.


In our example the INTERNAL zone is connected to the REMOTE-OFFICE zone via the VPN zone.

We have created a custom infrahub schema to define security policy.


Security zone objects contain the list of prefixes that are in the zone, firewall interfaces and destination endpoints.


Destination endpoints describe the prefixes and ports that are allowed from this zone. In this example zone REMOTE-OFFICE is permited to connect to INTERNAL-HTTP/S.


The endpoint allows 172.27.64.0/18, which is the lower half of the INTERNAL zone.


The endpoint allow ports 80 and 443, which are specified in service group HTTP and HTTPS.


So in summary, Destination Endpoint INTERNAL-HTTP/S permits flows from REMOTE-OFFICE to 172.27.64.0/18 on ports 80 and 443.


Validate with Kriten

We have writen a Python script to read policy from Infrahub and validate an access request. If valid, the script uses the Infrahub graph traversal feature to find the firewalls that need to be checked.


For example, say we need to check if request for source 10.10.10.50 to destination IP 172.27.64.50 port 80 is in policy. We know from this simple case that is should by endpoint INTERNAL-HTTP/S in REMOTE-OFFICE zone.


Run Kriten task validate-request
Run Kriten task validate-request
Kriten job result
Kriten job result

We can even run the task from a chat window with Kriten MCP configured.


In the next post, we'll look at using Infrahub and Kriten to check firewall rules and create a change request.

 
 
bottom of page