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

Fix common.py get_firewall_credentials #261

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

connellyt
Copy link

@connellyt connellyt commented Aug 16, 2022

Description

common.py was throwing several errors. The first was a local variable 'password' referenced before assignment. To resolve this, I defined the password variable before the get_firewall_credentials and added the global password statement.

Once this was resolved, I received the message that no user or password were defined for the searchcommand. This wasn't accurate, but I found that the function was looking for

'Firewallsplunk_cred_sep1'

but should have been looking for:

'firewallsplunk_cred_sep1'

Motivation and Context

Advanced features of the Palo Alto Networks App for Splunk will not work without these changes, as the features require authentication to the firewall with an API key. The current implementation cannot get that API.

How Has This Been Tested?

I tested this by running the commands found in the example for pantag and pancontentpack in our lab environment. This is on a Splunk 8.2.7.1 instance running on RHEL 7.9.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have updated the documentation accordingly.
  • [X ] I have read the CONTRIBUTING document.
  • I have added tests to cover my changes if appropriate.
  • All new and existing tests passed.

common.py was throwing several errors.  The first was a local variable 'password' referenced before assignment.  To resolve this, I defined the password variable before the get_firewall_credentials and added the global password statement.

Once this was resolved, I received the message that no user or password were defined for the searchcommand.  This wasn't accurate, but I found that the function was looking for

'Firewall``splunk_cred_sep``1'

but should have been looking for:

'firewall``splunk_cred_sep``1'
@welcome-to-palo-alto-networks

🎉 Thanks for opening this pull request! We really appreciate contributors like you! 🙌

@TLepingwell
Copy link

I ran into a similar issue. The problem turns out to be hardcoded assumptions. The script in common.py works IFF the "Account Name" in Splunk_TA_paloalto configuration page is set to "Firewall".

This is case sensitive, just using "firewall" will cause it to fail. The documentation should be updated to specify that the "Account Name" cannot be arbitrarily chosen, but must be "Firewall in all cases."

@paulmnguyen paulmnguyen force-pushed the develop branch 2 times, most recently from de4dfdc to d7bd687 Compare May 17, 2023 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants