-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Checklist metadata validation and checklist mapper severities (#2750)
* input validation for checklist metadata Signed-off-by: kemley76 <[email protected]> * use hdf-converters in hdf2ckl Signed-off-by: kemley76 <[email protected]> * updated hdf2ckl tests Signed-off-by: kemley76 <[email protected]> * update tests based on changes to ckl mapper Signed-off-by: Kaden Emley <[email protected]> * update ckl metadata validation to use hdf-converters helper function Signed-off-by: Kaden Emley <[email protected]> * added ability to use local install of inspecjs Signed-off-by: Kaden Emley <[email protected]> * update checklist commands and tests Signed-off-by: Kaden Emley <[email protected]> * ensure threshold counts stay based off impact Signed-off-by: Kaden Emley <[email protected]> * added tests to ensure that converting with invalid metadata display an error message Signed-off-by: Kaden Emley <[email protected]> * use checklist types from hdf-converters Signed-off-by: Kaden Emley <[email protected]> * remove redundant code in hdf2ckl command Signed-off-by: Kaden Emley <[email protected]> * use inspecJS to convert impact to severity Signed-off-by: Kaden Emley <[email protected]> * use checklist types from hdf-converters Signed-off-by: Kaden Emley <[email protected]> * fix test data Signed-off-by: Kaden Emley <[email protected]> * enforce enum matching for user input in generate ckl_metadata command Signed-off-by: Kaden Emley <[email protected]> * add backwards compatibility for old checklist metadata format Signed-off-by: Kaden Emley <[email protected]> * remove debug statement Signed-off-by: Kaden Emley <[email protected]> * fix code smells Signed-off-by: Kaden Emley <[email protected]> * linting Signed-off-by: Kaden Emley <[email protected]> * format every output json file with 2 space indent Signed-off-by: Kaden Emley <[email protected]> * add flags for all metadata fields on hdf2ckl command Signed-off-by: Kaden Emley <[email protected]> * clarify instructions on ckl metadata generation Signed-off-by: Kaden Emley <[email protected]> * change formating from 4 to 2 space indent Signed-off-by: Kaden Emley <[email protected]> * make version and release number optional in checklist metadata generation Signed-off-by: Kaden Emley <[email protected]> * update tests to reflect better formatted error messages Signed-off-by: Kaden Emley <[email protected]> * update markdown summary table to include row for severity: none Signed-off-by: Kaden Emley <[email protected]> * update code and tests to count N/A controls with severity other than none Signed-off-by: Kaden Emley <[email protected]> * fix code smells Signed-off-by: Kaden Emley <[email protected]> * revert addition of severity-none row to markdown summary table Signed-off-by: Kaden Emley <[email protected]> * remove heimdall version when running checklist tests Signed-off-by: Kaden Emley <[email protected]> * change return type of string | undefined to string | null Signed-off-by: Kaden Emley <[email protected]> --------- Signed-off-by: kemley76 <[email protected]> Signed-off-by: Kaden Emley <[email protected]> Co-authored-by: Amndeep Singh Mann <[email protected]>
- Loading branch information
Showing
71 changed files
with
388,745 additions
and
91,346 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
ECHO OFF | ||
|
||
SET CYPRESS_INSTALL_BINARY=0 | ||
SET PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true | ||
|
||
SET original_dir=%cd% | ||
ECHO %original_dir% | ||
|
||
IF DEFINED npm_config_heimdall ( | ||
CD %npm_config_heimdall%/libs/inspecjs/ | ||
) ELSE ( | ||
CD ../heimdall2/libs/inspecjs/ | ||
) | ||
|
||
IF DEFINED npm_config_branch ( | ||
CALL git switch %npm_config_branch% || EXIT /B %ERRORLEVEL% | ||
) ELSE ( | ||
CALL git switch master || EXIT /B %ERRORLEVEL% | ||
) | ||
|
||
ECHO Executing - git fetch ... | ||
CALL git fetch || EXIT /B %ERRORLEVEL% | ||
|
||
ECHO Executing - git pull ... | ||
CALL git pull || EXIT /B %ERRORLEVEL% | ||
|
||
ECHO Executing - yarn install ... | ||
CALL yarn install || EXIT /B %ERRORLEVEL% | ||
|
||
ECHO Executing - yarn pack ... | ||
CALL yarn pack || EXIT /B %ERRORLEVEL% | ||
|
||
ECHO Finished generating the tarball | ||
|
||
CD %original_dir% | ||
|
||
ECHO Executing - npm install remote ... | ||
CALL npm i || EXIT /B %ERRORLEVEL% | ||
|
||
ECHO Executing - npm install local ... | ||
|
||
IF DEFINED npm_config_heimdall ( | ||
FOR /f "tokens=*" %%a IN ('dir /b %npm_config_heimdall%\libs\inspecjs\inspecjs-v*.tgz') DO ( | ||
SET THIS_TAR_ZIP=%npm_config_heimdall%\libs\inspecjs\%%a | ||
) | ||
) ELSE ( | ||
FOR /f "tokens=*" %%a IN ('dir /b ..\heimdall2\libs\inspecjs\inspecjs-v*.tgz') DO ( | ||
SET THIS_TAR_ZIP=..\heimdall2\libs\inspecjs\%%a | ||
) | ||
) | ||
CALL npm i %THIS_TAR_ZIP% || EXIT /B %ERRORLEVEL% | ||
|
||
ECHO Executing - npm run prepack ... | ||
CALL npm run prepack || EXIT /B %ERRORLEVEL% | ||
|
||
ECHO Install of local inspecjs complete. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
|
||
set -o errexit # abort on nonzero exitstatus | ||
set -o nounset # abort on unbound variable | ||
set -o pipefail # don't hide errors within pipes | ||
|
||
ORIGINAL=$PWD | ||
echo $ORIGINAL | ||
|
||
cd "${npm_config_heimdall:-../heimdall2}" | ||
cd libs/inspecjs | ||
|
||
git switch "${npm_config_branch:-master}" | ||
|
||
echo "Executing - git fetch ..." | ||
git fetch | ||
|
||
echo "Executing - git pull ..." | ||
git pull | ||
|
||
echo "Executing - yarn install ..." | ||
CYPRESS_INSTALL_BINARY=0 PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true yarn install | ||
|
||
echo "Executing - yarn pack ..." | ||
yarn pack | ||
|
||
echo "Finished generating the tarball" | ||
|
||
cd "$ORIGINAL" | ||
|
||
echo "Executing - npm install remote ..." | ||
npm i | ||
|
||
echo "Executing - npm install local ..." | ||
npm i "${npm_config_heimdall:-../heimdall2}/libs/inspecjs/inspecjs-v"*".tgz" | ||
|
||
echo "Executing - npm run prepack ..." | ||
npm run prepack | ||
|
||
echo "Install of local inspecjs complete." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.