Updating IP GroupsΒΆ

You can update or remove existing rules or add new ones with one request. There are four optional and additional fields that you can use with the update action:

  • name - If specified, the name of the IP Group will be updated.

  • added - Specifies a JSON array of rules to add to/define the IP Group.

  • updated - Specifies a JSON array of rules to modify the IP Group. The rule_id field must be defined to change a rule.

  • removed - Specifies a JSON array of rule IDs to be removed.

Important

When updating IP Groups, the rule type must remain the same. For example, you can not change an IP rule to a subnet rule. The workflow in that case is to remove the old rule type and create a new one.

Note

You can leave any of the [name|added|updated|removed] fields empty.

Below is an example of the added field for tagging traffic for a single IP address on a specific port:

[
 {
  "type": "ip",
  "address": "10.1.4.66"
 }
]

Use the updated field to change an existing rule:

[
 {
  "rule_id": "84",
  "type": "network",
  "address": "10.30.0.0",
  "mask": "16"
 }
]

Below is an example of the removed field syntax:

[ 81, 82, 83 ]

Note

The three examples above result to the following:

  • Create two new rules for the IP Group, an IP rule, and a port rule.

  • Update the rule with ID 84 to change IPs to match on.

  • Remove rules 81, 82, and 83 that already existed in the IP Group definition.

Example API call:

curl --location  --insecure --request POST '{{scrutinizer}}/fcgi/scrut_fcgi.fcgi' \
--header 'Content-Type: application/json' \
--form 'authToken={{authToken}}' \
--form 'rm=ipgroups' \
--form 'action=update' \
--form 'fc_id={{new_ipgroup_fcid}}' \
--form 'name=Renamed Group' \
--form 'added=[
        {
                "type": "ip",
                "address": "10.1.4.66"
        }
]' \
--form 'updated=[
        {
                "rule_id": "84",
                "type": "ip",
                "address": "192.1.0.0"
        }
]' \
--form 'removed=[114]'

.