1. Fourteenforty Research Institute, Inc.
1
Fourteenforty Research Institute, Inc.
Fourteenforty Research Institute, Inc.
株式会社 フォティーンフォティ技術研究所
http://www.fourteenforty.jp
Ver 2.00.01
Windows 8 セキュリティ
AppContainerによるSandbox
2. Fourteenforty Research Institute, Inc.
• Windows 8から導入されたサンドボックス
• 新たな “AppContainer”によって実現されている
• Windows Store Appは原則AppContainerで動作する
• ファイルアクセスや他プロセスへのアクセスなどが制限される
2
AppContainer概要
3. Fourteenforty Research Institute, Inc.
• Windows Store Appはこれまでデスクトップアプリと動作環境が大きく異なる
• 制限が多く、隔離された環境となりセキュリティ面でも大きく向上している
これまでのアプリとの違い
3
Windows Store App Desktop App
Integrity Level Low Medium
AppContainer On Off
Kernel Object 各アプリごとの名前空間 セッション内で共有
4. Fourteenforty Research Institute, Inc.
• AppContainerとして動作するPEに適用されるフラグ
• Windows Store AppのEXEに適用される
• PEに新たなオプション
– PEのDLL Characteristicsに新たな値が定義された模様
• Windows Store AppのPEのDLL Characteristicsはフラグ0x1000がオン
(2010年のPEの仕様では予約済みとされている値)
4
/AppContainer コンパイラオプション
5. Fourteenforty Research Institute, Inc.
• Process Explorer
– Windows Store AppのIntegrity LevelはAppContainer
• Windows SDKのヘッダファイル
– AppContainerに対応するIntegrity LevelのSIDは存在しない
– AppContainerは既存のLow, Medium, HighといったIntegrity Levelとは別の仕組み
• AppContainerプロセスのIntegrity Level
– SECURITY_MANDATORY_LOW_RID (Low)と同じ
• プロセストークンに新たな値
– Windows 8より、GetTokenInformation APIで取得できる値に”TokenIsAppContainer”が追加された
5
AppContainerのアクセストークン
Process Explorerでは
Integrity LevelがAppContainerと表示される
6. Fourteenforty Research Institute, Inc.
6
AppContainerプロセスのアクセストークン情報
AppContainerを表すSIDが存在
CapabilityもSIDで表現される
Integrity Levelは “Low”
7. Fourteenforty Research Institute, Inc.
• AppContainerからはシステムフォルダやドキュメントフォルダなどほとんどのファイルの直接
の読み込みが禁止される
• ファイルアクセスは原則Runtime Broker経由(Capabilityによる制御)
• 今までのデスクトップアプリとは読み込みも禁止される点で大きく異なる
• アクセスするには、ALL APPLICATION PACKAGESグループに明示的にアクセス権を設定
するなどの必要がある
7
フォルダ・ファイルアクセス制限
Windows Store App
Integriyt Level “AppContainer”
Desktop App
Integrity Level “Low”
システムフォルダやドキュメントフォルダ
読み込みは可能
書き込みは禁止
読み書きともに禁止
Broker Process
Integrity Level
“Medium”
読み書き可能
ファイルアクセス依頼
8. Fourteenforty Research Institute, Inc.
• カーネルオブジェクトツリーに、各Windows Store App専用のディレクトリが作成される
• AppContainerNamedObject
• S-1-15-2-XXXX.... (一つ目のAppContainerのSID)
• S-1-15-2-YYYY.... (二つ目のAppContainerのSID)
• デフォルトでデスクトップアプリが作成する同一セッション内のオブジェクトへのアクセスは制限される
• Windows Store Appがデスクトップアプリの持つオブジェクトに対して操作することができない(攻撃できない)
(*ALL APPLICATION PACKAGEグループに対するアクセス許可を明示的に設定するなどでアクセス可能)
8
カーネルオブジェクトの分離
AppContainerのオブジェクト名前空間
AppContainerから名前を指定して
オブジェクトの作成、オープンを行う場合
こちらが参照される
セッションのオブジェクト名前空間
デスクトップアプリから名前を指定して
オブジェクトの作成、オープンを行う場合
こちらが参照される
9. Fourteenforty Research Institute, Inc.
• AppContainerからは通常のデスクトップアプリプロセスへのメモリアクセスはできない(読み
書きともに不可)
• 逆(デスクトップアプリ→Windows Store App)のメモリアクセスは可能
– Windows Store App型のIEなどへのコードインジェクションは可能
9
プロセスメモリアクセス制限
Windows Store App
Integrity Level “AppContainer”
Desktop App
Integrity Level “Low”
コードのインジェクト
10. Fourteenforty Research Institute, Inc.
• Windows Store App型のInternet Explorer 10はAppContainerで動作
• これまでIntegrity Level “Low”として動作していたプロセスが
AppContainerとして動作している
• 脆弱性攻撃を受けた際の被害が大きく抑えられる
Internet Explorer 10
10
11. Fourteenforty Research Institute, Inc.
• Windows Store Appは制限の大きいサンドボックス環境で実行される
• 今までの、Integrity Level “Low” よりも更に強い制限
• Windows Store Appが攻撃され乗っ取られた場合でも、システムへの影響
はかなり低く抑えられる
• デフォルトではWindows Store Appからデスクトップアプリへの侵入はでき
ない(Sandboxの実装に脆弱性がない限り)
• Windows Store App型のIEはAppContainerとして動作する
– IEの脆弱性を突いた攻撃が成功してもできることが限られている
– ただし、デスクトップアプリなどからマルウェアに感染した場合、MITB
などの攻撃を受ける可能性はまだ存在する
11
まとめ