RDA Python Package to setuid for program executions as an effective or common user
Project description
RDA Python package, including a C code wrapper, to execute commandline applications via setuid for effective and common user names.
Overview
rda_python_setuid provides a C binary (pywrapper) that acquires a setuid effective
user, then execvs a Python entry point script. This allows Python programs to run
as a designated common user (e.g. gdexdata) without requiring sudo access.
Two modes are supported:
- Mode 1 (CommonUser program): a symlink
dsarch -> pywrapperrunssetuid_dsarchas the common user. - Mode 2 (pgstart specialist): a copy
pgstart_zjiruns any command as specialistzjiviapgstart.py, restricted to authorized users.
Dependency requirement
Any Python package whose programs are to be run via the setuid mechanism must declare
rda_python_setuid as a dependency in its pyproject.toml:
[project]
dependencies = [
"rda_python_setuid",
...
]
It must also register each wrapped program's connector entry point with a setuid_
prefix:
[project.scripts]
"setuid_dsarch" = "rda_python_dsarch.dsarch:main"
pip install then places setuid_dsarch in the environment's bin/ directory
automatically. pywrapper-install --link locks it down to chmod 700 so users
cannot bypass the setuid wrapper by running it directly.
Environment setup
Option A — Python venv (DECS machines)
python3 -m venv $ENVHOME # e.g. /glade/u/home/gdexdata/gdexmsenv
source $ENVHOME/bin/activate
pip install rda_python_setuid rda_python_dsarch ...
Option B — Conda (DAV/Casper)
conda create -n pg-gdex python=3.10
conda activate pg-gdex
pip install rda_python_setuid rda_python_dsarch ...
The conda environment is typically at /glade/work/gdexdata/conda-envs/pg-gdex.
Installation
After setting up the environment and installing packages, run pywrapper-install
with no arguments to display the full user guide:
pywrapper-install
Full setuid setup (requires sudo access to CommonUser)
# 1. Install the target package (pulls in rda_python_setuid automatically):
pip install rda_python_dsarch
# 2. Compile pywrapper C binary (once per environment):
pywrapper-install --user gdexdata
# 3. Wire up each program as a setuid entry:
pywrapper-install --link dsarch --user gdexdata
# 4. Optionally, allow a specialist to run commands as themselves:
pywrapper-install --pgstart --user zji
Simple install (no sudo required, runs as current user)
Users who do not need the setuid mechanism can skip steps 2–4 and create a
direct symlink from dsarch to setuid_dsarch:
pip install rda_python_dsarch
pywrapper-install --link dsarch --simple
Runtime flow
user runs: dsarch [args]
| (symlink -> pywrapper, setuid bit -> EUID=gdexdata)
pywrapper.c: execv(bin/setuid_dsarch, args)
| (chmod 700, only gdexdata can exec directly)
setuid_dsarch: calls dsarch:main() as gdexdata
Github
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rda_python_setuid-1.0.4.tar.gz.
File metadata
- Download URL: rda_python_setuid-1.0.4.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f47fe87bd07545ea5259eee661b869672480cfd0565d0cf0d2879ac38c490834
|
|
| MD5 |
f6e028e7a6ad172b0aa9cb7483228503
|
|
| BLAKE2b-256 |
3898e7b8a6463c75eec2624514161e1012617ac495b77cd059261f0666486fd1
|
Provenance
The following attestation bundles were made for rda_python_setuid-1.0.4.tar.gz:
Publisher:
publish.yml on NCAR/rda-python-setuid
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rda_python_setuid-1.0.4.tar.gz -
Subject digest:
f47fe87bd07545ea5259eee661b869672480cfd0565d0cf0d2879ac38c490834 - Sigstore transparency entry: 1520866813
- Sigstore integration time:
-
Permalink:
NCAR/rda-python-setuid@6a29bd532127d03ec37317cf2f6631fcea14d933 -
Branch / Tag:
refs/tags/v1.0.4 - Owner: https://github.com/NCAR
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6a29bd532127d03ec37317cf2f6631fcea14d933 -
Trigger Event:
release
-
Statement type:
File details
Details for the file rda_python_setuid-1.0.4-py3-none-any.whl.
File metadata
- Download URL: rda_python_setuid-1.0.4-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40a86c7a5ef78b3fab51ae00591e425809c10527934fe80920a324e45f248dfc
|
|
| MD5 |
01c41467c00c7fd4c9afd1edcadb0d28
|
|
| BLAKE2b-256 |
c228340af09167c4bac34c95760e7ee820f70662c4c9987d4fb450a54837f0e4
|
Provenance
The following attestation bundles were made for rda_python_setuid-1.0.4-py3-none-any.whl:
Publisher:
publish.yml on NCAR/rda-python-setuid
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rda_python_setuid-1.0.4-py3-none-any.whl -
Subject digest:
40a86c7a5ef78b3fab51ae00591e425809c10527934fe80920a324e45f248dfc - Sigstore transparency entry: 1520866816
- Sigstore integration time:
-
Permalink:
NCAR/rda-python-setuid@6a29bd532127d03ec37317cf2f6631fcea14d933 -
Branch / Tag:
refs/tags/v1.0.4 - Owner: https://github.com/NCAR
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6a29bd532127d03ec37317cf2f6631fcea14d933 -
Trigger Event:
release
-
Statement type: