feat: add IaC security scanning with Checkov#6
feat: add IaC security scanning with Checkov#6moghit-eou wants to merge 4 commits intoMedical-Informatics-Platform:mainfrom
Conversation
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
|
Nice PR, thank you again @moghit-eou . |
|
Hi @moghit-eou, Now for the following, what was the logic behind excluding them fully? Is there an option for exceptions instead maybe?
Finally, Checkov now only scans this repo and not the dependencies it pulls. While this is a simple approach that can be remediated by adding checkov to other MIP repositories, what happens for other dependencies? I have to say that I don't yet have a solution for this but this is something we will need to think about and that is not blocking for this PR> |
|
Hi @jdaln, Hope the conference went well. On the Submariner failures: thanks for the context, good to know those should be cleaned up with the version upgrade. On the global skips: My initial approach was too broad. I used those three skips as a temporary way to unblock the first scan, but I intended to narrow them down properly. After a quick reviewing the repo and the relevant Checkov references, here is what I found: CKV_K8S_8 / CKV_K8S_9 are workload checks for liveness and readiness probes. In this repo, they are not meaningful on ArgoCD control resources such as CKV_K8S_35 is also a workload-level check: it evaluates how running containers consume secrets. For the same reason, it is not meaningful on ArgoCD control resources that do not define runtime containers or environment-variable based secret injection. The full scope of what this check targets is documented in the Checkov Kubernetes policy index. On exceptions instead of global skips: Checkov supports inline suppression at the individual resource level (suppression docs), so my proposed fix is to remove the global # checkov:skip=CKV_K8S_8: ArgoCD control resource - no runtime containers defined
# checkov:skip=CKV_K8S_9: ArgoCD control resource - no runtime containers defined
# checkov:skip=CKV_K8S_35: ArgoCD control resource - no runtime containers defined
apiVersion: argoproj.io/v1alpha1
kind: Application
...This way, real workload manifests such as On dependency scanning: you are right that Checkov currently only scans this repository, not the external Helm charts it references. I agree that is a separate gap worth tracking, and adding checks upstream in the MIP-related repositories seems like the cleanest direction. Does that approach make sense? Sorry, I can't provide more detailed approach I have an university exam this week so I have not had the chance to fully work through the implementation yet but I will take a closer look once that is done and update the PR in the weekend. |
|
@moghit-eou it did, thank you! And I have some takeaways in terms of runtime security that will be interesting to look at I believe :) . This approach is excellent. Let's wait for Google to communicate the results for the GSoC at the end of the month before moving further for now I would say. Good luck for your exams! |
What this does
Adds a Checkov workflow that scans all Kubernetes, Helm, and Kustomize
files on every PR for security misconfigurations.
Known limitation ( security gap ): skip_check
CKV_K8S_8,CKV_K8S_9,CKV_K8S_35are globally skipped to avoid false positives on ArgoCDwhich are not Kubernetes workloads and have no containers. You can find all the Checkov's rules in this link
I'm still working through the codebase to identify exactly which ArgoCD files need to be modified and I will address this in a follow up PR.
soft_fail: true
mip-infra has never been scanned before that why the first run will surface existing
findings in current files. soft_fail=true makes issues visible without
blocking all open PRs immediately.