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

Should we enable Snyk PR integration? #1094

Closed
phillipj opened this issue Jan 5, 2017 · 31 comments
Closed

Should we enable Snyk PR integration? #1094

phillipj opened this issue Jan 5, 2017 · 31 comments

Comments

@phillipj
Copy link
Member

phillipj commented Jan 5, 2017

In August w/#841 we introduced Snyk to the project, but unfortunately wasn't able to turn on the PR integration of Snyk. That's cause it used to require private organisation wide access, which is a big no-no for the nodejs organisation.

I've been informed by @guypod that Snyk recently has made it possible to only provide public organisation wide access. AFAIK such permissions could be allowed by the nodejs org, @nodejs/ctc please correct me if I'm wrong.

@nodejs/website any thoughts on trying to enable this integration?

More about Snyk PR/alerts @ https://snyk.io/features.

@guypod
Copy link

guypod commented Jan 9, 2017

Much of this integration's goal is to keep projects free of vulnerable dependencies continuously, but it's worth noting some projects under @nodejs use vulnerable packages today, as you can see in these test reports:
https://snyk.io/org/guypod/test/github/nodejs/iojs.org
https://snyk.io/org/guypod/test/github/nodejs/foundation.nodejs.org
https://snyk.io/org/guypod/test/github/nodejs/nodejs-zh-tw

This integration will make it easy to find out about these issues and fix them with a click with the right upgrades and patches.

@Fishrock123
Copy link
Contributor

AFAIK such permissions could be allowed by the nodejs org, @nodejs/ctc please correct me if I'm wrong.

That sounds correct.

@guypod
Copy link

guypod commented Jan 9, 2017

@Fishrock123 they indeed all see to have pretty old commits, just wasn't sure if they're still deployed somewhere.
I did note nodejs-ko seems more recently updated and has vuln deps: https://snyk.io/test/github/nodejs/nodejs-ko/

@phillipj
Copy link
Member Author

Since no objects has been made, I'm trying to get this setup. For reference I'm adding a couple of screenshots showing what I'm seeing. The first grant access screen (1) looks promising. Not so much for the request nodejs organization permissions modal (2) tho which is really misleading if it's true that Snyk won't actually request access to private org data.

I've requested permissions from the nodejs org. Lets see if the org admins will grant it or not.

Screenshot 1


screen shot 2017-01-12 at 09 51 31

Screenshot 2


screen shot 2017-01-12 at 09 51 56

@guypod
Copy link

guypod commented Jan 12, 2017

@phillipj I believe the private information in this statement only refers to the list of users in the org and perhaps some other metadata. The team is confirming that's accurate right now.

As you can see in the first screen, we're definitely not requesting (nor getting) access to private repos.

Last note - we request write access only because that's the only way that allows us to set a webhook. We never commit code to the repo otherwise, only submit fix pull requests.

@phillipj
Copy link
Member Author

@phillipj I believe the private information in this statement only refers to the list of users in the org and perhaps some other metadata. The team is confirming that's accurate right now.

That might still be something we don't want. IIRC @ChALkeR might have some concerns about exposing org users?

Last note - we request write access only because that's the only way that allows us to set a webhook.

If we were able to add that webhook manually ourselfs, would we avoid this issue entirely?

@targos
Copy link
Member

targos commented Jan 12, 2017

The new GitHub integrations API has a more fine-grained permission system (and automatically creates a webhook).

@adrukh
Copy link

adrukh commented Jan 12, 2017

If we were able to add that webhook manually ourselfs, would we avoid this issue entirely?

@phillipj the webhook creation needs to come from our server, as we add a secret to sign posted webhooks so we can trust their source to be GitHub.

@bnoordhuis
Copy link
Member

Denied, sorry. Access to 'private data' is too coarse.

By signing up you agree to our terms & conditions: https://snyk.io/policies

This might be problematic. I don't think I can unilaterally agree to the T&C for the nodejs organization. Probably has to be brought up at a CTC or TSC meeting.

@jasnell
Copy link
Member

jasnell commented Jan 12, 2017

Agree that the access to the "private organizational data" is far too vague to approve this. Our policy is to prevent access to private data by default. It needs to be clarified exactly what private data Snyk would have access to and the CTC or TSC would need to review and approve it.

@guypod
Copy link

guypod commented Jan 12, 2017

All, thanks for looking into this.
I believe the second screen (requesting approval) simply has a somewhat misleading text from GitHub. The permissions we request are in the first screenshot, and clearly outlined. They contain asking for access to private email address, hence the use of the word private in the second prompt.

Perhaps one of the admins on the repo, who can choose to grant the permissions locally, could browse to https://snyk.io/add and attempt to grant the (public only) access there? This should skip the second prompt which, as I mentioned, is simply a bit poorly phrased...

@mikeal
Copy link
Contributor

mikeal commented Jan 12, 2017

As a general rule we don't enable org wide access to external applications for security reasons. We have sensitive information in private repositories.

Being that there are only a few repos that we want to enable Snyk can we just configure a proper hook per repository?

@guypod
Copy link

guypod commented Jan 12, 2017

