Skip to content
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

ci: add various scan & enforce them #34

Merged
merged 6 commits into from
May 25, 2022
Merged

ci: add various scan & enforce them #34

merged 6 commits into from
May 25, 2022

Conversation

louis-bompart
Copy link
Collaborator

@louis-bompart louis-bompart commented May 20, 2022

  • Add a GHA composite action that runs Snyk and Snyk Code

  • Add aforementioned action to the CI job. In the case of the CI, the goal is only to report (so this is why there's a continue-on-error). The enforcing is done using the checks that this generates. You can see an example in the coveo/cli: https://github.com/coveo/cli/pull/794/checks?check_run_id=6525846881. The boon of this method is that it allows PR to come in if they do not worsen the project (so if the project were to have a vuln detected, it will not grind the CI to a halt).

  • Add the action to the CD, but this time, it'll crash if there's unaddressed vulnerability.

    • For Snyk dependency analysis: vuln has to be fixed or addressed using Snyk UI.
    • For Snyk Code and CodeQL, use the GitHub Code Scanning Alert UI.

fixes #20

@louis-bompart louis-bompart requested review from a team, GermainBergeron and aiheon and removed request for a team May 20, 2022 15:31
@louis-bompart louis-bompart force-pushed the ci/#20 branch 2 times, most recently from 5eaa99b to 4741156 Compare May 20, 2022 15:45
@louis-bompart louis-bompart marked this pull request as draft May 20, 2022 15:46
@louis-bompart louis-bompart force-pushed the ci/#20 branch 3 times, most recently from ba3dce1 to 86eb376 Compare May 20, 2022 16:17
@louis-bompart louis-bompart force-pushed the main branch 2 times, most recently from f7d9078 to 9516656 Compare May 24, 2022 16:32
@louis-bompart
Copy link
Collaborator Author

Needs #36 to resync package-lock.json, which will allow snyk dependency scan to work properly

Copy link
Member

@GermainBergeron GermainBergeron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm really not that knowledgeable in Github actions, but it seems like we repeat a lot of code?

@louis-bompart
Copy link
Collaborator Author

I'm really not that knowledgeable in Github actions, but it seems like we repeat a lot of code?

Oh yeah. :feelsgood: . There's the concept of composite actions, that I wanted to use for that... But they do not support the continue-on-error option. So I was forced to repeat.

Tho I'll check again it seems it's been added very very recently. OneMoreTry ™️

@louis-bompart louis-bompart marked this pull request as ready for review May 25, 2022 16:15
@louis-bompart
Copy link
Collaborator Author

image
e.g. of the end results. SnykCode, Snyk Open Source are enforced (i.e. cannot merge if red)

@louis-bompart louis-bompart merged commit 59a8170 into main May 25, 2022
@louis-bompart louis-bompart deleted the ci/#20 branch May 25, 2022 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add security analysis tools
2 participants