Skip to content

Commit

Permalink
feat(terraform): add versioned kubernetes resources to terraform kube…
Browse files Browse the repository at this point in the history
…rnetes checks (1/5) (bridgecrewio#3653)

Add versioned kubernetes resources to terraform kubernetes checks (Part 1/5)
  • Loading branch information
ugrave authored Oct 18, 2022
1 parent 642a0c3 commit cd5033c
Show file tree
Hide file tree
Showing 20 changed files with 1,837 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def __init__(self):

name = "Containers should not run with allowPrivilegeEscalation"
id = "CKV_K8S_20"
supported_resources = ['kubernetes_pod']
supported_resources = ['kubernetes_pod', 'kubernetes_pod_v1']
categories = [CheckCategories.GENERAL_SECURITY]
super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def __init__(self):

id = "CKV_K8S_25"

supported_resources = ['kubernetes_pod']
supported_resources = ['kubernetes_pod', 'kubernetes_pod_v1']
categories = [CheckCategories.GENERAL_SECURITY]
super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def __init__(self):
# https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
id = "CKV_K8S_39"

supported_resources = ['kubernetes_pod']
supported_resources = ['kubernetes_pod', 'kubernetes_pod_v1']
categories = [CheckCategories.GENERAL_SECURITY]
super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)

Expand Down
2 changes: 1 addition & 1 deletion checkov/terraform/checks/resource/kubernetes/CPULimits.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class CPULimits(BaseResourceCheck):
def __init__(self) -> None:
name = "CPU Limits should be set"
id = "CKV_K8S_11"
supported_resources = ["kubernetes_pod"]
supported_resources = ["kubernetes_pod", "kubernetes_pod_v1"]
categories = [CheckCategories.GENERAL_SECURITY]
super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class CPURequests(BaseResourceCheck):
def __init__(self):
name = "CPU requests should be set"
id = "CKV_K8S_10"
supported_resources = ["kubernetes_pod"]
supported_resources = ["kubernetes_pod", "kubernetes_pod_v1"]
categories = [CheckCategories.GENERAL_SECURITY]
super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def __init__(self):
# Location: container .securityContext
id = "CKV_K8S_30"

supported_resources = ['kubernetes_pod']
supported_resources = ['kubernetes_pod', 'kubernetes_pod_v1']
categories = [CheckCategories.GENERAL_SECURITY]
super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)

Expand Down
Loading

0 comments on commit cd5033c

Please sign in to comment.