Repository: tenable/terrascan (language: python)

Issue:
fix kustomize scan breakage on windows



Discussion / hints:
# [Codecov](https://codecov.io/gh/accurics/terrascan/pull/630?src=pr&el=h1) Report
> Merging [#630](https://codecov.io/gh/accurics/terrascan/pull/630?src=pr&el=desc) (8457959) into [master](https://codecov.io/gh/accurics/terrascan/commit/dfc0d08a7d092f6d6e5ac383a995f2218f0e8a57?el=desc) (dfc0d08) will **not change** coverage.
> The diff coverage is `100.00%`.

[![Impacted file tree graph](https://codecov.io/gh/accurics/terrascan/pull/630/graphs/tree.svg?width=650&height=150&src=pr&token=1BH6E8C4SD)](https://codecov.io/gh/accurics/terrascan/pull/630?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master     #630   +/-   ##
=======================================
  Coverage   78.09%   78.09%           
=======================================
  Files         104      104           
  Lines        2597     2597           
=======================================
  Hits         2028     2028           
  Misses        422      422           
  Partials      147      147           
```


| [Impacted Files](https://codecov.io/gh/accurics/terrascan/pull/630?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pkg/iac-providers/kustomize/v3/load-dir.go](https://codecov.io/gh/accurics/terrascan/pull/630/diff?src=pr&el=tree#diff-cGtnL2lhYy1wcm92aWRlcnMva3VzdG9taXplL3YzL2xvYWQtZGlyLmdv) | `74.00% <100.00%> (ø)` | |

Kudos, SonarCloud Quality Gate passed!

[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=accurics_terrascan&pullRequest=630&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=accurics_terrascan&pullRequest=630&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=accurics_terrascan&pullRequest=630&resolved=false&types=BUG)  
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=accurics_terrascan&pullRequest=630&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=accurics_terrascan&pullRequest=630&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=accurics_terrascan&pullRequest=630&resolved=false&types=VULNERABILITY)  
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=accurics_terrascan&pullRequest=630&resolved=false&types=SECURITY_HOTSPOT) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=accurics_terrascan&pullRequest=630&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=accurics_terrascan&pullRequest=630&resolved=false&types=SECURITY_HOTSPOT)  
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=accurics_terrascan&pullRequest=630&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=accurics_terrascan&pullRequest=630&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=accurics_terrascan&pullRequest=630&resolved=false&types=CODE_SMELL)

[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo.png' alt='No Coverage information' width='16' height='16' />](https://sonarcloud.io/component_measures?id=accurics_terrascan&pullRequest=630) No Coverage information  
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=accurics_terrascan&pullRequest=630&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=accurics_terrascan&pullRequest=630&metric=new_duplicated_lines_density&view=list)


@dev-gaur can you just run `go mod tidy` on this PR branch?

Fix patch:
diff --git a/pkg/iac-providers/kustomize.go b/pkg/iac-providers/kustomize.go
index e4e405a00..fbcdcc128 100644
--- a/pkg/iac-providers/kustomize.go
+++ b/pkg/iac-providers/kustomize.go
@@ -19,18 +19,18 @@ package iacprovider
 import (
 	"reflect"
 
-	kustomizev3 "github.com/accurics/terrascan/pkg/iac-providers/kustomize/v3"
+	kustomizev4 "github.com/accurics/terrascan/pkg/iac-providers/kustomize/v4"
 )
 
 // kustomize specific constants
 const (
 	kustomize                  supportedIacType    = "kustomize"
-	kustomizeV3                supportedIacVersion = "v3"
-	kustomizeDefaultIacVersion                     = kustomizeV3
+	kustomizeV4                supportedIacVersion = "v4"
+	kustomizeDefaultIacVersion                     = kustomizeV4
 )
 
 // register kustomize as an IaC provider with terrascan
 func init() {
 	// register iac provider
-	RegisterIacProvider(kustomize, kustomizeV3, kustomizeDefaultIacVersion, reflect.TypeOf(kustomizev3.KustomizeV3{}))
+	RegisterIacProvider(kustomize, kustomizeV4, kustomizeDefaultIacVersion, reflect.TypeOf(kustomizev4.KustomizeV4{}))
 }
diff --git a/pkg/iac-providers/kustomize/v3/load-dir.go b/pkg/iac-providers/kustomize/v4/load-dir.go
similarity index 98%
rename from pkg/iac-providers/kustomize/v3/load-dir.go
rename to pkg/iac-providers/kustomize/v4/load-dir.go
index 5963b3a02..d3f44abb5 100644
--- a/pkg/iac-providers/kustomize/v3/load-dir.go
+++ b/pkg/iac-providers/kustomize/v4/load-dir.go
@@ -1,4 +1,4 @@
-package kustomizev3
+package kustomizev4
 
 import (
 	"fmt"
@@ -23,8 +23,7 @@ var (
 )
 
 // LoadIacDir loads the kustomize directory and returns the ResourceConfig mapping which is evaluated by the policy engine
-func (k *KustomizeV3) LoadIacDir(absRootDir string, options map[string]interface{}) (output.AllResourceConfigs, error) {
-
+func (k *KustomizeV4) LoadIacDir(absRootDir string, options map[string]interface{}) (output.AllResourceConfigs, error) {
 	allResourcesConfig := make(map[string][]output.ResourceConfig)
 
 	files, err := utils.FindFilesBySuffixInDir(absRootDir, KustomizeFileNames())
diff --git a/pkg/iac-providers/kustomize/v3/load-file.go b/pkg/iac-providers/kustomize/v4/load-file.go
similarity index 86%
rename from pkg/iac-providers/kustomize/v3/load-file.go
rename to pkg/iac-providers/kustomize/v4/load-file.go
index 02967d5c0..f6e2477fd 100644
--- a/pkg/iac-providers/kustomize/v3/load-file.go
+++ b/pkg/iac-providers/kustomize/v4/load-file.go
@@ -1,4 +1,4 @@
-package kustomizev3
+package kustomizev4
 
 import (
 	"fmt"
@@ -12,7 +12,7 @@ var (
 )
 
 // LoadIacFile is not supported for kustomize. Only loading directories that have kustomization.y(a)ml file are supported
-func (k *KustomizeV3) LoadIacFile(absRootPath string, options map[string]interface{}) (allResourcesConfig output.AllResourceConfigs, err error) {
+func (k *KustomizeV4) LoadIacFile(absRootPath string, options map[string]interface{}) (allResourcesConfig output.AllResourceConfigs, err error) {
 	zap.S().Error(errLoadIacFileNotSupported)
 	return make(map[string][]output.ResourceConfig), errLoadIacFileNotSupported
 }
diff --git a/pkg/iac-providers/kustomize/v3/types.go b/pkg/iac-providers/kustomize/v4/types.go
similarity index 89%
rename from pkg/iac-providers/kustomize/v3/types.go
rename to pkg/iac-providers/kustomize/v4/types.go
index af1c66a01..d924c57d7 100644
--- a/pkg/iac-providers/kustomize/v3/types.go
+++ b/pkg/iac-providers/kustomize/v4/types.go
@@ -1,12 +1,12 @@
-package kustomizev3
+package kustomizev4
 
 import (
 	"github.com/accurics/terrascan/pkg/utils"
 	"github.com/hashicorp/go-multierror"
 )
 
-// KustomizeV3 struct
-type KustomizeV3 struct {
+// KustomizeV4 struct
+type KustomizeV4 struct {
 	errIacLoadDirs *multierror.Error
 }
 
diff --git a/pkg/policy/kustomize.go b/pkg/policy/kustomize.go
index 6057149ae..3d371b34a 100644
--- a/pkg/policy/kustomize.go
+++ b/pkg/policy/kustomize.go
@@ -2,7 +2,7 @@ package policy
 
 const (
 	defaultKustomizeIacType    supportedIacType    = "kustomize"
-	defaultKustomizeIacVersion supportedIacVersion = version3
+	defaultKustomizeIacVersion supportedIacVersion = version4
 )
 
 func init() {
diff --git a/pkg/policy/types.go b/pkg/policy/types.go
index cfa06f7ed..98ab9ea1f 100644
--- a/pkg/policy/types.go
+++ b/pkg/policy/types.go
@@ -12,6 +12,7 @@ const (
 	version12 = "v12"
 	version1  = "v1"
 	version3  = "v3"
+	version4  = "v4"
 )
 
 // EngineInput Contains data used as input to the engine


Test patch:
diff --git a/pkg/iac-providers/kustomize/v3/load-dir_test.go b/pkg/iac-providers/kustomize/v4/load-dir_test.go
similarity index 93%
rename from pkg/iac-providers/kustomize/v3/load-dir_test.go
rename to pkg/iac-providers/kustomize/v4/load-dir_test.go
index 8c515a722..3986cd1f6 100644
--- a/pkg/iac-providers/kustomize/v3/load-dir_test.go
+++ b/pkg/iac-providers/kustomize/v4/load-dir_test.go
@@ -1,4 +1,4 @@
-package kustomizev3
+package kustomizev4
 
 import (
 	"fmt"
@@ -23,7 +23,7 @@ func TestLoadIacDir(t *testing.T) {
 	table := []struct {
 		name          string
 		dirPath       string
-		kustomize     KustomizeV3
+		kustomize     KustomizeV4
 		want          output.AllResourceConfigs
 		wantErr       error
 		resourceCount int
@@ -32,58 +32,58 @@ func TestLoadIacDir(t *testing.T) {
 		{
 			name:          "invalid dirPath",
 			dirPath:       "not-there",
-			kustomize:     KustomizeV3{},
+			kustomize:     KustomizeV4{},
 			wantErr:       multierror.Append(&os.PathError{Err: syscall.ENOENT, Op: "open", Path: "not-there"}),
 			resourceCount: 0,
 		},
 		{
 			name:          "simple-deployment",
 			dirPath:       filepath.Join(testDataDir, "simple-deployment"),
-			kustomize:     KustomizeV3{},
+			kustomize:     KustomizeV4{},
 			resourceCount: 4,
 		},
 		{
 			name:          "multibases",
 			dirPath:       filepath.Join(multibasesDir, "base"),
-			kustomize:     KustomizeV3{},
+			kustomize:     KustomizeV4{},
 			resourceCount: 2,
 		},
 		{
 			name:          "multibases",
 			dirPath:       filepath.Join(multibasesDir, "dev"),
-			kustomize:     KustomizeV3{},
+			kustomize:     KustomizeV4{},
 			resourceCount: 2,
 		},
 		{
 			name:          "multibases",
 			dirPath:       filepath.Join(multibasesDir, "prod"),
-			kustomize:     KustomizeV3{},
+			kustomize:     KustomizeV4{},
 			resourceCount: 2,
 		},
 
 		{
 			name:          "multibases",
 			dirPath:       filepath.Join(multibasesDir, "stage"),
-			kustomize:     KustomizeV3{},
+			kustomize:     KustomizeV4{},
 			resourceCount: 2,
 		},
 		{
 			name:          "multibases",
 			dirPath:       multibasesDir,
-			kustomize:     KustomizeV3{},
+			kustomize:     KustomizeV4{},
 			resourceCount: 4,
 		},
 		{
 			name:          "no-kustomize-directory",
 			dirPath:       filepath.Join(testDataDir, "no-kustomizefile"),
-			kustomize:     KustomizeV3{},
+			kustomize:     KustomizeV4{},
 			wantErr:       multierror.Append(fmt.Errorf("kustomization.y(a)ml file not found in the directory %s", filepath.Join(testDataDir, "no-kustomizefile"))),
 			resourceCount: 0,
 		},
 		{
 			name:          "kustomize-file-empty",
 			dirPath:       filepath.Join(testDataDir, "kustomize-file-empty"),
-			kustomize:     KustomizeV3{},
+			kustomize:     KustomizeV4{},
 			wantErr:       multierror.Append(fmt.Errorf("unable to read the kustomization file in the directory %s, error: yaml file is empty", filepath.Join(testDataDir, "kustomize-file-empty"))),
 			resourceCount: 0,
 		},
diff --git a/pkg/iac-providers/kustomize/v3/load-file_test.go b/pkg/iac-providers/kustomize/v4/load-file_test.go
similarity index 92%
rename from pkg/iac-providers/kustomize/v3/load-file_test.go
rename to pkg/iac-providers/kustomize/v4/load-file_test.go
index b46553898..25174dbe7 100644
--- a/pkg/iac-providers/kustomize/v3/load-file_test.go
+++ b/pkg/iac-providers/kustomize/v4/load-file_test.go
@@ -1,4 +1,4 @@
-package kustomizev3
+package kustomizev4
 
 import (
 	"reflect"
@@ -13,7 +13,7 @@ func TestLoadIacFile(t *testing.T) {
 		name      string
 		filePath  string
 		options   map[string]interface{}
-		kustomize KustomizeV3
+		kustomize KustomizeV4
 		typeOnly  bool
 		want      output.AllResourceConfigs
 		wantErr   error
@@ -21,7 +21,7 @@ func TestLoadIacFile(t *testing.T) {
 		{
 			name:      "load iac file is not supported for kustomize",
 			filePath:  "/dummyfilepath.yaml",
-			kustomize: KustomizeV3{},
+			kustomize: KustomizeV4{},
 			wantErr:   errLoadIacFileNotSupported,
 		},
 	}
diff --git a/pkg/iac-providers/kustomize/v3/testdata/erroneous-deployment/deployment.yaml b/pkg/iac-providers/kustomize/v4/testdata/erroneous-deployment/deployment.yaml
similarity index 100%
rename from pkg/iac-providers/kustomize/v3/testdata/erroneous-deployment/deployment.yaml
rename to pkg/iac-providers/kustomize/v4/testdata/erroneous-deployment/deployment.yaml
diff --git a/pkg/iac-providers/kustomize/v3/testdata/erroneous-deployment/kustomization.yaml b/pkg/iac-providers/kustomize/v4/testdata/erroneous-deployment/kustomization.yaml
similarity index 100%
rename from pkg/iac-providers/kustomize/v3/testdata/erroneous-deployment/kustomization.yaml
rename to pkg/iac-providers/kustomize/v4/testdata/erroneous-deployment/kustomization.yaml
diff --git a/pkg/iac-providers/kustomize/v3/testdata/erroneous-pod/kustomization.yaml b/pkg/iac-providers/kustomize/v4/testdata/erroneous-pod/kustomization.yaml
similarity index 100%
rename from pkg/iac-providers/kustomize/v3/testdata/erroneous-pod/kustomization.yaml
rename to pkg/iac-providers/kustomize/v4/testdata/erroneous-pod/kustomization.yaml
diff --git a/pkg/iac-providers/kustomize/v3/testdata/erroneous-pod/pod.yaml b/pkg/iac-providers/kustomize/v4/testdata/erroneous-pod/pod.yaml
similarity index 100%
rename from pkg/iac-providers/kustomize/v3/testdata/erroneous-pod/pod.yaml
rename to pkg/iac-providers/kustomize/v4/testdata/erroneous-pod/pod.yaml
diff --git a/pkg/iac-providers/kustomize/v3/testdata/kustomize-file-empty/configMap.yaml b/pkg/iac-providers/kustomize/v4/testdata/kustomize-file-empty/configMap.yaml
similarity index 100%
rename from pkg/iac-providers/kustomize/v3/testdata/kustomize-file-empty/configMap.yaml
rename to pkg/iac-providers/kustomize/v4/testdata/kustomize-file-empty/configMap.yaml
diff --git a/pkg/iac-providers/kustomize/v3/testdata/kustomize-file-empty/deployment.yaml b/pkg/iac-providers/kustomize/v4/testdata/kustomize-file-empty/deployment.yaml
similarity index 100%
rename from pkg/iac-providers/kustomize/v3/testdata/kustomize-file-empty/deployment.yaml
rename to pkg/iac-providers/kustomize/v4/testdata/kustomize-file-empty/deployment.yaml
diff --git a/pkg/iac-providers/kustomize/v3/testdata/kustomize-file-empty/kustomization.yaml b/pkg/iac-providers/kustomize/v4/testdata/kustomize-file-empty/kustomization.yaml
similarity index 100%
rename from pkg/iac-providers/kustomize/v3/testdata/kustomize-file-empty/kustomization.yaml
rename to pkg/iac-providers/kustomize/v4/testdata/kustomize-file-empty/kustomization.yaml
diff --git a/pkg/iac-providers/kustomize/v3/testdata/kustomize-file-empty/service.yaml b/pkg/iac-providers/kustomize/v4/testdata/kustomize-file-empty/service.yaml
similarity index 100%
rename from pkg/iac-providers/kustomize/v3/testdata/kustomize-file-empty/service.yaml
rename to pkg/iac-providers/kustomize/v4/testdata/kustomize-file-empty/service.yaml
diff --git a/pkg/iac-providers/kustomize/v3/testdata/multibases/base/kustomization.yaml b/pkg/iac-providers/kustomize/v4/testdata/multibases/base/kustomization.yaml
similarity index 100%
rename from pkg/iac-providers/kustomize/v3/testdata/multibases/base/kustomization.yaml
rename to pkg/iac-providers/kustomize/v4/testdata/multibases/base/kustomization.yaml
diff --git a/pkg/iac-providers/kustomize/v3/testdata/multibases/base/pod.yaml b/pkg/iac-providers/kustomize/v4/testdata/multibases/base/pod.yaml
similarity index 100%
rename from pkg/iac-providers/kustomize/v3/testdata/multibases/base/pod.yaml
rename to pkg/iac-providers/kustomize/v4/testdata/multibases/base/pod.yaml
diff --git a/pkg/iac-providers/kustomize/v3/testdata/multibases/dev/kustomization.yaml b/pkg/iac-providers/kustomize/v4/testdata/multibases/dev/kustomization.yaml
similarity index 100%
rename from pkg/iac-providers/kustomize/v3/testdata/multibases/dev/kustomization.yaml
rename to pkg/iac-providers/kustomize/v4/testdata/multibases/dev/kustomization.yaml
diff --git a/pkg/iac-providers/kustomize/v3/testdata/multibases/kustomization.yaml b/pkg/iac-providers/kustomize/v4/testdata/multibases/kustomization.yaml
similarity index 100%
rename from pkg/iac-providers/kustomize/v3/testdata/multibases/kustomization.yaml
rename to pkg/iac-providers/kustomize/v4/testdata/multibases/kustomization.yaml
diff --git a/pkg/iac-providers/kustomize/v3/testdata/multibases/prod/kustomization.yaml b/pkg/iac-providers/kustomize/v4/testdata/multibases/prod/kustomization.yaml
similarity index 100%
rename from pkg/iac-providers/kustomize/v3/testdata/multibases/prod/kustomization.yaml
rename to pkg/iac-providers/kustomize/v4/testdata/multibases/prod/kustomization.yaml
diff --git a/pkg/iac-providers/kustomize/v3/testdata/multibases/stage/kustomization.yaml b/pkg/iac-providers/kustomize/v4/testdata/multibases/stage/kustomization.yaml
similarity index 100%
rename from pkg/iac-providers/kustomize/v3/testdata/multibases/stage/kustomization.yaml
rename to pkg/iac-providers/kustomize/v4/testdata/multibases/stage/kustomization.yaml
diff --git a/pkg/iac-providers/kustomize/v3/testdata/multibases/zero-violation-base/kustomization.yaml b/pkg/iac-providers/kustomize/v4/testdata/multibases/zero-violation-base/kustomization.yaml
similarity index 100%
rename from pkg/iac-providers/kustomize/v3/testdata/multibases/zero-violation-base/kustomization.yaml
rename to pkg/iac-providers/kustomize/v4/testdata/multibases/zero-violation-base/kustomization.yaml
diff --git a/pkg/iac-providers/kustomize/v3/testdata/multibases/zero-violation-base/pod.yaml b/pkg/iac-providers/kustomize/v4/testdata/multibases/zero-violation-base/pod.yaml
similarity index 100%
rename from pkg/iac-providers/kustomize/v3/testdata/multibases/zero-violation-base/pod.yaml
rename to pkg/iac-providers/kustomize/v4/testdata/multibases/zero-violation-base/pod.yaml
diff --git a/pkg/iac-providers/kustomize/v3/testdata/no-kustomizefile/configMap.yaml b/pkg/iac-providers/kustomize/v4/testdata/no-kustomizefile/configMap.yaml
similarity index 100%
rename from pkg/iac-providers/kustomize/v3/testdata/no-kustomizefile/configMap.yaml
rename to pkg/iac-providers/kustomize/v4/testdata/no-kustomizefile/configMap.yaml
diff --git a/pkg/iac-providers/kustomize/v3/testdata/no-kustomizefile/deployment.yaml b/pkg/iac-providers/kustomize/v4/testdata/no-kustomizefile/deployment.yaml
similarity index 100%
rename from pkg/iac-providers/kustomize/v3/testdata/no-kustomizefile/deployment.yaml
rename to pkg/iac-providers/kustomize/v4/testdata/no-kustomizefile/deployment.yaml
diff --git a/pkg/iac-providers/kustomize/v3/testdata/no-kustomizefile/service.yaml b/pkg/iac-providers/kustomize/v4/testdata/no-kustomizefile/service.yaml
similarity index 100%
rename from pkg/iac-providers/kustomize/v3/testdata/no-kustomizefile/service.yaml
rename to pkg/iac-providers/kustomize/v4/testdata/no-kustomizefile/service.yaml
diff --git a/pkg/iac-providers/kustomize/v3/testdata/simple-deployment/configMap.yaml b/pkg/iac-providers/kustomize/v4/testdata/simple-deployment/configMap.yaml
similarity index 100%
rename from pkg/iac-providers/kustomize/v3/testdata/simple-deployment/configMap.yaml
rename to pkg/iac-providers/kustomize/v4/testdata/simple-deployment/configMap.yaml
diff --git a/pkg/iac-providers/kustomize/v3/testdata/simple-deployment/deployment.yaml b/pkg/iac-providers/kustomize/v4/testdata/simple-deployment/deployment.yaml
similarity index 100%
rename from pkg/iac-providers/kustomize/v3/testdata/simple-deployment/deployment.yaml
rename to pkg/iac-providers/kustomize/v4/testdata/simple-deployment/deployment.yaml
diff --git a/pkg/iac-providers/kustomize/v3/testdata/simple-deployment/kustomization.yaml b/pkg/iac-providers/kustomize/v4/testdata/simple-deployment/kustomization.yaml
similarity index 100%
rename from pkg/iac-providers/kustomize/v3/testdata/simple-deployment/kustomization.yaml
rename to pkg/iac-providers/kustomize/v4/testdata/simple-deployment/kustomization.yaml
diff --git a/pkg/iac-providers/kustomize/v3/testdata/simple-deployment/service.yaml b/pkg/iac-providers/kustomize/v4/testdata/simple-deployment/service.yaml
similarity index 100%
rename from pkg/iac-providers/kustomize/v3/testdata/simple-deployment/service.yaml
rename to pkg/iac-providers/kustomize/v4/testdata/simple-deployment/service.yaml
diff --git a/pkg/runtime/executor_test.go b/pkg/runtime/executor_test.go
index dc1ba320e..dfce69d1b 100644
--- a/pkg/runtime/executor_test.go
+++ b/pkg/runtime/executor_test.go
@@ -30,7 +30,7 @@ import (
 	dockerv1 "github.com/accurics/terrascan/pkg/iac-providers/docker/v1"
 	helmv3 "github.com/accurics/terrascan/pkg/iac-providers/helm/v3"
 	k8sv1 "github.com/accurics/terrascan/pkg/iac-providers/kubernetes/v1"
-	kustomizev3 "github.com/accurics/terrascan/pkg/iac-providers/kustomize/v3"
+	kustomizev4 "github.com/accurics/terrascan/pkg/iac-providers/kustomize/v4"
 	tfv12 "github.com/accurics/terrascan/pkg/iac-providers/terraform/v12"
 	tfv14 "github.com/accurics/terrascan/pkg/iac-providers/terraform/v14"
 	"github.com/accurics/terrascan/pkg/notifications/webhook"
@@ -262,7 +262,7 @@ func TestInit(t *testing.T) {
 				policyPath:  []string{testPoliciesDir},
 			},
 			wantErr:         nil,
-			wantIacProvider: []iacProvider.IacProvider{&armv1.ARMV1{}, &cftv1.CFTV1{}, &dockerv1.DockerV1{}, &helmv3.HelmV3{}, &k8sv1.K8sV1{}, &kustomizev3.KustomizeV3{}, &tfv15.TfV15{}},
+			wantIacProvider: []iacProvider.IacProvider{&armv1.ARMV1{}, &cftv1.CFTV1{}, &dockerv1.DockerV1{}, &helmv3.HelmV3{}, &k8sv1.K8sV1{}, &kustomizev4.KustomizeV4{}, &tfv15.TfV15{}},
 			wantNotifiers:   []notifications.Notifier{},
 		},
 		{
diff --git a/test/e2e/help/golden/help_scan.txt b/test/e2e/help/golden/help_scan.txt
index 8b444d480..7aa979780 100644
--- a/test/e2e/help/golden/help_scan.txt
+++ b/test/e2e/help/golden/help_scan.txt
@@ -12,7 +12,7 @@ Flags:
   -d, --iac-dir string            path to a directory containing one or more IaC files (default ".")
   -f, --iac-file string           path to a single IaC file
   -i, --iac-type string           iac type (arm, cft, docker, helm, k8s, kustomize, terraform, tfplan)
-      --iac-version string        iac version (arm: v1, cft: v1, docker: v1, helm: v3, k8s: v1, kustomize: v3, terraform: v12, v13, v14, v15, tfplan: v1)
+      --iac-version string        iac version (arm: v1, cft: v1, docker: v1, helm: v3, k8s: v1, kustomize: v4, terraform: v12, v13, v14, v15, tfplan: v1)
       --non-recursive             do not scan directories and modules recursively
   -p, --policy-path stringArray   policy path directory
   -t, --policy-type strings       policy type (all, aws, azure, docker, gcp, github, k8s) (default [all])