Skip to content

Commit

Permalink
Fix PaloaltoArp plugin so that it omits API keys when logging
Browse files Browse the repository at this point in the history
Now, the PaloaltoArp ipdevpoll plugin only shows netloc part of URL in log messages
  • Loading branch information
jorund1 committed Jan 31, 2025
1 parent dbf3893 commit cd68d4a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/3251.security.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Omit PaloaltoArp API keys when logging
6 changes: 4 additions & 2 deletions python/nav/ipdevpoll/plugins/paloaltoarp.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ def creatorForNetloc(self, hostname, port):
return ssl.CertificateOptions(verify=False)

url = f"https://{address}/api/?type=op&cmd=<show><arp><entry+name+=+'all'/></arp></show>&key={key}"
self._logger.debug("making request: %s", url)
self._logger.debug(
"Making HTTP request to Paloalto API endpoint at %s", address
)

agent = Agent(reactor, contextFactory=SslPolicy())

Expand All @@ -116,7 +118,7 @@ def creatorForNetloc(self, hostname, port):
)
except Exception: # noqa
self._logger.exception(
"Error when talking to PaloAlto API. "
"Error when making HTTP request to Paloalto API endpoint. "
"Make sure the device is reachable and the API key is correct."
)
returnValue(None)
Expand Down

0 comments on commit cd68d4a

Please sign in to comment.