Remove duplicate violation on latest images
Update tests based on new expected failed tests numbers.
MODIFY
checkov/circleci_pipelines/checks/image_version_not_hash.py
checkov/circleci_pipelines/checks/image_version_not_hash.py
@@ -26,6 +26,10 @@ class ImageReferenceHashVersion(BaseCircleCIPipelinesCheck):
if isinstance(image, str):
if "@" in image:
return CheckResult.PASSED, conf
+ if "latest" in image:
+ return CheckResult.PASSED, conf
+ # We pass on "latest" as we have a specific check with a more informative violation description.
+ # See CKV_CIRCLECIPIPELINES_1
return CheckResult.FAILED, conf

MODIFY
tests/circleci_pipelines/test_runner.py
tests/circleci_pipelines/test_runner.py
@@ -16,9 +16,9 @@ class TestRunnerValid(unittest.TestCase):
root_folder=valid_dir_path,
runner_filter=RunnerFilter(framework=['circleci_pipelines'], checks=checks)
)
- self.assertEqual(len(report.failed_checks), 19)
+ self.assertEqual(len(report.failed_checks), 13)
self.assertEqual(report.parsing_errors, [])
- self.assertEqual(len(report.passed_checks), 19)
+ self.assertEqual(len(report.passed_checks), 29)
self.assertEqual(report.skipped_checks, [])
report.print_console()

Remove duplicate violation on latest images
Update tests based on new expected failed tests numbers.