-
Notifications
You must be signed in to change notification settings - Fork 66
ci: add trivy security scanning workflow #571
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2f3e3b8
to
a4bff4f
Compare
/ok-to-test |
a4bff4f
to
7679b90
Compare
7679b90
to
847a70b
Compare
32542fb
to
f99f030
Compare
This commit provides a basic GHA to enable Trivy FS scanning on the notebooks-v1 and notebooks-v2 branches. In order to support `workflow_dispatch` and `cron` triggers - this GHA needs to live on the default branch (`main`). But while the workflow lives on the `main` branch - it will only scan `notebooks-v1` and/or `notebooks-v2` branches depending on how its invoked. It scans from the root of repo and reports on `CRITICAL`, `HIGH` or `MEDIUM` vulnerabilities that have fixes available. It will also scan for secrets. It will always exit with status code 0 and upload its results to the GitHub Security tab. Custom ruleId metadata is injected into the report to help differentiate whether reported findings originated in `notebooks-v1` or `notebooks-v2`. - custom `ruleId` also ensures flagging a false positive in `notebooks-v1` will not auto-apply to `notebooks-v2` branch if similar vulnerabilities exist and vice-versa. The workflow is configured to fire every day at 6:00 AM UTC and also supports manually invoking it. I personally did not see any reason to run this on pull_requests and/or pushes to `notebooks-v1` or `notebooks-v2` branches as vulnerabilities could be disclosed / fixes made available **at any time**. Therefore, having it set on a daily schedule as well as supported ad-hoc runs seems a reasonable way to manage. Addtionally, the build has an `if:` conditional to prevent the `schedule` runs from running on forks in an attempt to be a good/responsible github citizen. Signed-off-by: Andy Stoneberg <[email protected]>
f99f030
to
55c2ace
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: thesuperzapper The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ℹ️ : NO GH ISSUE
This commit provides a basic GHA to enable Trivy FS scanning on the notebooks-v1 and notebooks-v2 branches. In order to support
workflow_dispatch
andcron
triggers - this GHA needs to live on the default branch (main
). But while the workflow lives on themain
branch - it will only scannotebooks-v1
and/ornotebooks-v2
branches depending on how its invoked.It scans from the root of repo and reports on
CRITICAL
orHIGH
vulnerabilities that have fixes available. It will also scan for secrets. It will always exit with status code 0 and upload its results to the GitHub Security tab. Custom ruleId metadata is injected into the report to help differentiate whether reported findings originated innotebooks-v1
ornotebooks-v2
.ruleId
also ensures flagging a false positive innotebooks-v1
will not auto-apply tonotebooks-v2
branch if similar vulnerabilities exist and vice-versa.The workflow is configured to fire every Sunday at 6:00 AM UTC and also supports manually invoking it. I personally did not see any reason to run this on pull_requests and/or pushes to
notebooks-v1
ornotebooks-v2
branches as vulnerabilities could be disclosed / fixes made available at any time. Therefore, having it set on a weekly schedule as well as supported ad-hoc runs seems a reasonable way to manage.Addtionally, the build has an
if:
conditional to prevent theschedule
runs from running on forks in an attempt to be a good/responsible github citizen.