Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring Back Date Modified and Date Created to PaloAlto Security Rules #506

Open
pjrwlazlo opened this issue Apr 27, 2023 · 4 comments
Open

Comments

@pjrwlazlo
Copy link

pjrwlazlo commented Apr 27, 2023

Is your feature request related to a problem?

There are no timestamps coming from the API pull for when a Security Rule for Post Rule or Pre rules where Modified or Created. For Auditing purposes my company would like to look at all the firewalls in our fleet have last updated their rules.

Describe the solution you'd like

Have the pan-os-python latest update include the date the rule was created and the date when the rule was last modified.

Describe alternatives you've considered

I have looked at old methods that use xpath at it seems like this used to be an option.

from pandevice import firewall

# Create a connection to Panorama
pano = panorama.Panorama(api_username='admin', api_password='password', hostname='panorama')

# Get a list of all the managed firewalls
fw_list = pano.refresh_devices()

# Get a specific firewall by name
fw = firewall.Firewall('firewall1')
pano.add(fw)

# Retrieve the modification timestamp for a specific security rule on the firewall
xpath = "/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/rulebase/security/rules/entry[@name='my_rule']"
response = fw.xapi.show(xpath=xpath, cmd_xml=False)

# Extract the modification timestamp from the response
timestamp = response.find('./result/entry/timestamp').text

print(f"The last modified timestamp for the rule is: {timestamp}")

However since the configuration of Palo Alto does not the date the rule was created and the date when the rule was last modified it is not coming through the pan-os-api.

@welcome-to-palo-alto-networks

🎉 Thanks for opening your first issue here! Welcome to the community!

@pjrwlazlo
Copy link
Author

Is there somewhere else I have to go to get a response?

@pjrwlazlo
Copy link
Author

Is there somewhere else I have to go to get a response?

@pjrwlazlo
Copy link
Author

Is there somewhere else I have to go to get a response?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant