Skip to content

Conversation

@guykisel
Copy link
Owner

@theTechnoWeenie does this look right to you?

@mention-bot
Copy link

@guykisel, thanks for your PR! By analyzing the annotation information on this pull request, we identified @v3n, @vsiakka and @raphaelcastaneda to be potential reviewers

shell = True
local_env = {}
safe_envvars = [
b'PATH', b'PYTHONPATH', b'GOPATH', b'SystemRoot',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like this could balloon into many language + tool aware exceptions. Can I get the context on what this is trying to solve?

Copy link
Owner Author

Choose a reason for hiding this comment

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

the idea here is to reduce risk when running potentially untrusted subprocesses by providing the absolute minimum necessary environment variables. i'm also going to refactor the way the token is being passed in the bot to make this safer.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, if this is about security then the gains from doing this are barely worth it. Processes can just look at the environment variables on their parent if they're feeling malicious. If you want to run code without trusting it you must sandbox it / jail it using OS functionality or machine separation.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, that's a really good point about the per language ballooning. Running the comment portion in a separate container would be an option, but then you'd need to think about authorization to be able to use the comment service... how deep would that rabbit hole go?

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.

5 participants