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

to_xccdf: Enable STIGViewer support for automatic CCI descriptions. #222

Merged
merged 4 commits into from
Apr 16, 2021

Conversation

janeuner
Copy link
Contributor

@janeuner janeuner commented Apr 9, 2021

XCCDF ident elements with CCI values should use a cyber.mil/cci system attribute to display correctly in STIG Viewer.

Before:
20210409_rule_with_public_cci

After:
20210409_rule_with_mil_cci

…m attribute to display correctly in STIG Viewer.

Signed-off-by: Jarod Neuner <[email protected]>
@janeuner janeuner force-pushed the jn-ident-system-stigviewer branch from 10dae7a to eb466e7 Compare April 9, 2021 23:11
@janeuner
Copy link
Contributor Author

janeuner commented Apr 12, 2021

I was also able to figure out the Legacy IDs field. Adding to the PR since they are closely related in the data schema.

20210412_rule_with_legacy_ids

Copy link
Contributor

@Bialogs Bialogs left a comment

Choose a reason for hiding this comment

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

Instead of making the rule_idents method aware of the type of system being created, move back the logic to the initializer for the Ident itself. This way the logic for determine legacy or CCI can be reused if we need to include this information on other output formats.

Not sure what you would have to parse within the control['cci'] or control['legacy'] to make that determination.

Essentially what would be acceptable is

# to_xxdf.rb#build_rule_idents
# ...
idents.map { Ident.new(identifier) }

# HappyMapperTools::Benchmark::Ident
class Ident
  def initialize(ident_string)
    # Some parsing to determine CCI or Legacy
   @system = system
    @ident = ident
  end
end

@Bialogs
Copy link
Contributor

Bialogs commented Apr 15, 2021

Thanks for the changes. Makes sense since these legacy IDs are now being parsed from the XCCDF content. Please take a look at my review.

@Bialogs Bialogs merged commit d4ee848 into mitre:master Apr 16, 2021
@janeuner janeuner mentioned this pull request Apr 16, 2021
Bialogs pushed a commit that referenced this pull request Apr 23, 2021
- added fallback logic for unrecognized idents, using legacy behaviors
- added unit testing for the new Ident constructor
* Cleanup Ident test to use hash instead of array

Signed-off-by: Jarod Neuner <[email protected]>
Signed-off-by: Robert Clark <[email protected]>
Co-authored-by: Robert Clark <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants