Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Subprocess - change executing user #1350

Open
ansibleguy opened this issue Mar 25, 2024 · 0 comments
Open

Feature: Subprocess - change executing user #1350

ansibleguy opened this issue Mar 25, 2024 · 0 comments
Labels
needs_triage New item that needs to be triaged

Comments

@ansibleguy
Copy link

ansibleguy commented Mar 25, 2024

Greetings!

I've been implementing ansible-runner in a project of mine.

Note: I am aware that process-isolation can (also) be used to tackle this problem - but the feature described below could be a nice addition to ansible-runner. In addition to this - the process-isolation adds an dependency on some containerization technology that would not be needed if we can simply switch the user-context.

Background:
We are running a service that executes ansible-runner in multiple threads.

To protect some service-related secrets I looked into running ansible-runner as dedicated user.

Feature:

The python3 subprocess module would allow us to do so using the user parameter.

If user is not None, the setreuid() system call will be made in the child process prior to the execution of the subprocess

This argument could (simply) be added/passed-through here: https://github.com/ansible/ansible-runner/blob/2.3.6/ansible_runner/runner.py#L229

The docs of run_subprocess show:

The other arguments are the same as for the Popen constructor

@ansibleguy ansibleguy changed the title Featrue: Subprocess - change executing user Feature: Subprocess - change executing user Mar 25, 2024
@github-actions github-actions bot added the needs_triage New item that needs to be triaged label Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs_triage New item that needs to be triaged
Projects
None yet
Development

No branches or pull requests

1 participant