FortiSOAR Discussions
Swapnil1
New Contributor II

Misspelled xpath in Palo Alto Panaroma connector in delete_address_object in 7.0.1 release

In the below connector code from operations.py it is observed that the xpath is misspelled as 'xapth' when defining the data variable. My guess is this will never work. This might have been missed as unblock IP action is not the most commonly used action by customers. For one of our use cases the customer requirement was to periodically check the reputation of already marked Malicious Ips and unblock them if they are found to be non-malicious. 

def __delete_address_object(self, ip, device_group):
address_name = _format_address_name(ip)
xpath = "/config/devices/entry/device-group/entry[@name='{device_group}']/address/entry[@name='{address_name}']".format(
address_name=address_name, device_group=device_group)
try:
data = {'action': 'delete', 'xapth': xpath}
self.__make_request(data)
except Exception as exp:
logger.debug("Unblocking of IP failed %s" % str(exp))
raise ConnectorError("Failed to unblock the IP %s" % str(exp))
1 REPLY 1
Anonymous
Not applicable

Thanks for sharing @Swapnil. We appreciate your observation and contribution.

@Shravan, please can you get this change validated and incorporated in the respective connector.​​

------------------------------
Abhishek Narula
CTO, SOAR Division | VP Product Engineering
------------------------------
-------------------------------------------
Original Message:
Sent: Nov 23, 2021 05:13 AM
From: Swapnil Koulgikar
Subject: Misspelled xpath in Palo Alto Panaroma connector in delete_address_object in 7.0.1 release

In the below connector code from operations.py it is observed that the xpath is misspelled as 'xapth' when defining the data variable. My guess is this will never work. This might have been missed as unblock IP action is not the most commonly used action by customers. For one of our use cases the customer requirement was to periodically check the reputation of already marked Malicious Ips and unblock them if they are found to be non-malicious. 

def __delete_address_object(self, ip, device_group):
address_name = _format_address_name(ip)
xpath = "/config/devices/entry/device-group/entry[@name='{device_group}']/address/entry[@name='{address_name}']".format(
address_name=address_name, device_group=device_group)
try:
data = {'action': 'delete', 'xapth': xpath}
self.__make_request(data)
except Exception as exp:
logger.debug("Unblocking of IP failed %s" % str(exp))
raise ConnectorError("Failed to unblock the IP %s" % str(exp))