LoginSignup
6
3

More than 3 years have passed since last update.

Oracle Autonomous Linuxをハックする Part 2

Last updated at Posted at 2019-10-02

前回の続き

前回から続いた内容なので、連続した段落番号をつけている。

4. Kspliceの設定を調べる

KspliceとはOracle Linuxで利用できるライブ・パッチング・システムだ。詳しくは以下のエントリーを読んでもらうとして、簡単に説明する。

通常アップデートしたLinuxカーネルを有効にするには、OSを再起動する必要がある。しかしKspliceを使用すると、再起動しなくてもアップデートを有効化できる。

Kspliceのおもなメリットは以下のとおり。またglibcとopensslを対象にした、ユーザー空間対応Kspliceモジュールもある。

  • ダウンタイム無しのパッチ適用/ロールバック
  • 迅速なセキュリティ脆弱性への対応

4-1. インストールされているKspliceモジュール

インストールされているKspliceモジュールを確認する。拡張クライアント(ksplice)とUptrackクライアント(uptrack)の両方がインストールされている。さらにglibc-2.17-292.0.1.ksplice1openssl-1.0.2k-19.0.1.ksplice1などのユーザー空間用パッケージもインストールされている。

# rpm -qa | grep -e ksplice -e uptrack | sort
glibc-2.17-292.0.1.ksplice1.el7.x86_64
glibc-common-2.17-292.0.1.ksplice1.el7.x86_64
ksplice-1.0.42-1.el7.x86_64
ksplice-core0-1.0.42-1.el7.x86_64
ksplice-helper-1.0.42-1.el7.x86_64
ksplice-known-exploit-detection-1.0.42-1.el7.x86_64
ksplice-release-el7-1.0-5.el7.x86_64
ksplice-tools-1.0.42-1.el7.x86_64
openssl-1.0.2k-19.0.1.ksplice1.el7.x86_64
openssl-libs-1.0.2k-19.0.1.ksplice1.el7.x86_64
uptrack-1.2.58-0.el7.noarch

4-2. Kspliceの設定ファイル

Kspliceの設定ファイルを確認する。autoinstall = noなので、自動適用しない設定になっている。

# grep -v -e '^\s*#' -e '^\s*$' /etc/uptrack/uptrack.conf
[Auth]
accesskey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(意図的に伏せ字)
[Network]
https_proxy =
gconf_proxy_lookup = no
update_repo_url=https://oraclecloud-updates-ksplice.oracle.com/update-repository
user_update_repo_url=https://oraclecloud-updates-ksplice.oracle.com/ksplice/request
[Settings]
install_on_reboot = yes
autoinstall = no ★この部分
[Known-Exploit-Detection]
enabled = yes

4-3. Kspliceの動作状況

Kspliceの動作状況を確認する。unameとuptrack-unameの結果が異なるので、Kspliceパッチが適用されている。

  • uname: 動作しているベースカーネルのバージョン
  • uptrack-uname: Kspliceパッチを提供した実効カーネルバージョン
# uname -r
4.14.35-1902.4.8.el7uek.x86_64
# uptrack-uname -r
4.14.35-1902.5.2.2.el7uek.x86_64

以下のコマンドを実行すると、適用済みパッチのリストが表示される。

# ksplice all show
100% |########################################################################|
Ksplice user-space updates:
No Ksplice user-space updates installed

Ksplice kernel updates:
Installed updates:
[lubjelbn] Known exploit detection.
[7zk0g4lf] Known exploit detection for CVE-2017-7308.
[zfuwlaff] Known exploit detection for CVE-2018-14634.
[pqqx26q0] Known exploit detection for CVE-2018-18445.
[28h7tx53] Kernel IO hang during directory entry cache shrinking.
[s3la2wa9] Use-after-free in Xen network backend receive path.
[r0cv90yp] SUNRPC failure during NFS secure unmounting.
[awwtw5mv] Memory leak when freeing NVMe subsystem.
[htah118n] NULL pointer dereference when using NVMe multipath with ANA deactivated.
[d8w38jxd] Multiple use-after-free in NVMe subsystem.
[oxqquizz] Improved fix for Spectre v1: Bounds check bypass in Vhost ioctl.
[6dd5x4cg] CVE-2019-14835: Privilege escalation during live migration of guest.
[plcrrmwl] KPTI enablement for Ksplice.
[j5cc6s5g] CVE-2019-14821: Denial-of-service in KVM MMIO coalesced writes.

