mitre / inspec_tools

A command-line and ruby API of utilities, converters and tools for creating, converting and processing security baseline formats, results and data
https://inspec-tools.mitre.org/
Other
91 stars 30 forks source link

Added logic so that inspec_tools can be a plugin to Inspec as a comma… #68

Closed kevin-j-smith closed 5 years ago

kevin-j-smith commented 5 years ago

…nd plugin

fixes #67 closes #67

Signed-off-by: Kevin J. Smith kevin.j.smith2@cerner.com

kevin-j-smith commented 5 years ago

:), it is true I copied cli.rb to plugin_cli and started the enhancement from there. Some refactoring to remove the duplication could be done, but where to begin.

lukemalinowski commented 5 years ago

I like the idea, and we'll be looking into this further!

@kevin-j-smith what do you think about dropping standalone cli support inspec_tools and making it purely an inspec plugin?

aaronlippold commented 5 years ago

We seem to have some CodeFactor issues.

kevin-j-smith commented 5 years ago

@lukemalinowski - Currently that is the only way I use it. But I am thinking what would be better is to break out into 3 parts. 1) inspec_tools (as a pure library gem), 2) inspec_tools-bin (as the standalone cli) and 3) inspec_tools-plugin (as the Inspec plugin).

I say this because of your other tool (Heimdal) seems to be using this as a library (although I have not drilled down into that code, yet, to find out). If it is not, then certainly as a plugin only would work.

lukemalinowski commented 5 years ago

I wasn't sure how to push more commits since github says you have to push commits to Kevin's branch, but there's now a new branch at https://github.com/mitre/inspec_tools/tree/kevin-j-smith-adding_inspec_command_plugin_logic which fixes the code duplication, It just assigns the base cli parser variable to be the same as the inspec plugin argument parser.

Id appreciate it if we kept everything this on this PR, so can @kevin-j-smith apply a patch with my changes to his fork? Also, it could probably use some more testing, as I only have the rake test's, and the samples. https://stackoverflow.com/questions/28192623/create-patch-or-diff-file-from-git-repository-and-apply-it-to-another-different