旅するえんじにあ - Engineers to Travel -

旅するエンジニアの気まま備忘録

【Linux】CentOS bash 脆弱性の対応

一部LinuxMac OS Xで使用されているbash脆弱性 Shellshockが見つかった問題で2014年9月末結構バタバタした。

その時CentOSを何台か使っていたので対策を行った。 その時のメモ。

bash脆弱性については以下のサイトがわかりやすい。

http://www.nca.gr.jp/2014/shellshock/index.html

まずはOSの確認

# cat /etc/redhat-release
CentOS release 6.4 (Final)

どうやらうちはCentOS6.2と6.4を使用していた模様 bashのバージョンとしては4.1.2-15.el6_5.2が入っていれば問題ないとのことだったので 簡単にyumでインストールできないか確認をする。

# yum check-update | grep bash
Not using downloaded repomd.xml because it is older than what we have:
  Current   : Fri Nov  2 11:44:18 2012
  Downloaded: Wed Jul 25 10:44:22 2012
bash.x86_64                          4.1.2-15.el6_5.2                   updates

どうやらいけそうな雰囲気

# yum -y update bash.x86_64
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * rpmforge: mirror.fairway.ne.jp
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package bash.x86_64 0:4.1.2-8.el6.centos will be updated
---> Package bash.x86_64 0:4.1.2-15.el6_5.2 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================
 Package           Arch                Version                          Repository            Size
===================================================================================================
Updating:
 bash              x86_64              4.1.2-15.el6_5.2                 updates              905 k

Transaction Summary
===================================================================================================
Upgrade       1 Package(s)

Total download size: 905 k
Downloading Packages:
bash-4.1.2-15.el6_5.2.x86_64.rpm                                            | 905 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating   : bash-4.1.2-15.el6_5.2.x86_64                                                    1/2
  Cleanup    : bash-4.1.2-8.el6.centos.x86_64                                                  2/2

Updated:
  bash.x86_64 0:4.1.2-15.el6_5.2


Complete!

インストールが無事完了

一応ちゃんとアップデートされているか確認をする。

# yum list installed | grep bash
bash.x86_64           4.1.2-15.el6_5.2  @updates

これで完了です。

他のサーバも同様にアップデート。

うちのサーバはCentOSなんですが、Distributionによって違うみたいなので注意してください。