Effective kernel version is 4.14.35-1902.5.2.2.el7uek

autoinstall = noで自動適用しない設定になっていることと一致しないが、この謎解きは今後の課題にする。

5. Oracle Autonomous Linuxとは何か?

ここまでの調査で大まかなことは分かった。「Oracle Autonomous Linux固有」と思われる機能は以下のとおり。Kspliceとyum-cronは通常のOracle Linuxでも利用できるが、デフォルトでは有効化されていない。

  1. Kspliceパッチが自動適用される
  2. RPMパッケージが自動アップデートされる(yum-cron)
  3. Oracle Autonomous Linux固有のサービスal-config.serviceが起動している

とはいえ、

Oracle Autonomous Linuxって、Kspliceやyum-cronがデフォルトで有効化されるだけ?

新機能として発表しても、実際には既存の手堅いテクノロジーを利用していることが多いOracle。それでもコンサバすぎるのでは?

stressやfioで負荷を掛けても反応無し。いったいNotificationsを設定した意味は?

などと考えつつ、インスタンスを起動したまま放置。

すると翌日Notifications経由でメールが送られてきた来た! イエーイ!

※2019/9/24以降のバージョン(al-config-1.0-1.0.29.el7)では、Notificationsをセットアップするとメールが送信される。

これがメールの文面。

+------------------------------------------------------------------------+
| Summary (Tue Oct 1 HH:MM:DD JST 2019)
| 
+------------------------------------------------------------------------+
Yum updates installed: no
Ksplice updates installed: no
Uptime: 15:46:07 up 20:42, 1 user,
load average: 0.00, 0.00, 0.00 
+------------------------------------------------------------------------+
| Ksplice upgrade report
| 
+------------------------------------------------------------------------+
Running 'ksplice -y all upgrade'. 
Updating on-disk packages for new processes 
Loaded plugins: langpacks, ulninfo 
No packages marked for update 
Nothing to do. 
Nothing to be done. 
Your kernel is fully up to date. 
Effective kernel version is 4.14.35-1902.5.2.2.el7uek 
+------------------------------------------------------------------------+
| Yum upgrade report 
|
+------------------------------------------------------------------------+
Running 'yum-cron' with update cmd: default. 
+------------------------------------------------------------------------+
| Ksplice updates status 
| 
+------------------------------------------------------------------------+
Running 'ksplice all show'. 
Ksplice user-space updates: 
No Ksplice user-space updates installed 

Ksplice kernel updates: 
Installed updates: 
[1rw4f14x] Known exploit detection. 
[eexuzyat] Known exploit detection for CVE-2017-7308. 
[bum1jlug] Known exploit detection for CVE-2018-14634. 
[p31wiydb] KPTI enablement for Ksplice. 
[oql5q0mj] Known exploit detection for CVE-2018-18445. 

Effective kernel version is 4.14.35-1902.5.2.2.el7uek 
+------------------------------------------------------------------------+
| Needs-restarting status 
|
+------------------------------------------------------------------------+
Running 'needs-restarting'. 
-------------------------------------------------------------------------- 
Running 'needs-restarting --services'. 
-------------------------------------------------------------------------- 
Running 'needs-restarting --reboothint'. No core libraries or services have been updated.
Reboot is probably not necessary.

書かれている内容は以下のとおり。来ないよりはいいが、正直物足りないような。まあAutonomous Databaseも徐々に進歩だからねぇ。

  • Kspliceによるアップデート情報
  • yum-cronによるアップデート情報
  • OS再起動の必要性の有無。needs-restartingは、インストールしたRPMパッケージから再起動の必要性を表示するツール

おわりに

次回は実際にスクリプトを調査して、より深い解析を試みる。

6
3
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
6
3