Implemented CIS Kubernetes benchmark
All checks were successful
--> Linted: ANSIBLE No errors were found in the linting process
--> Linted: GITLEAKS No errors were found in the linting process
--> Linted: JSCPD No errors were found in the linting process
--> Linted: TERRAFORM_TFLINT No errors were found in the linting process
--> Linted: TERRAFORM_TERRASCAN No errors were found in the linting process
Lint Code Base / run-lint (push) Successful in 42s

This commit is contained in:
Davide Oddone 2024-10-18 13:16:30 +02:00
parent 319c7b2a6f
commit bb7393b05e

View File

@ -192,3 +192,21 @@ resource null_resource create_namespace {
} }
} }
} }
resource null_resource run_benchmark {
depends_on = [
null_resource.create_namespace
]
provisioner "remote-exec" {
inline = ["curl https://raw.githubusercontent.com/aquasecurity/kube-bench/refs/heads/main/job-master.yaml > job-master.yaml", "kubectl --kubeconfig ~/.kube/config apply -f job-master.yaml", "rm job-master.yaml"]
connection {
host = libvirt_domain.k8s_masters[0].network_interface[0].addresses[0]
type = "ssh"
user = "ansible"
private_key = data.template_file.private_key.rendered
}
}
}