Open morelser opened 2 years ago
Fixed, it was a formatting error in the Security context block. Terraform expects snake_case and Kubernetes uses camelCase.
...
security_context {
run_as_non_root = true
run_as_user = 1000
run_as_group = 1000
fs_group = 1000
}
...
Hello, I'm re-opening because the fix works for deploying the cronJob, the securityContext is applied. But terrascan still fails to recognize the security_context block.
Description
Terrascan detects a policy violation for missing Security context in a "kubernetes_cron_job" resource definition. Reference ID AC-K8-NS-PO-M-0122
What I Did
Copy the example resource definition for a kubernetes_cron_job from the Terraform documentation and add the security_context in the container spec.
Run
terrascan
and see policy violation in the scan summary.Running terrascan with log level set to debug shows this: