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

Improve xccdf_results_mapper when converting XCCDF Results to HDF Results #4255

Merged
merged 28 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
403987d
Improve xccdf_results_mapper when converting XCCDF->HDF
candrews Apr 12, 2023
88cd988
Merge branch 'master' into xccdf_results_mapper-improvements
aaronlippold Apr 13, 2023
25b361c
Minor changes requested by code review
candrews May 9, 2023
e8bc220
Use the "RegExp.exec()" method instead
candrews May 9, 2023
263cf60
Set impact to 0 for 'notapplicable' and 'informational' results
candrews May 9, 2023
c2640f5
Don't handle every array item within each array item
candrews May 11, 2023
51f047f
"version" should use "version.text" (not just "version")
candrews May 11, 2023
2f63274
For version, prefer version over id
candrews May 22, 2023
6992f6d
For version, remove unnecessary comment
candrews May 22, 2023
9276f02
Remove unnecessary String conversion
candrews May 22, 2023
71fad37
Add tsdoc to getRulesInGroup
candrews May 22, 2023
4b01555
Merge branch 'master' into xccdf_results_mapper-improvements
Amndeep7 May 23, 2023
f216a6f
removed 'id' as a potential path for 'version'. the complianceascode…
Amndeep7 May 23, 2023
747bdc8
linting
Amndeep7 May 23, 2023
2f618b2
Use triple equals for string comparson
candrews May 23, 2023
5a9cf54
Various fixes
candrews Jun 17, 2023
aad9481
Correct "refs" to comply with schema
candrews Jun 21, 2023
68ab499
Only include description if it has a label
candrews Jun 21, 2023
587282d
make the nist family part of the regexes only match against valid nis…
Amndeep7 Jun 23, 2023
d637e70
Use `as unknown as ControlDescription` instead of `as any`
candrews Jun 23, 2023
8df5b2d
Run lint on src/nist.ts
candrews Jun 23, 2023
cd8b2ee
Regenerate samples
candrews Jun 23, 2023
fc89563
Use concise character class syntax '\d' instead of '[0-9]'.
candrews Jun 23, 2023
ebdaade
the treemap expects a canonized form of the nist controls that are no…
Amndeep7 Jul 13, 2023
d855250
get rid of dupe nist tags - even if there were dupes in the original …
Amndeep7 Jul 13, 2023
e926155
could simplify the default_partial_config implementation and also ran…
Amndeep7 Jul 13, 2023
9e93622
sonarqube
Amndeep7 Jul 13, 2023
cd2aaa6
Merge branch 'master' into xccdf_results_mapper-improvements
Amndeep7 Jul 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

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.

1,070 changes: 1 addition & 1,069 deletions libs/hdf-converters/sample_jsons/xccdf_results_mapper/xccdf-scc-rhel7-hdf.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1,490 changes: 1 addition & 1,489 deletions libs/hdf-converters/sample_jsons/xccdf_results_mapper/xccdf-scc-rhel8-hdf.json

Large diffs are not rendered by default.

60 changes: 32 additions & 28 deletions libs/hdf-converters/src/xccdf-results-mapper.ts
Amndeep7 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -481,37 +481,41 @@ export class XCCDFResultsMapper extends BaseConverter {
},
descriptions: [
Amndeep7 marked this conversation as resolved.
Show resolved Hide resolved
{
data: {
path: ['check.check-content-ref.name'],
transformer: (text: string | string[]) =>
asArray(text).join('\n') || undefined
},
label: 'check'
},
path: ['check.check-content-ref.name'],
transformer: (
data: string | string[]
): ExecJSON.ControlDescription => ({
data: asArray(data).join('\n'),
label: 'check'
})
} as any,
Amndeep7 marked this conversation as resolved.
Show resolved Hide resolved
{
data: {
path: ['fixtext.text', 'fixtext', 'fix.text', 'fix'],
transformer: (text: string | string[]) =>
asArray(text).map(parseHtml).join('\n') || undefined
},
label: 'fix'
},
path: ['fixtext.text', 'fix.text'],
transformer: (
data: string | string[]
): ExecJSON.ControlDescription => ({
data: asArray(data).map(parseHtml).join('\n'),
label: 'fix'
})
} as any,
{
data: {
path: ['rationale.text', 'rationale'],
transformer: (text: string | string[]) =>
asArray(text).map(parseHtml).join('\n') || undefined
},
label: 'rationale'
},
path: ['rationale.text'],
transformer: (
data: string | string[]
): ExecJSON.ControlDescription => ({
data: asArray(data).map(parseHtml).join('\n'),
label: 'rationale'
})
} as any,
{
data: {
path: ['warning'],
transformer: (text: string | string[]) =>
asArray(text).map(parseHtml).join('\n') || undefined
},
label: 'warning'
}
path: ['warning.text'],
transformer: (
data: string | string[]
): ExecJSON.ControlDescription => ({
data: asArray(data).map(parseHtml).join('\n'),
label: 'warning'
})
} as any
],
impact: {
transformer: (vulnerability: Record<string, unknown>): number => {
Expand Down