<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Feb 26, 2019 at 2:31 PM Steve Dower <<a href="mailto:steve.dower@python.org">steve.dower@python.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 2/26/2019 1:20 PM, Gregory P. Smith wrote:<br>
> For an OS distro provided interpreter, being able to restrict its use to <br>
> only OS distro provided software would be ideal (so ideal that people <br>
> who haven't learned the hard distro maintenance lessons may hate me for it).<br>
> <br>
> Such a restriction could be implemented within the interpreter itself. <br>
> For example: Say that only this set of fully qualified path whitelisted <br>
> .py files are allowed to invoke it, with no interactive, stdin, or <br>
> command line "-c" use allowed.  I'm not aware of anyone actually having <br>
> done that.  It's hard to see how to do that in a /maintainable/ manner <br>
> that people using many distros wouldn't just naively work around by <br>
> adding themselves to the whitelist rather than providing their own <br>
> interpreter for their own software stack.  It feels more doable without <br>
> workarounds for something like macOS or any other distro wholly <br>
> controlled and maintained as a single set of software rather than a <br>
> widely varying packages.<br>
> <br>
> Solving that is way outside the scope of PEP 394.  Just food for thought <br>
> that I'd like to leave as an earworm for the future for distro minded <br>
> folks.  I some people to hate this idea.<br>
<br>
I haven't caught up on this thread yet, but this sounds a lot like the <br>
"Restricting the entry point" section of <br>
<a href="https://www.python.org/dev/peps/pep-0551/" rel="noreferrer" target="_blank">https://www.python.org/dev/peps/pep-0551/</a> (which is still a draft, so if <br>
anyone wants to help make it more like what they want, I'm happy to have <br>
contributors).<br>
<br>
So I'm in favour of making this easy (since I'm already having to deal <br>
with it being difficult ;) ), as it's extremely valuable for <br>
security-conscious deployments as well as the distro package cases <br>
mentioned by Gregory.<br></blockquote><div><br></div><div>Similar. What I'm talking about has nothing to do with _security_ (pep-0551's focus) and only to do with installed interpreter maintainability.  But an implementation of the concept of deciding what is allowed to use an entry point in what manner might be the same.  :)</div><div><br></div><div>As for 551, I'm not a fan of pretending you can aid security by restricting use of an interpreter; when an adversary has the ability to trigger an exec of new process with args or input of its desire, their opponent lost the game several moves ago.  Defense in depth minded people may disagree and still desire the feature.</div><div><br></div><div>-gps</div></div></div>