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

inspec2ckl does not create a title that matches original XCCDF document #213

Closed b-mad closed 3 years ago

b-mad commented 3 years ago

When an XCCDF is used to generate a Checklist in STIGViewer the title output is different than when inspec2ckl is used to create the checklist title. An XCCDF attributes input is needed to allow for consistency with STIGViewer behavior.

The proposal here is to expose attributes in the same way as inspec2xccdf so that a matching title may be made in artifact creation.

https://github.com/mitre/inspec_tools/blob/2862786fedefec4d488106bba8a9b580b95c74a6/lib/inspec_tools/plugin_cli.rb#L58-L59

Updating inspec.rb with the following can then complete the update.

    def generate_title(attributes, json)
      return "#{attributes['benchmark.title']} :: Version #{attributes['benchmark.version']}, #{attributes['benchmark.plaintext']}" if attributes['benchmark.title']
aaronlippold commented 3 years ago

Looking forward to the PR. Please fork the repo and create a PR so it will trigger the unit and ci/cd test suite so we can do a peer review and merge. Thanks.

Aaron Lippold

lippold@gmail.com

260-255-4779

twitter/aim/yahoo,etc. 'aaronlippold'

On Wed, Dec 30, 2020 at 9:44 AM Bryan Madsen notifications@github.com wrote:

When an XCCDF is used to generate a Checklist in STIGViewer the title output is different than when inspec2ckl is used to create the checklist title. An XCCDF attributes input is needed to allow for consistency with STIGViewer behavior.

The proposal here is to expose attributes in the same way as inspec2xccdf so that a matching title may be made in artifact creation.

https://github.com/mitre/inspec_tools/blob/2862786fedefec4d488106bba8a9b580b95c74a6/lib/inspec_tools/plugin_cli.rb#L58-L59

Updating inspec.rb with the following can then complete the update.

def generate_title(attributes, json)
  return "#{attributes['benchmark.title']} :: Version #{attributes['benchmark.version']}, #{attributes['benchmark.plaintext']}" if attributes['benchmark.title']

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mitre/inspec_tools/issues/213, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALK42DIVB4RQWJYQTINDG3SXM4FBANCNFSM4VOMR7UQ .