Bulk Import DFW Rules to NSX-T using Aria Automation
Managing a large number of Distributed Firewall (DFW) rules manually in NSX-T can be time-consuming and error-prone. In enterprise environments, firewall rules are often provided in bulk through spreadsheets and need to be applied consistently across policies.
In this blog, we’ll explore how to automate bulk creation and update of NSX-T DFW rules using VMware Aria Automation (vRA) and vRealize Orchestrator (vRO), driven by a CSV input file.
Use Case Overview
The goal of this automation is to:
-
Import firewall rules in bulk using a CSV file
-
Automatically create or update DFW rules in NSX-T
-
Enforce platform limits and validations
-
Support large-scale rule deployments in a controlled manner
This solution is ideal for:
-
Firewall rule migrations
-
Compliance-driven rule deployment
-
Large-scale application onboarding
Input CSV Format
The automation accepts a CSV file with the following fields:
-
Policy Name , Source , Destination, Protocol , Ports, Applied To
Each row in the CSV represents a firewall rule definition.
High-Level Automation Flow
- User requests a vRA catalog item for bulk DFW rule import
CSV file is uploaded and validated
vRO workflow processes each CSV entry
NSX-T REST APIs are used to create or update rules
-
Results are validated and logged
Automation Logic and Validations
1. CSV Validation
-
Validates file structure and mandatory fields
-
Invalid records are logged and skipped
-
Valid records continue processing
2. Policy Validation
-
Checks whether the target firewall policy exists
-
Automatically creates a new policy if required
3. Rule Create vs Update Logic
-
If the rule already exists → Update
-
If the rule does not exist → Create
-
Same workflow handles both scenarios
4. Protocol and Port Validation
-
Maximum 15 ports per rule enforced
-
If ports exceed the limit:
-
Ports are automatically split into multiple rules
-
-
Supports protocol updates (TCP, UDP, etc.)
5. Policy Scalability Control
-
NSX-T best practice: Maximum 1000 rules per policy
-
When limit is reached:
-
A new policy is created automatically
-
Rule creation continues under the new policy
6. Rule Naming
-
Rule names are auto-generated
-
Naming logic can be customized based on requirements
7. NSX-T REST API Execution
-
POST method for new rules
-
PUT method for updating existing rules
-
API responses are validated
-
Errors are logged for troubleshooting
Flowchart – Bulk DFW Rule Import
Demo Summary
In the demo video:
-
Bulk DFW rules are created from CSV using vRA
-
More than 600 firewall rules are deployed automatically
-
Existing rules are later updated using the same workflow
-
TCP and UDP protocols and ports are appended correctly
-
End-to-end automation completes successfully without manual intervention

Comments
Post a Comment