rhel centos 源

My script implements a Red Hat solution.

我的脚本实现了Red Hat解决方案。

Cryptography is vital for business, organizations, really for everyone. Cryptography has been around in one form or another for centuries, and has a very rich history.

密码学对于企业,组织,甚至每个人都至关重要。 密码学以一种或另一种形式存在了数百年,并且历史悠久 。

One aspect of cryptography is the Federal Information Processing Standards or “FIPS”. FIPS is something made by the National Institute of Standards and Technology, or “NIST”.

加密的一个方面是联邦信息处理标准或“ FIPS”。 FIPS是由美国国家标准技术研究院(NIST)制定的。

FIPS is required for the government, and the US is not the only nation that uses FIPS. FIPS is also not just limited to the federal government. Here’s a quote from that link: “These standards and guidelines are developed when there are no acceptable industry standards or solutions for a particular government requirement. Although FIPS are developed for use by the federal government, many in the private sector voluntarily use these standards.”

政府需要FIPS,并且美国不是唯一使用FIPS的国家。 FIPS还不仅限于联邦政府 。 这是该链接的引文: “当没有针对特定政府要求的可接受的行业标准或解决方案时,便会制定这些标准和指南。 尽管FIPS是为联邦政府开发的,但私营部门中的许多人自愿使用这些标准 。”

FIPS is in place for various operating systems, and applications. My focus here is for Red Hat Linux (RHEL)/CentOS. Yet even the the other Operating System implements it too, as do various flavors of UNIX and other forms of Linux. Many of Red Hat’s products have FIPS capability. Some do not quite yet, such as Gluster. However, Red Hat does push to adopt FIPS and for example, the Red Hat Satellite product can have FIPS enabled as of version 6.5. There are some important planning aspects to implement FIPS. Example: On an Identity Management Server (IDM), you must implement FIPS prior to creating the IDM server itself.

FIPS适用于各种操作系统和应用程序。 我的重点是Red Hat Linux(RHEL)/ CentOS。 但是,甚至其他操作系统也实现了它 ,如各种UNIX和其他形式的Linux一样。 红帽的许多产品都具有FIPS功能 。 一些还不太完善,例如Gluster 。 但是,Red Hat确实推动采用FIPS,例如,Red Hat Satellite产品从6.5版开始可以启用FIPS。 实施FIPS有一些重要的计划方面。 示例:在身份管理服务器(IDM)上, 必须 创建IDM服务器本身之前实施FIPS 。

When you properly implement FIPS, the certified cryptographic modules are used and forced. Important note: You can use ecdsa and rsa ssh keys but not dsa or ed25519 keys on a FIPS enabled system. Also, use caution with the rescue kernel. If you end up having to boot into emergency mode, NO PASSWORD WILL WORK in emergency mode and you MUST either turn off fips=0 during grub boot (know the grub password please) -or- boot into a boot media such as a DVD or DVD iso if virtual. Ask me how I know.

正确实施FIPS时,将使用并强制使用经过认证的加密模块。 重要说明 :在启用了FIPS的系统上, 可以使用ecdsa和rsa ssh密钥,但不能使用 dsa或ed25519密钥。 另外,请谨慎使用救援内核。 如果最终不得不进入紧急模式,则在紧急模式下将无法使用密码,并且必须在grub引导期间关闭fips = 0(请知道grub密码)-或-引导至DVD或DVD等引导媒体DVD iso(如果是虚拟的)。 问我我怎么知道。

The implementation for RHEL/CentOS 8 is far easier that version 7. The script I wrote follows the RHEL/CentOS 8 version. You can download it at the gitlab link below.

RHEL / CentOS 8的实现比版本7容易得多。我编写的脚本遵循 RHEL / CentOS 8的版本。 您可以从下面的gitlab链接下载它。

以下代码块适用于RHEL / CentOS 8 (This code block below is for RHEL/CentOS 8)

Link to the Red Hat documentation

链接到Red Hat文档

# echo "this is for RHEL 8/CentOS 8"# fips-mode-setup --enableSetting system policy to FIPSFIPS mode will be enabled.Please reboot the system for the setting to take effect.

以下代码块适用于RHEL / CentOS 7 (This code block below is for RHEL/CentOS 7)

