Skip to content
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

Cryptography 3.3 LTS release without Rust bindings #5799

Closed
tiran opened this issue Feb 9, 2021 · 30 comments
Closed

Cryptography 3.3 LTS release without Rust bindings #5799

tiran opened this issue Feb 9, 2021 · 30 comments

Comments

@tiran
Copy link
Contributor

tiran commented Feb 9, 2021

@kaniini proposed the creation of a PyCA Cryptography LTS release branch. The LTS branch would give users more time to adjust their infrastructure for Rust requirements. Alpine and musl libc maintainers might even get manymusl binary wheels ready in time. I support their proposal and would be interested to assist with and use a LTS release in RHEL 8 and CentOS.

To reduce maintenance overhead and to set user expectations, a long term support branch should be clearly scoped. Therefore I propose

  • LTS is based on 3.3.x branch (no Rust dependency)
  • only updates for security issues (implies that bug must get a CVE).
  • EOL on 2021-12-31. No further updates after EOL date
  • supports for currently supported OpenSSL API/ABI. That implies compatibility patches for upcoming OpenSSL 3.0.0 will not be backported.
  • feature updates are out of scope
  • source-only releases, so you don't have to release a new LTS when OpenSSL does a security update. Users can use binary wheels of latest update.

This proposal should keep the workload small and cover majority of users.

10 months until EOL should be sufficient for majority of users to get Rust infrastructure in place. The next stable Debian 11 (Bullseye) should be released roughly half a year before the EOL date. Latest Alpine, CentOS 8, Fedora, and Ubuntu already have recent enough Rust.

@reaperhulk
Copy link
Member

The primary challenge I see for this is keeping CI functional. Since we don't need to maintain a functioning wheel build system for this the problem is simpler, but, for two examples, we'd probably also want to freeze the docker containers on a specific tag and pin our test dependencies (which we currently leave open deliberately). 3.3.x was also the last release we supported Python 2 on so the test infra would need to maintain the ability to test against that.

I agree we need an official end date if we do this, but I'm not sure what the right date is for it.

@alex
Copy link
Member

alex commented Feb 9, 2021

My default disposition is strongly anti-LTS. I think they tend to add a lot of maintenance burden for the folks who maintain them, as well as other OSS maintainers who get demands to support older versions of things as a result.

Indeed, @reaperhulk and I discussed doing an LTS a year ago for Python2 support, and concluded it was simply easier to support Python2 for an additional year rather than to support a separate LTS branch.

I also have philosophical concerns with the LTS theory of security: fixing vulnerabilities isn't the only way to improve security. Hardening, detection, privsep, etc. contribute much more to security (https://alexgaynor.net/2018/jul/20/worst-truism-in-infosec/). Just because you have all known bugs fixed doesn't make you equally secure: https://alexgaynor.net/2019/mar/07/chrome-windows-exploit-security-beyond-bugfixes/

There's also a practical concern: If we do source only releases, this will work well for Linux distribution maintainers who do their own builds, but wreak havoc on folks who install from PyPI. An alternate solution might be to simply not post to PyPI, but now we're in seriously strange territory.

I'm still open to being persuaded, but this is where I'm at now.

@tiran
Copy link
Contributor Author

tiran commented Feb 9, 2021

