-
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
Add support for modifying the asset linking global preference #202
Conversation
Create the new #parse_asset_correlation_from_xml and #add_asset_correlation_to_xml methods to Nexpose::GlobalSettings. Example usage: ```ruby global_settings = Nexpose::GlobalSettings.load(connection) global_settings.asset_correlation = true global_settings.save(connection) ```
@@ -6,6 +6,10 @@ class GlobalSettings | |||
# all sites. | |||
attr_accessor :asset_exclusions | |||
|
|||
# Whether asset linking in enabled. A feature tied to ControlsInsight |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the ControlsInsight comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really the right description ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy pasta 🍝
Awesome! This is exactly what I need to entirely script the scenario I am trying to reproduce :) |
The Nexpose UI references correlation as cross site asset linking.
|
||
# Internal method for parsing XML for whether asset linking in enabled. | ||
def parse_asset_linking_from_xml(xml) | ||
enabled = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kprzerwa-r7 @gschneider-r7 @sgreen-r7 @jhart-r7 I can't recall what the default value in Nexpose is, maybe it is actually true
.
Old versions of Nexpose didn't support it which is why I left this as false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For new installs, the default is true; for upgrades, false. AFAIK.
Regarding adding the element if it doesn't exist, yeah, I think leaving it out is probably safer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is enabled by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kprzerwa-r7 @jhart-r7 Pushing a change to make this true
. I'll leave out adding the element if it doesn't exist.
@jhart-r7 looks like your comment auto-collapsed since I pushed code that affected a line near what you'd mentioned:
@gschneider-r7 @kprzerwa-r7 @sgreen-r7 Opinions? I think my approach is sufficient. It also ensures we don't submit an invalid element to versions of Nexpose that didn't support asset linking/correlation. |
By default Nexpose customers have this value enabled. Customers who have set it false will have the element in their global settings and therefore have it correctly mutated to false in the lines that follow this default value.
I am pretty sure that any consoles that don't support asset linking can't really be used very well with the 1.0 or later versions of the gem anyway, so I'm not really concerned about that. The changes look good to me. 👍 |
Add support for modifying the asset linking global preference
Create the new
#parse_asset_linking_from_xml
and#add_asset_linking_to_xml
methods to
Nexpose::GlobalSettings
.Example usage:
recommended reviewers: @gschneider-r7 @lsanchez-r7 @mpodber-r7