Skip to content
Scott Ware edited this page Jun 13, 2019 · 29 revisions

This page will help to show you how the CSV file is formatted when used to import and update rules in a policy.

CSV Structure

When importing a CSV to create rules or modify them, the file MUST have the following fields in this order:

Name,Type,Description,Tags,SourceZones,SourceAddresses,NegateSource,SourceUsers,HipProfiles,DestinationZones,DestinationAddresses,NegateDestination,Applications,Services,Categories,Action,LogSetting,LogStart,LogEnd,Disabled,Schedule,IcmpUnreachable,DisableServerResponseInspection,Group,Targets,NegateTarget,Virus,Spyware,Vulnerability,UrlFiltering,FileBlocking,WildFireAnalysis,DataFiltering

The easiest way to make the modifications all while adhering to this order, is to export the policy first (using the --action export), and then modifying that file.

Here is an example CSV file of a policy that has been exported:

policy.csv

And here is a screenshot of this policy:

Screenshot: Policy

Importing and Modifying Rules

When you import (create) rules, or want to modify existing values of a rule, you DO NOT need to have every column that is listed above filled out with a value. You still NEED them to be defined/listed, but they can be empty.

Any field that you want to add or modify you need to have a value there, but at the very least, you MUST have values in the following fields:

Name, Type, Action

Examples

Based on the policy above, none of our rules have any security profiles configured. Let's say we want to add some (AV, Vulnerability, Wildfire, etc.), along with add a security profile to a couple of rules. Here is a CSV file that we will use to accomplise this:

policy_add_profiles.csv

As you can see in the file, we only have the Name, Type, Action and profile/group fields defined with the values we want to add. Once panco has imported this file, our policy should now reflect the security profiles that we defined:

Screenshot: Policy with profiles


Now let's add a couple of rules to our policy, and then add tags to a couple of existing ones. Here is the CSV file we will be using for this task:

policy_add_rules.csv

As you can see in this file, we are doing the following:

  • Add a rule that will deny traffic to gaming sites, as well as the Gaming_Apps application filter we have defined.
  • Add a rule that will deny access to Reddit.
  • Add a rule that will allow access to the social-networking URL category.
  • Add the Internet tag to two existing rules: Web_Browsing-APP and Web_Browsing-SVC

Once we import this using panco, our policy will now reflect all of the changes we have done:

Screenshot: Policy with all changes

Clone this wiki locally