Closed climbertjh2 closed 3 months ago
@climbertjh2 this was moved out of the loop due to errors on the last PR that @dbbegimh raisedm, but I can see that the cfn_filename
inclusion outside the loop may be a pain point.
Checking out your fork to see if the regression is recurring with these changes
@climbertjh2 yeah, this brings back the error that @dbbegimh raised where it is not matching files during the loop when there are multiple cloudformation templates found
ASH version 1.3.0
Archive: ./bla.zip
extracting: /out/work/bla/dummy1.py
inflating: /out/work/bla/dummy_creds
Archive: ./bla2.zip
extracting: /out/work/bla2/dummy2.py
inflating: /out/work/bla2/dummy_creds2
Archive: ./zip_w_space.zip
creating: /out/work/zip_w_space/dir with space/
inflating: /out/work/zip_w_space/dir with space/test.yaml
No git repository found in source folder.
Imported ash-ignore-report.txt from /out
Imported ash-scan-set-files-list.txt from /out
ASH found 347 file(s) in the source directory...
Items to scan for in Dockerfile-cdk are: [ yaml yml json template ]
Items to scan for in Dockerfile-yaml are: [ yaml yml tf json dockerfile ]
waiting on Dockerfile-cdk to finish ...
Running cdk-docker-execute.sh ...
Items to scan for in Dockerfile-js are: [ js jsx ts tsx ]
Items to scan for in Dockerfile-grype are: [ js jsx ts tsx py java go cs sh war jar ]
Items to scan for in Dockerfile-py are: [ py pyc ipynb ]
Running yaml-docker-execute.sh ...
Items to scan for in Dockerfile-git are: [ git ]
Running js-docker-execute.sh ...
Running grype-docker-execute.sh ...
Running py-docker-execute.sh ...
Running git-docker-execute.sh ...
Dockerfile Dockerfile-git returned 0
Dockerfile Dockerfile-py returned 1
Dockerfile Dockerfile-yaml returned 1
Dockerfile Dockerfile-js returned 1
cp: cannot stat '/tmp/cdk-nag-scan.PCZUA/cdk.out/*.template.json': No such file or directory
rm: cannot remove '/tmp/cdk-nag-scan.PCZUA/cdk.out/*.template.json': No such file or directory
cp: cannot stat '/tmp/cdk-nag-scan.PCZUA/cdk.out/*.template.json': No such file or directory
rm: cannot remove '/tmp/cdk-nag-scan.PCZUA/cdk.out/*.template.json': No such file or directory
Dockerfile Dockerfile-cdk returned 1
Dockerfile-cdk finished with return code 1
waiting on Dockerfile-yaml to finish ...
Dockerfile-yaml finished with return code 1
waiting on Dockerfile-git to finish ...
Dockerfile-git finished with return code 0
waiting on Dockerfile-py to finish ...
Dockerfile-py finished with return code 1
waiting on Dockerfile-js to finish ...
Dockerfile-js finished with return code 1
waiting on Dockerfile-grype to finish ...
Dockerfile Dockerfile-grype returned 1
Dockerfile-grype finished with return code 1
Jobs return code report:
Dockerfile-cdk : 1
Dockerfile-yaml : 1
Dockerfile-git : 0
Dockerfile-py : 1
Dockerfile-js : 1
Dockerfile-grype : 1
Your final report can be found here: /Users/nateferl/Downloads/local-dummy-files/ash_output/aggregated_results.txt
ASH execution completed in 78 seconds.
Highest return code is 1
@scrthq - I have pushed an additional update which should fix the regression with the test-case noted above. Or at least it appears to in my test environment.
Please re-test in yours.
$ cat ash_stdout.txt
Resolved OCI_RUNNER to: /usr/bin/docker
Building image automated-security-helper:local -- this may take a few minutes during the first build...
Running ASH scan using built image...
ASH version 1.3.1
Repository cloned successfully.
ASH found 61 file(s) in the source directory...
Items to scan for in Dockerfile-cdk are: [ yaml yml json template ]
Items to scan for in Dockerfile-yaml are: [ yaml yml tf json dockerfile ]
Running cdk-docker-execute.sh ...
waiting on Dockerfile-cdk to finish ...
Items to scan for in Dockerfile-py are: [ py pyc ipynb ]
Running yaml-docker-execute.sh ...
Items to scan for in Dockerfile-grype are: [ js jsx ts tsx py java go cs sh war jar ]
Items to scan for in Dockerfile-git are: [ git ]
Items to scan for in Dockerfile-js are: [ js jsx ts tsx ]
Running py-docker-execute.sh ...
Running grype-docker-execute.sh ...
Running js-docker-execute.sh ...
Running git-docker-execute.sh ...
Dockerfile Dockerfile-js returned 0
Dockerfile Dockerfile-git returned 0
Dockerfile Dockerfile-py returned 0
Dockerfile Dockerfile-cdk returned 0
Dockerfile-cdk finished with return code 0
waiting on Dockerfile-yaml to finish ...
Dockerfile Dockerfile-grype returned 0
Dockerfile Dockerfile-yaml returned 0
Dockerfile-yaml finished with return code 0
waiting on Dockerfile-git to finish ...
Dockerfile-git finished with return code 0
waiting on Dockerfile-py to finish ...
Dockerfile-py finished with return code 0
waiting on Dockerfile-js to finish ...
Dockerfile-js finished with return code 0
waiting on Dockerfile-grype to finish ...
Dockerfile-grype finished with return code 0
Jobs return code report:
Dockerfile-cdk : 0
Dockerfile-yaml : 0
Dockerfile-git : 0
Dockerfile-py : 0
Dockerfile-js : 0
Dockerfile-grype : 0
Your final report can be found here: /home/runner/work/automated-security-helper/automated-security-helper/ash_output/aggregated_results.txt
ASH execution completed in 24 seconds.
Highest return code is 0
Issue #, if available: 68
Description of changes: Updated
cdk-docker-execute.sh
to copy template/nag files on every iteration through the loop, copying to separate folders for each file scanned.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.