-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
python2Packages.certifi: init at 2019.11.28 #127453
Conversation
To be honest, I don't like providing an outdated version of certifi for Python 2 because we shouldn't ship outdated security-related stuff. Maybe it's better not to fix this and mark NixOps 1.7 as broken. |
Result of 11 packages marked as broken and skipped:
12 packages built successfully:
Note that build failures may predate this PR, and could be nondeterministic or hardware dependent. |
This poses a certain security risk, so I decided to set |
license = licenses.isc; | ||
maintainers = with maintainers; [ ]; # NixOps team | ||
knownVulnerabilities = [ | ||
"Python 2 supported for certifi ended in 2019 and shipping an outdated certificate store carries a non-negligble risk" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can anyone describe an actual threat model based on “shipping an outdated certificate store”? I can't think of any that would actually be a problem for normal users, and non-normal users already have much worse to worry about.
IMO adding knownVulnerabilities
when there are no actually known vulnerabilities only makes people more used to working around it, especially for a package as advertised as nixops, and so is a net negative for the security of NixOS users.
Now, if there were some specific known vulnerability (eg. “this CA that was there in 2019 was removed after having issued malicious certificates that can still be used”), I would totally understand this item; but IMO as currently described this is lacking motivation and it'd be better to have no knownVulnerabilities than this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
easy. Some CA get's their private key stolen and now the thief can issue new certificates. Alternatively (way more common) the CA is seen to be not trustworthy due to weird behavior or bogus certificates issued by it. CAs that are not trustworthy or compromised might issue certificates that can be used to stage successful man-in-the-middle attacks. This impacts all tls secured communication that uses a certificate store that includes this CA (passwords/downloads/...). Unless you have support for OCSP, revocation is done via two ways:
- certificate revocation lists (that are sparely used). In this case the issuing CA revokes the compromised CA and publishes a file that includes this information.
- removing the CA from certificate stores like this one. The only way to handle compromised self-signed CA.
Hence keeping the certificate store up to date is important.
For reference: https://sslmate.com/certspotter/failures
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, what about re-using the bundle from the cacert
package instead? This would not only solve this issue but also would consolidate the CA bundle to a single location. For example when writing integration tests involving Python software, one usually needs to not only override cacert
but also python*Packages.certifi
to inject testing certificates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The approach suggested by @aszlig may also be applicable to the boto 2.49.0 package, as I believe it has an embedded cacert file that is even further out-of-date: https://raw.githubusercontent.com/boto/boto/2.49.0/boto/cacerts/cacerts.txt. I'm not certain when this embedded cacerts.txt is used by boto versus the one provided by python2Packages.certifi.
If someone can confirm that boto's embedded cacerts.txt is actually used (especially through nixops 1.7), we might want to add a knownVulnerabilities to the boto package as well -- for consistency with python2Packages.certifi. Or, provide updated certificates in both packages. I took a quick look at arch and debian to see if they had updated the certs in their boto 2.49.0 packages, and it doesn't seem that they have. So, maybe I am mistaken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zeri42 Thank you, your link confirms that as of today there is no known instance of a CA having an issue that would warrant the knownVulnerabilities
toggle since the version of certifi that is being considered here, and so that reverting updates should not be a security vulnerability :) (though it is only one source, of course)
(And also, even if they were in most cases I'd keep my position: an attacker stealing the private key from a CA is not a reasonable threat model for a normal NixOS user, which is the reason why I wrote my first message)
This being said I'm going to step out of this discussion: I'm only focussed on “knownVulnerabilities
here would be bad”; there are for sure much better things that could be done by improving stuff in various ways :)
@dotlambda Note this would also fixes the |
We could also use a recent version of certifi and disable the test for the |
This will also fix buttersink failing to build: #128151. |
This will also fix gnuradio 3.7 shipped with nixos-21.05: #128620 |
It's not clear when the `certifi` PR[1] will be merged, and I don't want to have to wait for a new hydra build because of it. `nixopsUnstable` is unusable in its current from due to almost lacking documentation, and so I have little choice but to remove `nixops` right now until `certifi` is merged. [1]:NixOS/nixpkgs#127453
f81cc2b
to
0af5adc
Compare
@dotlambda I took the liberty of reworking this PR a bit. I think this is a decent solution with minimal maintenance. |
@adisbladis I wonder whether the package version of this hybrid should be |
The version should be 2019.11.28 because the API has since been changed. |
0af5adc
to
0b5fe23
Compare
Alright, version set as |
We use the sources from 2019.11.28 to build, but inherit the cert bundle from the maintained Python3-only version of certifi. Co-authored-by: adisbladis <[email protected]>
0b5fe23
to
ada27b8
Compare
clefru@57e65ad has a commit that patches Python 2 support back into a recent certifi. Works for me so far (with nixops) |
@clefru I thought about adopting a similar approach but opted against it because of the added maintenance burden. I think for now I'll just merge this and if you think your approach is sufficiently better could you please create a separate PR? |
Successfully created backport PR #129374 for |
Motivation for this change
fixes #127423
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)cc @tollb @NixOS/nixops-committers