4 ms·
> Perhaps spit a scary sounding security warning for all packages which use a setup.py? This would be nice, but there's probably too many practical barriers to
by woodruffw 4y ago
> Perhaps spit a scary sounding security warning for all packages which use a setup.py?
This would be nice, but there's probably too many practical barriers to this. For example, you can't (easily) replace `setup.py`'s dynamism for packages that contain native packages: they need to be able to spawn compilers, etc. and do so in ways that are hard to describe declaratively.
We probably don't want to provide a security warning on every native non-wheel package, so that's a no-go for the time being.
- falcor84 4y agoCould we perhaps sandbox any such compilation steps within a container and then copy out the resulting artifact(s), with a hook that does some security scanning?
- woodruffw 4y agoThis is hard to do in the general case: the compilation steps often need system dependencies or to otherwise query system state to do the right thing, which means that the sandbox has to accurately reflect the host. In terms of hooks, audit hooks and events[1] get us some of the way there. But they can be circumvented as well; I wouldn't rely on them for untrusted code. [1]: https://docs.python.org/3/library/audit_events.html https://docs.python.org/3/library/audit_events.html
- de6u99er 4y agoShould start with a warning, and move after one year to users having confirm that they allow pqckqges to execute setup.py and ultimatrly not allow it any more.
- woodruffw 4y agoThis would probably break too much of the ecosystem, since many top Python packages include native extensions that can only be built with a dynamic `setup.py`. Wheels are solving that problem, but it's likely going to be many years before warning about `setup.py` is reasonable and not disruptive to the majority of legitimate users.