-
Notifications
You must be signed in to change notification settings - Fork 277
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
SHA-1 GPG keys are deprecated, request to update GPG-keys and RPM repository packages #3124
Comments
Hi @Jounimk we have not officially support RHEL9 related distros yet. Tho this is a good call out and we probably need to just disable sha1 checksum in the build process. Also, @bbarani @setiah please chime in on your thoughts. |
Interesting part is we already use sha512 for signing but seems like sha1 checksum is still somewhat being verified by the host on default so this needs more researching. |
@peterzhuamazon where is this code? Maybe @Jounimk can try and contribute a fix? |
@dblock This issue is not in the code itself and I'm afraid it cannot be mitigated in the RPM/Deb build process. Problem lies inside old opensearch GPG keypair which was done using SHA-1 hash. Therefore opensearch.pgp public key cannot be imported anymore into the RHEL9 (or similar distributions). So package installation fails |
Thanks @Jounimk this is a much bigger issue than I initially anticipated. This means we also need to post 2 public keys for people to verify, old artifacts vs new ones later (possibly) Need thoughts from @bbarani @CEHENKLE @dblock as this is not extending the key into a new signing subkey, but completely generate a new master key. All steps are in this issue: Thanks. |
This info could be helpful https://old.nixaid.com/gpg-migration-sha1-to-sha2/ to migrate to sha2. Can we try this @peterzhuamazon ? |
Yes @prudhvigodithi after doing some research I think if we can just migrate from sha1 to sha2, it will be the best case. |
Thanks @peterzhuamazon for the details! @bbarani I think someone will need to take this on your team. |
Updated the Acceptance Criteria section of the issue. |
It requires some research on the migration without completely revoking the key. |
We are targeting to migrate to SHA-2 from 2.8.0 version. CC: @peterzhuamazon @prudhvigodithi |
@peterzhuamazon @prudhvigodithi Lets do the analysis and report the findings soon. |
Starting to do the key migration now before expiration day 20230512. |
Test on a rockylinux9 server on this:
|
Old key confirm to have sha1 (hash / digest-algo 2)
|
We will try to change the cipher from CAST5 to AES256 (S3 to S9) while change hash from sha1 to sha512 (H2 to H10) in line with the rpm signature internally signed within the package. |
Note that the change means both subprivate key and master private key need to have this change. |
A related bug seems not able to let me force a sha512: |
Use this gpg.conf:
|
Trying to use a older version of gpg:
|
Seems like it will not able to change the existing sha1 key to sha2, period, unless you recreate a key initially in sha2. It will keep showing as this:
|
RH official post: https://www.redhat.com/en/blog/rhel-security-sha-1-package-signatures-distrusted-rhel-9
|
Seems like as long as the public key is in sha2 then rpm install will let it through
|
Use this config and only change hash to SHA512 (H10), this results in the public key generated having 2 signature packets of both H2 and H10, to suit for both older and newer requirements.
The cipher remained to be on CAST5 for now. Expire in one year at about 20240512. Test on Rockylinux9:Old key:
New key: (IGNORE post install script issues as I am testing on docker without systemd now)
|
To clear old repo gpg check key use:
To clear old rpm imported gpg key:
|
Ubuntu 20.04 ok: (IGNORE post install script issues as I am testing on docker without systemd now)
|
Try centos7 ok: (IGNORE errors as there is no systemd here)
|
Test verify detached signature on the oldest releases:
|
Update this: |
We will publish the new key as part of this issue: |
We have released the new key now to public: Thanks. |
Is you try to install rpm without yum, but directly using the rpm package by You can always enable the legacy crypto:
|
Is your feature request related to a problem? Please describe
SHA-1 keys are deprecated and it's not possible to install OpenSearch packages from the repository to RHEL 9, which does not accept anymore SHA-1 signed RPMs packages by default (there are considered distrusted).
“Importing GPG key 0x9310D3FC:
Userid : "OpenSearch project <[email protected]>"
Fingerprint: C5B7 4989 65EF D1C2 924B A9D5 39D3 1987 9310 D3FC
From : https://artifacts.opensearch.org/publickeys/opensearch.pgp
Is this ok [y/N]: y
warning: Signature not supported. Hash algorithm SHA1 not available.
Key import failed (code 2). Failing package is: opensearch-2.4.1-1.x86_64”
https://www.redhat.com/en/blog/rhel-security-sha-1-package-signatures-distrusted-rhel-9
Describe the solution you'd like
I would like that OpenSearch GPG keys would be updated to SHA-256 (or SHA-512) algoritm and RPM packages in the repository would be signed with this new key to make them RHEL 9 compatible by default.
Describe alternatives you've considered
No response
Additional context
No response
Acceptance Criteria
The text was updated successfully, but these errors were encountered: