- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
04-21-2017 04:44 AM
Hi all!
I'm trying to creating a script for a customer i Windows Batch (*.bat) that needs to login to a Palo Alto Firewall, run a few commands and then login to another firewall and so on.
This is a strict environment so no internet connection is available.
The goal is to login to upload the anti-virus and content offline-packs (Dynamic Updates )to a couple of Palo Alto devices from an SCP source.
I have made the script that can log into a Palo Alto using Puttys command line tool "plink.exe" and execute commands from a text file. The problem is that the SCP-server is requiring a password that outputs a prompt that is shown in the session window that I don't know how to send characters to.
I have not find a way to solve this....
Is there any good Windows Batch programmer here that can help me out or is there another way to simply upload the Dynamic Updates file to a destination on the firewall or do I really need to trigger the update from within the Palo Alto itself?
I would appreciate any help I can get.
Thanks
01-31-2020 06:48 AM
Current status:
-----------------------------------------------------
- Plink cannot connect to Palo
Troubleshooting steps:
-----------------------------------------------------
- it can login but cannot execute
Options:
- Python
- API
- we need to use fw.expect with Python, be careful about 2.0 or 3.0 Python (commands different)
Discussion & Observations:
-----------------------------------------------------
- Palo doesn't have full bash CLI that is why Plink is not working
Tips for your firewall:
-----------------------------------------------------
- Scripting is not supported by brake and fix team
- Please contact your SE or RE, but I will try my best to assist
Please see KB:
-----------------------------------------------------
- https://github.com/kevinsteves/pan-python
- http://pandevice.readthedocs.io/
- https://docs.paloaltonetworks.com/pan-os/8-1/pan-os-panorama-api.html
- https://X.X.X.X/api (put Panoram IP) redirects to https://X.X.X.X/php/rest/browse.php
Next steps:
-----------------------------------------------------
- Please see example at
https://live.paloaltonetworks.com/t5/API-Articles/Scripts-Expect-scripts-for-Operational-and-Config-...
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 LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!