Linux アプリケーション向けの Seccomp フィルター生成の自動化
Automating Seccomp Filter Generation for Linux Applications
Automating Seccomp Filter Generation for Linux Applications
@misc{canella2020automating,
title = {Automating Seccomp Filter Generation for Linux Applications},
author = {Claudio Canella and Mario Werner and Daniel Gruss and Michael Schwarz},
year = {2020},
eprint = {2012.02554},
archivePrefix = {arXiv},
primaryClass = {cs.CR},
url = {https://arxiv.org/abs/2012.02554}
}
Canella, C., Werner, M., Gruss, D., & Schwarz, M. (2020). Automating Seccomp Filter Generation for Linux Applications [Preprint]. arXiv. https://doi.org/10.48550/arXiv.2012.02554
CANELLA C, WERNER M, GRUSS D, et al. Automating Seccomp Filter Generation for Linux Applications[EB/OL]. (2020-12-04)[2026-11-29]. https://arxiv.org/abs/2012.02554.
要旨
アプリケーションにおけるソフトウェアの脆弱性は、アプリケーションのセキュリティを損なう。不要な機能のブロックにより、潜在的な攻撃のインパクトを低減できる。seccomp はシステムコールのフィルタリングに対する解決策を提供するが、各アプリケーションに対してフィルタ規則の手動実装を必要とする。最近の研究では、必要なフィルタ規則を検出・インストールするための自動化アプローチが検討されている。しかし、我々が示すように、これらのアプローチは不必要な仮定に基づいているか、過度に時間のかかる分析を必要とする。本稿では、Linux ユーザースペースアプリケーションに対して厳格なシステムコールフィルタを生成する自動化アプローチ Chestnut を提案する。Chestnut は 2 つのフェーズから構成され、第 1 フェーズにはコンパイラとバイナリ解析器という 2 つの静的コンポーネントが含まれ、コンパイル時またはバイナリの分析中に使用されているシステムコールを抽出する。Chestnut のコンパイラベースのアプローチは、精度に悪影響を与えずに、従来のアプローチに比べて最大 73 倍高速である。バイナリ解析レベルでは、関連する研究における位置独立型バイナリの要件が不要であることを示し、Chestnut の適用可能なアプリケーションの範囲を広げた。オプションの第 2 フェーズでは、Chestnut はさらに許可されたシステムコールのセットを制限するダイナミックな精細化ツールを提供する。18 つの広く使用されているアプリケーションのセットにおいて、Chestnut はコンパイラ経由で平均 302 個(86.5%)のシステムコールをブロックし、バイナリレベルの分析では 288 個(82.5%)をブロックした。我々は、Chestnut がコンパイラベースのアプローチでは 50%、バイナリベースのアプローチでは 77.7% のテストアプリケーションで危険な exec システムコールをブロックしたことを発見した。テストされたアプリケーションにおいて、Chestnut はシステムコールを介してカーネルを標的とする 175 つの CVE のうち 62% 以上を攻撃から保護した。最後に、サンドボックス化された Nginx サーバーに対する 6 ヶ月間の長期研究を行った。
Software vulnerabilities in applications undermine the security of applications. By blocking unused functionality, the impact of potential exploits can be reduced. While seccomp provides a solution for filtering syscalls, it requires manual implementation of filter rules for each individual application. Recent work has investigated automated approaches for detecting and installing the necessary filter rules. However, as we show, these approaches make assumptions that are not necessary or require overly time-consuming analysis. In this paper, we propose Chestnut, an automated approach for generating strict syscall filters for Linux userspace applications with lower requirements and limitations. Chestnut comprises two phases, with the first phase consisting of two static components, i.e., a compiler and a binary analyzer, that extract the used syscalls during compilation or in an analysis of the binary. The compiler-based approach of Chestnut is up to factor 73 faster than previous approaches without affecting the accuracy adversely. On the binary analysis level, we demonstrate that the requirement of position-independent binaries of related work is not needed, enlarging the set of applications for which Chestnut is usable. In an optional second phase, Chestnut provides a dynamic refinement tool that allows restricting the set of allowed syscalls further. We demonstrate that Chestnut on average blocks 302 syscalls (86.5%) via the compiler and 288 (82.5%) using the binary-level analysis on a set of 18 widely used applications. We found that Chestnut blocks the dangerous exec syscall in 50% and 77.7% of the tested applications using the compiler- and binary-based approach, respectively. For the tested applications, Chestnut prevents exploitation of more than 62% of the 175 CVEs that target the kernel via syscalls. Finally, we perform a 6 month long-term study of a sandboxed Nginx server.