个人工具
登录
查看“UbuntuHelp:FileIntegrityAIDE”的源代码 - Ubuntu中文
UbuntuHelp
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“UbuntuHelp:FileIntegrityAIDE”的源代码
来自Ubuntu中文
←
UbuntuHelp:FileIntegrityAIDE
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{From|https://help.ubuntu.com/community/FileIntegrityAIDE}} {{Languages|php5}} === Introduction === One of the many possible layers of security which may be applied to your Ubuntu computer is known as ''file integrity monitoring'', or ''file integrity verification''. The purpose of monitoring and/or verifying the integrity of key files including system binaries, and configuration files is to ensure the files have not been altered by unauthorized means. The unauthorized alteration of certain system files is one of the symptoms of an active attack, or compromise upon a system. Using file integrity monitoring is a pro-active means of being aware of any changes to critical system files. As with most tools, and utilities in the GNU/Linux community, there exist many different applications for use in monitoring, and verifying the integrity of files on your Ubuntu system. This guide will mention some of these tools, and go on to discuss installation, configuration, and usage of the tools on an Ubuntu system. === Available Tools === While there are literally a dozen, or more solutions for monitoring, and verifying the integrity of critical files on a GNU/Linux computer system, this guide will focus only on the '''Advanced Intrusion Detection Environment''' ('''AIDE''') utility. Other possible tools, and utilities for monitoring, and/or verifying file integrity will be listed in the '''Resources''' section of this guide, however. The exploration, and use of these tools is left as an exercise for the reader of this guide. === AIDE === The Advanced Intrusion Detection Environment (AIDE) is a ''free'' replacement for the popular file integrity verification tool '''Tripwire'''. It creates a database from regular expression rules that it finds in a configuration file, and once this database is initialized, it can be used to verify the integrity of critical system, and user files. AIDE uses most of the popular message digest algorithms (md5,sha1,rmd160,tiger,haval,etc.) for checking file integrity. Additional algorithms may also be added easily. All of the traditional file system attributes may also be checked for inconsistencies as well. ==== Installing AIDE ==== To install AIDE from a terminal prompt, ensure that your Internet connection is working, and enter the following command: <code><nowiki>sudo apt-get install aide</nowiki></code> Enter your password, and upon successful authentication, the AIDE package should be fetched, and installed. During installation, an '''Ubuntu Configuration''' window will appear notifying you that daily reports are mailed to the ''root'' user by default, and that this behavior may be changed by editing the <code><nowiki>/etc/default/aide</nowiki></code> configuration file. Press '''ENTER''' to acknowledge this message. You will then be asked if the AIDE database should be initialized. Select '''Yes''' here, and press '''ENTER'''. The next confirmation dialog asks you to examine <code><nowiki>/var/lib/aide/aide.db.new</nowiki></code> before replacing any existing database. If this is your first time installing AIDE on the system in question, select '''Yes''' here, and press '''ENTER'''. ==== Configuring AIDE ==== There are two primary configuration files for AIDE: ||<code><nowiki>/etc/default/aide</nowiki></code>||The AIDE general configuration file|| ||<code><nowiki>/etc/aide/aide.conf</nowiki></code>||The AIDE rules configuration file|| Some general settings, and behaviors for AIDE may be modified by editing the <code><nowiki>{/etc/default/aide</nowiki></code> configuration file. For example, if you would like to have all of AIDE's daily reports e-mailed to the user <code><nowiki>breandon</nowiki></code> instead of the default root user, simply use <code><nowiki>sudo</nowiki></code> with your favorite editor, and modify the line: ||<code><nowiki>MAILTO=root</nowiki></code>|| so that it reflects your choice of user (<code><nowiki>breandon</nowiki></code> in our example) as such: ||<code><nowiki>MAILTO=breandon</nowiki></code>|| Read the comments in <code><nowiki>/etc/default/aide</nowiki></code> to see what the other configuration directives control, and change them accordingly to suit your installation's requirements. The other configuration file, <code><nowiki>/etc/aide/aide.conf</nowiki></code> controls the rules for the directories, files, and attributes of files which AIDE uses to determine changes when scanning. For example, in the default <code><nowiki>/etc/aide/aide.conf</nowiki></code> file, all member directories and files of the Group definition <code><nowiki>BinLib</nowiki></code> are checked for permissions, inode, number of links, user, group, size, block count, mtime, ctime, md5 checksum, and sha1 checksum (p+i+n+u+g+s+b+m+c+md5+sha1) whereas all member directories, and files in the Group definition Databases are checked only for permissions, number of links, user, and group (p+n+u+g). The member directories of a particular Group definition are added by specifying one entry per line, in the form of : ||<code><nowiki>directory</nowiki></code> <code><nowiki>Group definition</nowiki></code>|| For example, to make the directory <code><nowiki>/opt/local/bin</nowiki></code> part of the <code><nowiki>BinLib</nowiki></code> Group definition, a line would be added in the appropriate section of the <code><nowiki>/etc/aide/aide.conf</nowiki></code> configuration file resembling the following: ||<code><nowiki>/opt/local/bin BinLib</nowiki></code>|| Another example of a clever use for AIDE is to monitor the system's crontabs. System crontabs control the scheduled system activities which are executed on a schedule by the cron daemon. To ensure these files are not altered in such a way as to introduce the automatic, scheduled execution of a malicious application, simply use the <code><nowiki>sudo</nowiki></code> command to edit the <code><nowiki>/etc/aide/aide.conf</nowiki></code> file with your favorite editor and locate the following section of the file : ||<code><nowiki># Check crontabs</nowiki></code>|| Uncomment all of the lines beginning with <code><nowiki>#/var/spool</nowiki></code> under the <code><nowiki># Check crontabs</nowiki></code> heading, and save the file. You should examine the file <code><nowiki>/etc/aide/aide.conf</nowiki></code> closely, observing the commented sections in particular, for other possible uses of AIDE, and read the <code><nowiki>aide.conf</nowiki></code> manual page, in addition to reading the HTML version of the AIDE manual for further uses of AIDE which may be specified in this configuration file. When you've made configuration changes, and you would like them used immediately, issue the following command at the terminal prompt to update the AIDE configuration: <code><nowiki>sudo update-aide.conf</nowiki></code> Otherwise, AIDE's daily crontab will do the same thing, so if you have made changes, but do not need to run aide manually, and immediately you can be assured the configuration will be updated by the daily crontab automatically before the daily run of AIDE by the daily crontab. ==== Using AIDE ==== To begin using AIDE, you must make sure the database is present: <code><nowiki>ls /var/lib/aide</nowiki></code> If you see the file <code><nowiki>aide.db</nowiki></code> in the output of the <code><nowiki>ls</nowiki></code> command, then proceed to the initialization step. If instead, you see the file <code><nowiki>aide.db.new</nowiki></code> then you need to rename the <code><nowiki>aide.db.new</nowiki></code> file to <code><nowiki>aide.db</nowiki></code> using this command: <code><nowiki>sudo mv /var/lib/aide/aide.db.new /var/lib/aide/aide.db</nowiki></code> Once the AIDE database is in place, you can initialize the database with the following command from a terminal prompt: <code><nowiki>sudo aide --init</nowiki></code> At the end of this process, you should see the line: ||<pre><nowiki> You may run an initial check of the directories and files as defined in <code><nowiki>/etc/aide/aide.conf</nowiki></code> by entering the following command at a terminal prompt: <code><nowiki>sudo aide --check</nowiki></code> If all is well in the directories, and files being monitored, you will see this message when the check completes: ||<pre><nowiki> AIDE will also run each day from the <code><nowiki>/etc/cron.daily/aide</nowiki></code> crontab, and the output of this run will be mailed to the user specified in the <code><nowiki>MAILTO=</nowiki></code> directive of the <code><nowiki>/etc/default/aide</nowiki></code> configuration file as detailed above. === Resources === Additional information on AIDE, and file integrity monitoring, and verification is available via the following resources: ==== Local System Resources ==== ||<style="background:#F1F1ED;"><code><nowiki>man aide</nowiki></code>|| System manual page for the <code><nowiki>aide</nowiki></code> command|| ||<style="background:#F1F1ED;"><code><nowiki>man aide.conf</nowiki></code>|| System manual page for the <code><nowiki>aide.conf</nowiki></code> configuration file|| ||<style="background:#F1F1ED;"><code><nowiki>man aideinit</nowiki></code>|| System manual page for the <code><nowiki>aideinit</nowiki></code> command|| ||<style="background:#F1F1ED;"><code><nowiki>man update-aide.conf</nowiki></code>|| System manual page for the <code><nowiki>update-aide.conf</nowiki></code> command|| ||<style="background:#F1F1ED;"><code><nowiki>/usr/share/doc/aide/manual.html</nowiki></code>|| The AIDE manual in HTML format|| ||<style="background:#F1F1ED;"><code><nowiki>/etc/default/aide</nowiki></code>|| The AIDE general configuration file|| ||<style="background:#F1F1ED;"><code><nowiki>/etc/aide/aide.conf</nowiki></code>|| The AIDE rules configuration file|| ||<style="background:#F1F1ED;"><code><nowiki>/etc/cron.daily/aide</nowiki></code>|| Daily AIDE cron scripts|| ==== Other File Integrity Monitoring and Verification Tools ==== * '''BSign''' : Corruption and Intrusion Detection using embedded hashes * '''Integrit''' : Small footprint, unattended monitoring of file integrity with cascading rulesets [http://integrit.sourceforge.net/ Integrit Website] * '''Samhain''' : Standalone, or Client-Server file integrity monitoring solution [http://la-samhna.de/samhain/ Samhain Website] * '''Systraq''' : Monitors, and alerts on file changes [http://mdcc.cx/systraq/ Systraq Website] ==== WWW Resources ==== * [http://sourceforge.net/projects/aide AIDE Website] * [http://www.linuxsecurity.com/content/view/101882/49/ Guide on CHKROOTKIT and AIDE] ---- CategorySecurity CategoryCleanup [[category:UbuntuHelp]]
该页面使用的模板:
模板:From
(
查看源代码
)
模板:Languages
(
查看源代码
)(受保护)
模板:Languages/Lang
(
查看源代码
)(受保护)
返回至
UbuntuHelp:FileIntegrityAIDE
。