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

GitHub token information #333

Open
smythp opened this issue Jun 21, 2024 · 2 comments
Open

GitHub token information #333

smythp opened this issue Jun 21, 2024 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@smythp
Copy link

smythp commented Jun 21, 2024

I seem to be able to download the data cache for all providers using the make command without issues, but when using

grype-db -g

It errors on GitHub, and seems that I need a token. I'm wondering if there are docs on which token is needed? Looking at the config, it seems the token should be set an an env variable, but correct me if I'm wrong.

Alternatively, is there a way to run the grype-db build command and use all the cached data in the data folder? It seems like it really wants grype-db -g to be run to configure providers first, but I have the data sitting here in the cache, and just grype-db to build a database using all of it.

$ ls data/vunnel 
alpine  chainguard  github   nvd     rhel  ubuntu
amazon  debian      mariner  oracle  sles  wolfi
$ grype-db build
[0000]  INFO grype-db version: 0.23.1
[0000] ERROR configure a provider via the application config or use -g to generate a list of configs from vunnel
[0000] ERROR 1 error occurred:
	* unable to create providers: no providers configured


error: 1 error occurred:
	* unable to create providers: no providers configured
@wagoodman
Copy link
Contributor

It errors on GitHub, and seems that I need a token.

Indeed to run the vunnel provider (which is being invoked by grype-db) then you'll need a github token. I don't think any special permissions are needed.

I'm using the following .grype-db.yaml file to run this:

provider:
  root: data/vunnel
  vunnel:
    executor: docker
    docker-tag: latest
    generate-configs: true
    env:
      GITHUB_TOKEN: $GITHUB_TOKEN

This will forward the GITHUB_TOKEN env var from your host to the container that is running vunnel.

@wagoodman
Copy link
Contributor

Ideally we should document:

  • how to run grype-db minimally
  • the configuration path
  • minimal properties needed for default vunnel providers

@wagoodman wagoodman added the documentation Improvements or additions to documentation label Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants