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

set rpm_digest to sha256 instead of default md5 #14864

Merged
merged 1 commit into from
Feb 2, 2023

Conversation

jsvd
Copy link
Member

@jsvd jsvd commented Feb 2, 2023

Release notes

set rpm_digest to sha256 instead of default md5 to allow installation on FIPS enabled OS

What does this PR do?

Set "rpm_digest" in fpm to SHA256 instead of the default MD5. This effectively sets _binary_filedigest_algorithm _build_binary_file_digest_algo to "8" in the rpm spec for building Logstash RPM packages.

Why is it important/What is the impact to the user?

This allows FIPS enabled Operating Systems to validate the RPM package.
On RHEL w/ FIPS enabled, without this PR:

[joaoduarte@jsvd-fips ~]$ sudo rpm -Uvh logstash-8.6.1-x86_64.rpm 
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:logstash-1:8.6.1-1               ################################# [100%]
error: unpacking of archive failed on file /etc/default/logstash;63da885d: cpio: Digest mismatch
error: logstash-1:8.6.1-1.x86_64: install failed

with this PR:

[joaoduarte@jsvd-fips ~]$ sudo rpm -Uvh logstash-8.6.2-SNAPSHOT-x86_64.rpm 
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:logstash-1:8.6.2~SNAPSHOT-1      ################################# [100%]

Author's Checklist

  • check in older supported operating systems that the RPM packages is still installable (is any supported OS not able to do SHA256 checksum validation?)

How to test this PR locally

  1. rake artifact:rpm on a x64 machine
  2. start a RHEL 9 VM
  3. switch system to FIPS by running fips-mode-setup --enable
  4. reboot
  5. copy RPM over the machine
  6. run rpm -Uvh <rpm_file.rpm>

Related issues

closes #12597

Use cases

One step towards FIPS compliance, but more is needed (e.g. using certified cryptographic modules, avoiding use of tmp, etc).

this allows FIPS enabled Operating Systems to validate the RPM package
Copy link
Contributor

@roaksoax roaksoax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jsvd jsvd merged commit fb8cfb2 into elastic:main Feb 2, 2023
@jsvd jsvd deleted the set_rpm_digest_to_sha256 branch February 2, 2023 15:38
@jsvd
Copy link
Member Author

jsvd commented Feb 2, 2023

@logstashmachine backport 8.6

github-actions bot pushed a commit that referenced this pull request Feb 2, 2023
this allows FIPS enabled Operating Systems to validate the RPM package

(cherry picked from commit fb8cfb2)
@github-actions github-actions bot added the v8.6.2 label Feb 2, 2023
jsvd added a commit that referenced this pull request Feb 2, 2023
this allows FIPS enabled Operating Systems to validate the RPM package

(cherry picked from commit fb8cfb2)

Co-authored-by: João Duarte <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sign Logstash RPM w/ SHA256 header for FIPS-enabled Operating Systems
2 participants