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

[v0.10] Merge unprivileged stuff to v0.10 #3341

Merged
merged 10 commits into from
Dec 14, 2024

Conversation

metalefty
Copy link
Member

No description provided.

matt335672 and others added 10 commits December 10, 2024 21:04
runtime_user and runtime_group are added to the xrdp.ini file
so that the service knows how to reduce privilege

(cherry picked from commit 17a5656)
- xrdp_listen.c is refactored so we can create the
  listening socket(s) before dropping privileges.
- The code which reads startup params from xrdp.ini
  is moved from xrdp_listen.c to xrdp.c, so it
  is only called once if we test the listen before
  starting the daemon.

(cherry picked from commit ddff9eb)
Now we have g_file_open_rw() we don't need to try to write to
the PID file to see if we can. Just leave the file open and write to
it after forking.

(cherry picked from commit 2446c20)
If xrdp is running with dropped privileges it won't be able to delete
the PID file it's created. Places where xrdp is stopped need to cater
for this.

It's prefereable to do this than make the PID file writeable by xrdp
with dropped privileges, as this can still lead to DoS attacks if an
attacker manages to modify the PID file from a compromised xrdp
process.

(cherry picked from commit ce355fc)
The unprivileged user needs to be able to read the certificate and
key files to offer TLS, but should not be able to write to then.

This commit checks the TLS files are read-only, rather than
simply readable

(cherry picked from commit 0ebf4cf)
While here, ignore build artifacts of chkpriv tools.

Follow-up to:   neutrinolabs#2974

(cherry picked from commit c2b8cbf)
- Do not include substitutedd xrdp-chkpriv into tarball
- Dot not install xrdp-chkpriv.in

While here, drop exec permission from *.c source file.

(cherry picked from commit f61a591)
While here, drop exec permission from xrdp-chkpriv.in. The exec
permission will be granted to substituted xrdp-chkpriv script
during `make install` process.

(cherry picked from commit a857f0b)
@metalefty metalefty requested a review from matt335672 December 13, 2024 07:07
Copy link
Member

@matt335672 matt335672 left a comment

Choose a reason for hiding this comment

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

This seems OK to me. As far as I can tell, it's unchanged from the changes we made for devel.

I ran it up, and it seems to work fine.

@metalefty metalefty merged commit 540f5c3 into neutrinolabs:v0.10 Dec 14, 2024
13 checks passed
@metalefty metalefty deleted the v0.10-unprivileged branch December 14, 2024 07:21
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.

2 participants