feat: Analyze manifests concurrently
What does this MR do?
Previous logic ran sequential kubesec scans for each manifest. This update changes the analyzer logic to scan each concurrently and concatenate the results
Before
time docker run: 12.346 total
❯ time docker run --rm --volume "$PWD":/tmp/app --env GITLAB_FEATURES="sast_custom_rulesets,vulnerability_finding_signatures" --env CI_PROJECT_DIR="/tmp/app" kubesec:master
[INFO] [Kubesec] [2021-10-29T21:31:14Z] ▶ GitLab Kubesec analyzer v2.15.0
[INFO] [Kubesec] [2021-10-29T21:31:14Z] ▶ Detecting project
[INFO] [Kubesec] [2021-10-29T21:31:14Z] ▶ Found project in /tmp/app
[INFO] [Kubesec] [2021-10-29T21:31:14Z] ▶ Running analyzer
[INFO] [Kubesec] [2021-10-29T21:31:14Z] ▶ Searching /tmp/app for Kubernetes manifests.
[INFO] [Kubesec] [2021-10-29T21:31:26Z] ▶ Creating report
docker run --rm --volume "$PWD":/tmp/app --env --env kubesec:master 0.14s user 0.10s system 1% cpu 12.346 total
After
time docker run: 0.844 total
❯ time docker run --rm --volume "$PWD":/tmp/app --env GITLAB_FEATURES="sast_custom_rulesets,vulnerability_finding_signatures" --env CI_PROJECT_DIR="/tmp/app" kubesec:master
[INFO] [Kubesec] [2021-10-29T21:30:51Z] ▶ GitLab Kubesec analyzer v2.15.0
[INFO] [Kubesec] [2021-10-29T21:30:51Z] ▶ Detecting project
[INFO] [Kubesec] [2021-10-29T21:30:51Z] ▶ Found project in /tmp/app
[INFO] [Kubesec] [2021-10-29T21:30:51Z] ▶ Running analyzer
[INFO] [Kubesec] [2021-10-29T21:30:51Z] ▶ Searching /tmp/app for Kubernetes manifests.
[INFO] [Kubesec] [2021-10-29T21:30:51Z] ▶ Creating report
docker run --rm --volume "$PWD":/tmp/app --env --env kubesec:master 0.13s user 0.07s system 23% cpu 0.844 total
What are the relevant issue numbers?
Does this MR meet the acceptance criteria?
-
Changelog entry added -
Documentation created/updated for GitLab EE, if necessary -
Documentation created/updated for this project, if necessary -
Documentation reviewed by technical writer or follow-up review issue created -
Tests added for this feature/bug -
Job definition updated, if necessary -
Conforms to the code review guidelines -
Conforms to the Go guidelines -
Security reports checked/validated by reviewer
Edited by Lucas Charles