LoginSignup
4
4

More than 5 years have passed since last update.

こんなときにはansible

Last updated at Posted at 2014-10-08

そもそも

そういえばたくさんサーバをお守りしてる!
お守りしているサーバのbashの状況をいっぺんに確認したい!

こんなとき、さくっと出来るのはansible。

bashバージョンの確認:

CentOSの場合ですが...

% ansible  SERVER_GROUP -a "rpm -qa bash"

脆弱性の確認:

% ansible SERVER_GROUP -a "env x='() { :;}; echo vulnerable' bash -c \"echo this is a test\""
  • SERVER_GROUP には、インベントリファイルに設定したホストを指定。
  • もしくは、個別のサーバ名を指定。

ダメな場合:

% ansible MY_SERVERS -a "env x='() { :;}; echo vulnerable' bash -c \"echo this is a test\""
my-server1.com | success | rc=0 >>
vulnerable
this is a test

my-server2.com | success | rc=0 >>
vulnerable
this is a test

# ... こういうのが続きます...

可能なら、これも -a "yum update -y bash" しましょう。

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4