Sandboxing each workflow run in a self hosted runner #180866
Replies: 2 comments 2 replies
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
|
To achieve proper sandboxing on self-hosted runners and prevent side effects between workflow runs, the best approach is to treat your runners as ephemeral (disposable). Here are the two most common strategies to achieve this isolation:
Bash
If you are strictly on a single persistent server, using the jobs.<job_id>.container property in your workflow YAML can help isolate the build environment (dependencies), but using ephemeral runners is the only way to guarantee the entire workspace and runner state is wiped clean every time. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Why are you starting this discussion?
Question
What GitHub Actions topic or product is this about?
ARC (Actions Runner Controller)
Discussion Details
I'm needing to have a self-runner and I have security and practicality concerns. One of which is if we run an action, like the Nix deploy action, that touches the host system in some way. I've managed to sandbox the systemd service itself for the runner listener so the systemd service has an ephemeral rootfs. Now, I am wondering if multiple runs occur that do something like install Nix, how that would impact the other runs. I am doubting the Nix install action to handle installing Nix on something which already has Nix installed.
For security reasons, I also have concerns about multiple runs happening and other runs seeing each other. For this reason, I need to be able to sandbox each individual run and not just the runner listener. I did find pre/post hooks but that doesn't fit my model. I need to be able to sandbox an entire workflow run from the start. Is there any planned way to do this properly?
Beta Was this translation helpful? Give feedback.
All reactions