-
Notifications
You must be signed in to change notification settings - Fork 687
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
Upgrading securedrop-app-code should remove unused Python dependencies #856
Comments
We should revisit this the next time we have to upgrade the Python dependencies the securedrop-app-code .deb package. |
Just discussed this with @conorsch. We started working on this because of #856 (comment), and @fowlslegs has a good start towards a resolution in #1302. However, that solution makes me a little nervous and would require significant testing prior to release. Furthermore, this issue is not high priority. Since the outdated dependencies are no longer used by the application, I do not think they pose a significant security risk. As a result, I am removing this from the 0.3.7 milestone. We should revisit it again in the near future. |
@fowlslegs and I discussed this in person. We agreed that it is difficult to do this well because SecureDrop's Python dependencies are installed into the system-wide pool of Python packages, which makes it hard to disambiguate SecureDrop's Python packages from other Python packages. The "right answer" is to properly isolate SecureDrop's deployment environment. There are numerous techniques for doing this, and doing so would be a significant change in the current deployment stack; therefore, they should be evaluated carefully and considered for a later release. |
In general, pip-sync seems like a good tool to use here. The only thing preventing us from just dropping it in is:
from #856 (comment). If we isolate those environments, then it should be straightforward to use |
Actually, this seems not to be the case. Since SecureDrop installs it's Python packages using if which pycompile >/dev/null 2>&1; then
pycompile -p python-six
fi I could not find any other examples of Debian packages providing Python packages that use In my opinion, installing neither |
#1472, if done correctly, will prevent the problem of deprecated dependency buildup in case of future dependency turnover, however, it doesn't address past buildup. I think it'd be safe to blow away the contents of |
Note that the dependency management story has significantly changed with the introduction of |
@rmol will do a quick test to check whether this is still an issue (likely not with current implementation) and close if not. |
The current packaging does result in dropped dependencies being deleted from the production virtualenv, except for their We could start using the |
The postinst script of
securedrop-app-code
upgrades the Python dependencies with the following command:The only downside here is that it does not automatically remove unused dependencies. For example, when I upgraded the Python dependencies with
pip_update.sh
in 9868f3a,argparse
andwsgiref
were no longer being used and were automatically removed from the requirements file bypip-dump
. However, upgrading the package on the server (which runs the abovepip install
) does not trigger their removal.The text was updated successfully, but these errors were encountered: