reactioncommerce / reaction-feature-requests

Reaction Feature Requests
13 stars 1 forks source link

Rethink security scanning CI approach #66

Open focusaurus opened 5 years ago

focusaurus commented 5 years ago

Most of our javascript repositories are using the snyk security auditing tool in some fashion. This is often a CI check linked to github pull requests. I'm not sure this approach is the best.

Problems with snyk as a pull request CI check

Alternatives to consider

CC: @rosshadden

kieckhafer commented 5 years ago

Looks like Snyk itself is dealing with the forked PR issue: https://github.com/snyk/snyk/pull/510

spencern commented 5 years ago

@focusaurus, thanks for getting this discussion started.

I've been thinking a lot about this over the past few weeks. It seems there's good momentum toward this proposal.

For several reasons, I agree with your conclusion that we should remove snyk test from our CI pipeline.

As you mention snyk fails to run during CI for all contributions from a fork. This alone is enough for me to consider this change.

The CI integration of snyk also fails to take into account whether the failure was introduced in a given pull request, causing unnecessary failure, and blocking PRs. The cost of rerunning a CI build is high, as our CI workflow takes 30 minutes or more to run.

We now have other snyk tools for auditing a PR for newly introduced vulnerabilities that were not present when we setup this CI workflow. For example, in the reaction repo, we have a GitHub check for licenses and for security, both run by snyk.

image

These seem to work regardless of whether a PR is from a fork or not, and are integrated via GitHub webhooks, rather than requiring a token to be shared.

We now also have better tools - such as the snyk dashboard - for ongoing monitoring of security vulnerabilities that have been introduced across all of our projects and don't have to wait for a PR to a project to learn about them.

spencern commented 5 years ago

@kieckhafer I think the issue may be one with CircleCI and how ENV variables (such as our token) are made available (or not) during the workflow. That issue seems to have stalled a bit

spencern commented 5 years ago

All considered, I'm in favor of this decision to remove snyk from our CI process and use the other tools available for auditing package vulnerabilities