Skip to content

Github_workflows #2313

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

Open
Sh4d0wHunt3rX opened this issue Feb 25, 2025 · 14 comments
Open

Github_workflows #2313

Sh4d0wHunt3rX opened this issue Feb 25, 2025 · 14 comments
Labels
bug Something isn't working

Comments

@Sh4d0wHunt3rX
Copy link
Contributor

I'm not sure if the thing I'm saying is good or no, but I was thinking maybe hide these warning or not issue them as warning.

Image

@Sh4d0wHunt3rX Sh4d0wHunt3rX added the bug Something isn't working label Feb 25, 2025
@TheTechromancer
Copy link
Collaborator

@domwhewell-sage might have thoughts

@domwhewell-sage
Copy link
Contributor

Was this run run without an API key? I remember the permissions for the github workflows was quite confusing... #1305 (comment)

That reminds me perhaps we need to require an API key for github_workflows and not the other two.

@Sh4d0wHunt3rX
Copy link
Contributor Author

Hey @domwhewell-sage , thanks a lot for checking this. Yes, I have setup a different API key for each different BBOT Github modules which are in secrets.yml.

@domwhewell-sage
Copy link
Contributor

Thanks @Sh4d0wHunt3rX could you confirm what permissions they have?

@Sh4d0wHunt3rX
Copy link
Contributor Author

Sure, here you are:

Image

Image

Image

So, I guess maybe I needed to enable "workflows" for my github workflows api?

@domwhewell-sage
Copy link
Contributor

Let me replicate the same permissions and get back to you, I believe the documentation only states you need the whole repo scope.

@Sh4d0wHunt3rX
Copy link
Contributor Author

Thanks : ) Very noob question. The workflows and repos that I'm trying to access do not belong to me. Maybe this is a normal behavior that I do not have the permission to access them?

@domwhewell-sage
Copy link
Contributor

The repo in your screenshot is publicly available. And the artifact is publicly accessible (Via the web), It's just specific permissions are still required to download it via the API :/

@domwhewell-sage
Copy link
Contributor

Hmm, I mirrored your API key permissions and I can download those Facebook artifacts

@Sh4d0wHunt3rX
Copy link
Contributor Author

Strange 🤔 Maybe it's kind of rate limiting. But I get this error on many scans, I thought that it's a normal error that the workflow is not public. I will tell you the next time I get it. 🙏

@Sh4d0wHunt3rX
Copy link
Contributor Author

This is what I get actually sometimes:

Image

@domwhewell-sage
Copy link
Contributor

Thanks @Sh4d0wHunt3rX, It could well be rate limiting as I know github uses the same status code 403 for when you've reached the rate limit. (It is supposed to be quite high when API tokens are included though) So I would be interested to know if it would be possible to create a check for if you have insufficient API permissions or you are getting rate limited given they are the same status code.

@domwhewell-sage
Copy link
Contributor

Ah it seems the API key isn't being included in when making the request to download the file

await self.helpers.download(
                f"{self.base_url}/repos/{owner}/{repo}/actions/runs/{run_id}/logs",
                filename=file_destination,
                headers=self.headers,
                raise_error=True,
                warn=False,
            )

Where self.headers is set to {} in the template.

I'm not sure if we can modify the download helper to include the API key rotation feature @TheTechromancer? But at the very least I will be able to add the API key into the self.headers to fix this issue

@TheTechromancer
Copy link
Collaborator

Ohh yes that should be doable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants