2010年12月25日土曜日

AppArmor Technical Documentation - 3 The Apparmor Security Model

When a file is accessed by name with open(2), mkdir(2), etc., the kernel looks up the location of the object associated with the specified pathname in the file system hierarchy. The lookup is relative to the root directory for pathnames starting with a slash, and to the current working directory otherwise. Different processes can have have different working directories as well as different root directories. See path resolution(2) for a detailed discussion of how pathname resolution works.
Either way, the result of the lookup is a pair of (dentry, vfsmount) kernel-internal objects that uniquely identify the location of the file in the file system
hierarchy. The dentry points to the object if the object already exists, and is a placeholder for the object to be created otherwise.
AppArmor uses the (dentry, vfsmount) pair to compute the pathname of the file within a process's filesystem namespace. The resulting pathname contains no relative pathname components (\." or \.."), or symlinks.
AppArmor checks if the current profile contains rules that match this pathname, and if those rules allow the requested access. Accesses that are not explicitly allowed are denied.

(略)
どちらの方法(各プロセスのルートディレクトリから始まるパスネーム、ないしは、作業ディレクトリからのそれ、からファイルをルックアップすること)でも、ルックアップの結果は(dentry,vfsmount)カーネル内部の、ファイルシステム階層内部のファイルの位置を固有に特定する、オブジェクトのペアです。 dentryは、オブジェクトがすでに存在すればそのオブジェクトを指し、さもなくば、生成される予定のオブジェクトのプレースホルダーです。
AppArmorは(dentry,vfsmountの)ペアを用いて、プロセスのファイルシステムのネームスペース内部のファイルのパスネームを特定します。結果として生じるパスネームには、一切の相対パスネームの部分("."ないしは"..")やシンボリックリンクは含まれません。AppArmorは現在のプロファイルが、このパスネームにマッチするルールを含んでいるかどうか、そして、それらのルールが要求されたアクセスを許可しているかどうかをチェックします。明示的に許可されていないアクセスは拒否されます。

0 件のコメント:

コメントを投稿