I created this script below from Red Hat Solution ID 137833 that has the very manual method to implement FIPS. The discussion page for my script is at this link (the Red Hat Discussion forum). I had to implement this across hundreds of systems so I turned this into a script that i also have hosted at gitlab.

我是从以下Red Hat解决方案ID 137833创建此脚本的,该脚本具有用于实施FIPS的非常手动的方法。 我的脚本的讨论页面位于此链接 (Red Hat讨论论坛)上 。 我必须在数百个系统中实现此功能,因此将其转换为脚本 , 该脚本也已在gitlab上托管 。

#!/bin/bash## 10/17/2018 changed uname directives to use "uname -r" which works better in some environments.  Additionally ensured quotes were paired (some were not in echo statements)## this script was posted originally at https://access.redhat.com/discussions/3487481 and the most current edition is most likely (maybe) posted there... maybe.  # updated 8/24/2018 (thanks for those who  provided inputs for update)# # Purpose, implement FIPS 140-2 compliance using the below article as a reference# See Red Hat Article https://access.redhat.com/solutions/137833##   --  I suspect Red-Hatter Ryan Sawhill https://access.redhat.com/user/2025843 put that solution together (Thanks Ryan).# see original article, consider "yum install dracut-fips-aesni"# --> And special thanks to Dusan Baljevic who identified typos and tested this on UEFI# NOTE: You can create a Red Hat Login for free if you are a developer, # - Go to access.redhat.com make an account and then sign into # - developers.redhat.com with the same credentials and then check your email and accept the Developer's agreement.# Risks...  1) Make sure ${mygrub} (defined in script) is backed up as expected and the directives are in place prior to reboot# Risks...  2) Make sure /etc/default/grub is backed up as expected and the proper directives are in place prior to reboot# Risks...  3) Check AFTER the next kernel upgrade to make sure the ${mygrub} (defined in script) is properly populated with directives# Risks...  4) Be warned that some server roles either do not work with FIPS enabled (like a Satellite Server) or of other issues, and you've done your research# Risks...  5) There are more risks, use of this script is at your own risk and without any warranty# Risks...  6) The above list of risks is -not- exhaustive and you might have other issues, use at your own risk.# Recommend using either tmux or screen session if you are using a remote session, in case your client gets disconnected. ###### Where I found most of the directives... some was through my own pain with the cross of having to do stig compliance.rhsolution="https://access.redhat.com/solutions/137833"manualreview="Please manually perform the steps found at $rhsolution"####### check if root is running this script, and bail if not root# be root or exitif [ "$EUID" -ne 0 ]  then echo "Please run as root"  exitfi### bail if command sysctl crypto.fips_enable returns with "1" with the variable $answer belowconfigured="The sysctl crypto.fips_enabled command has detected fips is already configured, Bailing...."notconfigured="fips not currently activated, so proceeding with script."## Dusan's good suggestion...answer=`sysctl crypto.fips_enabled`yes='crypto.fips_enabled = 1'if [ "$answer" == "$yes" ] ; then        echo -e "\n\t $configured \n"        exit 1    else        echo -e "\n\t $notconfigured \n"fi##### uefi check, bail if uefi (I do not have a configured uefi system to test this on)######- Added 7/5/2018, do not proceed if this is a UEFI system... until we can test it reliably[ -d /sys/firmware/efi ] && fw="UEFI" || fw="BIOS"echo -e "$fw"if [ "$fw" == "UEFI" ] ; then        echo -e "\n\tUEFI detected, this is a ($fw) system.\n\setting \$fw variable to ($fw)..."        mygrub='/boot/efi/EFI/redhat/grub.cfg'          ### Thanks Dusan Baljevic for testing this.          ### exit 1    else        echo -e "\n\t($fw) system detected, proceeding...\n"    mygrub='/boot/grub2/grub.cfg'fi##### rhel6 check really don't run this on a rhel6 box... and bail if it is rhel 6myrhel6check=`uname -r | egrep 'el6'`if [ "$myrhel6check" != "" ] ; then        echo -e "\n\tThis system is not RHEL 7, and Red Hat 6 is detected, \n\tThis script is intended for RHEL 7 systems only, bailing!!!\n"        exit 1   else        echo -e "\n\tRHEL 7 detectd, proceeding\n"fi##### rhel5 check really don't run this on a rhel5 box... and bail if it is rhel5myrhel5check=`uname -r | egrep el5`if [ "$myrhel5check" != "" ] ; then        echo -e "\n\tThis system is not RHEL 7, and Red Hat 5 is detected, \n\tThis script is intended for RHEL 7 systems only, bailing!!!\n"        exit 1   else        echo -e "\n\tNot RHEL 5, so proceeding...\n"fi##### only run if this returns  el7 in the grep# overkill? you bet, don't run unless this is rhel7myrhel7check=`uname -r | grep el7`if [ "$myrhel7check" != "" ] ; then        echo "RHEL 7 detected, Proceeding"   else        echo -e "\n\tThis system is not rhel7, \n\tBailing..."        echo exit 1fi######- add a second to $mydate variablesleep 1mydate=`date '+%Y%m%d_%H_%M_%S'`;echo $mydate##### make backup copy $mygrub defined earliercp -v ${mygrub}{,.$mydate}##### check fips in grub, if it's there, bail, if not proceedmyfipscheckingrub=`grep fips $mygrub | grep linux16 | egrep -v \# | head -1`if [ "$myfipscheckingrub" != "" ] ; then        echo -e "FIPS directives detected in ($mygrub), \n\t\t($myfipscheckingrub)\n\tSo, recommend AGAINST running this script\n\t$manualreview"        exit 1    else        echo -e "\n\tFIPS directives not detected in ($mygrub)\n\tproceeding..."fi##### fips should not be in /etc/default/grub, if so, bailetcdefgrub='/etc/default/grub'myfipschecketcdefgrub=`grep fips $etcdefgrub | grep -v \#`if [ "$myfipschecketcdefgrub" != "" ] ; then        echo -e "FIPS directives detected in ($etcdefgrub), \n\t\t($myfipschecketcdefgrub)\n\tSo, recommend AGAINST running this script\n\t$manualreview"        echo exit 1    else        echo -e "\n\tFIPS directives not detected in ($etcdefgrub)\n\tproceeding..."fi##### verify that this system is actually in the same kernel as we're going to install this in..., or bail# if they don't match, the script bails.mydefkern=`grubby --default-kernel | sed 's/.*vmlinuz\-//g'| awk '{print $1}'`myuname=`uname -r`if [ "$mydefkern" != "$myuname" ] ; then   echo -e "\n\tKernel Mismatch between running and installed kernel...\n\tThe default kernel is: $mydefkern\n\tThe running kernel is $myuname\n\n\tPlease reboot this system and then re-run this script\n\tBailing...\n"   exit 1  else echo "Default Kernel ($mydefkern) and Current Running Kernel ($myuname) match, proceeding"fi##### overkill, yes# yes, there's an number of checks above, but I'm still persisting with this, just in case someone runs this script twice.  # it will never reach this if it fails any of the previous checks, but I'll leave it.#####  a file named "/root/fipsinstalled" is created at the end of this script.  So I'll check for it at the beginning so that this script is only ran once.if [ -f /root/fipsinstalled ] ; then   sysctl crypto.fips_enabled   echo -e "\tThis script was ran previously,\n\t nothing to do, \n\texiting..."   exit 1 else   echo "continuing" >/dev/null   echo proceeding...fi######################################################################### this is where the script actually begins to make modifications.  # -- everything before was either a check, or a backup of a config# Only install dracut-fips if it is not installed (that's the "||" below)rpm -q dracut-fips > /dev/null || yum -y install dracut-fips##### warn people not to bail at this point, pause 4 seconds so they might see it if they're watching the screen.echo -e "\n\n\n\tWARNING!!!: \n\tWARNING!!!DO NOT INTERRUPT THIS SCRIPT OR IT CAN CAUSE \n\tTHE SYSTEM TO BECOME UNBOOTABLE!!!!\n\tPlease be patient it will take some time...\n\tWARNING!!!\n\tWARNING\n\n\n"sleep 4##### next disable prelinkingrpm -q prelink >/dev/null && grep PRELINKING /etc/sysconfig/prelink ##### slightly lesser known use of sed, it only flips PRELINKING to "no"# this flips "yes" to "no" in the prelink config file, next kills prelinkingrpm -q prelink >/dev/null && sed -i '/^PRELINKING/s,yes,no,' /etc/sysconfig/prelinkrpm -q prelink >/dev/null && prelink -uav 2>/tmp/err/bin/cp -v /etc/aide.conf{,.undofips}rpm -q prelink >/dev/null && sed -i 's/^NORMAL.*/NORMAL = FIPSR+sha512/' /etc/aide.conf##### update the $mydate variable which is used to copy off backups of various configs throughout the rest of this script.mydate=`date '+%Y%m%d_%H_%M_%S'`;echo $mydate###-----#### back up existing initramfsmv -v /boot/initramfs-$(uname -r).img{,.$mydate}##### warn people not to bail at this point, pause 4 seconds so they might see it if they're watching the screen.##### really, don't interrupt this portion.echo -e "\n\n\n\tWARNING!!!: \n\tWARNING!!!DO NOT INTERRUPT THIS SCRIPT OR IT CAN CAUSE \n\tTHE SYSTEM TO BECOME UNBOOTABLE!!!!\n\tPlease be patient it will take some time...\n\tWARNING!!!\n\tWARNING!!!\n\n\n"# this pauses as before so the person running this script gets a chance to see the above, it also is to allow the $mydate variable below to get a new valuesleep 3# run dracutdracutmydate=`date '+%Y%m%d_%H_%M_%S'`###-----######### The Red Hat solution I cited earlier in the comments, this is where this came from# this section below updates /boot/grub/grub.cfg with fips and the uuid of the boot device# first back it up/bin/cp ${mygrub}{,.$mydate}grubby --update-kernel=$(grubby --default-kernel) --args=fips=1###### this displays the kernel lines in grub with fipsgrep fips ${mygrub} | grep linux16###### that Red Hat solution I cited earlier in the comments, this is where this came from# set the uuid variable to be used lateruuid=$(findmnt -no uuid /boot)echo -e "\n\t Just for reference, the /boot uuid is: ($uuid)\n"###### that Red Hat solution I cited earlier in the comments, this is where this came from# update  the boot uuid for fips in ${mygrub}# the 2nd line is to satisfy the disa stig checker which checks every single menu entry linux16 line.  without it, the check fails.[[ -n $uuid ]] && grubby --update-kernel=$(grubby --default-kernel) --args=boot=UUID=${uuid}# update 7/23/2019.  The next line is excessive.  The impact of the next line, when the system goes to emergency mode, and you select **any** kernel at grub, you are faced with a system that **will not** accept any password.  I've removed it for the rescue kernel.## so maybe your security people require this. **IF** the do, then know that when you go to emergency mode, you **will** require the grub password (know it in advance!) and you ought to set **one time only** the grub line to fips=0 **for a one time only boot**# #sed -i "/linux16 \/vmlinuz-0-rescue/ s/$/ fips=1 boot=UUID=${uuid}/"  ${mygrub}###### that Red Hat solution I cited earlier in the comments, this is where this came from# update /etc/default/grub for subsequent kernel updates. this APPENDS to the end of the line.  sed -i "/^GRUB_CMDLINE_LINUX/ s/\"$/  fips=1 boot=UUID=${uuid}\"/" /etc/default/grubgrep -q GRUB_CMDLINE_LINUX_DEFAULT /etc/default/grub || echo 'GRUB_CMDLINE_LINUX_DEFAULT="fips=1"' >> /etc/default.grubecho -e "\n\tThe next line shows the new grub line with fips in the two locations below:\n"grep $uuid ${mygrub} | grep linux16echo;grep $uuid /etc/default/grub### warning ### warning ###### Note, if you do not change Ciphers and MACs prior to reboot, you will NOT be able to ssh to the system.  That could be a problem depending on the distance or difficulty of getting a console or physical access to fix after reboot.  Be warned.###mydate=`date '+%Y%m%d_%H_%M_%S'`;echo $mydatecp -v /etc/ssh/sshd_config{,.$mydate}# without this, no ssh, really, ask me how I knowsed -i 's/^Cipher.*/Ciphers aes128-ctr,aes192-ctr,aes256-ctr/' /etc/ssh/sshd_configsed -i 's/^MACs.*/MACs hmac-sha2-256,hmac-sha2-512/' /etc/ssh/sshd_config# bread crumbstouch /root/fipsinstalledchattr +i /root/fipsinstalled###### the command to check this after reboot is: sysctl crypto.fips_enabledecho -e "\n\tScript has completed.  \n\tSystem must be rebooted for fips to be enabled.  \n\tPlease check the following 2 files for sane entries:\n\t/etc/default/grub \n\t${mygrub}.  \n\n\tAlso, --AFTER--REBOOT--as-root-- run sysctl crypto.fips_enabled and the output must be \n\t'crypto.fips_enabled = 1' \n"##### without this, the disa provided stig checker fails fips compliance, you're welcomeecho 'GRUB_CMDLINE_LINUX_DEFAULT="fips=1"' >> /etc/default/grubrpm -q prelink > /dev/null && rpm -e prelink > /dev/null##### Same with this.../bin/chmod 0600 /etc/ssh/ssh_host*key

