[enhancement] github runner: support just-in-time (JIT) runner configuration

未关闭
#957 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 4 天内回复

@atishay-kasliwal 已经在做这个了。

开始于 2026年11月16日。

  • #971 来自 @atishay-kasliwal —— 未关闭

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
aws, azure, github-actions, go
领域
cli, cloud, security

调研方向

Read the self-hosted runner documentation linked in the issue and trace the --install-ghactions-runner CLI options and the code that generates runner user data. Check how existing token, App and PAT options are validated and how runner startup differs across platforms. Done means the JIT config file option starts a one-job ephemeral runner, conflicting options return an error, and registration tokens do not appear in user data or Pulumi state.

由索引模型根据 Issue 内容生成。

描述

Problem

Reading https://github.com/redhat-developer/mapt/blob/main/docs/self-hosted-runner.md, the GitHub runner is registered with a registration token written into the instance's cloud-init user data (config.sh --token … --replace). That token is valid for one hour and isn't bound to one runner. Any process on the host can read it from the instance metadata service, and so can anyone with access to the cloud account or the Pulumi state. Within the hour, they can register other runners on the same repository or organization, with any name and labels, or replace an existing runner of the same name.

This matters when the jobs on the runner aren't fully trusted, or when the cloud account and the GitHub organization belong to different parties.

Proposal

Support GitHub's just-in-time (JIT) runners (REST API, security hardening guide). A JIT config registers exactly one ephemeral runner, whose name, labels and runner group are set by whoever generated it. It can't register another runner, and it's useless once consumed.

  1. Add --ghactions-runner-jitconfig-file <path>: a JIT config generated by the caller, read from a file so it stays out of process listings. It excludes the token, App and PAT options, and --ghactions-runner-labels / --ghactions-runner-ephemeral (the config sets them).
  2. With it, the snippets start the runner with run.sh --jitconfig <config> instead of config.sh, on every platform.
  3. Optionally, with --ghactions-app-*, mapt generates a JIT config itself instead of a registration token, so App users get the same benefit.

Related: #851.

Acceptance
  • mapt aws rhel create --install-ghactions-runner --ghactions-runner-jitconfig-file jit.txt … brings up a runner that takes one job and is then removed by GitHub.
  • No registration token appears in the user data or the Pulumi state.
  • Combining the option with a token, App or PAT option exits with an error.
主要语言
Go
星标
25
派生
41
平均合并
5 天 3 小时
30 天内合并 PR
16

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

redhat-developer/mapt 的其他 Issue

查看 redhat-developer/mapt 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。