tenable / pyTenable

Python Library for interfacing into Tenable's platform APIs
https://pytenable.readthedocs.io
MIT License
356 stars 175 forks source link

problem with pyTenable sc.feeds.process() function #201

Closed rs904c closed 4 years ago

rs904c commented 4 years ago

There seems to be a problem with the pyTenable sc.feeds.process() function. I'm trying to update a feed with a file I have locally. Here is my debug, when I was doing a sc.feeds.process(): DEBUG:tenable.sc.TenableSC:{"method": "POST", "url": "https://192.168.214.5:443/rest/file/upload", "params": {}, "body": {}} DEBUG:urllib3.connectionpool:Resetting dropped connection: 192.168.214.5 DEBUG:urllib3.connectionpool:https://192.168.214.5:443 "POST /rest/file/upload HTTP/1.1" 200 194 DEBUG:tenable.sc.TenableSC:{"method": "POST", "url": "https://192.168.214.5:443/rest/feed/sc/update", "params": {}, "body": {"filename": "zIwqQT"}}

sc.feeds.process() was incorrectly doing a update, when it should instead do a feed/sc/process

rs904c commented 4 years ago

Even though the above returns a 200 code, it always fails.

The SC system logs show the following: Job id #760 terminated abnormally with error status '60'. (command: /opt/sc/support/bin/php /opt/sc/src/tools/feedUpdate.php 760; initiator = 2; object = no_object; jobparams = a:1:{s:4:"type";s:2:"sc";}; pid: 16701)

SteveMcGrath commented 4 years ago

This issue should be resolved now. This was originally missed as the test had to be skipped because of the size of the plugin downloads. Not a great answer, but the current testing suite would have lead to some massive mocked yaml files in the code repo if it wasn't skipped.

rs904c commented 4 years ago

I upgraded my pyTenable however, I'm still seeing this problem. I'm seeing an update instead of process. Steve, Can you double check this on your end?

DEBUG:tenable.sc.TenableSC:{"method": "POST", "url": "https://192.168.214.5:443/rest/file/upload", "params": {}, "body": {}} DEBUG:urllib3.connectionpool:https://192.168.214.5:443 "POST /rest/file/upload HTTP/1.1" 200 194 DEBUG:tenable.sc.TenableSC:{"method": "POST", "url": "https://192.168.214.5:443/rest/file/upload", "params": {}, "body": {}} DEBUG:urllib3.connectionpool:https://192.168.214.5:443 "POST /rest/file/upload HTTP/1.1" 200 194 DEBUG:tenable.sc.TenableSC:{"method": "POST", "url": "https://192.168.214.5:443/rest/feed/sc/update", "params": {}, "body": {"filename": "Rlpwab"}} DEBUG:urllib3.connectionpool:https://192.168.214.5:443 "POST /rest/feed/sc/update HTTP/1.1" 200 100

SteveMcGrath commented 4 years ago

1.1.2 has yet to be released. If you want bleeding edge, then you may want to pull directly from github.