While I am not a representative of Red Hat and my views about Red Hat are just my own, I am a member of the official Red Hat Accelerators community, which gives me the connection to Red Hat and through which I engage with other RHA team members.

虽然我不是Red Hat的代表,但我对Red Hat的看法只是我个人的看法,但我还是Red Hat Accelerators官方社区的成员,这使我与Red Hat保持联系,并与其他RHA团队成员互动。

翻译自: https://medium.com/codemooselinuxblog/fips-script-for-rhel-centos-7-d0cec41a4fcf

rhel centos 源


http://www.taodudu.cc/news/show-4149485.html

相关文章:

  • OPENSSL FIPS
  • 什么是FIDO、什么是FIPS浅理解
  • FIPS 140-3与140-2的差异-2
  • javafx教程大全
  • eclipse上配置JavaFX完整教程
  • JavaFX教程资源
  • JavaFX开发教程-什么是JavaFX?
  • javafx 教程_Swing和JavaFX:使用JFXPanel
  • javafx 教程_新的JMetro JavaFX 11兼容版本
  • java fx 教程_JavaFX快速入门
  • javafx 教程
  • javafx 教程_集成JavaFX和Swing(修订版)
  • javafx 教程_JavaFX,Jigsaw项目和JEP 253
  • javafx 教程_何时使用JavaFX代替HTML
  • javafx 教程_集成JavaFX和Swing
  • javafx 教程_Java验证(javafx)
  • JavaFx教程-03JavaFX Application的生命周期
  • JavaFx教程-02第一个javaFX程序
  • javafx 教程_用JavaFX编写图块引擎
  • javafx 教程_示例介绍:JavaFX 8打印
  • JavaFx教程-01初识javaFX
  • java ar教程_JavaFX教程整理
  • JavaFX开发教程——快速入门FX
  • BZOJ1050 [HAOI2006]旅行comf (并查集)
  • BZOJ 1050 HAOI2006 旅行comf
  • BZOJ1050 HAOI2006 旅行comf 生成树+枚举
  • [BZOJ1050] [HAOI2006] 旅行comf (Kruskal, LCT)
  • BZOJ 1050: [HAOI2006]旅行comf
  • bzoj1050 [HAOI2006]旅行comf
  • 1050: [HAOI2006]旅行comf

