Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1842826

Summary: nodejs:14/nodejs: rpmlint reports crypto-policy-non-compliance-openssl
Product: Red Hat Enterprise Linux 8 Reporter: Ondrej Moriš <omoris>
Component: nodejsAssignee: Zuzana Svetlikova <zsvetlik>
Status: CLOSED CURRENTRELEASE QA Contact: Jakub Heger <jheger>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.2CC: a.relyaidan7741823, dbeveniu, dolachan22, jhouska, jstanek, jwakely, robertsonldspj11, vondruch, zsvetlik
Target Milestone: rcKeywords: Triaged
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: nodejs-14-8050020210817172013.b4937e53 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1952915 (view as bug list) Environment:
Last Closed: 2021-12-16 11:54:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1842847, 1952915    

Description Ondrej Moriš 2020-06-02 07:33:51 UTC
Description of problem:

Crypto-policy non-compliance is reported by rpmlint.

Since RHEL-8.0 we have system-wide crypto policies - usage of cryptographic protocols such as TLS that are enforced system-wide. In general we want all applications in RHEL to be compliant with the crypto policy set on the system (see policy [1] inherited from Fedora).

Rpmlint detected that nodejs uses SSL_CTX_set_cipher_list from OpenSSL library without  PROFILE=SYSTEM. This indicates that a custom setting is used rather than system-wide crypto-policies setting. It is not a problem as long as it is intentional (e.g. specific algorithm is requested by user or configuration). However, unintentional usage might be a potential bug.

Could you please inspect relevant parts of the code, check that this is not rpmlint false positive and verify that custom setting is used intentionally?

 * If yes, feel free to close this BZ as NOT-A-BUG.
 * If not, could you please consider using system-wide crypto policy setting (PROFILE=SYSTEM) instead of custom setting?

[1] https://docs.fedoraproject.org/en-US/packaging-guidelines/CryptoPolicies

Version-Release number of selected component (if applicable):

nodejs-10.19.0-2.module+el8.2.0+6232+1df3dc5f

How reproducible:

100%

Steps to Reproduce:

1. rpmlint nodejs-10.19.0-2.module+el8.2.0+6232+1df3dc5f.x86_64.rpm


Expected results:

No crypto-policy-non-compliance warning.

Actual results:

nodejs.x86_64: W: crypto-policy-non-compliance-openssl /usr/bin/node SSL_CTX_set_cipher_list

Comment 1 Jan Staněk 2020-06-03 14:35:02 UTC
There was related discussion of interested parties going on via e-mail; pasting it here so we can find it later.

Also, I'm adding the mentioned people to the CC of this bug; let's continue the discussion here.

---

From jstanek:
> Hi all,
> while waiting for Node 14 test suite run to finish, I decided to take a
> look at the situation there. After a bit of poking, this is what I gathered:
>
> 1. The SSL_CTX_set_cipher_list call is wrapped and provided as a part of
> TLS API of Node – that by itself should be fine; users should be allowed
> to set their own ciphers.
>
> 2. The default value for this call was a bit tricky to find, but I think
> it comes from DEFAULT_CIPHER_LIST_CORE in `src/node_constants.h`. The
> value in Node 14 is a hard-coded list of ciphers; I did not check,
> but I assume that is not the same as the system policy, and it will
> definitely not follow it in case it changes.
>
> So, if I understood the police correctly, we want to change this
> constant from the list of ciphers/ciphersuites to the "PROFILE=SYSTEM"
> string; although I have no idea what will this do with the expectations
> within the test suite…
>
> Hope this helps somehow!

From dbeveniu:
> Hi,
>
> I'm not familiar with Fedora's crypto policies, but from what I've read the usage of SSL_CTX_set_cipher_list is used in Node when a cipher list is specified as an argument to createSecureContext.
> There is also a the default cipher list which can be configured using an option to node, for example:
> $ node --tls-cipher-list='PROFILE=SYSTEM' -p "require('crypto').constants.defaultCipherList;"
> PROFILE=SYSTEM
> or as an environment variable
> $ env NODE_OPTIONS=--tls-cipher-list='PROFILE_SYSTEM' ./node -p "require('crypto').constants.defaultCipherList;"
> PROFILE=SYSTEM
>
> It is also possible to set --openssl-config to point to a openssl.cnf configuration, or use the environment variable OPENSSL_CONF if it needs to be explicitly configured.
>
> If those options don't help perhaps we could consider a build time configuration option where the defaults can be specified. For example:
> ./configure --openssl-default-cipher-list="PROFILE_SYSTEM"
>
> With that said it sounds like rpmlint would complain just the same because of the usage of SSL_CTX_set_cipher.
>
> Regards,
>
> /Dan

