[Feature Request]: run0 for $ESCALATION_TOOLS & lifting the requirement for sudo usage

Open
#1,375 1 comment 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
linux, shell

Research direction

Start with linutil/core/tabs/common-script.sh at the ESCALATION_TOOLS definition, then trace how escalation methods are selected across the scripts. Review the hard-coded sudo calls in applications-setup/noctalia-shell.sh and utils/locale-us-setup.sh. Done means run0 is supported as an escalation option and applicable package or system setup commands no longer require sudo specifically.

Written by the indexing model from the issue text.

Description

Problem Description

The usage of sudo for superuser escalation privileges relies heavily on Set User-ID (SUID) binaries, therefore inheriting the caller's execution context, while systemd's run0 runs commands in an isolated service scope. Utilizing run0 mitigates both the privilege escalation attack surface of SUID programs and the "PATH bleed-through" vulnerabilities

Proposed solution

As a solution for people choosing systemd's run0 over sudo, it would be nice to have run0 implemented as one of the options for privilege escalation methods as part of the "ESCALATION_TOOLS" env variable:

linutil/core/tabs/common-script.sh:110: ESCALATION_TOOLS='sudo doas'

Additionally, extending support for any of the escalation tools across linutil, allowing packages' installation without enforcing sudo usage where applicable:

linutil/core/tabs/applications-setup/noctalia-shell.sh:21:                curl -fsSL https://pkg.noctalia.dev/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/noctalia.gpg
linutil/core/tabs/applications-setup/noctalia-shell.sh:22:                echo "deb [signed-by=/etc/apt/keyrings/noctalia.gpg] https://pkg.noctalia.dev/apt trixie main" | sudo tee /etc/apt/sources.list.d/noctalia.list
linutil/core/tabs/utils/locale-us-setup.sh:3:echo "LC_ALL=en_US.UTF-8" | sudo tee -a /etc/environment
linutil/core/tabs/utils/locale-us-setup.sh:4:echo "en_US.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen
linutil/core/tabs/utils/locale-us-setup.sh:5:echo "LANG=en_US.UTF-8" | sudo tee -a /etc/locale.conf
linutil/core/tabs/utils/locale-us-setup.sh:6:sudo locale-gen en_US.UTF-8
Alternatives

No response

Additional Context

No response

Checklist
  • I checked for duplicate issues.
  • I checked already existing discussions.
  • This feature is not included in the roadmap.
Dominant language
Shell
Stars
5.4k
Forks
425
Avg merge
1d 6h
Merged PRs (30d)
4

Getting set up

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.

More from ChrisTitusTech/linutil

All issues in ChrisTitusTech/linutil

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.