rhel centos 源_Rhel centos 7的fips脚本相关推荐

  1. linux启动有两个选择,RHEL5 用CentOS源升级,GRUB出现CentOS,RHEL两个启动项,选择哪一个?...

    gogo11 于 2011-07-22 01:12:05发表: 就是grub里边的名称不一样,你vi /boot/grub/menu.lst就行了-------? every_why 于 2011-0 ...

  2. RHEL 8使用CentOS源

    RHEL8使用在线源可参考如下链接阿里云关于CentOS8切换源的说明 centos镜像-centos下载地址-centos安装教程-阿里巴巴开源镜像站 wget -O /etc/yum.repos. ...

  3. [跟我一起涨姿势]未注册服务的RHEL6.4使用网易的CentOS源

    RHEL6.4安装和使用CentOS源 针对未注册更新服务的RHEL版本 [前言] 最近CentOS发布新闻表示自己已经被小红帽归拢了,考虑到大势所趋我也把VM虚拟实验环境从CentOS6.4改成了R ...

  4. REHL yum的配置(本地和centos源)

    本地yum源设置,将yum源设置成本地RHEL镜像里面的Server,这样使用yum的时候就可以直接调用这里面的rpm, 1.挂载DVD镜像,并将命令写入/etc/rc.d/rc.local自启动 m ...

  5. RHEL6.4换CentOS源

    2019独角兽企业重金招聘Python工程师标准>>> 废话少说,直接上脚本: rpm -qa | grep yum | xargs rpm -e --nodeps rpm -ivh ...

  6. CentOS源码下载和Windows平台下解压rpm包

    CentOS源码网址,http://vault.centos.org/ 找到自己要的版本:6.0的url如下, https://vault.centos.org/6.0/os/Source/Packa ...

  7. 下载CentOS源码、Hyper-V虚拟机联网、拷贝文件到Hyper-V虚拟机中的Linux系统

    下载CentOS源码: 先查看CentOS版本和内核版本:后面那个是内核版本: 进入CentOS官网:找到对应操作系统版本: 进入:os - Source - SPackages目录: 找到对应内核版 ...

  8. linux6.4添加源,RHEL6.4更改为CentOS源

    今日网上搜索了很多关于RHEL6.4更改为CentOS源的文章,都是按照一步一步去操作,但都是不行的.后来自己综合了各篇文章,修修改改,终于成功更改了yum源. 第一步:删除默认的yum源.命令如下 ...

  9. linux安装centos源,CentOS Linux安装RPMForge源

    RPMForge是CentOS系统下的软件仓库,拥有10000多种的软件包,被CentOS社区认为是最安全也是最稳定的一个软件仓库.默认的CentOS源,软件太少了,可以添加额外的RpmForge.这 ...

