P403n1x87 / austin-vscode

Austin extension for Visual Studio Code
MIT License
21 stars 4 forks source link

Missing instructions for using austin with sudo through vs code? #55

Open zestysoft opened 1 year ago

zestysoft commented 1 year ago

Heya, I've been trying to get this working per the instructions, but the error I keep getting back from the terminal is exit 37 which I know to mean 'insufficient permissions'.

I've created an appropriate /private/etc/sudoers.d file and tested sudo austin from the terminal to make sure it runs without a password prompt.

However when running a task within vs code (running as the user in the sudoers.d file), I still get that exit 37 issue. The only thing I can think of is that the vs code extension isn't executing austin with sudo? Is this something that must exist in the tasks.json file?

Also, unrelated, I could not get the recommended sudoers line to work in MacOS Sonoma. I had to replace the (root) part with (ALL). sudo would refuse to recognize it for whatever reason. (sudo -l -l would not display the entry as existing at all, even when sudo visudo -c thatsudoersfile returned a clean bill of health )

zestysoft commented 1 year ago

Okay, I found this: https://github.com/P403n1x87/austin#on-macos-1

I'm using poetry already with the .venv existing within the project folder, and I even went so far as to remove the code signature from the python executable, however I still have the same results.

Now that I have a better understanding of what's going on here, I think I may be running into the same problem I've been having using IDA Pro. There are a lot of parallels -- their workaround were similar to yours -- run sudo on the debugger, etc etc however I could not debug the app.

It turns out that the app was using a dependent library that was using the hardened runtime. No amount of codesigning trickery worked on the main executable. Hopefully that's not what's happening here.

zestysoft commented 1 year ago

Well, if I take the command line I see in the terminal in vs code and verbatim type it out in iterm it works with sudo, so I don't think the OS is getting in the way.

P403n1x87 commented 12 months ago

@zestysoft I'm currently unable to test this on Sonoma. However, on other versions of MacOS I don't seem to have any problems running austin as a task when it is added to the sudoers. I think this is a step that you have also tried yourself, based I what I've read from your comments. Austin itself does not depend on anything else other than the standard C library and the OS API. Perhaps there are some new security policies on the latest MacOS version that prevent spawning certain type of processes from something like VS Code?