{"id":294911,"date":"2024-12-11T20:06:48","date_gmt":"2024-12-11T12:06:48","guid":{"rendered":"https:\/\/lrxjmw.cn\/srljstslxtaq.html"},"modified":"2024-12-11T20:06:48","modified_gmt":"2024-12-11T12:06:48","slug":"srljstslxtaq","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/srljstslxtaq.html","title":{"rendered":"\u6df1\u5165\u7406\u89e3SELinux\uff1a\u63d0\u5347Linux\u7cfb\u7edf\u5b89\u5168\u7684\u5173\u952e\u914d\u7f6e\u4e0e\u7b56\u7565"},"content":{"rendered":"

SELinux<\/a>\u662fLinux\u7cfb\u7edf\u5185\u7684\u4e00\u9879\u5173\u952e\u5b89\u5168\u8bbe\u65bd\u3002\u5b83\u5bf9\u7cfb\u7edf\u8d44\u6e90\u4e0e\u8fdb\u7a0b\u5b9e\u65bd\u4e25\u683c\u7684\u7ba1\u63a7\uff0c\u6709\u6548\u63d0\u5347\u4e86\u7cfb\u7edf\u7684\u5b89\u5168\u7b49\u7ea7\u3002\u6b63\u786e\u914d\u7f6eSELinux<\/a>\u6781\u4e3a\u5173\u952e\uff0c\u8fd9\u9700\u8981\u8bbe\u5b9a\u4f17\u591a\u89c4\u5219\u3001\u6a21\u5f0f\u53ca\u7b56\u7565\u3002<\/p>\n

SELinux\u57fa\u7840\u6982\u5ff5\u7406\u89e3<\/b><\/p>\n

SELinux\u8fd0\u7528\u4e00\u7cfb\u5217\u5b89\u5168\u63aa\u65bd\uff0c\u5bf9\u7cfb\u7edf\u5185\u8fdb\u7a0b\u4e0e\u6587\u4ef6\u7684\u4e92\u52a8\u8fdb\u884c\u7ea6\u675f\u3002\u8fd9\u6e90\u81ea\u5bf9\u7cfb\u7edf\u5b89\u5168\u7684\u9ad8\u5ea6\u91cd\u89c6\u3002\u4f8b\u5982\uff0c\u5728\u591a\u7528\u6237\u670d\u52a1\u5668\u4e0a\uff0c\u5b83\u80fd\u963b\u6b62\u7528\u6237\u901a\u8fc7\u4e0d\u6b63\u5f53\u9014\u5f84\u8bbf\u95ee\u6587\u4ef6\u7cfb\u7edf\u3002\u5b83\u91c7\u7528\u57fa\u4e8e\u6807\u7b7e\u7684\u8bbf\u95ee\u63a7\u5236\uff0c\u4e0e\u5e38\u89c4Linux\u6743\u9650\u5b58\u5728\u663e\u8457\u5dee\u5f02\u3002\u5e38\u89c4Linux\u6743\u9650\uff0c\u5982\u8bfb\u53d6\u3001\u5199\u5165\u3001\u6267\u884c\u7b49\uff0c\u4ec5\u63d0\u4f9b\u57fa\u7840\u9650\u5236\uff0c\u800cSELinux\u5728\u6b64\u57fa\u7840\u4e0a\uff0c\u80fd\u901a\u8fc7\u6807\u7b7e\u8fdb\u884c\u66f4\u7ec6\u81f4\u7684\u8bbf\u95ee\u63a7\u5236\u3002\u5b89\u5168\u4e0a\u4e0b\u6587\u7684\u914d\u7f6e\u540c\u6837\u81f3\u5173\u91cd\u8981\u3002\u6bcf\u4e2a\u6587\u4ef6\u548c\u8fdb\u7a0b\u90fd\u62e5\u6709\u5b89\u5168\u4e0a\u4e0b\u6587\uff0c\u8fd9\u51b3\u5b9a\u4e86\u5b83\u4eec\u662f\u5426\u62e5\u6709\u8bbf\u95ee\u6743\u9650\u3002<\/p>\n

linux selinux\u914d\u7f6e_linux\u7981\u7528selinux_\u914d\u7f6eselinux<\/p>\n

SELinux\u5177\u5907\u591a\u79cd\u64cd\u4f5c\u72b6\u6001\u3002\u6bd4\u5982\uff0c\u6709\u5f3a\u5236\u578b\u4e0e\u5bbd\u677e\u578b\u3002\u5728\u5f3a\u5236\u578b\u72b6\u6001\u4e0b\uff0c\u7cfb\u7edf\u4f1a\u4e25\u683c\u4f9d\u7167\u89c4\u5b9a\u6765\u5b9e\u65bd\u6743\u9650\u7ba1\u7406\uff0c\u4efb\u4f55\u8fdd\u89c4\u64cd\u4f5c\u90fd\u4f1a\u88ab\u53ca\u65f6\u62e6\u622a\u3002\u800c\u5bbd\u677e\u578b\u6a21\u5f0f\u901a\u5e38\u7528\u4e8e\u68c0\u6d4blinux selinux\u914d\u7f6e<\/strong>\uff0c\u5b83\u4e0d\u5bf9\u8fdd\u89c4\u884c\u4e3a\u8fdb\u884c\u963b\u6b62\uff0c\u800c\u662f\u5c06\u8fdd\u89c4\u8bb0\u5f55\u4e0b\u6765linux\u6587\u672c\u7f16\u8f91\u5668\uff0c\u4fbf\u4e8e\u7ba1\u7406\u5458\u8fdb\u884c\u67e5\u9605\u548c\u5206\u6790\u3002<\/p>\n

\u5b89\u88c5\u4e0e\u542f\u52a8SELinux<\/b><\/p>\n

\u5927\u591a\u6570Linux\u7cfb\u7edf\u90fd\u4f1a\u9884\u88c5SELinux\u3002\u82e5\u672a\u5b89\u88c5\uff0c\u9700\u4ece\u8f6f\u4ef6\u6e90\u4e2d\u624b\u52a8\u6dfb\u52a0\u3002\u4ee5RHEL\u548cCentOS\u4e3a\u4f8b\uff0c\u5b89\u88c5\u65f6\u9700\u9009\u7528selinux-policy-targeted\u548cselinux-policy-base\u8fd9\u4e24\u4e2a\u5305\u3002\u5b89\u88c5\u6210\u529f\u540e\uff0c\u522b\u5fd8\u4e86\u542f\u52a8SELinux\u670d\u52a1\u3002\u542f\u52a8\u547d\u4ee4<\/a>\u6839\u636e\u7cfb\u7edf\u4e0d\u540c\u800c\u6709\u6240\u533a\u522b\u3002\u90e8\u5206\u7cfb\u7edf\u53ef\u901a\u8fc7systemctlenableselinux\u547d\u4ee4\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f\uff0c\u518d\u7528systemctlstartselinux\u542f\u52a8\u670d\u52a1\u3002<\/p>\n

linux\u7981\u7528selinux_\u914d\u7f6eselinux_linux selinux\u914d\u7f6e<\/p>\n

\u6b64\u5916\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u67e5\u9605\u914d\u7f6e\u6587\u4ef6\u6765\u6838\u5b9eSELinux\u7684\u914d\u7f6e\u60c5\u51b5\u3002\u5728etc\/selinux\/config\u6587\u4ef6\u91cc\uff0c\u53ef\u4ee5\u8c03\u6574SELinux\u7684\u8fd0\u884c\u72b6\u6001\u548c\u7b56\u7565\u7c7b\u578b\u3002\u6bd4\u5982\uff0c\u5c06SELINUX\u53c2\u6570\u8bbe\u4e3aenforcing\u5c31\u662f\u542f\u7528\u5f3a\u5236\u6a21\u5f0f\uff0c\u800c\u8bbe\u7f6e\u4e3apermissive\u5219\u662f\u91c7\u7528\u5bbd\u5bb9\u6a21\u5f0f\u3002\u8fd9\u4e9b\u8c03\u6574\u5728\u7cfb\u7edf\u91cd\u542f\u540e\u4fbf\u4f1a\u751f\u6548\u3002<\/p>\n

SELinux\u7b56\u7565\u7c7b\u578b<\/b><\/p>\n

SELinux\u62e5\u6709\u591a\u79cd\u7b56\u7565\u6a21\u5f0f\u3002\u5728\u8fd9\u4e9b\u6a21\u5f0f\u4e2d\uff0ctargeted\u7b56\u7565\u5c24\u4e3a\u5e38\u89c1\u3002\u5b83\u4e3b\u8981\u7528\u6765\u4fdd\u62a4\u7279\u5b9a\u7684\u7f51\u7edc\u670d\u52a1\u3002\u5728\u591a\u6570\u4f01\u4e1a\u90e8\u7f72\u7f51\u7edc\u670d\u52a1\u7684\u573a\u5408\uff0c\u8fd9\u79cd\u7b56\u7565\u80fd\u6709\u6548\u517c\u987e\u5b89\u5168\u4e0e\u670d\u52a1\u7684\u53ef\u7528\u6027\u3002\u5f53\u4f7f\u7528\u8fd9\u79cd\u7b56\u7565\u65f6\uff0cSELinux\u4f1a\u5bf9\u90a3\u4e9b\u88ab\u8bbe\u5b9a\u4e3a\u76ee\u6807\u7684\u7f51\u7edc\u670d\u52a1\u63d0\u4f9b\u4fdd\u62a4\uff0c\u4f8b\u5982httpd\u670d\u52a1\u3001vsftpd\u670d\u52a1\u7b49\u3002<\/p>\n

linux selinux\u914d\u7f6e_linux\u7981\u7528selinux_\u914d\u7f6eselinux<\/p>\n

\u8fd9\u662f\u53e6\u4e00\u79cd\u65b9\u6cd5\uff0c\u5373\u591a\u7ea7\u5b89\u5168\u9632\u62a4\u7b56\u7565\uff08mls\uff09\u3002\u5b83\u8981\u6c42\u66f4\u4e3a\u4e25\u683c\uff0c\u64cd\u4f5c\u4e5f\u66f4\u4e3a\u7e41\u6742\u3002\u5b83\u7279\u522b\u9002\u5408\u90a3\u4e9b\u5bf9\u5b89\u5168\u6709\u6781\u9ad8\u8981\u6c42\u7684\u573a\u5408\uff0c\u4f8b\u5982\u519b\u4e8b\u6216\u653f\u5e9c\u7684\u9ad8\u7ea7\u673a\u5bc6\u6570\u636e\u4e2d\u5fc3\u3002\u4e0d\u8fc7\uff0c\u7531\u4e8e\u64cd\u4f5c\u96be\u5ea6\u8f83\u5927\uff0c\u9700\u8981\u6295\u5165\u66f4\u591a\u7684\u7ba1\u7406\u548c\u7ef4\u62a4\u8d44\u6e90\uff0c\u8fd9\u79cd\u7b56\u7565\u5728\u4e00\u822c\u4f01\u4e1a\u4e2d\u63a8\u5e7f\u8d77\u6765\u5e76\u4e0d\u5bb9\u6613\uff0c\u4e0e\u5b9a\u5411\u7b56\u7565\u76f8\u6bd4\uff0c\u63a8\u5e7f\u96be\u5ea6\u66f4\u5927\u3002<\/p>\n

\u81ea\u5b9a\u4e49SELinux\u7b56\u7565<\/b><\/p>\n

\u6709\u65f6\uff0c\u73b0\u6210\u7684SELinux\u7b56\u7565\u65e0\u6cd5\u6ee1\u8db3\u6211\u4eec\u7684\u7279\u6b8a\u8981\u6c42\u3002\u8fd9\u65f6\uff0c\u6211\u4eec\u53ef\u4ee5\u7740\u624b\u5236\u5b9a\u4e2a\u6027\u5316\u7684\u7b56\u7565\u3002\u9996\u5148\uff0c\u6211\u4eec\u5fc5\u987b\u638c\u63e1sepolicy-tools\u5de5\u5177\u5305\u7684\u64cd\u4f5c\u65b9\u6cd5\u3002\u8fd9\u4e2a\u5de5\u5177\u5305\u5177\u5907\u521b\u5efa\u3001\u7f16\u8f91\u548c\u7ba1\u63a7SELinux\u7b56\u7565\u7684\u80fd\u529b\u3002\u501f\u52a9audit2allow\u547d\u4ee4\uff0c\u6211\u4eec\u80fd\u591f\u4f9d\u636eSELinux\u65e5\u5fd7\u4e2d\u7684\u8fdd\u89c4\u8bb0\u5f55\u6765\u8c03\u6574\u7b56\u7565\u3002<\/p>\n

\u82e5\u67d0\u5e94\u7528\u7a0b\u5e8f\u7684\u6587\u4ef6\u8bbf\u95ee\u673a\u5236\u4e0e\u4f17\u4e0d\u540c\uff0c\u5b83\u6216\u8bb8\u4f1a\u906d\u9047SELinux\u7b56\u7565\u7684\u62e6\u622a\u3002\u8fd9\u65f6\uff0c\u6211\u4eec\u53ef\u4ee5\u67e5\u9605SELinux\u65e5\u5fd7\uff0c\u8bc6\u522b\u51fa\u53d7\u963b\u7684\u89c4\u5219\uff0c\u518d\u901a\u8fc7audit2allow\u547d\u4ee4\u6765\u8bbe\u7acb\u65b0\u7684\u89c4\u5219\uff0c\u786e\u4fdd\u5e94\u7528\u80fd\u6b63\u5e38\u8fd0\u884c\u3002\u4e0d\u8fc7\uff0c\u5728\u5236\u5b9a\u81ea\u5b9a\u4e49\u7b56\u7565\u65f6\u9700\u683c\u5916\u5c0f\u5fc3linux selinux\u914d\u7f6e<\/strong>\uff0c\u56e0\u4e3a\u82e5\u89c4\u5219\u8bbe\u7f6e\u5931\u8bef\uff0c\u53ef\u80fd\u5f15\u53d1\u5b89\u5168\u9690\u60a3\u3002<\/p>\n

SELinux\u6545\u969c\u6392\u67e5<\/b><\/p>\n

\u8fd0\u884cSELinux\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u95ee\u9898\uff0c\u4f8b\u5982\u670d\u52a1\u542f\u52a8\u5931\u8d25\u6216\u6587\u4ef6\u8bbf\u95ee\u88ab\u9650\u5236\u3002\u8fd9\u65f6\uff0c\u67e5\u770bSELinux\u65e5\u5fd7\u662f\u5173\u952e\u3002\u65e5\u5fd7\u901a\u5e38\u5b58\u653e\u5728\/var\/log\/audit\/audit.log\u6587\u4ef6\u91cc\u3002\u901a\u8fc7\u65e5\u5fd7\uff0c\u53ef\u4ee5\u67e5\u770b\u5230\u8be6\u7ec6\u7684\u8fdd\u89c4\u8be6\u60c5\uff0c\u6bd4\u5982\u54ea\u4e2a\u8fdb\u7a0b\u5c1d\u8bd5\u8bbf\u95ee\u54ea\u4e2a\u6587\u4ef6\u8d44\u6e90\uff0c\u8fdd\u53cd\u4e86\u54ea\u6761\u5b89\u5168\u89c4\u5b9a\u3002<\/p>\n

\u6b64\u5916\uff0c\u501f\u52a9sealert\u5de5\u5177\u53ef\u4ee5\u6709\u6548\u5730\u8fdb\u884c\u6545\u969c\u68c0\u6d4b\u3002\u8be5\u5de5\u5177\u80fd\u5bf9SELinux\u7684\u65e5\u5fd7\u8fdb\u884c\u89e3\u8bfb\uff0c\u6574\u5408\u76f8\u5173\u6570\u636e\uff0c\u5e76\u4ee5\u66f4\u76f4\u89c2\u7684\u65b9\u5f0f\u5c55\u793a\u7ed9\u7ba1\u7406\u5458\u3002\u82e5\u53d1\u73b0\u662fSELinux\u963b\u6321\u4e86\u5408\u6cd5\u64cd\u4f5c\uff0c\u6211\u4eec\u4fbf\u53ef\u901a\u8fc7\u65e5\u5fd7\u5185\u5bb9\u4ee5\u53casealert\u7684\u5206\u6790\u7ed3\u679c\uff0c\u8fd0\u7528audit2allow\u5de5\u5177\u6765\u8c03\u6574\u5b89\u5168\u7b56\u7565\uff0c\u786e\u4fdd\u64cd\u4f5c\u5f97\u4ee5\u987a\u5229\u6267\u884c\u3002<\/p>\n

SELinux\u6700\u4f73\u5b9e\u8df5<\/b><\/p>\n

linux\u7981\u7528selinux_\u914d\u7f6eselinux_linux selinux\u914d\u7f6e<\/p>\n

\u5728\u914d\u7f6eSELinux\u65f6linux\u8bbe\u7f6e\u9ed8\u8ba4\u7f51\u5173\uff0c\u5148\u5728\u6d4b\u8bd5\u73af\u5883\u4e2d\u8fdb\u884c\u7b56\u7565\u6d4b\u8bd5\u662f\u8f83\u597d\u7684\u505a\u6cd5\u3002\u53ef\u4ee5\u5148\u8bbe\u7f6eSELinux\u4e3a\u5bbd\u5bb9\u6a21\u5f0f\uff0c\u63a5\u7740\u5728\u5c3d\u91cf\u4e0e\u5b9e\u9645\u8fd0\u884c\u73af\u5883\u4e00\u81f4\u7684\u524d\u63d0\u4e0b\uff0c\u6a21\u62df\u5404\u79cd\u4e1a\u52a1\u573a\u666f\uff0c\u5e76\u7559\u610fSELinux\u65e5\u5fd7\u4e2d\u7684\u5f02\u5e38\u884c\u4e3a\u3002\u6b64\u65b9\u6cd5\u65e8\u5728\u4e0d\u5f71\u54cd\u6b63\u5f0f\u4e1a\u52a1\u7684\u524d\u63d0\u4e0b\uff0c\u63d0\u524d\u53d1\u73b0\u6f5c\u5728\u95ee\u9898\u3002<\/p>\n

\u540c\u65f6\uff0c\u9700\u5b9a\u65f6\u5bf9SELinux\u7684\u7b56\u7565\u8fdb\u884c\u5ba1\u89c6\u548c\u66f4\u65b0\u3002\u56e0\u4e3a\u4e1a\u52a1\u4e0d\u65ad\u8fdb\u6b65\uff0c\u65b0\u5e94\u7528\u9646\u7eed\u4e0a\u7ebf\uff0c\u65e7\u6709\u7684\u7b56\u7565\u53ef\u80fd\u4e0d\u518d\u9002\u5408\u3002\u5b9a\u65f6\u5ba1\u67e5\u6709\u52a9\u4e8e\u786e\u4fdd\u7b56\u7565\u6301\u7eed\u6709\u6548\u5730\u5b88\u62a4\u7cfb\u7edf\u5b89\u5168\u3002\u53e6\u5916\uff0c\u6301\u7eed\u5173\u6ce8SELinux\u793e\u533a\uff0c\u638c\u63e1\u6700\u65b0\u7684\u5b89\u5168\u52a8\u6001\u548c\u6700\u4f73\u914d\u7f6e\u6280\u5de7\uff0c\u4e5f\u662f\u5341\u5206\u5fc5\u8981\u7684\u3002<\/p>\n

\u8fd9\u662fLinux\u7cfb\u7edf\u4e0b\u5173\u4e8eSELinux\u8bbe\u7f6e\u7684\u51e0\u4e2a\u5173\u952e\u70b9\u3002\u672c\u6587\u65e8\u5728\u5e2e\u52a9\u4f60\u66f4\u597d\u5730\u8ba4\u8bc6SELinux\u3002\u5728\u8bbe\u7f6eSELinux\u65f6\uff0c\u4f60\u662f\u5426\u9047\u5230\u8fc7\u96be\u9898\uff1f\u6b22\u8fce\u5728\u8bc4\u8bba\u533a\u5206\u4eab\u4f60\u7684\u7ecf\u5386\u3002\u540c\u65f6\uff0c\u4e5f\u8bf7\u4f60\u7ed9\u4e88\u70b9\u8d5e\u548c\u8f6c\u53d1\u652f\u6301\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5b83\u5bf9\u7cfb\u7edf\u8d44\u6e90\u4e0e\u8fdb\u7a0b\u5b9e\u65bd\u4e25\u683c\u7684\u7ba1\u63a7\uff0c\u6709\u6548\u63d0\u5347\u4e86\u7cfb\u7edf\u7684\u5b89\u5168\u7b49\u7ea7\u3002\u6b63\u786e\u914d\u7f6eSELinux\u6781\u4e3a\u5173\u952e\uff0c\u8fd9\u9700\u8981\u8bbe\u5b9a\u4f17\u591a\u89c4\u5219\u3001\u6a21\u5f0f\u53ca\u7b56\u7565\u3002SELinux\u8fd0\u7528\u4e00\u7cfb\u5217\u5b89\u5168\u63aa\u65bd\uff0c\u5bf9\u7cfb\u7edf\u5185\u8fdb\u7a0b\u4e0e\u6587\u4ef6\u7684\u4e92\u52a8\u8fdb\u884c\u7ea6\u675f\u3002\u5728\u914d\u7f6eSELinux\u65f6\uff0c\u5148\u5728\u6d4b\u8bd5\u73af\u5883\u4e2d\u8fdb\u884c\u7b56\u7565\u6d4b\u8bd5\u662f\u8f83\u597d\u7684\u505a\u6cd5\u3002<\/p>\n","protected":false},"author":1,"featured_media":294912,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[4840,3469,4841,4842,1264],"class_list":["post-294911","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-lxtaq","tag-SELinux","tag-gjpz","tag-cl-4","tag-fwkz"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/294911","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=294911"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/294911\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/294912"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=294911"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=294911"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=294911"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}