{"id":3421,"date":"2017-07-15T19:30:44","date_gmt":"2017-07-15T11:30:44","guid":{"rendered":"https:\/\/ixyzero.com\/blog\/?p=3421"},"modified":"2017-07-15T19:30:44","modified_gmt":"2017-07-15T11:30:44","slug":"centos%e4%b8%8baudit%e7%9a%84%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/ixyzero.com\/blog\/archives\/3421.html","title":{"rendered":"CentOS\u4e0baudit\u7684\u4ecb\u7ecd"},"content":{"rendered":"<p>=Start=<\/p>\n<h4 id=\"CentOS6\u4e0baudit\u7684\u4f7f\u7528-\u7f18\u7531\uff1a\">\u7f18\u7531\uff1a<\/h4>\n<p><strong>Linux \u5ba1\u8ba1\u7cfb\u7edf\uff08audit\uff09\u4e3a<span style=\"color: #ff0000;\">\u8ffd\u8e2a\u7cfb\u7edf\u4e2d\u4e0e\u5b89\u5168\u76f8\u5173\u7684\u4fe1\u606f<\/span>\u63d0\u4f9b\u4e86\u9014\u5f84\u3002<\/strong>\u57fa\u4e8e\u9884\u914d\u7f6e\u539f\u5219\uff0caudit\u5c06\u751f\u6210\u65e5\u5fd7\u9879\u4ece\u800c\u8bb0\u5f55\u5c3d\u53ef\u80fd\u591a\u7684\u5728\u7cfb\u7edf\u4e2d\u53d1\u751f\u7684\u4e8b\u4ef6\u3002\u8fd9\u4e00\u4fe1\u606f\u5bf9\u6267\u884c\u5173\u952e\u4efb\u52a1\u7684\u73af\u5883\u5c24\u5176\u91cd\u8981\uff0c\u5b83\u53ef\u4ee5\u786e\u5b9a\u90a3\u4e9b\u8fdd\u53cd\u5b89\u5168\u7b56\u7565\u7684\u4eba\u4ee5\u53ca\u4ed6\u4eec\u7684\u884c\u4e3a\u3002audit\u4e0d\u4f1a\u4e3a\u7cfb\u7edf\u63d0\u4f9b\u989d\u5916\u7684\u5b89\u5168\u4fdd\u62a4\uff1b\u76f8\u53cd\uff0c\u5b83\u53ea\u662f\u7528\u6765\u53d1\u73b0\u7cfb\u7edf\u4e2d\u8fdd\u53cd\u5b89\u5168\u7b56\u7565\u7684\u884c\u4e3a\u3002\u901a\u8fc7\u989d\u5916\u7684\u63aa\u65bd\u4f8b\u5982 SELinux \u53ef\u4ee5\u8fdb\u4e00\u6b65\u5730\u9632\u6b62\u8fd9\u4e9b\u8fdd\u53cd\u884c\u4e3a\u3002<\/p>\n<h4 id=\"CentOS6\u4e0baudit\u7684\u4f7f\u7528-\u6b63\u6587\uff1a\">\u6b63\u6587\uff1a<\/h4>\n<h5 id=\"CentOS6\u4e0baudit\u7684\u4f7f\u7528-\u53c2\u8003\u89e3\u7b54\uff1a\">\u53c2\u8003\u89e3\u7b54\uff1a<\/h5>\n<p>audit\u5ba1\u8ba1\u7cfb\u7edf\u4e3b\u8981\u7531\u4ee5\u4e0b\u51e0\u90e8\u5206\u7ec4\u6210\uff1a<\/p>\n<ul>\n<li>audit\u5185\u6838\u6a21\u5757\uff08kauditd\uff09\uff1b<\/li>\n<li>audit\u7528\u6237\u6001\u5b88\u62a4\u8fdb\u7a0b\uff08auditd\uff09\uff1b<\/li>\n<li>audit\u7528\u6237\u6001\u5b9e\u7528\u5de5\u5177\uff08auditctl\/audispd\/aureport\/ausearch\/&#8230;\uff09\uff1b<\/li>\n<\/ul>\n<pre class=\"lang:default decode:true\"># ps aux | grep --color \"audit\"\r\nroot       613  0.0  0.0      0     0 ?        S     2016   0:17 [kauditd] #\u7528\u4e2d\u62ec\u53f7\u62ec\u8d77\u6765\u7684\u8fdb\u7a0b\u90fd\u662f\u5185\u6838\u8fdb\u7a0b\/\u7ebf\u7a0b\r\nroot      2471  0.0  0.0  93156   896 ?        S&lt;sl  2016   1:03 auditd\r\n#\u4e0a\u4e00\u884c\u4e2d\u7684\u300cS&lt;sl\u300d\u7684\u542b\u4e49\u89e3\u8bfb\uff1aS\u8868\u793a\u8fdb\u7a0b\u6b63\u5728\u7761\u7720\uff0c&lt;\u8868\u793a\u5177\u6709\u8f83\u9ad8\u7684\u4f18\u5148\u7ea7\uff0cs\u8868\u793a\u591a\u8fdb\u7a0bl\u8868\u793a\u591a\u7ebf\u7a0b\r\n#\r\n# which auditctl\r\n\/sbin\/auditctl\r\n#\r\n# ls -lt \/sbin\/au*\r\n-rwxr-x--- \/sbin\/audispd  #\u8f6c\u53d1\u4e8b\u4ef6\u901a\u77e5\u7ed9\u5176\u4ed6\u5e94\u7528\u7a0b\u5e8f\uff0c\u800c\u4e0d\u662f\u5199\u5165\u5230\u5ba1\u8ba1\u65e5\u5fd7\u6587\u4ef6\u4e2d\u3002\r\n-rwxr-x--- \/sbin\/auditctl #\u5373\u65f6\u63a7\u5236\u5ba1\u8ba1\u5b88\u62a4\u8fdb\u7a0b\u7684\u884c\u4e3a\u7684\u5de5\u5177\uff0c\u6bd4\u5982\u5982\u6dfb\u52a0\u89c4\u5219\u7b49\u7b49\u3002\r\n-rwxr-x--- \/sbin\/auditd\r\n-rwxr-xr-x \/sbin\/aureport #\u67e5\u770b\u548c\u751f\u6210\u5ba1\u8ba1\u62a5\u544a\u7684\u5de5\u5177\r\n-rwxr-xr-x \/sbin\/ausearch #\u67e5\u627e\u5ba1\u8ba1\u4e8b\u4ef6\u7684\u5de5\u5177\u3002\r\n-rwxr-x--- \/sbin\/autrace  #\u7528\u4e8e\u8ddf\u8e2a\u8fdb\u7a0b\u7684\u5de5\u5177\r\n-rwxr-x--- \/sbin\/augenrules #\u7528\u4e8e\u751f\u6210\u548c\u66f4\u65b0\u5ba1\u8ba1\u89c4\u5219\u7684\u5de5\u5177(\u4e00\u4e2abash\u811a\u672c)<\/pre>\n<p>Linux\u7684audit\u5ba1\u8ba1\u7cfb\u7edf\u63d0\u4f9b\u4e86\u4e00\u79cd\u8bb0\u5f55\u7cfb\u7edf\u5b89\u5168\u4fe1\u606f\u7684\u65b9\u6cd5\uff0c\u4e3a\u7cfb\u7edf\u7ba1\u7406\u5458\u5728\u7528\u6237\u8fdd\u53cd\u7cfb\u7edf\u5b89\u5168\u89c4\u5219\u65f6\u63d0\u4f9b\u53ca\u65f6\u7684\u8b66\u544a\u4fe1\u606f\u3002\u5185\u6838\u5176\u4ed6\u7ebf\u7a0b\u901a\u8fc7\u5185\u6838\u5ba1\u8ba1API\u5199\u5165\u5957\u63a5\u5b57\u7f13\u51b2\u533a\u961f\u5217audit_skb_queue\u4e2d\uff0c<span style=\"color: #ff0000;\">\u5185\u6838\u7ebf\u7a0bkauditd\u901a\u8fc7netlink\u673a\u5236(NETLINK_AUDIT)\u5c06\u5ba1\u8ba1\u6d88\u606f\u5b9a\u5411\u53d1\u9001\u7ed9\u7528\u6237\u6001\u7684\u5ba1\u8ba1\u540e\u53f0auditd\u7684\u4e3b\u7ebf\u7a0b<\/span>\uff0c<strong>auditd\u4e3b\u7ebf\u7a0b\u518d\u901a\u8fc7\u4e8b\u4ef6\u961f\u5217\u5c06\u5ba1\u8ba1\u6d88\u606f\u4f20\u7ed9\u5ba1\u8ba1\u540e\u53f0\u7684\u5199log\u6587\u4ef6\u7ebf\u7a0b\uff0c\u5199\u5165log\u6587\u4ef6<\/strong>\u3002\u53e6\u4e00\u65b9\u9762\uff0c<strong>\u5ba1\u8ba1\u540e\u53f0\u8fd8\u901a\u8fc7\u4e00\u4e2a\u4e0e\u5957\u63a5\u5b57\u7ed1\u5b9a\u7684\u7ba1\u9053\u5c06\u5ba1\u8ba1\u6d88\u606f\u53d1\u9001\u7ed9audispd\u5e94\u7528\u7a0b\u5e8f\uff0c\u53ef\u628a\u4e8b\u4ef6\u4f20\u9001\u7ed9\u5176\u4ed6\u5e94\u7528\u7a0b\u5e8f\u505a\u8fdb\u4e00\u6b65\u5904\u7406<\/strong>\u3002<\/p>\n<p>\u4e0b\u9762\u7528\u4e00\u5f20\u56fe\u8bf4\u660e\u4e00\u4e0baudit\u5ba1\u8ba1\u7cfb\u7edf\u7684\u5927\u4f53\u67b6\u6784\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3422\" src=\"https:\/\/ixyzero.com\/blog\/wp-content\/uploads\/2017\/07\/CentOS_audit_arch.png\" alt=\"\" width=\"800\" height=\"566\" srcset=\"https:\/\/ixyzero.com\/wp-content\/uploads\/2017\/07\/CentOS_audit_arch.png 800w, https:\/\/ixyzero.com\/wp-content\/uploads\/2017\/07\/CentOS_audit_arch-300x212.png 300w, https:\/\/ixyzero.com\/wp-content\/uploads\/2017\/07\/CentOS_audit_arch-768x543.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/p>\n<p>RedHat\u5b98\u65b9\u7ed9\u51fa\u7684\u90a3\u4e2a\u67b6\u6784\u56fe\u89c9\u5f97\u6ca1\u6709\u4e0a\u9762\u8fd9\u5f20\u56fe\u6e05\u6670\u6613\u61c2\uff0c\u5c31\u4e0d\u653e\u4e86\uff0c\u611f\u5174\u8da3\u7684\u53ef\u4ee5\u81ea\u5df1\u53bb\u770b\u770b\u3002<\/p>\n<h5 id=\"CentOS6\u4e0baudit\u7684\u4f7f\u7528-\u53c2\u8003\u94fe\u63a5\uff1a\">\u53c2\u8003\u94fe\u63a5\uff1a<\/h5>\n<p><strong>\u7b2c 5 \u7ae0 \u7cfb\u7edf\u5ba1\u6838<\/strong><br \/>\n<a href=\"https:\/\/access.redhat.com\/documentation\/zh-CN\/Red_Hat_Enterprise_Linux\/7\/html\/Security_Guide\/chap-system_auditing.html\">https:\/\/access.redhat.com\/documentation\/zh-CN\/Red_Hat_Enterprise_Linux\/7\/html\/Security_Guide\/chap-system_auditing.html<\/a><\/p>\n<p><strong>linux\u670d\u52a1\u4e4baudit<\/strong><br \/>\n<a href=\"http:\/\/www.cnblogs.com\/createyuan\/p\/3861149.html\">http:\/\/www.cnblogs.com\/createyuan\/p\/3861149.html<\/a><\/p>\n<p><span style=\"color: #ff0000;\"><strong>linux Audit \u4ecb\u7ecd\u3010\u67b6\u6784\u7bc7\u3011<\/strong><\/span><br \/>\n<a href=\"http:\/\/blog.chinaunix.net\/uid-20786165-id-3166587.html\">http:\/\/blog.chinaunix.net\/uid-20786165-id-3166587.html<\/a><\/p>\n<p>audispd &#8211; Unix\uff0cLinux\u547d\u4ee4<br \/>\n<a href=\"http:\/\/tutorialspoint.howtolib.com\/unix_commands\/audispd.htm\">http:\/\/tutorialspoint.howtolib.com\/unix_commands\/audispd.htm<\/a><br \/>\n<a href=\"http:\/\/www.man7.org\/linux\/man-pages\/man8\/audispd.8.html\">http:\/\/www.man7.org\/linux\/man-pages\/man8\/audispd.8.html<\/a><\/p>\n<p>=END=<\/p>\n","protected":false},"excerpt":{"rendered":"<p>=Start= \u7f18\u7531\uff1a Linux \u5ba1\u8ba1\u7cfb\u7edf\uff08audit\uff09\u4e3a\u8ffd\u8e2a\u7cfb\u7edf\u4e2d\u4e0e\u5b89\u5168\u76f8\u5173\u7684\u4fe1\u606f\u63d0\u4f9b\u4e86\u9014\u5f84\u3002\u57fa\u4e8e\u9884\u914d\u7f6e\u539f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,11,25,12],"tags":[216,855,854,30],"class_list":["post-3421","post","type-post","status-publish","format-standard","hentry","category-knowledgebase-2","category-linux","category-security","category-tools","tag-audit","tag-auditctl","tag-auditd","tag-linux"],"views":8920,"_links":{"self":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/3421","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/comments?post=3421"}],"version-history":[{"count":1,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/3421\/revisions"}],"predecessor-version":[{"id":3423,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/3421\/revisions\/3423"}],"wp:attachment":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/media?parent=3421"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/categories?post=3421"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/tags?post=3421"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}