5.14.3. Adding metadata to rules: tags and description

To make the configuration file more readable and informative, you can add descriptions and tags to the rules. Descriptions can be longer texts, while tags are simple labels, for example, to identify rules that belong to the same type of traffic. Adding metadata to rules is not necessary, but can be a great help when maintaining large configurations.

  • To add a description to a rule, add the text of the description before the rule, enclosed between three double-quotes:

    """This rule is ..."""
  • To tag a rule, add a comment line before the rule that contains the list of tags applicable to the rule, separated with commas.

    #Tags: tag1, tag2
Example 5.35. Tagging rules

The following rule has two tags, marking the traffic type and the source zone: http and office.

#Tags: http, office
    """Description"""
    Rule(proto=(6),
    src_zone='office',
    service='MyHttpService'
    )