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

UIforETW's UI should run as a normal user #135

Open
randomascii opened this issue Jul 2, 2019 · 2 comments
Open

UIforETW's UI should run as a normal user #135

randomascii opened this issue Jul 2, 2019 · 2 comments

Comments

@randomascii
Copy link
Contributor

UIforETW needs administrator privileges in order to record ETW traces, but currently this means that lots of other things end up running as administrator. For instance, WPA is launched as administrator, trace compression runs as admin, scripts such as identify chrome processes (auto-run if you have Chrome Developer checked), and any future trace processing that is invoked from UIforETW also runs as admin. This is... not ideal.

A better design would be for UIforETW to run as non-admin but immediately launch an admin-required helper process. UIforETW would talk to the child process through IPC whenever tracing needs to be started or stopped. The IPC mechanism would have to be simple (to avoid bugs) and limited (so that the child process couldn't be used to launch arbitrary commands).

I would like to add more options for trace processing, including using the new C# ETW tracing API (https://blogs.windows.com/windowsdeveloper/2019/05/09/announcing-traceprocessor-preview-0-1-0/) and the more code that can be launched from UIforETW the more important it is for it to run as a normal user.

PRs welcome.

@Trass3r
Copy link

Trass3r commented Nov 7, 2019

Just wondering, wouldn't it be enough to run the xperf commands as elevated processes using ShellExecute: https://stackoverflow.com/a/4893508

@randomascii
Copy link
Contributor Author

Recording an ETW trace requires running multiple commands elevated. If UIforETW is running non-elevated then each elevated command would require the user to confirm a UAC dialog or type in an admin password. That's not usable.

The idea behind the admin helper process is that it would ask for elevation once and would then run commands on behalf of UIforETW. This could be made secure by ensuring that it only runs commands coming from UIforETW and only running a restricted set of commands.

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

No branches or pull requests

2 participants