-
Notifications
You must be signed in to change notification settings - Fork 103
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
Site.save on dynamic site causes APIError #84
Comments
The script's nexpose user has the following privileges: I specifically do not want this user to have too many privileges, so I've been very specific in the ones assigned. It is my assumption that the manage scan alerts privilege should be sufficient. |
The underlying problem is that each change of the site also requires the site configuration to be saved. This includes credentials, including global credentials. I'd tried to work the For the site where you see the problem, are their global credentials, site credentials, or both? I'll try to test each of these scenarios, but if I know your specific case, I'll focus on that first. |
Ah, I see. That's unfortunate but I suspected it was an API limitation I wasn't aware of that the gem was working around. One site is using both types and one site is using only shared credentials. Thanks for your help. |
I spent some time looking into this, and it isn't a simple fix. The dynamic site saving through the gem currently only works if the user has permission to change everything about the site. I was able to work around the credential problem, then hit up against a lack of permissions to save the dynamic criteria (which dynamic site saving attempts to do automatically on save). Even if I fixed this, it would break people who wanted to change credentials on a dynamic site. In the near future, we are planning to collapse dynamic and static sites in the Nexpose UI. When that happens, it should also mean cleaning up how dynamic sites are saved. I'll have to check into what the timeline for that is, since it's another team working on it. |
Well, I can change the permissions but I have them configured that way to avoid totally borking my production Nexpose install. I'm not very experienced with the API / nexpose or automation on a large scale and since I don't have a test environment, I am (carefully) testing my scripts as I write them but unfortunately running against production none-the-less. Who cares if I mess up alerts or tags, but actually messing up the site's configured assets or scan credentials would be not good. I guess now's the time to figure out how to get myself a test environment for script testing. Thanks for looking into this in any case. |
When attempting to modify a dynamic site (for instance, changing an alert), calling Site.save results in an APIError:
<ajaxResponse success="0"> <Errors> <Error>Insufficient privileges to remove credentials</Error> </Errors> </ajaxResponse>
However I did not modify the credentials of the loaded site and static sites do not give the same error. Am I unaware of something that's different about handling dynamic sites? The documentation only mentions that connection and asset filter changes must be saved through the DiscoveryConnection#update_site call.
The text was updated successfully, but these errors were encountered: