Skip to content

RFD: Ensure code executed on the worker is confined#7127

Open
d3flex wants to merge 1 commit intoos-autoinst:masterfrom
d3flex:docs/rfd-worker-confinement
Open

RFD: Ensure code executed on the worker is confined#7127
d3flex wants to merge 1 commit intoos-autoinst:masterfrom
d3flex:docs/rfd-worker-confinement

Conversation

@d3flex
Copy link
Copy Markdown
Contributor

@d3flex d3flex commented Mar 18, 2026

Copy link
Copy Markdown
Member

@okurz okurz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

content looks good although I don't think we should commit this file into the repo at the current state.


## Investigation

To demonstrate the attack surface I wrote a test module (`tests/install/explore.pm`) that uses standard testapi calls (`script_run`, `upload_logs`) alongside direct Perl code to do sensitive things from inside the worker process on the host side.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote a test module (tests/install/explore.pm)

where can I find this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that not really important. I will add something similar to the openqa-in-opena as suggested in the RFD.

Copy link
Copy Markdown
Contributor

@Martchus Martchus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this to become part of our documentation you should avoid the use of "I". Maybe that's also not strictly necessary right now.

It would be interesting to test the isolation of tests runs from each other. I think it would be easily possible to restrict accessible directories even more so tests would only be able to read needed files from the system and from their own pool directory (but not pool directories of other worker slots).

It would also be interesting to test whether it works with the cache service or whether further settings need to be added.

## Investigation

To demonstrate the attack surface I wrote a test module (`tests/install/explore.pm`) that uses standard testapi calls (`script_run`, `upload_logs`) alongside direct Perl code to do sensitive things from inside the worker process on the host side.
This covers the main ways a malicious test module could exploit the worker: testapi calls that run commands in the VM but also give access to the host process, direct host file reads, and leaking files via `upload_logs` to the WebUI.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This covers the main ways a malicious test module could exploit the worker: testapi calls that run commands in the VM but also give access to the host process, direct host file reads, and leaking files via `upload_logs` to the WebUI.
This covers the main ways a malicious test module could exploit the worker: testapi calls that run commands in the VM but also give access to the host process, direct host file reads, and leaking files via `upload_logs` to the web UI.


### systemd hardening — tested and working

I added standard systemd hardening directives to the worker unit. This solution seems to be the simplier less efortless to great value approach, which should be applied first .
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"less efortless to great value approach" is incomprehensible.

@okurz
Copy link
Copy Markdown
Member

okurz commented Mar 20, 2026

For this to become part of our documentation you should avoid the use of "I". Maybe that's also not strictly necessary right now.

As I stated in #7127 (review) I don't see the benefit of submitting this to the repo.

Issue: https://progress.opensuse.org/issues/194717

Signed-off-by: Ioannis Bonatakis <ybonatakis@suse.com>
@d3flex d3flex force-pushed the docs/rfd-worker-confinement branch from b62b5d7 to 2a1ec03 Compare March 24, 2026 11:34
d3flex added a commit to d3flex/os-autoinst-distri-openQA that referenced this pull request Mar 30, 2026
Provide a set of scripts which explore the confined capabilities of the workers.
There are two main approaches: using the test API to read/write from within the
SUT and the Host level operations using system().

RFD: os-autoinst/openQA#7127

Issue: https://progress.opensuse.org/issues/194717
Signed-off-by: Ioannis Bonatakis <ybonatakis@suse.com>
d3flex added a commit to d3flex/os-autoinst-distri-openQA that referenced this pull request Apr 2, 2026
Provide a set of scripts which explore the confined capabilities of the workers.
There are two main approaches: using the test API to read/write from within the
SUT and the Host level operations using system().

RFD: os-autoinst/openQA#7127

Issue: https://progress.opensuse.org/issues/194717
Signed-off-by: Ioannis Bonatakis <ybonatakis@suse.com>
d3flex added a commit to d3flex/os-autoinst-distri-openQA that referenced this pull request Apr 2, 2026
Provide a set of scripts which explore the confined capabilities of the workers.
There are two main approaches: using the test API to read/write from within the
SUT and the Host level operations using system().

RFD: os-autoinst/openQA#7127

Issue: https://progress.opensuse.org/issues/194717
Signed-off-by: Ioannis Bonatakis <ybonatakis@suse.com>
d3flex added a commit to d3flex/os-autoinst-distri-openQA that referenced this pull request Apr 2, 2026
Provide a set of scripts which explore the confined capabilities of the workers.
There are two main approaches: using the test API to read/write from within the
SUT and the Host level operations using system().

RFD: os-autoinst/openQA#7127

Issue: https://progress.opensuse.org/issues/194717
Signed-off-by: Ioannis Bonatakis <ybonatakis@suse.com>
d3flex added a commit to d3flex/os-autoinst-distri-openQA that referenced this pull request Apr 2, 2026
Provide a set of scripts which explore the confined capabilities of the workers.
There are two main approaches: using the test API to read/write from within the
SUT and the Host level operations using system().

RFD: os-autoinst/openQA#7127

Issue: https://progress.opensuse.org/issues/194717
Signed-off-by: Ioannis Bonatakis <ybonatakis@suse.com>
d3flex added a commit to d3flex/os-autoinst-distri-openQA that referenced this pull request Apr 2, 2026
Provide a set of scripts which explore the confined capabilities of the workers.
There are two main approaches: using the test API to read/write from within the
SUT and the Host level operations using system().

RFD: os-autoinst/openQA#7127

Issue: https://progress.opensuse.org/issues/194717
Signed-off-by: Ioannis Bonatakis <ybonatakis@suse.com>
d3flex added a commit to d3flex/os-autoinst-distri-openQA that referenced this pull request Apr 6, 2026
Provide a set of scripts which explore the confined capabilities of the workers.
There are two main approaches: using the test API to read/write from within the
SUT and the Host level operations using system().

RFD: os-autoinst/openQA#7127

Issue: https://progress.opensuse.org/issues/194717
Signed-off-by: Ioannis Bonatakis <ybonatakis@suse.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants