AppArmor

維基百科,自由的百科全書
跳至導覽 跳至搜尋
AppArmor
File:AppArmor logo.svg
原作者Immunix英語Immunix
開發者Canonical Ltd, SUSENovell
首次釋出1998年,​28年前​(1998
目前版本
    Module:EditAtWikidata第29行Lua錯誤:attempt to index field 'wikibase' (a nil value)
    原始碼庫
    • {{URL|example.com|可选的显示文本}}
    Module:EditAtWikidata第29行Lua錯誤:attempt to index field 'wikibase' (a nil value)
    程式語言C, Perl, C++, sh
    引擎
      Module:EditAtWikidata第29行Lua錯誤:attempt to index field 'wikibase' (a nil value)
      作業系統Linux
      類型安全
      特許條款GNU通用公眾特許條款

      AppArmor (「Application Armor」,意為「應用盔甲」) 是一個Linux內核安全模組,允許系統管理員通過每個程式的設定檔限制程式的功能。如它的幫助頁面所說,「AppArmor 是一個對內核的增強工具,將程式限制在一個有限的資源集合中。AppArmor 獨特的安全模型將對訪問屬性的控制繫結到程式而非用戶。」[1]

      AppArmor 通過提供強制訪問控制(MAC)來補充傳統的Unix自主訪問控制(DAC)模型。 從Linux內核的2.6.36版本開始,它已經被包含在主流分支中,並且自2009年它的開發得到了 Canonical 公司的支援。[2][3]

      功能特性[1][編輯]

      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)內核介面實現的。[4] 在2009年,Linux 2.6.30 中包含了一個名為 Tomoyo英語Tomoyo 的新解決方案[5];像 AppArmor 一樣,它也使用基於路徑的訪問控制。

      同 SELinux 的異同[編輯]

      AppArmor 是作為 SELinux 的替代品出現的,因為對 SELinux 的批評者認為它難以讓管理員設置和維護。[6]與基於將標籤應用於檔案的 SELinux 不同,AppArmor 使用檔案路徑來確認檔案。 AppArmor 的支持者聲稱,它對普通用戶而言要比 SELinux 更簡單、更易學習。[7][8] 他們還認為 AppArmor 對現有系統的要求更低:例如 SELinux 需要支援「安全標籤」的檔案系統[9],因此無法為通過 NFS 掛載的檔案提供訪問控制。 AppArmor 則對檔案系統沒有要求。

      但不論如何,這兩個軟件產品對讓管理員加強系統的安全性都非常有幫助。他們都專注於訪問控制,強化了標準的Linux訪問控制策略。他們都生成紀錄檔,並提供審計活動的工具。他們都在應用程式層內工作。從技術上講,他們同樣地使用LSM與Linux內核進行互動。它們允許管理員使用GUI與非GUI工具。最後,它們都允許管理員在沒有真正阻止訪問的情況下嘗試策略(而只是警告),以便僅在足夠數量的測試之後才應用安全加固策略。[10]

      SELinux 和 AppArmor 的不同主要體現在管理方式和整合方式上。例如一個重要的區別: SELinux 通過 inode 編號而不是路徑標識檔案系統對象。[11]這意味着如果給一個無法訪問的檔案建立了硬連結,在 AppArmor 中它將可以訪問,但 SELinux 通過新建立的硬連結仍然會拒絕訪問——由 inode 參照的基礎數據是一樣的。另外,在文件數量上 AppArmor 要比 SELinux 略遜一籌,這意味着網上尋找解決方案的難易程度同樣有所差異。[10]

      歷史[編輯]

      AppArmor 在1998~2003年首先在 Immunix英語Immunix Linux中被使用。當時,AppArmor被稱為SubDomain,[12][13]這個名字意在將特定程式的安全設定檔分割成不同的域,而程式可以動態地在不同的域中進行切換。 AppArmor 首先在 SLES 和 openSUSE 中可用,並且在 SLES英語SUSE_Linux_Enterprise 10 和 openSUSE 10.1 中預設首先啟用。

      2005年5月,Novell 收購了 Immunix 並將 SubDomain 重新命名為 AppArmor,並開始對其 Linux 內核進行代碼清理和重寫。[14]從2005年到2007年9月,AppArmor 由 Novell 維護。從那時起,SUSE 就是商標名 AppArmor 的合法所有者。[15]

      AppArmor 在2007年4月第一次成功移植並打包於 Ubuntu。它成為Ubuntu 7.10版本的預設軟件套件,並最終作為Ubuntu 8.04發行版的一部分,預設設置只保護 CUPS。從 Ubuntu 9.04 開始,更多的專案(如MySQL)已經安裝了設定檔。在 Ubuntu 9.10 中,AppArmor 的功能不斷得到改進,因為它提供了客戶對談、libvirt 虛擬機器、Evince文件檢視器的設定檔。它還提供了一個可選的 Firefox 的設定檔。[16]

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

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

      參見[編輯]

      參考文獻[編輯]

      1. ^ 1.0 1.1 Apparmor(7) man page.
      2. ^ Pete Graner. The Ubuntu Kernel (PDF). 2009年 [2018年2月]. (原始內容存檔 (PDF)於2018-12-22). 
      3. ^ Canonical Mainlines A Bunch Of Their AppArmor Changes For Linux 4.13 - Phoronix. www.phoronix.com. [2018-02-02]. (原始內容存檔於2018-02-03) (English). 
      4. ^ Andreas Gruenbacher & Seth Arnold. AppArmor Technical Documentation (PDF). SUSE Labs / Novell. 2004年11月 [2018年2月]. (原始內容存檔 (PDF)於2019-02-15). 
      5. ^ TOMOYO Linux [LWN.net]. lwn.net. [2018-02-02]. (原始內容存檔於2018-02-03). 
      6. ^ Mayank Sharma. Linux.com :: SELinux: Comprehensive security at the price of usability. 2006-12-11 [2018-02-02]. (原始內容存檔於2009-02-02). 
      7. ^ Ralf Spenneberg. Protective armor: Shutting out intruders with AppArmor. Linux Magazine. August 2006 [2008-08-02]. (原始內容存檔於2008-08-21). 
      8. ^ Comparison Between AppArmor and Selinux. security.stackexchange.com. [2018-02-02]. (原始內容存檔於2018-02-03). 
      9. ^ James Morris. Filesystem Labeling in SELinux (PDF). ]. 2004年11月 [2018年2月]. (原始內容存檔 (PDF)於2018-02-03). 
      10. ^ 10.0 10.1 SELinux and AppArmor: An Introductory Comparison. Scribd. [2018-02-02]. (原始內容存檔於2019-02-15) (English). 
      11. ^ AppArmor与SELinux - 运维之路. www.361way.com. [2018-02-02]. (原始內容存檔於2018-02-03). 
      12. ^ Vincent Danen. Immunix System 7: Linux security with a hard hat (not a Red Hat). 2001-12-17 [2018-02-02]. (原始內容存檔於2012-05-23). 
      13. ^ WireX Communications, Inc. Immunix.org: The Source for Secure Linux Components and Platforms. 2000-11-15 [2018-02-02]. (原始內容存檔於2001-02-03). 
      14. ^ AppArmor History. AppArmor. [2018-02-02]. (原始內容存檔於2017-07-02). 
      15. ^ AppArmor Trademark. United States Patent and Trademark Office. [2018年2月]. (原始內容存檔於2018-02-03). 
      16. ^ SecurityTeam/KnowledgeBase/AppArmorProfiles - Ubuntu Wiki. [9 January 2011]. (原始內容存檔於2018-02-03). 
      17. ^ James Corbet. The 2.6.36 kernel is out. 2010-10-20 [2018-02-02]. (原始內容存檔於2018-02-03). 
      18. ^ Linus Torvalds. Change Log. 2010-10-20 [2018-02-02]. (原始內容存檔於2011-09-04). 
      19. ^ Linux 2 6 36. 2010-10-20 [2018-02-02]. (原始內容存檔於2018-06-10). 
      20. ^ Sean Michael Kerner. Linux Kernel 2.6.36 Gets AppArmor. 2010-10-20 [2018-02-02]. (原始內容存檔於2018-02-03). 
      21. ^ 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) (français). 

      外部連結[編輯]