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

Enable Dependabot for NPM packages #86

Closed
donpui opened this issue Nov 23, 2022 · 19 comments
Closed

Enable Dependabot for NPM packages #86

donpui opened this issue Nov 23, 2022 · 19 comments
Assignees
Labels
Tech Debt Technical debt, small improvements to code, libraries

Comments

@donpui
Copy link
Contributor

donpui commented Nov 23, 2022

Enable Github Dependabot for NPM packages to scan for security issues with packages.

For discussion, should we configure only production packages scanning or also devDependencies?

@donpui
Copy link
Contributor Author

donpui commented Dec 6, 2022

@btlogy may be you could look at this issue?

@btlogy
Copy link
Contributor

btlogy commented Dec 6, 2022

I just had a quick look. And my first impressions are:

  • Dependabot encompasses 3 different features: alerts, security and version updates. Are we talking only about alerts in this issue @donpui?
  • Dependabot features can be enabled only by repository owners or people with admin access, which I don't have (yet) in this repository.
  • Dependabot feature do not seems to be configurable via the Terraform module we are using today.

@wuan, can you give us some guidance on how to go further here?

As for the discussion, I'm not sure there is a way to scan only production packages. In a repository I'm testing, it seems like we can only enable or disable the Dependabot Alert feature. Not much to configure there.
This being said, my experience with GitHub features is still a WiP...

@donpui
Copy link
Contributor Author

donpui commented Dec 6, 2022

I was more thinking about security alerts. There are possibility to configure via Github interface, but maybe it is possible to configure via .yml file: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file and then push changes here?

@donpui
Copy link
Contributor Author

donpui commented Dec 6, 2022

Also now, if we run npm audit, it will find some issues, but if we omit=dev packages, currently there is no vulnerabilities (by npm audit). For discussion, should we enable for all packages and have pain or should we focus only for prod packages usage (which are deployed)?
FYI @JustusFT

@wuan
Copy link
Contributor

wuan commented Dec 6, 2022

Support for the security_and_analysis block seems to be on the way: mineiros-io/terraform-github-repository#143

It would be best to set this via the Terraform configuration.

@btlogy
Copy link
Contributor

btlogy commented Dec 6, 2022

Support for the security_and_analysis block seems to be on the way: mineiros-io/terraform-github-repository#143

Good catch @wuan. My search results were empty there (not always indexed apparently).

@btlogy
Copy link
Contributor

btlogy commented Dec 6, 2022

I was more thinking about security alerts. There are possibility to configure via Github interface, but maybe it is possible to configure via .yml file: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file and then push changes here?

This looks like a nice way to tune Dendendabot @donpui, but I think it needs to be enabled for the repository first.

@btlogy
Copy link
Contributor

btlogy commented Dec 6, 2022

Also now, if we run npm audit, it will find some issues, but if we omit=dev packages, currently there is no vulnerabilities (by npm audit). For discussion, should we enable for all packages and have pain or should we focus only for prod packages usage (which are deployed)?

With this in mind, and since it is only about alerting: should we not then add a GitHub action to npm audit rather than enable Dependabot @donpui?

I'm only asking because enabling this as requested would mean using yet another platform feature we can rely on only for some of our projects (i.e.: not for PrivateStorageWeb for instance).

@donpui donpui added the Tech Debt Technical debt, small improvements to code, libraries label Dec 22, 2022
@donpui
Copy link
Contributor Author

donpui commented Jan 19, 2023

With this in mind, and since it is only about alerting: should we not then add a GitHub action to npm audit rather than enable Dependabot @donpui?

We can have a mix usage, run in Github Actions and also on Github. Github Dependabot provide some Web interface and also can create PRs.
Downside of CI, is that if there is not changes, not checks are done. Dependabot runs regularly. Although, maybe CI also can be setup regularly.

@donpui
Copy link
Contributor Author

donpui commented Jan 19, 2023

Lets enable Dependabot first (as it is quickest open), while we explore and make other more common via all repos approach.

@donpui
Copy link
Contributor Author

donpui commented Jan 19, 2023

Actually dependabot is already enabled in this repo, however only Admin level can see. Plus or not, if security check runs in CI, it could be seen for lower rights users.

@btlogy
Copy link
Contributor

btlogy commented Jan 20, 2023

Nearly 2 months since mineiros-io/terraform-github-repository#143 and not yet merged...
I can push a dependabot.yml file, but I feel like I'll be poking in the dark as long as I'm not an Admin...
I'll test in a sandbox repo...

@wuan
Copy link
Contributor

wuan commented Jan 20, 2023

We can enable Dependabot manually for selected repositories so that we do not need to wait for the update and in parallel all click on the thumbs up here: mineiros-io/terraform-github-repository#145.

@donpui
Copy link
Contributor Author

donpui commented Jan 23, 2023

Winden it is already enabled.

@donpui donpui closed this as completed Jan 23, 2023
@btlogy
Copy link
Contributor

btlogy commented Jan 23, 2023

For the record: I've tested dependabot.yml elsewhere and this did not enable the alerting.

@wuan
Copy link
Contributor

wuan commented Jan 26, 2023

For the record: I've tested dependabot.yml elsewhere and this did not enable the alerting.

Having a look at the "Code security and analysis" section in the repo settings it looks like Dependabot is enabled:

image

@btlogy
Copy link
Contributor

btlogy commented Jan 26, 2023

Thank you @wuan.

From this screenshot we can confirm Dependabot is enabled, but altering is disabled!
Now, when I've asked earlier:

Dependabot encompasses 3 different features: alerts, security and version updates. Are we talking only about alerts in this issue @donpui?

@donpui replied:

I was more thinking about security alerts.

Thus, is this issue really resolved?

@donpui
Copy link
Contributor Author

donpui commented Jan 27, 2023

Thus, is this issue really resolved?

Alerts are enabled, button shows, that you can disable :) However, they are visible in Security Dashboard, but only who have certain rights. Dependabot also allows to create PR automatically, however, this means public disclosure.

@btlogy
Copy link
Contributor

btlogy commented Jan 27, 2023

Alerts are enabled, button shows, that you can disable :)

Oups...
Now I see :-p
I found that way of presenting disable/enable button a bit counter-intuitive, but I'll get used to it, I guess.
Thank you @donpui.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tech Debt Technical debt, small improvements to code, libraries
Projects
None yet
Development

No branches or pull requests

3 participants