Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(terraform) Add versioned kubernetes resources to existing terraform kubernetes checks #3651

Closed

Conversation

ugrave
Copy link
Contributor

@ugrave ugrave commented Oct 12, 2022

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Description

Terraform Kuernetes provider has changes the pattern how to name rousource. The resource contains now that api version in the resource name (https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/guides/versioned-resources)
This PR adds add the new resource names to the existing checks

  • kubernetes_pod_v1
  • kubernetes_deployment_v1
  • kubernetes_daemon_set_v1
  • kubernetes_stateful_set_v1
  • kubernetes_replication_controller_v1
  • kubernetes_job_v1
  • kubernetes_cron_job_v1
  • kubernetes_api_service_v1
  • kubernetes_secret_v1
  • kubernetes_service_account_v1
  • kubernetes_role_binding_v1
  • kubernetes_config_map_v1
  • kubernetes_ingress_v1

Fixes #3650

Edited policies

  • CKV_K8S_20
    Add resource: kubernetes_pod_v1
  • CKV_K8S_25
    Add resource: kubernetes_pod_v1
  • CKV_K8S_39
    Add resource: kubernetes_pod_v1
  • CKV_K8S_11
    Add resource: kubernetes_pod_v1
  • CKV_K8S_10
    Add resource: kubernetes_pod_v1
  • CKV_K8S_30
    Add resource: kubernetes_pod_v1
  • CKV_K8S_21
    Add resources: kubernetes_pod_v1, kubernetes_deployment_v1, kubernetes_daemon_set_v1, kubernetes_stateful_set_v1, kubernetes_replication_controller_v1, kubernetes_job_v1, kubernetes_cron_job_v1, kubernetes_api_service_v1, kubernetes_secret_v1, kubernetes_service_account_v1, kubernetes_role_binding_v1, kubernetes_config_map_v1, kubernetes_ingress_v1
  • CKV_K8S_41
    Add resources: kubernetes_service_account_v1
  • CKV_K8S_42
    Add resources: kubernetes_role_binding_v1, kubernetes_cluster_role_binding_v1
  • CKV_K8S_27
    Add resources: kubernetes_pod_v1, kubernetes_deployment_v1, kubernetes_daemon_set_v1
  • CKV_K8S_28
    Add resource: kubernetes_pod_v1
  • CKV_K8S_26
    Add resource: kubernetes_pod_v1
  • CKV_K8S_43
    Add resource: kubernetes_pod_v1
  • CKV_K8S_15
    Add resource: kubernetes_pod_v1
  • CKV_K8S_14
    Add resource: kubernetes_pod_v1
  • CKV_K8S_8
    Add resource: kubernetes_pod_v1
  • CKV_K8S_12
    Add resource: kubernetes_pod_v1
  • CKV_K8S_13
    Add resource: kubernetes_pod_v1
  • CKV_K8S_37
    Add resource: kubernetes_pod_v1
  • CKV_K8S_29
    Add resources: kubernetes_pod_v1, kubernetes_deployment_v1, kubernetes_daemon_set_v1
  • CKV_K8S_16
    Add resource: kubernetes_pod_v1
  • CKV_K8S_9
    Add resource: kubernetes_pod_v1
  • CKV_K8S_22
    Add resource: kubernetes_pod_v1
  • CKV_K8S_35
    Add resource: kubernetes_pod_v1
  • CKV_K8S_18
    Add resource: kubernetes_pod_v1
  • CKV_K8S_17
    Add resource: kubernetes_pod_v1
  • CKV_K8S_19
    Add resource: kubernetes_pod_v1
  • CKV_K8S_44
    Add resource: kubernetes_service_v1
  • CKV_K8S_49
    Add resources: kubernetes_role_v1, kubernetes_cluster_role_v1

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my feature, policy, or fix is effective and works
  • New and existing tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@gruebel
Copy link
Contributor

gruebel commented Oct 13, 2022

hey @ugrave thanks for effort, but can you split it up in smaller chunks. As far as I can tell, you adjusted 30 checks, so how about 5 separate PRs with 6 checks each 🙂

@ugrave
Copy link
Contributor Author

ugrave commented Oct 13, 2022

Hi, i created 5 new PRs I will close this one.

#3653
#3654
#3655
#3656
#3657

@ugrave ugrave closed this Oct 13, 2022
@gruebel
Copy link
Contributor

gruebel commented Oct 13, 2022

nice, thanks 🍻

@ugrave ugrave deleted the versioned_kubernetes_resources branch October 14, 2022 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Terraform kubernetes checks doesn`t include new versioned resources
2 participants