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

self-hosted-runner: detect Github large runners #327

Open
2 tasks done
ubiratansoares opened this issue Dec 18, 2024 · 2 comments
Open
2 tasks done

self-hosted-runner: detect Github large runners #327

ubiratansoares opened this issue Dec 18, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@ubiratansoares
Copy link
Contributor

ubiratansoares commented Dec 18, 2024

Pre-submission checks

  • I am not reporting a bug (crash, false positive/negative, etc). These must be filed via the bug report template.
  • I have looked through the open issues for a duplicate request.

What's the problem this improvement will solve?

Right now, the self-hosted audit assumes that having runs-on along with a defined Runners group implies self-hosted Runners. However, Github large runners are also defined on top of Runner Groups, meaning that we may be flagging as self-hosted a Runner actually hosted by Github

Describe the solution you'd like

There are a couple of endpoints in the Github REST API related to runner groups, including listing self-hosted runner groups, and listing runners that belong to that group.

Perhaps we can query the Github API and match against the value defined in the Workflow. This solution requires a Github PAT with org:admin permission, though 💔

Additional context

No response

@ubiratansoares ubiratansoares added the enhancement New feature or request label Dec 18, 2024
@woodruffw
Copy link
Owner

Thanks @ubiratansoares! We should definitely improve our handling here, but that level of permission in the API token is probably a dealbreaker 😞 -- we could tell users how to configure a stronger token here, but I'm concerned that documenting that will lead to people giving zizmor way overscoped tokens when then represent their own security issue.

Any thoughts on how we could overcome this, or maybe sidestep it with a heuristic?

@ubiratansoares
Copy link
Contributor Author

Yeah ... The overscoping is an issue indeed 😭

I don't have any ideas on how to overcome this without the REST API. My first suggestion is flagging that group may imply self-hosting in the audit message, since the audit confidence is already set to low in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants