AppArmor

本页使用了标题或全文手工转换
维基百科,自由的百科全书
AppArmor
原作者Immunix英语Immunix
开发者Canonical Ltd, SUSENovell
首次发布1998年,​26年前​(1998
当前版本
  • 3.1.7 (2024年2月2日;稳定版本)[1]
编辑维基数据链接
源代码库 编辑维基数据链接
编程语言C, Perl, C++, sh
操作系统Linux
类型安全
许可协议GNU通用公共许可证
网站gitlab.com/apparmor 编辑维基数据

AppArmor (“Application Armor”,意为“应用盔甲”) 是一个Linux内核安全模块,允许系统管理员通过每个程序的配置文件限制程序的功能。如它的帮助页面所说,“AppArmor 是一个对内核的增强工具,将程序限制在一个有限的资源集合中。AppArmor 独特的安全模型将对访问属性的控制绑定到程序而非用户。”[2]

AppArmor 通过提供强制访问控制(MAC)来补充传统的Unix自主访问控制(DAC)模型。 从Linux内核的2.6.36版本开始,它已经被包含在主流分支中,并且自2009年它的开发得到了 Canonical 公司的支持。[3][4]

功能特性[2][编辑]

AppArmor 对相关程序的约束与控制通过 apparmor_parser 加载到内核的配置文件来提供,这一般通过 /etc/init.d/apparmor 中的 SysV initscript ,如:

# /etc/init.d/apparmor start
# /etc/init.d/apparmor stop
# /etc/init.d/apparmor restart

AppArmor可以以两种模式运行:执行(enforcement)模式或学习(complain/learning)模式:

  • 执行模式 - 加载的配置文件中定义的策略将会被执行,并且会向 syslogd 报告违规尝试。
  • 学习 - 以“学习”模式加载的配置文件不会执行策略。 它仅仅会报告违反策略的尝试。这种模式对于开发配置文件很方便。利用这种模式可以根据各个程序针对性地生成配置文件。

AppArmor 是使用Linux安全模块(LSM)内核接口实现的。[5] 在2009年,Linux 2.6.30 中包含了一个名为 Tomoyo英语Tomoyo 的新解决方案[6];像 AppArmor 一样,它也使用基于路径的访问控制。

同 SELinux 的异同[编辑]

AppArmor 是作为 SELinux 的替代品出现的,因为对 SELinux 的批评者认为它难以让管理员设置和维护。[7]与基于将标签应用于文件的 SELinux 不同,AppArmor 使用文件路径来确认文件。 AppArmor 的支持者声称,它对普通用户而言要比 SELinux 更简单、更易学习。[8][9] 他们还认为 AppArmor 对现有系统的要求更低:例如 SELinux 需要支持“安全标签”的文件系统[10],因此无法为通过 NFS 挂载的文件提供访问控制。 AppArmor 则对文件系统没有要求。

但不论如何,这两个软件产品对让管理员加强系统的安全性都非常有帮助。他们都专注于访问控制,强化了标准的Linux访问控制策略。他们都生成日志,并提供审计活动的工具。他们都在应用程序层内工作。从技术上讲,他们同样地使用LSM与Linux内核进行交互。它们允许管理员使用GUI与非GUI工具。最后,它们都允许管理员在没有真正阻止访问的情况下尝试策略(而只是警告),以便仅在足够数量的测试之后才应用安全加固策略。[11]

SELinux 和 AppArmor 的不同主要体现在管理方式和集成方式上。例如一个重要的区别: SELinux 通过 inode 编号而不是路径标识文件系统对象。[12]这意味着如果给一个无法访问的文件创建了硬链接,在 AppArmor 中它将可以访问,但 SELinux 通过新创建的硬链接仍然会拒绝访问——由 inode 引用的基础数据是一样的。另外,在文档数量上 AppArmor 要比 SELinux 略逊一筹,这意味着网上寻找解决方案的难易程度同样有所差异。[11]

历史[编辑]

AppArmor 在1998~2003年首先在 Immunix英语Immunix Linux中被使用。当时,AppArmor被称为SubDomain,[13][14]这个名字意在将特定程序的安全配置文件分割成不同的域,而程序可以动态地在不同的域中进行切换。 AppArmor 首先在 SLES 和 openSUSE 中可用,并且在 SLES英语SUSE_Linux_Enterprise 10 和 openSUSE 10.1 中默认首先启用。

2005年5月,Novell 收购了 Immunix 并将 SubDomain 重新命名为 AppArmor,并开始对其 Linux 内核进行代码清理和重写。[15]从2005年到2007年9月,AppArmor 由 Novell 维护。从那时起,SUSE 就是商标名 AppArmor 的合法所有者。[16]

AppArmor 在2007年4月第一次成功移植并打包于 Ubuntu。它成为Ubuntu 7.10版本的默认软件包,并最终作为Ubuntu 8.04发行版的一部分,默认设置只保护 CUPS。从 Ubuntu 9.04 开始,更多的项目(如MySQL)已经安装了配置文件。在 Ubuntu 9.10 中,AppArmor 的功能不断得到改进,因为它提供了客户会话、libvirt 虚拟机、Evince文档查看器的配置文件。它还提供了一个可选的 Firefox 的配置文件。[17]

AppArmor 第一次被整合到 Linux 内核中是在2010年10月的2.6.36版本。[18][19][20][21]

2014年,AppArmor 已经整合到了 Synology 的 DSM 5.1 Beta中。[22]

参见[编辑]

参考文献[编辑]

  1. ^ Release_Notes_3.1.7 · Wiki · AppArmor / apparmor · GitLab. 2024年2月2日 [2024年3月18日] (英语). 
  2. ^ 2.0 2.1 Apparmor(7) man page.
  3. ^ Pete Graner. The Ubuntu Kernel (PDF). 2009年 [2018年2月]. (原始内容存档 (PDF)于2018-12-22). 
  4. ^ Canonical Mainlines A Bunch Of Their AppArmor Changes For Linux 4.13 - Phoronix. www.phoronix.com. [2018-02-02]. (原始内容存档于2018-02-03) (英语). 
  5. ^ Andreas Gruenbacher & Seth Arnold. AppArmor Technical Documentation (PDF). SUSE Labs / Novell. 2004年11月 [2018年2月]. (原始内容存档 (PDF)于2019-02-15). 
  6. ^ TOMOYO Linux [LWN.net]. lwn.net. [2018-02-02]. (原始内容存档于2018-02-03). 
  7. ^ Mayank Sharma. Linux.com :: SELinux: Comprehensive security at the price of usability. 2006-12-11 [2018-02-02]. (原始内容存档于2009-02-02). 
  8. ^ Ralf Spenneberg. Protective armor: Shutting out intruders with AppArmor. Linux Magazine. August 2006 [2008-08-02]. (原始内容存档于2008-08-21). 
  9. ^ Comparison Between AppArmor and Selinux. security.stackexchange.com. [2018-02-02]. (原始内容存档于2018-02-03). 
  10. ^ James Morris. Filesystem Labeling in SELinux (PDF). ]. 2004年11月 [2018年2月]. (原始内容存档 (PDF)于2018-02-03). 
  11. ^ 11.0 11.1 SELinux and AppArmor: An Introductory Comparison. Scribd. [2018-02-02]. (原始内容存档于2019-02-15) (英语). 
  12. ^ AppArmor与SELinux - 运维之路. www.361way.com. [2018-02-02]. (原始内容存档于2018-02-03). 
  13. ^ Vincent Danen. Immunix System 7: Linux security with a hard hat (not a Red Hat). 2001-12-17 [2018-02-02]. (原始内容存档于2012-05-23). 
  14. ^ WireX Communications, Inc. Immunix.org: The Source for Secure Linux Components and Platforms. 2000-11-15 [2018-02-02]. (原始内容存档于2001-02-03). 
  15. ^ AppArmor History. AppArmor. [2018-02-02]. (原始内容存档于2017-07-02). 
  16. ^ AppArmor Trademark. United States Patent and Trademark Office. [2018年2月]. (原始内容存档于2018-02-03). 
  17. ^ SecurityTeam/KnowledgeBase/AppArmorProfiles - Ubuntu Wiki. [9 January 2011]. (原始内容存档于2018-02-03). 
  18. ^ James Corbet. The 2.6.36 kernel is out. 2010-10-20 [2018-02-02]. (原始内容存档于2018-02-03). 
  19. ^ Linus Torvalds. Change Log. 2010-10-20 [2018-02-02]. (原始内容存档于2011-09-04). 
  20. ^ Linux 2 6 36. 2010-10-20 [2018-02-02]. (原始内容存档于2018-06-10). 
  21. ^ Sean Michael Kerner. Linux Kernel 2.6.36 Gets AppArmor. 2010-10-20 [2018-02-02]. (原始内容存档于2018-02-03). 
  22. ^ sebastien@nextinpact.com. NAS Synology : le DSM 5.1 est là, avec des mises à jour automatiques. 2014-07-11 [2018-02-02]. (原始内容存档于2018-02-03) (法语). 

外部链接[编辑]