-
Notifications
You must be signed in to change notification settings - Fork 0
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
Create a re-usable workflow for oci-image scans #69
Comments
Thank you for reporting us your feedback! The internal ticket has been created: https://warthogs.atlassian.net/browse/KF-6331.
|
Based on feedback from @misohu, the way to better approach this enhancement proposal is to have the scans closer to the source (each rock repository) instead of a central place. |
Add the option to report vulnerabilities automatically via Github issues. Fixes #69
Add the option to report vulnerabilities automatically via Github issues. Fixes #69
This re-usable workflow can be used for reporting security vulnerabilities via Github issues. It takes the issue title, image-name, and issue-labels as inputs, and in turn: * edits an existing issue with the same title and updates the vulnerability report * creates a new issue with the issue-title and adds the vulnerability report in the description Please NOTE this workflow assumes the existence of vulnerability reports as artefacts of a workflow run; that is, it expects artefacts named trivy-report-<image-name> to be present in the sabe workflow run. Part of #69
… reports This commit adds get-published-images-scan-and-report.yaml, a re-usable workflow that enables repositories to scan images from a public registry (in the case of the Analytics team it defaults to charmedkubeflow) and reports back the security vulnerabilities as Github issues. This workflow is intended to be used on demand (using a workflow dispatch) and on schedule, as it will be used for continuous testing of the published images a rock repository generates. Part of #69
SolutionsBased on the description of this issue and after working a bit on the solution, we have the following:
This workflow is flexible enough to work with the current implementation of This workflow can also be used for workflows triggered
DiscussionsA) Should automatic reports be enabled
This can be solved by relying on the scheduled workflow, BUT, the scheduled workflow only scans and reports published images. On the other hand, not enabling this would ensure that the CI is always green and publishing images regardless of the vulnerabilities. #74 shows an example of how this can be added and be left for us to enable it whenever we call |
This commit enables the automatic creation of Github issues when a security vulnerability is found in the scan jobs that the build-scan-test-publish-rock.yaml already performs. The intention of this is to add reporting capabilities to the workflows that are already using build-scan-test-publish-rock.yaml on_merge, that is, enable automatic reports of vulnerabilities as Github issues on every merge. Part of #69
* ci: add workflow to enable automatic vulnerability reports This re-usable workflow can be used for reporting security vulnerabilities via Github issues. It takes the issue title, image-name, and issue-labels as inputs, and in turn: * edits an existing issue with the same title and updates the vulnerability report * creates a new issue with the issue-title and adds the vulnerability report in the description Please NOTE this workflow assumes the existence of vulnerability reports as artefacts of a workflow run; that is, it expects artefacts named trivy-report-<image-name> to be present in the sabe workflow run. Part of #69
#73) * ci: add re-usable workflow for scans from published img and automatic reports This commit adds get-published-images-scan-and-report.yaml, a re-usable workflow that enables repositories to scan images from a public registry (in the case of the Analytics team it defaults to charmedkubeflow) and reports back the security vulnerabilities as Github issues. This workflow is intended to be used on demand (using a workflow dispatch) and on schedule, as it will be used for continuous testing of the published images a rock repository generates. Part of #69
Context
As the team grows its offerings, security vulnerabilities must be scanned and report effectively so the team can addressed them in an appropriate time.
Currently, the only repository that has a Github workflow for scanning
oci-images
and getting reports iscanonical/bundle-kubeflow
using thescan-images.yaml
workflow. While working correctly at the moment, this workflow presents the following limitations:get-all-images.py
script depends on scripts present in each repository to generate a list of images per repo. The problem with this is that 1) not all repos have this script (e.g. mlflow), 2) this script is tightly coupled to the host repo.canonical/kubeflow-ci
. This is problematic because 1) it creates a maintenance task, 2) they are doing something that actions likeaquasecurity/[email protected]
are already providing.mlflow-operator
repository.Proposal
Create a re-usable workflow for scanning oci-images that:
aquasecurity/[email protected]
to scan and generate reports for each of the images under scanPlease NOTE that part of this proposal is to only scan images that the Analytics team maintains. This is because the images that charms use that come from upstream cannot be patched by us.
Limitations
1. There is no other way of fetching the images that each charm uses, so for now we'll stick to using theget-all-images.py
script.2. The Trivy reports will be uploaded individually, meaning that there is a linear relation between the number of scanned images and the number of artefacts saved in the workflow run.
3. BIGGEST This workflow will be coupling the product to the rocks, that is, the scans are done far from the source code. Ideally we'd have scans and vulnerability reports at the rockcraft project repositories. For this one, though, we could plan to push rocks to theThe workflows will live at rocks repo level, so this is not a limitation anymore.oci-factory
and outsource all the vulnerability scans and reports.Out of scope
Example
What needs to get done
Create a re-usable workflow for getting images used by any rock, scanning them for vulnerabilities, and reporting found vulns following the example in https://github.com/canonical/bundle-kubeflow/pull/1087/files#diff-327280cbc65c9de9998db8b0e5d1c937ccf75524907e5f9d026304ca85146f53
Definition of Done
There is a re-usable workflow that any of the charming products of this team can use.
The text was updated successfully, but these errors were encountered: