Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Improve xccdf_results_mapper when converting XCCDF Results to HDF Results #4255
Improve xccdf_results_mapper when converting XCCDF Results to HDF Results #4255
Changes from 1 commit
403987d
88cd988
25b361c
e8bc220
263cf60
c2640f5
51f047f
2f63274
6992f6d
9276f02
71fad37
4b01555
f216a6f
747bdc8
2f618b2
5a9cf54
aad9481
68ab499
587282d
d637e70
8df5b2d
cd8b2ee
fc89563
ebdaade
d855250
e926155
9e93622
cd2aaa6
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like your sample is not updated properly still? or this function is borked lol
xccdf-scc-rhel7-hdf.json
seems like the nist tag array is including the stig control ids, which it shouldn't do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is_control(parse_nist('SV-86515'))
return true... so as far as inspectjs is concerned, 'SV-86515' is a nist control and therefore should be included.Am I misunderstanding
nist.js
? How should I determine if an item should be included or excluded from this list?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this feels like a failure on inspecjs' part in not removing things that are clearly wrong. parse_nist should throw errors/explicitly fail when they are not nist controls/control families. it not doing so confuses the type system by mistakenly typing that string. is_control more or less is only used to narrow down types and doesn't do much actual validation.
anyways as shown there and in 'raw_nist.ts', nist controls look like 'two_letter_family-small_number possibly followed by letters and numbers in parentheses' whereas stig ids are 'S?V-5__or_6_digit_number'.
the issue that arose here is that it thinks 'sv' is a control family and then processes the numbers after it as like 'control "big number" from within that control family' but doesn't take into account the reality of the situation where 'sv' is not a valid control family nor is there a control with an index as high as '86515' in existence.
looking briefly, it seems like the regexes that parse_nist uses are vastly broader than the actually allowed set of inputs. i will experiment to see if it's possible to restrict it to allowed control families.