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

Add methods to enable debug/enhanced logging in the scan template. #197

Merged
merged 6 commits into from
Dec 1, 2015

Conversation

xliu-r7
Copy link
Contributor

@xliu-r7 xliu-r7 commented Nov 13, 2015

This feature is dependent on a future version of Nexpose.

logging = REXML::Element.new('Logging')
@xml.add_element(logging)
end
enhancedLogging = REXML::XPath.first(logging, 'enhancedLogging')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use snake_case for variable names.


# Enable or disable the debug logging.
# @param [Boolean] enable Enable or disable the debug logging.
def enable_debug_logging=(enable)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should just be debug_logging=(enable)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are methods with the same prefix serving this purpose in the file. Don't see a big difference to make the change.

$ grep -B2 "def enable_.*=(enable)" lib/nexpose/scan_template.rb
    # Enable/disable IP stack fingerprinting
    # @param [Boolean] enable Enable or disable IP stack fingerprinting
    def enable_ip_stack_fingerprinting=(enable)
--
    # Enable/disable ICMP device discovery
    # @param [Boolean] enable Enable or disable ICMP device discovery
    def enable_icmp_device_discovery=(enable)
--
    # Enable/disable TCP device discovery
    # @param [Boolean] enable Enable or disable TCP device discovery
    def enable_tcp_device_discovery=(enable)
--
    # Enable/disable UDP device discovery
    # @param [Boolean] enable Enable or disable UDP device discovery
    def enable_udp_device_discovery=(enable)
--
    # Enable or disable TCP port scanning.
    # @param [Boolean] enable Enable or disable TCP ports
    def enable_tcp_service_discovery=(enable)
--
    # Enable or disable UDP service discovery
    # @param [Boolean] enable Enable or disable UDP service discovery
    def enable_udp_service_discovery=(enable)
--
    # Enable or disable the debug logging.
    # @param [Boolean] enable Enable or disable the debug logging.
    def enable_debug_logging=(enable)
--
    # Enable or disable the enhanced logging.
    # @param [Boolean] enable Enable or disable the enhanced logging.
    def enable_enhanced_logging=(enable)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

@tomhart-r7
Copy link
Contributor

I'm surprised you could create a branch here. @gschneider-r7 , I thought he had to fork the repo? Or is it just if you're an external contributor that you need to do that?

@gschneider-r7
Copy link
Contributor

Forks are not required for internal contributors, but may be useful when a branch may have lots of commits or may need to be squashed/rewrite history to keep the main repo "clean". In this case the branch is fine.

# @param [Boolean] enable Enable or disable the enhanced logging.
def enable_enhanced_logging=(enable)
debug_logging = enable
aces_level = (enable ? 'full' : 'none')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Useless assignment to variable - aces_level.

@fkazemeyni-r7
Copy link

could you please add the ticket number to the commit comment

@xliu-r7
Copy link
Contributor Author

xliu-r7 commented Nov 18, 2015

Normally, as pulls in https://github.com/rapid7/nexpose-client/pulls, we don't include the internal ticket number I guess since this is a public repo.

@sgreen-r7
Copy link
Contributor

Looks good to me. :shipit: ლ(́◉◞౪◟◉‵ლ)

@gschneider-r7
Copy link
Contributor

Yeah we don't need (or want) to use internal ticket numbers in this repo.

# @param [Boolean] enable Enable or disable the enhanced logging.
def enable_enhanced_logging=(enable)
self.enable_debug_logging = enable
self.aces_level = (enable ? 'full' : 'none')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, self.. I forgot about that.

@tomhart-r7
Copy link
Contributor

🚢 once the associated code changes are ready

gschneider-r7 added a commit that referenced this pull request Dec 1, 2015
Add methods to enable debug/enhanced logging in the scan template.
@gschneider-r7 gschneider-r7 merged commit b2f9681 into master Dec 1, 2015
@gschneider-r7 gschneider-r7 deleted the debug/enhanced_logging branch December 1, 2015 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants