StackStorm / StackStorm/st2

st2actionrunner doesn't respect system user when doing private repo pack installs

Open
#5,334 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stale
Dominant language
Python
Stars
6.5k
Forks
787
PR merge metrics
No merged PRs in 30d

Description

SUMMARY

I have a special user on my st2 machines that has permissions for installing packs. This is also the same user listed in the st2.conf file as the system user (replacing stanley). When doing an install from a private repo the st2actionrunner is continues to run as root and therefore none of the ssh keys are setup for this.

STACKSTORM VERSION

Paste the output of st2 --version:

st2 3.5.0, on Python 3.6.8

OS, environment, install method

HA cluster (non-k8s): 2 app nodes and 1 controller

Steps to reproduce the problem

As a non-root user try to install a package from a private git repo

Expected Results

The package to install using the system user specified in the st2.conf file so it would use that user's keys.

Actual Results

st2actionrunner runs as the root user instead of the system user specified in st2.conf.

Looking at source the install only happens as the current user that is running the pid. In this case st2actionrunner runs as the root user only while all the other services run as the system user specified in st2.conf.

Thinking of ways to work around this one without adding keys to the root user.

Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the st2actionrunner private-repository pack-install path and how it reads the system user from st2.conf. Reproduce the install as a non-root user on the described HA setup, then verify that installation uses the configured user's identity and SSH keys rather than root.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.