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
92 stars 30 forks source link

inspec_tools docker images is not actually showing results to cli #183

Closed aaronlippold closed 4 years ago

aaronlippold commented 4 years ago
yarn.lock
~
➜  ~ clear
➜  ~ docker run -it -v$(pwd):/share mitre/inspec_tools
+---------------------------------------------+
✔ 1 product license accepted.
+---------------------------------------------+
Commands:
  inspec_tools compliance -j, --inspec-json=INSPEC_JSON                                                         # compliance parses an inspec results json to check if the compliance level meets a speci...
  inspec_tools csv2inspec -c, --csv=CSV -m, --mapping=MAPPING                                                   # csv2inspec translates CSV to Inspec controls using a mapping file
  inspec_tools generate_ckl_metadata                                                                            # Generate metadata file that can be passed to inspec2ckl
  inspec_tools generate_inspec_metadata                                                                         # Generate mapping file that can be passed to xccdf2inspec
  inspec_tools generate_map                                                                                     # Generates mapping template from CSV to Inspec Controls
  inspec_tools help [COMMAND]                                                                                   # Describe available commands or one specific command
  inspec_tools inspec2ckl -j, --inspec-json=INSPEC_JSON -o, --output=OUTPUT                                     # inspec2ckl translates an inspec json file to a Checklist file
  inspec_tools inspec2csv -j, --inspec-json=INSPEC_JSON -o, --output=OUTPUT                                     # inspec2csv translates Inspec controls to CSV
  inspec_tools inspec2xccdf -a, --attributes=ATTRIBUTES -j, --inspec-json=INSPEC_JSON -o, --output=OUTPUT       # inspec2xccdf translates an inspec profile and attributes files to an xccdf file
  inspec_tools pdf2inspec -p, --pdf=PDF                                                                         # pdf2inspec translates a PDF Security Control Speficication to Inspec Security Profile
  inspec_tools summary -j, --inspec-json=INSPEC_JSON                                                            # summary parses an inspec results json to create a summary json
  inspec_tools xccdf2inspec -x, --xccdf=XCCDF                                                                   # xccdf2inspec translates an xccdf file to an inspec profile
  inspec_tools xlsx2inspec -m, --mapping=MAPPING -p, --control-name-prefix=CONTROL_NAME_PREFIX -x, --xlsx=XLSX  # xlsx2inspec translates CIS XLSX to Inspec controls using a mapping file

Options:
      [--log-level=LOG_LEVEL]         # Set the logging level: ["debug", "info", "warn", "error", "fatal"]
      [--log-location=LOG_LOCATION]   # Location to send diagnostic log messages to. (default: $stdout or Inspec::Log.error)
  l, [--log-directory=LOG_DIRECTORY]  # Provie log location

➜  ~ docker run -it -v$(pwd):/share mitre/inspec_tools summary -j ubuntu-16.04-baseline-results.json
+---------------------------------------------+
✔ 1 product license accepted.
+---------------------------------------------+
➜  ~ docker run -it -v$(pwd):/share mitre/inspec_tools summary -j /share/ubuntu-16.04-baseline-results.json
+---------------------------------------------+
✔ 1 product license accepted.
+---------------------------------------------+
➜  ~ docker run -it -v$(pwd):/share mitre/inspec_tools summary
+---------------------------------------------+
✔ 1 product license accepted.
+---------------------------------------------+
No value provided for required options '--inspec-json'
➜  ~ docker run -it -v$(pwd):/share mitre/inspec_tools summary --inspec-json=/share/ubuntu-16.04-baseline-results.json
+---------------------------------------------+
✔ 1 product license accepted.
+---------------------------------------------+
➜  ~ docker run -it -v$(pwd):/share mitre/inspec_tool
rbclark commented 4 years ago

You have to pass the -c flag in order to get summary to print to the CLI. Without it you will see this behavior with or without Docker.

➜  inspec_tools git:(master)    inspec_tools summary -j examples/sample_json/single_control_results.json -c

Overall compliance: 100.0%

failed
    total : 0
    critical : 0
    high : 0
    medium : 0
    low : 0
passed
    total : 1
    critical : 0
    high : 0
    medium : 1
    low : 0
no_impact
    total : 0
    critical : 0
    high : 0
    medium : 0
    low : 0
skipped
    total : 0
    critical : 0
    high : 0
    medium : 0
    low : 0
error
    total : 0
    critical : 0
    high : 0
    medium : 0
    low : 0
➜  inspec_tools git:(master) docker run -it -v$(pwd):/share mitre/inspec_tools summary -j examples/sample_json/single_control_results.json -c
+---------------------------------------------+
✔ 1 product license accepted.
+---------------------------------------------+

Overall compliance: 100.0%

failed
    total : 0
    critical : 0
    high : 0
    medium : 0
    low : 0
passed
    total : 1
    critical : 0
    high : 0
    medium : 1
    low : 0
no_impact
    total : 0
    critical : 0
    high : 0
    medium : 0
    low : 0
skipped
    total : 0
    critical : 0
    high : 0
    medium : 0
    low : 0
error
    total : 0
    critical : 0
    high : 0
    medium : 0
    low : 0