From vondruch:
> Thx. Interesting, a lot of options. The only problem is that all of these are runtime options if I understand it correctly.
>
> > If those options don't help perhaps we could consider a build time configuration option where the defaults can be specified. For example:
> > ./configure --openssl-default-cipher-list="PROFILE_SYSTEM"
>
> Configure option would be really nice. Otherwise, we need to apply downstream patch which is also reasonable. This is one example of the package where we do this:
>
> https://src.fedoraproject.org/rpms/rubygem-puma/blob/master/f/rubygem-puma.spec#_26
>
> > With that said it sounds like rpmlint would complain just the same because of the usage of SSL_CTX_set_cipher.
>
> Right, but the warning already did its job, if we are discussing this issue. After we fix this, there will be the ticket tracking the issue + some explanatory comment in .spec file + commit message. So it should be easy to discover the warning is false positive. Actually it should be possible to suppress the warning via rpmlint dot file included in the repository if I am not mistaken.
>
> Vít

From dbeveniu:
> >Configure option would be really nice.
> Great, I'll take a look at adding this and I'll post back a link to the PR once created.

From dbeveniu:
> I've created a suggestion for this option:
> https://github.com/nodejs/node/pull/33708
>
> There might be pushback on adding this if it is viewed as we are only doing it for Fedora/RHEL. Do you know if any other distributions do anything like this?
>
> Thanks,
>
> /Dan

From vondruch:
> Hi Nikos,
>
> Because you are original author of the Fedora Crypto Policies [1], do you have answer, if any other distros are doing something similar? Ideally, you could share them in the Dan's PR of if you know somebody from other distros, who could support it.
>
> Vít
>
> [1] https://fedoraproject.org/wiki/Changes/CryptoPolicy

From nmav:
> Hi Vit,
>  (adding rhel-crypto as well). I know that debian tries to do
> something similar and ships a crypto-policies package:
>
> https://wiki.debian.org/CryptoPolicy
> https://packages.debian.org/sid/crypto-policies
>
> Other than that I do not know, maybe Tomas has a better view.
>
> regards,
> Nikos

From tmraz:
> In my opinion the suggested upstream PR should be uncontroversial as it
> might be very much useful also in other contexts just than on Fedora
> with its crypto-policies. The package maintainer building the NodeJS
> package on any distro or even in out-of-distro context might have very
> different needs and preferences for the default cipher list
> configuration than the thing that is hardcoded in the NodeJS sources. I
> am not saying the hardcoded default is particularly wrong but it is
> somewhat strange and there might be different needs in different
> contexts.
>
> As for adoption of crypto-policies outside of Fedora/RHEL, I do not
> have anything more than what Nikos already said below.

Comment 4 Jan Staněk 2021-04-15 10:58:46 UTC
As the PR proposed in the original ML thread was merged upstream in version 15.0.0, I will prepare a downstream patch backporting this option to our currently supported releases.

Comment 5 Jan Staněk 2021-04-21 13:51:45 UTC
The proposed change was included in upstream releases v14.5.0 and v12.18.3. It should be enough to use `./configure --openssl-default-cipher-list=PROFILE=SYSTEM` while building the RPMs.

I will prepare the relevant PRs.

Comment 12 Jan Staněk 2021-08-31 10:59:35 UTC
This change seems to be commited to dist-git via http://pkgs.devel.redhat.com/cgit/rpms/nodejs/commit/?h=stream-14&id=8ca81b5fbdcd56c559f03bd55361b470f39f3645

Comment 20 Lillyhenry 2023-08-25 04:58:34 UTC Comment hidden (spam)