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

Checklist metadata validation and checklist mapper severities #2750

Merged
merged 37 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
0e7a273
input validation for checklist metadata
kemley76 Jun 6, 2024
0d5fd2c
use hdf-converters in hdf2ckl
kemley76 Jun 7, 2024
f0a2dac
updated hdf2ckl tests
kemley76 Jun 7, 2024
71d53c7
update tests based on changes to ckl mapper
kemley76 Jun 28, 2024
f1d09e3
update ckl metadata validation to use hdf-converters helper function
kemley76 Jul 1, 2024
dd3fbd3
added ability to use local install of inspecjs
kemley76 Jul 9, 2024
1999bd5
update checklist commands and tests
kemley76 Jul 9, 2024
0ff6be4
ensure threshold counts stay based off impact
kemley76 Jul 9, 2024
69e94c0
added tests to ensure that converting with invalid metadata display a…
kemley76 Jul 10, 2024
5d2ffda
use checklist types from hdf-converters
kemley76 Jul 10, 2024
16e1bc6
remove redundant code in hdf2ckl command
kemley76 Jul 10, 2024
4cfe734
use inspecJS to convert impact to severity
kemley76 Jul 10, 2024
4482231
use checklist types from hdf-converters
kemley76 Jul 11, 2024
0711ff6
Merge branch 'hdf2ckl-severity-update' into update-hdf-converters
kemley76 Jul 15, 2024
6eaf79e
fix test data
kemley76 Jul 15, 2024
302e731
Merge branch 'main' into update-hdf-converters
kemley76 Jul 15, 2024
1da2b0f
enforce enum matching for user input in generate ckl_metadata command
kemley76 Jul 15, 2024
c4de62d
add backwards compatibility for old checklist metadata format
kemley76 Jul 16, 2024
b3d4724
Merge branch 'main' into update-hdf-converters
kemley76 Jul 23, 2024
72c8f39
remove debug statement
kemley76 Jul 23, 2024
02b21d2
fix code smells
kemley76 Jul 23, 2024
11991ca
linting
kemley76 Jul 23, 2024
5a091f4
format every output json file with 2 space indent
kemley76 Jul 23, 2024
e540f79
add flags for all metadata fields on hdf2ckl command
kemley76 Jul 24, 2024
c531d2b
clarify instructions on ckl metadata generation
kemley76 Jul 24, 2024
83c98f1
change formating from 4 to 2 space indent
kemley76 Jul 24, 2024
14aa7be
make version and release number optional in checklist metadata genera…
kemley76 Jul 24, 2024
9500d89
update tests to reflect better formatted error messages
kemley76 Jul 24, 2024
a84c21a
update markdown summary table to include row for severity: none
kemley76 Jul 25, 2024
4de13d1
update code and tests to count N/A controls with severity other than …
kemley76 Jul 25, 2024
81a36bb
Merge branch 'main' into update-hdf-converters
kemley76 Jul 25, 2024
b4fa9f6
fix code smells
kemley76 Jul 26, 2024
7ad5e57
revert addition of severity-none row to markdown summary table
kemley76 Jul 29, 2024
be94295
Merge branch 'main' into update-hdf-converters
Amndeep7 Jul 31, 2024
61e1dff
remove heimdall version when running checklist tests
kemley76 Jul 31, 2024
a6b99b5
change return type of string | undefined to string | null
kemley76 Jul 31, 2024
2f5f496
refactor to avoid while true loops
kemley76 Jul 31, 2024
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
2 changes: 1 addition & 1 deletion src/utils/ohdf/outputGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {PrintableSummary, Data, DataOrArray, RowType, ColumnType, PrintAndWriteO
*/
const logger: ReturnType<typeof createWinstonLogger> = createWinstonLogger('View Summary:')

export const ROW_ORDER: RowType[] = ['total', 'critical', 'high', 'medium', 'low']
export const ROW_ORDER: RowType[] = ['total', 'critical', 'high', 'medium', 'low', 'none']
export const COLUMN_ORDER: ColumnType[] = ['passed', 'failed', 'skipped', 'no_impact', 'error']

export const COLUMN_EMOJI: Record<ColumnType, string> = {
Expand Down
4 changes: 2 additions & 2 deletions src/utils/ohdf/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ export type DataOrArray = Data | Data[] | PrintableSummary | PrintableSummary[];

/**
* Represents the possible values for the row names in the generated Markdown table.
* The possible values are 'Total', 'Critical', 'High', 'Medium', 'Low', and 'Not Applicable'.
* The possible values are 'Total', 'Critical', 'High', 'Medium', 'Low', and 'None'.
*/
export type RowType = 'total' | 'critical' | 'high' | 'medium' | 'low' | 'Not Applicable';
export type RowType = 'total' | 'critical' | 'high' | 'medium' | 'low' | 'none';
Copy link
Contributor

Choose a reason for hiding this comment

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

i'm not familiar enough with threshold files to know if the changes you're making here are appropriate. please get @aaronlippold / @wdower / @ejaronne to confirm if this is alright.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Had a discussion with @aaronlippold and @wdower regarding this table. There is no need to have a row for severity "none" because it should not be possible for there to be severity "none". Every mapper should define a severity, especially in the case when status is not applicable, because then impact would be 0 leading to severity "none".

I have reverted my changes, but the option for RowType: 'Not Applicable' has been removed because it is never used and does not need to be used because there is a column that represents this.

The script that generates this kind of table may need to be updated to reflect the possibility of there being N/A controls with severity critical, high, medium, or low.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please make a new issue for this task @kemley76


/**
* Represents the possible values for the column names in the generated Markdown table.
Expand Down