Repository navigation
fix: run plugin evaluation in a sandboxed process - #162
Open
youkoulayley wants to merge 3 commits into
Open
youkoulayley wants to merge 3 commits into
youkoulayley wants to merge 3 commits into
Conversation
mmatur
reviewed
Oct 19, 2026
mmatur
left a comment
Member
There was a problem hiding this comment.
Nice work, splitting the evaluation into its own process with Landlock + seccomp is the right direction, and the fixtures make it easy to see what's covered.
A few things before merging:
- The plugin can forge its own result. It runs in the same process as the evaluator and
os.NewFileis available through Yaegi, soNew()can doos.NewFile(3, "").Write([]byte("{}")), close the fd and return an error. The parent reads{}, ignores the exit code, and the broken plugin passes. I checked it locally with a small fixture. See the inline suggestions (check the exit code + dropNewFile). The PR description should also be updated since fd 3 doesn't really prevent faking the result. - Network rules need Landlock ABI v4 (kernel >= 6.7). On older kernels
BestEffort()drops them silently and IMDS on port 80 is reachable again, which is one of the closure checks of the pentest. Do we know which kernel the prod/preprod nodes run? - No memory limit on the child: a plugin allocating in a loop will OOM the whole pod, Piceus included. Fine as a follow-up (the Job approach suggested on the issue would cover it), but worth tracking.
- Worth checking in preprod that the pod seccomp profile allows the landlock syscalls, otherwise Piceus won't start (which is the right behavior, just good to know before deploying).
- Read the result only when the evaluator exits cleanly, and drain the result pipe. - Truncate the plugin error in the evaluator, and remove os.NewFile from the plugin symbols. - Require Landlock ABI v6: the network and signal rules are always enforced. - Do not create an issue when Piceus fails to create the temp files.
mmatur
approved these changes
Oct 20, 2026
mmatur
left a comment
Member
There was a problem hiding this comment.
LGTM, thanks for the quick fixes! A few small things, none of them blocking:
- Right now any non-clean exit counts as an evaluator failure, so a plugin that crashes (panic in a goroutine, fatal error, stack overflow) is skipped on every run and its author never hears about it. We could keep exit code 3 as the only evaluator failure and treat the other exit codes as plugin errors. A fake
{}followed by a crash would still be rejected. TestEvaluator_Evaluate_emptyEnvironmentdoesn't really test the empty env:t.Setenvdoesn't show up in/proc/<pid>/environ, so the fixture never sees the token anyway. It also needsrequireSandbox(t): without the sandbox, it can read the real env of the test process.- Since we now need Landlock ABI v6, Piceus won't start on nodes with a kernel older than 6.12. Let's check the preprod/prod nodes before deploying.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Plugin code ran inside the Piceus process, next to its secrets. Each plugin is now checked in a separate
piceus evaluateprocess, with an empty environment, Landlock and seccomp.Details
--github-token-file);--github-tokenis deprecated. The evaluation timeout is configurable (--evaluation-timeout).