Enable/Disable security rules via XML API

L1 Bithead

Enable/Disable security rules via XML API

Hi all,

is it possible to enable / disable an existing security rule via XML API ?

Looking at the documentation (both the XML config guide and the api on the firewall) I found no useful informations on this topic :smileysad:

thank's !

Tags (3)
L5 Sessionator


You can do so using the following command:

To disable:


To enable:


L6 Presenter

Great Answer ...

L2 Linker

bat thank you for being awesome.  question: any idea why a get on the same xpath (without the element arg) won't simply return an XML object with the state of a security rule?

e.g. https://firewall/api/?type=config&action=get&xpath=%2Fconfig%2Fdevices%2Fentry%5B%40name%3D%27localh... returns something completely useless, like:

<response status="success" code="19">



What the deuce does that tell me?  Neither the status or the code change based on the state of the rule, so...

L5 Sessionator

Hi cjsteele

To know the status of rule query should be:


Let me know if this is what you are looking for.

Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the Live Community as a whole!

The Live Community thanks you for your participation!