@alex
LTS may be the wrong term. Would you rather agree to an extended security fix policy for 3.3.x branch, similar how CPython does source-only security fixes? In my opinion there is some merit in backporting security fixes to a non-Rust branch for a short while. (I'm also aware that the new name is borderline bike-shedding.)

The target audience for an extended security fix release would be users that download sources from PyPI.

Linux distribution package maintainers typically cherry-pick and backport security fixes. For example I maintain internal forks of cryptography for RHEL. The RHEL 8.4 rebase to 3.2.1 contain backport of CVE-2020-36242, compatibility with old pytest, NPN APIs for older PyOpenSSL, encode_rfc6979_signature, and others. It's basically a 3.2.1 that is compatible with software written for 2.3.0. The CentOS git contains a snapshot of my backports.

@reaperhulk
I completely forgot that 3.3.x has Python 2 support. How annoying...

@leo60228
Copy link

leo60228 commented Feb 9, 2021

Python 2 isn't getting security fixes. I don't really have any stake in this, but I'd consider it reasonable if the 3.3.x branch didn't have Python 2.

@kaniini
Copy link

kaniini commented Feb 9, 2021

Alpine has deprecated Python 2, so we have no interest in LTS for that reason.

Rust has a lot of problems for musl distributions (the default targets in rustc force static linking for example), so we have to define new targets, which makes getting rust everywhere problematic (we still lack rust for 2 release archs due to being unable to build cross compilers).

I suspect that there are other scenarios where upgrading or introducing Rust into an already released distribution is problematic.

Regarding commitment level, we would be glad to maintain the LTS ourselves without @alex having to spend time on it, other than his notifying us about things that need to be backported.

@alex
Copy link
Member

alex commented Feb 9, 2021

If your definition of "needs backport" is "has a CVE", then we'll continue to issue CVEs for any vulnerability, and we'll make sure the version metadata is accurate. Do y'all have a capacity to automatically pull in CVEs, or do you need an explicit notification process?

@kaniini
Copy link

kaniini commented Feb 9, 2021

As long as there is CVEs listed in the git history, we can handle backporting anything we need, even if it means fixing the C code based on changes done to the equivalent Rust code.

I don't think Alpine is alone in this situation though, I suspect that CentOS/RHEL 8 is unlikely to ever get a new enough Rust, for example, but I don't know their policies.

edit: apparently CentOS does have a new enough rust. I guess that's what appstreams are about :)

@reaperhulk
Copy link
Member

We don't consistently put CVEs in our git logs at the moment, but there's no real reason we couldn't make that part of our security response policy.

@alex
Copy link
Member

alex commented Feb 9, 2021 via email

@tiran
Copy link
Contributor Author

tiran commented Feb 9, 2021

I don't think Alpine is alone in this situation though, I suspect that CentOS/RHEL 8 is unlikely to ever get a new enough Rust, for example, but I don't know their policies.

edit: apparently CentOS does have a new enough rust. I guess that's what appstreams are about :)

Yeah, RHEL 8.3 and CentOS 8.3-2011 have rustc-1.45. It's totally feasible to rebase the RHEL 8 python-cryptography package to a future version with Rust. I have most pieces in place.

@kuwv
Copy link

kuwv commented Feb 10, 2021

I'm really confused. How could the introduction of rust bindings ever be considered a minor version when there is no backwards compatibility.

This specifically breaks established spec: https://semver.org/

Just asking because I'm sure this could have been handled a bit cleaner with a bump to 4.0.0.

@alex
Copy link
Member

alex commented Feb 10, 2021

Take a look at #5801 where we discuss this very question. (Spoiler: it's not at all clear this meets the semver standard for a major release at all.)

@kuwv
Copy link

kuwv commented Feb 10, 2021

Well, thank you for your efforts. I have no intention of tell you what you should be doing. I do agree with your arguments against C and the direction towards rust for future use.

It was just a bit disruptive unfortunately. I do think a 3.3.x would be beneficial.

morucci added a commit to change-metrics/monocle that referenced this issue Feb 11, 2021
This change is temporary waiting for Alpine support or even
the 3.3 branch LTS [1].

[1]: pyca/cryptography#5799
@reaperhulk
Copy link
Member

#5819 documents that we will now put CVEs in git commits in addition to our previous policy of the changelog and a GitHub security advisory.

Having read through this thread several times now I don't see a particularly good solution for us (as in PyCA) to maintain this. If we release source only to PyPI then the first source only release will cause significant breakage (antithetical to the concept of an LTS), but it's unreasonable for us to maintain our infrastructure for wheel building on this branch. That leaves just keeping a branch updated and not uploading releases from it (but possibly tagging them?) which, as @alex previously noted, is a very strange thing to do.

At the moment my inclination would be to be very explicit in the ways #5819 commits to and maintain open lines of communication with any distribution packagers who have additional questions in the event that a backport of a CVE fix becomes necessary, but not to do any new releases on the 3.3.x branch.

I'd be interested in hearing from packagers (both distribution level or others who package for more than just themselves) about whether they view this as a functional path forward while they work out ecosystem challenges around Rust.

morucci added a commit to change-metrics/monocle that referenced this issue Feb 12, 2021
This change is temporary waiting for Alpine support or even
the 3.3 branch LTS [1].

[1]: pyca/cryptography#5799
@tiran
Copy link
Contributor Author

tiran commented Feb 12, 2021

Neither @kaniini nor I are in need of an LTS branch for our packaging work. #5819 makes cherry-picking and backporting of security fixes even easier. No other packager has raised an interest in a LTS branch either. You don't want to do an LTS branch for good reasons.

I propose we wait a couple of days to give other packagers a chance to speak up, then close the ticket.

@chickahoona
Copy link

Hi, Sascha here from Psono. First thanks for all your work. Psono's backend heavily relies on it and you are doing a great job!

I am using alpine as a base image for my docker containers and would love to switch to the new Rust'ed version, yet without proper wheels the upgrade is not "easy". I am sure that others previously supported OS / Architectures feel the same :(

Maybe you could support the 3.3 Version till you re-established "normal" pip install for others?

@tiran
Copy link
Contributor Author

tiran commented Feb 13, 2021

The new Rust dependencies have kickstarted an effort to define manylinux binary weels for musl-based distros like Alpine, https://discuss.python.org/t/wheels-for-musl-alpine/7084

The next release of cryptography will work with older Rust on Alpine 3.12. You can find more information in #5823 and PyO3/pyo3#1420.

@jefferyto
Copy link
Contributor

Hi - I'm one of the Python/cryptography maintainers for OpenWrt. There is ongoing work to bring the Rust toolchain into our build process (openwrt/packages#13916) but there is no time frame for when it may be ready.

Asking our users to install cryptography from pip would not be ideal (we package cryptography because it is a dependency of other OpenWrt packages) and may not be entirely possible given the different architectures we support.

Having an LTS branch would be helpful during this time 🙏

@vincentdephily
Copy link

Looking at the openwrt discussion, they make the point that if they switch to 3.4 using CRYPTOGRAPHY_DONT_BUILD_RUST today, they might have to downgrade to 3.3 when 3.5 comes out (because 3.4 would be be EOL but 3.3 would still get LTS support).

Would it make sense to select 3.4 as the LTS release ?

Seems to me (outsider view warning) it would be the same amount of work on the pyca side, it would avoid the "3.4 with workaround today then downgrade to 3.3" conundrum, it would push the EOL date for the rust-free pyca further, and it would expose more users to the fact the Rust is coming.

@dbrgn
Copy link

dbrgn commented Feb 15, 2021

If you read this comment, you'll see that the current plan is to not provide an LTS release at all, but to clearly publish all CVEs and the associated fixes, so that maintainers of downstream packages can easily backport the fixes.

For OpenWRT, this might be the best approach: Using CRYPTOGRAPHY_DONT_BUILD_RUST for now, and backporting fixes for security issues if necessary.

@jefferyto
Copy link
Contributor

I propose we wait a couple of days to give other packagers a chance to speak up, then close the ticket.

To me the current plan appears to be to allow packagers to voice their opinion before making the final decision.

If upstream doesn't want to maintain an LTS branch, then downstream projects that need one will have to maintain their own branches. This sounds like a duplication of effort to me, or maybe OpenWrt is the only project in this situation.

We are all busy people - I suggest waiting for more than a couple of days for packagers to find this ticket.

kylef added a commit to cocodelabs/api.palaverapp.com that referenced this issue Feb 20, 2021
@andycsoto
Copy link

andycsoto commented Feb 22, 2021

I was having issues installing Cryptography while installing Ansible on WSL2 Ubuntu 18.04 using pip3 install --user ansible with my default wsl user.

python3 -m pip install --upgrade pip didn't work.

Upgrading pip through sudo -H python3 -m pip install --upgrade pip solved the issue.

@jfinkhaeuser
Copy link

This rust dependency is blowing my mind. That might bring me to swear off the entire Python ecosystem.

Who thought it was a good idea to introduce a hard dependency on an entirely optional language environment? I know dependency management is hard, I've given lectures on that. But not requiring stuff that is unlikely to be present is sort of lesson one.

I respect that you guys want to use some kind of Rust backend, but make the build dependent on actually finding the prerequisites, please.

This is just ridiculous. And I'm being very polite when use those words. It basically breaks Python. Not because Python needs this package, but because any reasonably complex application does.

You can be experimental and shit in a hobby project, but not in something that approaches infrastructure.

And an LTS release is entirely the wrong approach, for what it's worth. That implies that sooner or later everyone must pull the Rust ecosystem in for running Python. Boggles the mind.

@jfinkhaeuser
Copy link

10 months until EOL should be sufficient for majority of users to get Rust infrastructure in place.

Yes, considering the Python 2 EOL has completely wiped out the use of that old version, you're probably right.

https://w3techs.com/technologies/details/pl-python

@alex
Copy link
Member

alex commented Mar 10, 2021

hard dependency on an entirely optional language environment

a) It's not a hard dep in 3.4, there's an env var to disale it.
b) I have no idea what an "optional language environment" means. A C build toolchain is certainly optional and we depend on that.

