Enabling FIPS Mode on the Database Server
To enable the FIPS mode, you should set the operating system in FIPS mode.
- Run the commands given below:
- To verify whether the FIPS mode is enabled, run the following command:
- (For Azure Only) Before the rebooting, be sure to uncomment the ciphers under /etc/ssh/sshd_config using the following commands:
- (For Azure Only) If you have enabled FIPS and the openssh service will not start after rebooting, be sure to:
- Establish a serial connection to the VM.
- Log in with your corresponding username and password.
- Navigate to /etc/ssh/sshd_config.
- Comment on the same lines above.
- Start the service with systemctl start sshd.service.
yum install dracut-fips dracut-fips-aesni
rpm -q prelink && sed -i '/^PRELINKING/s,yes,no,' /etc/sysconfig/prelink
# prelink may not be installed, ignore error
mv -v /boot/initramfs-$(uname -r).img{,.bak}
dracut
grubby --update-kernel=$(grubby --default-kernel) --args=fips=1
uuid=$(findmnt -no uuid /boot)
[[ -n $uuid ]] && grubby --update-kernel=$(grubby --default-kernel) --args=boot=UUID=${uuid}
reboot
Ignore the error if prelink was not installed.
sysctl crypto.fips_enabled
Expected Result:
crypto.fips_enabled = 1 - FIPS is enabled
From
# Ciphers and keying
# Avoid using deprecated cryptographic settings
# blowfish-cbc cipher has been removed
# cast128-cbc cipher has been removed
# 3des-cbc cipher has been removed
Ciphers chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-cbc
# diffie-hellman-group1-sha1 key exchange has been removed
Kexalgorithms curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
#RekeyLimit default none
To
# Ciphers and keying
# Avoid using deprecated cryptographic settings
# blowfish-cbc cipher has been removed
# cast128-cbc cipher has been removed
# 3des-cbc cipher has been removed
# Ciphers chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-cbc
# diffie-hellman-group1-sha1 key exchange has been removed
# Kexalgorithms curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
#RekeyLimit default none
Disabling FIPS Mode
- Run the commands given below:
- To verify whether the FIPS mode is disabled, run the following command:
yum remove dracut-fips
dracut --force
grubby --update-kernel=$(grubby --default-kernel) --remove-args=fips=1
reboot
sysctl crypto.fips_enabled
Expected Result:
crypto.fips_enabled = 0