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

Allow users to debug their processes #119

Merged
merged 2 commits into from Sep 30, 2022
Merged

Conversation

jdno
Copy link
Member

@jdno jdno commented Sep 22, 2022

Ubuntu restricts ptrace by default, and only allows a process to debug its own child processes. This is limiting the ability of developers to use the dev desktops to analyze and debug their work.

The default scope for ptrace has been changed to 0, allowing users to debug their own processes. This carries with it the risk that malicious code can interact with any process that a user created. We deem this to be acceptable in this specific use case, as the dev desktops are intended to be used only for the development of Rust and have, by design, no user data or credentials that could be extracted.

Requested in #113

Ubuntu restricts ptrace by default, and only allows a process to debug
its own child processes. This is limiting the ability of developers to
use the dev desktops to analyze and debug their work.

The default scope for ptrace has been changed to `0`, allowing users to
debug their own processes. This carries with it the risk that malicious
code can interact with any process that a user created. We deem this to
be acceptable in this specific use case, as the dev desktops are
intended to be used only for the development of Rust and have, by
design, no user data or credentials that could be extracted.
@@ -172,3 +179,18 @@
src: sudoers
dest: /etc/sudoers.d/dev-desktop
mode: 0440

- name: Reboot to apply sysctl changes
Copy link
Member Author

Choose a reason for hiding this comment

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

I am not sure if rebooting as part of the role can cause issues with existing workflows. A reboot is definitely required after changing kernel.yama.ptrace_scope, but maybe there is a better way to ensure that it happens.

(This will also come up with the quotas, since they require a restart as well to enable the feature.)

Copy link
Member

Choose a reason for hiding this comment

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

Can we do the reboot with a handler? That way if multiple steps require a reboot we only do it once.

Copy link
Member

Choose a reason for hiding this comment

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

There is also a reboot module.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh my. The module is so nice. Role has been updated to use a handler and the module. 👍

@jdno jdno merged commit 0410489 into rust-lang:master Sep 30, 2022
@jdno jdno deleted the enable-ptrace branch September 30, 2022 09:20
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.

None yet

2 participants