That implies that sooner or later everyone must pull the Rust ecosystem in for running Python.

Yup, you've got it. As I've said many many many times, we're always eager for feedback on how we can do this better, whether it's communications, tooling, compatibility, etc. What we're not interested in is feedback that we shouldn't try to address language-level memory safety at all. The scourge of C and C++ on computer security is simply too great for me to countenance walking away from this work.

@tiran
Copy link
Contributor Author

tiran commented Mar 10, 2021

The scourge of C and C++ on computer security is simply too great for me to countenance walking away from this work.

Daniel's latest blog post on curl's security is a good data point. Half of curl's vulnerabilities are C mistakes. It's only half because Daniel is a very experienced developer and the project utilizes several code analyzers.

@jfinkhaeuser
Copy link

Well, I won't try to argue something I obviously won't win, but that kills Python for a vast variety of applications.

Sad, really, but that's out of my hands. I had a good 20 years with it, time to move on.

@alex
Copy link
Member

alex commented Mar 10, 2021 via email

@tiran
Copy link
Contributor Author

tiran commented Mar 10, 2021

@alex, I was about to apologize for the abusive language of my fellow countryman. But then I noticed that he is Bavarian and not German. :)

Anyway, Github Support is notified.

@reaperhulk
Copy link
Member

I'm not sure what rose to the level of abuse here unless there was a deleted comment. It was rude and entitled but nothing worthy of a report. However, I don't think this issue is being productive any more so I'm going to close and lock it.

The final decision is here is that we will not be releasing an LTS branch, but for any security fixes we will be providing more metadata in the commit messages so downstream packagers can cherry-pick them far more easily.

@pyca pyca locked as resolved and limited conversation to collaborators Mar 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests