Bug 2169990

Summary: [RHEL8.7/SCAP/RFE] Improve gnutls version test to be order indepedent
Product: Red Hat Enterprise Linux 8 Reporter: Rajesh Dulhani <rdulhani>
Component: scap-security-guideAssignee: Vojtech Polasek <vpolasek>
Status: CLOSED MIGRATED QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.7CC: ekolesni, ggasparb, mhaicman, mlysonek, mmarhefk, peter.vreman, wsato
Target Milestone: rcKeywords: FutureFeature, MigratedToJIRA, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-08-30 08:34:02 UTC Type: Story
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Rajesh Dulhani 2023-02-15 10:42:36 UTC
The STIG rule 'Configure GnuTLS library to use DoD-approved TLS Encryption' remediates a correct RHEL default configuration.
See screenshot of the finding

To my understanding the fidnding is the same as the default RHEL provided configured, only the swapped order to excluded ssl3,tls1.0,tls1.1 is swapped

Order expected by SCAP check
+VERS-ALL:-VERS-DTLS0.9:-VERS-SSL3.0:-VERS-TLS1.0:-VERS-TLS1.1:-VERS-DTLS1.0

Order by RedHat default:
+VERS-ALL:-VERS-DTLS0.9:-VERS-TLS1.1:-VERS-TLS1.0:-VERS-SSL3.0:-VERS-DTLS1.0



Below the output of RHEL8.7 that shows that this order is always the same there for all back-ends and not matching the STIG order even not for the expected FIPS crypto profile:
~~~
[Azure] vrempet-admin@li-lc-2635 ~
$ rpm -q crypto-policies
crypto-policies-20211116-1.gitae470d6.el8.noarch

[Azure] vrempet-admin@li-lc-2635 ~
$ grep -o '+VERS.*:+COMP' /usr/share/crypto-policies/back-ends/*/gnutls.config
/usr/share/crypto-policies/back-ends/DEFAULT/gnutls.config:+VERS-ALL:-VERS-DTLS0.9:-VERS-TLS1.1:-VERS-TLS1.0:-VERS-SSL3.0:-VERS-DTLS1.0:+COMP
/usr/share/crypto-policies/back-ends/FIPS/gnutls.config:+VERS-ALL:-VERS-DTLS0.9:-VERS-TLS1.1:-VERS-TLS1.0:-VERS-SSL3.0:-VERS-DTLS1.0:+COMP
/usr/share/crypto-policies/back-ends/FUTURE/gnutls.config:+VERS-ALL:-VERS-DTLS0.9:-VERS-TLS1.1:-VERS-TLS1.0:-VERS-SSL3.0:-VERS-DTLS1.0:+COMP
/usr/share/crypto-policies/back-ends/LEGACY/gnutls.config:+VERS-ALL:-VERS-DTLS0.9:-VERS-SSL3.0:+COMP
~~~

There are 3 Solutions:
- Make the SCAP check more advanced to check for +VERS-ALL: and then for each not to exclude VERS independent of the order (as long as it is after the +VERS-ALL)
- Update the RedHat defaults to match SCAP
- Update the SCAP expected order to match the RedHat defaults


Reproducer run STIG remediate on 
- update-crypto-policies --set FIPS
- run STIG SCAP

Result:
- Finding on 'Configure GnuTLS library to use DoD-approved TLS Encryption'

Expected:
- No finding 'Configure GnuTLS library to use DoD-approved TLS Encryption'


What is the business impact? Please also provide timeframe information.
Unneeded finding/remediate of a configuration

Comment 2 Jan Černý 2023-02-20 16:17:33 UTC
Analysis:

Reproducible with scap-security-guide-0.1.63-5.el8.noarch but it's present also in the current upstream as of 2023-02-20 as of HEAD 9a2ca6d9d4c41c5c5b6fe9a20a276271b0eb3db2.

The root cause is that the rule configure_gnutls_tls_crypto_policy has hard-coded list of ciphers and this list in a given order.

We need to investigate whether the alternative order is allowed by DISA/STIG and if yes then change the SCAP check to allow alternate order.

Switching to correct component.

Comment 3 RHEL Program Management 2023-08-30 08:33:01 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 4 RHEL Program Management 2023-08-30 08:34:02 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues.