CycodeLabs / raven

CI/CD Security Analyzer
Apache License 2.0
623 stars 33 forks source link

Add option to scan a user account #167

Closed ericcornelissen closed 9 months ago

ericcornelissen commented 11 months ago

Is your feature request related to a problem? Please describe.

As an independent open source software developer I want to be able to analyze all my personal repositories. However, with the current options ("Scanning a specific organization" and "Scanning the entire GitHub by star counts") this isn't possible.

Describe the solution you'd like

An option to download (and by extension index and report) the repositories associated with a user account.

The feature of #109 would not suffice because I want to be able to efficiently scan all my personal repositories.

Describe alternatives you've considered

n/a

Additional context

I tried doing this with the raven download org command but it seems to fail for accounts (and yes, I did verify my setup works for an organization). When trying to download for my own account I get the following error:

$ raven download org --token $GITHUB_TOKEN --org-name ericcornelissen
2023-12-12 13:54:23 | INFO     | [*] Querying page: 1
2023-12-12 13:54:23 | ERROR    | [-] Failed fetching repositories for ericcornelissen
2023-12-12 13:54:23 | ERROR    | status code: 404. Response: {
  "message": "Not Found",
  "documentation_url": "https://docs.github.com/rest/repos/repos#list-organization-repositories"
}
elad-pticha commented 11 months ago

We just added a new feature where for each account, we will determine if it is a user or org and will scan its repositories.

So running raven like:

raven download account --token $GITHUB_TOKEN --account-name ericcornelissen --account-name microsoft

Now works.

@ericcornelissen, please let me know what you think about this change.

ericcornelissen commented 11 months ago

Works like a charm for me and the UX makes sense to me. Thanks for the quick turnaround on this :smile:

elad-pticha commented 11 months ago

Glad you liked it 🙏