{"id":8915,"date":"2024-05-14T10:28:36","date_gmt":"2024-05-14T02:28:36","guid":{"rendered":"https:\/\/blog.pfchina.org\/?p=8915"},"modified":"2024-09-05T14:46:01","modified_gmt":"2024-09-05T06:46:01","slug":"opnsense%e5%ae%89%e8%a3%85%e5%92%8c%e9%85%8d%e7%bd%aecrowdsec%e6%8c%87%e5%8d%97","status":"publish","type":"post","link":"https:\/\/blog.pfchina.org\/?p=8915","title":{"rendered":"OPNsense\u5b89\u88c5\u548c\u914d\u7f6eCrowdSec\u6559\u7a0b"},"content":{"rendered":"<p style=\"text-align: justify;\"><a href=\"https:\/\/crowdsec.net\/\" target=\"_blank\" rel=\"noopener\">Crowdsec<\/a>\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u5165\u4fb5\u9632\u5fa1\u7cfb\u7edf (IPS)\uff0c\u5305\u542b\u5404\u79cd\u7c7b\u578b\u7684\u5a01\u80c1\u60c5\u62a5\uff0c\u5b83\u53ef\u4ee5\u76d1\u63a7\u3001\u8b66\u544a\u548c\u963b\u6b62\u7f51\u7edc\u4e2d\u7684\u6076\u610f\u6d3b\u52a8\uff0c\u4fdd\u62a4\u7f51\u7edc\u514d\u53d7\u5df2\u77e5\u5a01\u80c1\u3002\u867d\u7136\u5176\u4ed6 IPS \u5e73\u53f0\u53ef\u4ee5\u4f7f\u7528\u5404\u79cd\u7b7e\u540d\/\u89c4\u5219\u6765\u963b\u6b62\u5df2\u77e5\u7684\u6076\u610f\u6d41\u91cf\uff0c\u4f46CrowdSec\u91c7\u7528\u7684\u65b9\u6cd5\u662f\u4f7f\u7528\u793e\u533a\u6536\u96c6\u7684\u5a01\u80c1\u60c5\u62a5\u6765\u8ba1\u7b97IP\u5730\u5740\u7684\u4fe1\u8a89\u5206\u6570\uff0c\u5e76\u963b\u6b62\u4fe1\u8a89\u8bc4\u5206\u8f83\u5dee\u7684IP\u5730\u5740\u8bbf\u95ee\u53d7\u4fdd\u62a4\u7684\u8d44\u6e90\uff0c\u8fd9\u5c06\u66f4\u5feb\u901f\u3001\u9ad8\u6548\u3002<\/p>\n<p style=\"text-align: justify;\">CrowdSec\u6709\u4e24\u4e2a\u4e3b\u8981\u90e8\u5206\uff1a\u4ee3\u7406\u548c\u4fdd\u9556\u3002\u4ee3\u7406\u76d1\u89c6\u65e5\u5fd7\u6587\u4ef6\u4e2d\u7684\u6076\u610f\u6d3b\u52a8\u5e76\u5c06\u67d0\u4e9b\u4fe1\u606f\u4f20\u9001\u56deCrowdSec\u793e\u533a\u3002\u4fdd\u9556\u7528\u4e8e\u963b\u6b62IP\u5730\u5740\u8bbf\u95ee\u53d7\u4fdd\u62a4\u7684\u8d44\u6e90\u3002\u5728OPNsense\u9632\u706b\u5899\u4e0a\u8fd0\u884cCrowdSec\u5c06\u4fdd\u62a4\u6574\u4e2a\u7f51\u7edc\u514d\u53d7\u6076\u610f IP \u5730\u5740\u7684\u4fb5\u5bb3\u3002<\/p>\n<p style=\"text-align: justify;\">\u5728OPNsense\u9632\u706b\u5899\u4e0a\uff0c\u53ef\u4ee5\u540c\u65f6\u8fd0\u884cSuricata\u548cCrowdSec\uff0c\u4f7f\u7528\u4e0d\u540c\u7684\u5b89\u5168\u6280\u672f\u6765\u4fdd\u62a4\u5185\u90e8\u7f51\u7edc\u3002\u4ee5\u4e0b\u6559\u7a0b\u5728OPNsense 24.7.1\u4e0a\u5b8c\u6210\u3002<\/p>\n<h1 id=\"setting-up-ssh-access-in-opnsense\" style=\"text-align: justify;\">\u5b89\u88c5<\/h1>\n<p style=\"text-align: justify;\">\u5bfc\u822a\u5230\u7cfb\u7edf &gt; \u56fa\u4ef6 &gt;\u63d2\u4ef6\uff0c\u627e\u5230CrowdSec\u63d2\u4ef6\u5e76\u5b89\u88c5\u3002<\/p>\n<h1 style=\"text-align: justify;\">\u542f\u7528<\/h1>\n<p style=\"text-align: justify;\">\u5bfc\u822a\u5230\u670d\u52a1 &gt; CrowdSec &gt; Settings\u9875\u9762\uff0c\u9009\u4e2d\u4e0b\u56fe\u4e2d\u7684\u4e09\u4e2a\u9009\u9879 \uff0c\u7136\u540e\u5355\u51fb\u201c\u5e94\u7528\u201d\u6309\u94ae\u3002<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/05\/Snipaste_2024-08-14_11-38-30.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13215\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/05\/Snipaste_2024-08-14_11-38-30.png\" alt=\"\" width=\"1892\" height=\"1464\" \/><\/a><\/p>\n<h1 id=\"create-firewall-rules\" style=\"text-align: justify;\">\u6ce8\u518c<\/h1>\n<p style=\"text-align: justify;\">\u5982\u679c\u60f3\u4f7f\u7528\u514d\u8d39\u7684CrowdSec\u63a7\u5236\u53f0\uff08\u53ef\u9009\uff09\uff0c\u53ef\u4ee5\u8bbf\u95eeCrowdSec\u63a7\u5236\u53f0<a href=\"https:\/\/app.crowdsec.net\/\" target=\"_blank\" rel=\"noopener\">\u6ce8\u518c\u9875\u9762<\/a>\u3002\u521b\u5efa\u5e10\u6237\u5e76\u8fdb\u5165\u540e\uff0c\u4f1a\u5728\u4e0b\u65b9\u63d0\u793a\u6ce8\u518c\u7684\u547d\u4ee4\uff1a<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/05\/Snipaste_2024-08-14_10-25-43.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-13217\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/05\/Snipaste_2024-08-14_10-25-43.png\" alt=\"\" width=\"1075\" height=\"196\" \/><\/a><br \/>\n<span id=\"ez-clearholder-leader-3\"><\/span><\/p>\n<p style=\"text-align: justify;\">\u5728OPNsense\u7684shell\u73af\u5883\u8fd0\u884c\u4e0a\u8ff0\u547d\u4ee4\uff1a<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/05\/Snipaste_2024-08-14_10-26-02.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13216\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/05\/Snipaste_2024-08-14_10-26-02.png\" alt=\"\" width=\"1098\" height=\"173\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">\u91cd\u65b0\u5237\u65b0\u7f51\u9875\u5c06\u4f1a\u63d0\u793a\u6ce8\u518c\u8bf7\u6c42\uff0c\u70b9\u51fb\u63a5\u53d7\u62a5\u540d\u5b8c\u6210\u6ce8\u518c\u3002<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/05\/Snipaste_2024-08-14_10-25-16.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13218\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/05\/Snipaste_2024-08-14_10-25-16.png\" alt=\"\" width=\"2213\" height=\"1028\" \/><\/a><\/p>\n<h1>\u6dfb\u52a0\u9ed1\u540d\u5355<\/h1>\n<p style=\"text-align: justify;\">\u6ce8\u518c\u5b8c\u6210\u540e\uff0c\u8f6c\u81f3\u9ed1\u540d\u5355\uff0c\u6dfb\u52a0\u9ed1\u540d\u5355\uff0c\u514d\u8d39\u7528\u6237\u53ef\u6dfb\u52a0\u7684\u9ed1\u540d\u5355\u53ea\u6709\u51e0\u4e2a\u3002\u6dfb\u52a0\u5b8c\u6210\uff0c\u9700\u8981\u7b49\u5f85\u4e24\u5c0f\u65f6\u5de6\u53f3\u624d\u80fd\u751f\u6548\u3002<\/p>\n<p><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/08\/Snipaste_2024-08-14_14-22-50.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13229\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/08\/Snipaste_2024-08-14_14-22-50.png\" alt=\"\" width=\"2158\" height=\"1571\" \/><\/a><\/p>\n<p>\u5b89\u5168\u5f15\u64ce\u5305\u542b\u7684\u529f\u80fd\u5982\u4e0b\uff1a<\/p>\n<p><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/08\/Snipaste_2024-08-14_14-35-26.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13230\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/08\/Snipaste_2024-08-14_14-35-26.png\" alt=\"\" width=\"1082\" height=\"1041\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">CrowdSec\u793e\u533a\u7248\u5305\u542b\u7684\u529f\u80fd\u6709\u9650\uff0c\u66f4\u5168\u9762\u7684\u4fdd\u62a4\uff0c\u9700\u8981\u53e6\u5916\u4ed8\u8d39\u8ba2\u9605\u3002<\/p>\n<h2 style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/05\/Snipaste_2024-08-14_10-27-10.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13220\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/05\/Snipaste_2024-08-14_10-27-10.png\" alt=\"\" width=\"1574\" height=\"917\" \/><\/a><\/h2>\n","protected":false},"excerpt":{"rendered":"<p>Crowdsec\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u5165\u4fb5\u9632\u5fa1\u7cfb\u7edf (IPS)\uff0c\u5305\u542b\u5404\u79cd\u7c7b\u578b\u7684\u5a01\u80c1\u60c5\u62a5\uff0c\u5b83 &hellip; <a href=\"https:\/\/blog.pfchina.org\/?p=8915\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[365],"class_list":["post-8915","post","type-post","status-publish","format-standard","hentry","category-opnsense","tag-crowdsec"],"_links":{"self":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/8915","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8915"}],"version-history":[{"count":10,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/8915\/revisions"}],"predecessor-version":[{"id":13234,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/8915\/revisions\/13234"}],"wp:attachment":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8915"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8915"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8915"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}