{"id":19538,"date":"2017-04-30T06:43:11","date_gmt":"2017-04-29T22:43:11","guid":{"rendered":"https:\/\/2blog.ilc.edu.tw\/25793\/2017\/04\/30\/%e5%9c%a8-centos-7-x-%e4%b8%8b%e5%ae%89%e8%a3%9d-lynix\/"},"modified":"2021-03-18T17:25:01","modified_gmt":"2021-03-18T09:25:01","slug":"%e5%9c%a8-centos-7-x-%e4%b8%8b%e5%ae%89%e8%a3%9d-lynix","status":"publish","type":"post","link":"https:\/\/2blog.ilc.edu.tw\/25793\/2017\/04\/30\/%e5%9c%a8-centos-7-x-%e4%b8%8b%e5%ae%89%e8%a3%9d-lynix\/","title":{"rendered":"\u5728 CentOS 7.x \u4e0b\u5b89\u88dd lynix"},"content":{"rendered":"<p>Lynis \u662f\u4e00\u5957\u53ef\u7528\u65bc\u5404\u7a2e UNIX Based System \u7684\u7cfb\u7d71\u5b89\u5168\u6aa2\u6e2c\u5de5\u5177\uff0c\u5b83\u80fd\u627e\u51fa\u7cfb\u7d71\u5b89\u5168\u9700\u8981\u88dc\u5f37\u7684\u5730\u65b9, \u540c\u6642\u63d0\u4f9b\u8a31\u591a\u63d0\u5347\u7cfb\u7d71\u5b89\u5168\u7684\u4f5c\u6cd5\u8207\u5efa\u8b70\u3002<br \/>lynix \u5b98\u65b9\u7db2\u7ad9\uff1a<a href=\"https:\/\/cisofy.com\/lynis\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/cisofy.com\/lynis\/<\/a><br \/>\u53c3\u8003\u7db2\u9801\uff1a<br \/><a href=\"https:\/\/blog.gtwang.org\/linux\/linux-security-auditing-and-scanning-with-lynis-tool\/\" target=\"_blank\" rel=\"noopener noreferrer\">Lynis\uff1aLinux \u5b89\u5168\u6027\u6383\u63cf\u6aa2\u6e2c\u5de5\u5177\uff0c\u627e\u51fa\u7cfb\u7d71\u6f0f\u6d1e\u3001\u5f31\u9ede\u8207\u60e1\u610f\u7a0b\u5f0f &#8211; G. T. Wang<\/a><br \/><a href=\"https:\/\/net.nthu.edu.tw\/2009\/security:lynis\" target=\"_blank\" rel=\"noopener noreferrer\">\u7db2\u8def\u7cfb\u7d71\u7d44 \/ Network Systems [security:lynis]<\/a><\/p>\n<p>1. \u5b89\u88dd<br \/>#<span style=\"color: #ff0000\"> yum install lynis &#8211;enablerepo=epel<\/span><\/p>\n<p>2. \u53ef\u7528\u53c3\u6578<br \/># <span style=\"color: #ff0000\">\/bin\/lynis &#8211;help<\/span>[@more@]3. \u9032\u884c\u6aa2\u67e5<br \/><span style=\"color: #0000ff\">&#8211;check-all \u6aa2\u67e5\u6574\u500b\u7cfb\u7d71<\/span><br \/><span style=\"color: #0000ff\">&#8211;quick \u5feb\u901f\u6a21\u5f0f\uff0c\u4e0d\u7b49\u5f85\u4f7f\u7528\u8005\u4e92\u52d5\u78ba\u8a8d<\/span><br \/># <span style=\"color: #ff0000\">\/bin\/lynis &#8211;check-all &#8211;quick<\/span><br \/># <span style=\"color: #ff0000\">\/bin\/lynis -c -Q<\/span><\/p>\n<p>4. \u5c07\u6aa2\u67e5\u7d50\u679c\u8f38\u51fa\u5230\u6a94\u6848<br \/># <span style=\"color: #ff0000\">\/bin\/lynis &#8211;check-all &#8211;quick &#8211;no-colors &gt; \/tmp\/lynis.txt<\/span><\/p>\n<p>5. \u5217\u51fa \u8b66\u544a &amp; \u5efa\u8b70\u4e8b\u9805 <br \/>\u00a0\u00a0\u00a0 \u5167\u5b9a\u662f\u8f38\u51fa\u5230 <span style=\"color: #0000ff\">\/var\/log\/lynis.log<\/span><br \/># <span style=\"color: #ff0000\">egrep &#8216;Warning|Suggestion&#8217; \/var\/log\/lynis.log<\/span><\/p>\n<p>6. \u52a0\u5165\u5230\u5de5\u4f5c\u6392\u7a0b<br \/># <span style=\"color: #ff0000\">crontab -e<\/span><br \/><span style=\"color: #0000ff\">30 2 * * * \/bin\/lynis -c -Q &#8211;auditor &#8220;automated&#8221; &#8211;cronjob<\/span><\/p>\n<p>7. \u4f9d\u5efa\u8b70\u4e8b\u9805\u9032\u884c\u4fee\u6539<br \/><span style=\"color: #0000ff\">2017-03-05 13:01:27 Suggestion: Change the allow_url_fopen line to: allow_url_fopen = Off, to disable downloads via PHP [test:PHP-2376] [details:-] [solution:-]<\/span><\/p>\n<p># <span style=\"color: #ff0000\">sed -i &#8216;s\/allow_url_fopen = On\/allow_url_fopen = Off\/&#8217; \/etc\/php.ini<\/span><br \/># <span style=\"color: #ff0000\">systemctl restart httpd.service<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Lynis \u662f\u4e00\u5957\u53ef\u7528\u65bc\u5404\u7a2e UNIX Based System \u7684\u7cfb\u7d71\u5b89\u5168\u6aa2\u6e2c\u5de5\u5177\uff0c\u5b83\u80fd\u627e\u51fa\u7cfb\u7d71\u5b89\u5168\u9700\u8981\u88dc\u5f37 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/2blog.ilc.edu.tw\/25793\/2017\/04\/30\/%e5%9c%a8-centos-7-x-%e4%b8%8b%e5%ae%89%e8%a3%9d-lynix\/\" class=\"more-link\">\u95b1\u8b80\u5168\u6587<span class=\"screen-reader-text\">\u3008\u5728 CentOS 7.x \u4e0b\u5b89\u88dd lynix\u3009<\/span><\/a><\/p>\n","protected":false},"author":55,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[117],"tags":[],"class_list":["post-19538","post","type-post","status-publish","format-standard","hentry","category-c-78462"],"meta_key":{"_pingme":["1"],"_encloseme":["1"],"lt_post_id":["687741"]},"_links":{"self":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts\/19538"}],"collection":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/users\/55"}],"replies":[{"embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/comments?post=19538"}],"version-history":[{"count":1,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts\/19538\/revisions"}],"predecessor-version":[{"id":21050,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts\/19538\/revisions\/21050"}],"wp:attachment":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/media?parent=19538"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/categories?post=19538"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/tags?post=19538"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}