From de06422bf5b3f55039f046aa4fcce5cbc558cd06 Mon Sep 17 00:00:00 2001 From: Barak Fatal <35402131+bo156@users.noreply.github.com> Date: Mon, 10 Jul 2023 21:50:54 +0300 Subject: [PATCH] feat(kustomize): add back reverted kustomize annotations and update build github action to use github runners (#5316) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(kustomize): Add origin annotations to calculate bases of kustomize checks (#5298) * Added basic implementation of adding and removing buildmetadata originAnnotations * Only remove the new buildmetadata if it wasn't added successfully by checkov * middle of debugging * more improvements * Successfully updated the file path * middle of adding correct base code lines * Fixed calculation of caller file path * another debug way * Another addition * Fixed bug where we calculate the base for overlay incorrectly, causing us to copy overlays to wrong directory * Calculated relative directory to new base * Allowed empty caller file lines and fixed all kustomize tests * Added tests for caller file paths * Added support for caller file path in graph reports and updated tests accordingly * Fixed parsing of kustomization files with resources which actually represent overlays * Added env variable to allow kustomize file edits * Removed comment * Updated _get_caller_file_path signature * Linters * nosec on subprocess.Popen as we are incharge of the command * Added condition that annotations are not None * CR * find correct parent without loop Co-authored-by: Anton Grübel * don't check len Co-authored-by: Anton Grübel * Used subprocess.run * moved env var to another place in the instance * Fixed all tests: * Check for origin_relative_path before concat * Added documentation --------- Co-authored-by: Anton Grübel * Moved build job unit tests to use public images instead of self-hosted, as a bug exist in the hosted version --------- Co-authored-by: Anton Grübel --- checkov/version.py | 2 +- kubernetes/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/checkov/version.py b/checkov/version.py index dbf61d2b374..82863df962c 100644 --- a/checkov/version.py +++ b/checkov/version.py @@ -1 +1 @@ -version = '2.3.317' +version = '2.3.318' diff --git a/kubernetes/requirements.txt b/kubernetes/requirements.txt index 4ef07d1cdb9..3850202ef91 100644 --- a/kubernetes/requirements.txt +++ b/kubernetes/requirements.txt @@ -1 +1 @@ -checkov==2.3.317 +checkov==2.3.318