最新文章

  1. GridView里面的HyperLink和ButtonField操作总结
  2. P4245 【模板】任意模数多项式乘法
  3. linux java url 异常_java异常处理总结
  4. WinINet function(2)Request
  5. 油价下降,全国人民都高兴
  6. 二级Access数据库大纲知识要点
  7. python3 ftplib_python3从零学习-5.10.9、ftplib—FTP 协议客户端
  8. Instagram新推两款AI过滤工具,没错!背后功臣就是Deep Text
  9. linux boot 空间不足,解决Ubuntu 提示boot分区空间不足办法
  10. python爬虫之多线程、多进程爬虫_python 多线程,多进程,高效爬虫
  11. 山东大学网络考试的计算机试题及答案,专科 计算机基础 山东大学网络教育考试模拟题及答案.doc...
  12. 博图多版本共存安装教程 博图V14V15V16V17下载地址
  13. MySQL 误删数据恢复
  14. oracle诉讼_Oracle诉Google:Aaaaand诉讼又回来了! [更新]
  15. 【Python】一个简陋的基于混淆矩阵计算遥感分类精度(总体精度、Kappa系数、用户精度、生产者精度等)的代码
  16. GB:香港城市大学孙燕妮组发表高准确度病毒株识别工具VirStrain
  17. 摘-连载-《青青子衿》(念才)-采葛-96
  18. CH0502 七夕祭
  19. 【手把手反内卷】开创全新AI多模态任务一视听分割:代码实践、优化教程(二)
  20. Ext JS从零开始之二

热门文章

  1. 字符串处理,仿古书竖排版
  2. 用来在计算机各功能部件之间,广义相对论确认光在太阳附近会弯曲,引力透镜,水星进动等实验支持广义相对论。()...
  3. [blockchain-042]eos 硅谷ecs docer编译 mongo存储
  4. 旅游网站首页——html
  5. 初始化云硬盘切换云主机挂载验证lvm跨主机可读
  6. 一个测试工程师走进一家酒吧……
  7. 如何发现网站被劫持被黑DNS被污染
  8. 阿里百川的用户反馈(Android)
  9. JAVA开发讲义(一)-Java的自白
  10. [日更-2019.3.31]如何下载Nexus5的LineageOS14.1(cm-14.1)系统源码并编译、刷机