question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add functionality for allow self-hosted runner to protect workflow file and allow only execution only for collaborators for PRS

See original GitHub issue

Description:

Hi all, first of all I really like the github action runner and self-hosted runner.

It has however an issue with working for pull-request workflows.

I think the runner should have a way to be configurable to run only on Pull-requests from collaborator of X org or Repo. The problem to be solved is to protect the github-workflow file and don’t be changed by any arbitrary PR ( so there is no output redirection or other code executed) it is a recurring topic in some forums, but there is no solution or any issue about this afaik. let me know, and ping me for any info .

best

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:69
  • Comments:69 (7 by maintainers)

github_iconTop GitHub Comments

52reactions
eladchencommented, Jul 25, 2020

How about this:

image

An example:

Let’s say .github/workflows/pull-request.yml exists, and the suggested checkbox above is checked, and user John / DEV team is configured.

Workflow “.github/workflows/pull-request.yml” will not be executed if:

  • A pull request is created based of a forked repository
  • The pull request changed files include .github/workflows/pull-request.yml
  • The pull request is not authored (triggered?) by user John / a member of DEV team.

This allows contributors to create pull requests, and have workflows provide them (and maintainers) with feedback on the changes introduced by the pull request, and, in the same time preventing untrusted parties from changing a workflow, thus preventing any security issues that might arise.

WDYT?

25reactions
TingluoHuangcommented, Jun 8, 2020

@MalloZup sounds like some policy feature we can add on the service side even before sending the job to the runner.

@chrispat for feedback.

Read more comments on GitHub >

github_iconTop Results From Across the Web

About self-hosted runners
A self-hosted runner is a system that you deploy and manage to execute jobs from GitHub Actions on GitHub.com. For more information about...
Read more >
GitHub Actions Security Best Practices [cheat sheet included]
First, GitHub doesn't allow individual accounts to use self-hosted runners on public repositories, but they do allow organizations to do so. If ...
Read more >
GitHub Actions: secure self-hosted runners by limiting them ...
We're excited to announce an enhancement to the self-hosted runners experience that improves the security of your CI/CD workflows.
Read more >
Restrict self-hosted runner groups to specific workflows
You can now restrict self-hosted runner groups to only be accessible from certain workflows. In addition to restricting which repositories ...
Read more >
octokit/rest.js
Add custom labels to a self-hosted runner configured in a repository. You must authenticate using an access token with the repo scope to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found