@mikeal, the hook needs to be setup by our system as it includes a shared secret to verify requests.

However, you can easily control access further by creating a user that has access only to specific repos and integrate through that user. Would that be a valid way to set it up?

@phillipj
Copy link
Member Author

Perhaps one of the admins on the repo, who can choose to grant the permissions locally, could browse to https://snyk.io/add and attempt to grant the (public only) access there?

No repos under the nodejs org is listed there. Not under the "other repositories" tab either.

@guypod
Copy link

guypod commented Jan 13, 2017 via email

@guypod
Copy link

guypod commented Jul 26, 2017

All, it's been a long while since we had this conversation.
The ability to access only public repos is very tried and true now. If that's not enough, the ability to integrate Snyk via a broker (that further limits its code access) is very mature as well. Lastly, since Snyk is a member of the Node.js foundation we can probably own the integration ourselves :)

Would now be a good time to integrate Snyk into the public Node.js repos?

@lpinca lpinca mentioned this issue Oct 14, 2017
@refack
Copy link
Contributor

refack commented Oct 14, 2017

BTW: The private repos have been moved out nodejs/TSC#320. Does that help the situation?

lpinca added a commit that referenced this issue Oct 14, 2017
We can't integrate Snyk to the org and manually updating the .snyk file
is not feasible. The last update dates back to August 2016. Dependencies
have been updated since then but the policy file remained the same
making it useless.

Refs: #841
Refs: #1094
@lpinca
Copy link
Member

lpinca commented Oct 15, 2017

@Fishrock123 can you please take a look?

@lpinca
Copy link
Member

lpinca commented Oct 15, 2017

Also cc @Trott @jasnell.

@Trott
Copy link
Member

Trott commented Oct 16, 2017

@lpinca I've been uninvolved in this conversation to this point and it's not clear to me why I'm being cc'ed. Can you elaborate a bit?

@lpinca
Copy link
Member

lpinca commented Oct 16, 2017

@Trott yes, sorry. I'll try to summarize. There was an attempt to enable Snyk on this repo which failed becuase Snyk required an org wide permission. @guypod argued that it's possible to grant access only to public repos.

The ability to access only public repos is very tried and true now.

Perhaps one of the admins on the repo, who can choose to grant the permissions locally, could browse to https://snyk.io/add and attempt to grant the (public only) access there? This should skip the second prompt which, as I mentioned, is simply a bit poorly phrased...

My suggestion was that an admin in the org try that flow, as they would be able to grant access directly, just to better demonstrate there is no further "private" info we get access to, which is unclear from that pesky bad phrasing in the GitHub second prompt :)

So I tried to get the attention of some active org owners.

@fhemberger
Copy link
Contributor

BTW: Same goes for GitLocalize and Greenkeeper. Would be great assets for us.

@sotayamashita
Copy link
Contributor

@fhemberger I got a solution from platform engineer of GitHub. I will share it soon.

@Fishrock123
Copy link
Contributor

There are still sensitive repos in the org. Unless these applications can guarantee that they don't have private repo access I can't enable them, for now, still. We have the nodejs-private org now but there are still things that are not moved at this time.

@phillipj
Copy link
Member Author

Got pinged to see if I was able to cancel the previous authorisation request, but I haven't found that anywhere on github.com so far.

I tried to go through the authorisation process again, although the process seem to have been changed slightly, I'm not even able to request permissions anymore. This is what I did with a couple of added screenshots:

  1. https://snyk.io/add
  2. Authorized Snyk to get my public details (email)
  3. Choose to only fetch public repo info (screenshot #1)
  4. Not able to request access to the nodejs organisation (screenshot #2)

Click that red cross in step 4 doesn't delete my previous request, but sends me to an info page about OAuth restrictions.

Screenshot 1


screen shot 2017-10-19 at 20 31 35

Screenshot 2


screen shot 2017-10-19 at 20 44 03 2

@sotayamashita
Copy link
Contributor

@phillipj I think GitLocalize and Snyk has same problem. if you are member of Snyk. Let's solve this problem together.

@guypod
Copy link

guypod commented Oct 26, 2017

@sotayamashita I'm with Snyk, let's talk this through. How about a quick call to discuss? Can you ping a note to contact@snyk.io and I'll take it from there?

fhemberger pushed a commit that referenced this issue Dec 19, 2017
We can't integrate Snyk to the org and manually updating the .snyk file
is not feasible. The last update dates back to August 2016. Dependencies
have been updated since then but the policy file remained the same
making it useless.

Refs: #841
Refs: #1094
@fhemberger
Copy link
Contributor

Removed Snyk for the moment (see #1402), as we just push out static HTML and don't run any actual Node.js code in production. Closing this, but feel free to re-open once we want it back in place.

@sotayamashita
Copy link
Contributor

@guypod My bad, I didn't notice you there. If you've straggled with it already, let's talk!! I will send a email.

@sjmaple
Copy link

sjmaple commented Apr 3, 2018

@sotayamashita hey Sam, I joined Snyk's dev rel team and can perhaps jump on a call to discuss this further - I'd be keen to help get this up and running again. I'm at simon@snyk.io.

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

No branches or pull requests