{"id":247,"date":"2022-10-20T23:57:04","date_gmt":"2022-10-20T14:57:04","guid":{"rendered":"https:\/\/yuaiho.com\/blog\/?p=247"},"modified":"2022-10-23T01:19:41","modified_gmt":"2022-10-22T16:19:41","slug":"%e3%82%a2%e3%82%af%e3%82%bb%e3%82%b9%e5%88%b6%e5%be%a1%e3%83%aa%e3%82%b9%e3%83%88acl%e3%81%ae%e5%8b%98%e6%89%80","status":"publish","type":"post","link":"https:\/\/yuaiho.com\/blog\/archives\/2022\/247","title":{"rendered":"\u30a2\u30af\u30bb\u30b9\u5236\u5fa1\u30ea\u30b9\u30c8(ACL)\u306e\u52d8\u6240"},"content":{"rendered":"\n<p>\u591a\u304f\u306eNW\u6a5f\u5668\u3084FW\u3001OS\u3001\u30b5\u30fc\u30d0\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306b\u306f\u30a2\u30af\u30bb\u30b9\u5236\u5fa1(\u6a5f\u69cb)\u304c\u5b9f\u88c5\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u30a2\u30af\u30bb\u30b9\u5236\u5fa1\u6a5f\u69cb\u306f\u591a\u304f\u306e\u5834\u5408\u3001Allow list(\u30db\u30ef\u30a4\u30c8\u30ea\u30b9\u30c8)\u3084Deny list(\u30d6\u30e9\u30c3\u30af\u30ea\u30b9\u30c8)\u3042\u308b\u3044\u306f\u305d\u306e\u4e21\u65b9\u3092\u542b\u3080\u30eb\u30fc\u30eb\u30ea\u30b9\u30c8\u3001\u4fd7\u306b\u3044\u3046ACL(Access Control List)\u3092\u3082\u3063\u3066\u3066\u3001\u30a2\u30af\u30bb\u30b9\u3057\u3066\u6765\u305f\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306eIP\u3084\u30dd\u30fc\u30c8\u3068\u3001ACL\u306b\u66f8\u304b\u308c\u3066\u3044\u308b\u30eb\u30fc\u30eb\u3092\u6bd4\u8f03\u3057\u3066\u3001OK\u3001NG\u3092\u5224\u5225\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>1\u3064\u306eACL\u306e\u5b9f\u88c5\u3057\u304b\u6271\u3063\u3066\u306a\u3044\u3068\u4e2d\u3005\u6c17\u304c\u3064\u304b\u306a\u3044\u3093\u3067\u3059\u304c\u3001<strong>\u5b9f\u306fACL\u306e\u8a55\u4fa1\u65b9\u6cd5\u306f\u5b9f\u88c5\u6bce\u306b\u7570\u306a\u308a\u307e\u3059<\/strong>\u3002<\/p>\n\n\n\n<p>\u5b9f\u88c5\u6bce\u306e\u5177\u4f53\u7684\u306a\u4ed5\u69d8\u306f\u5fc5\u8981\u306b\u306a\u3063\u305f\u3089\u305d\u306e\u5834\u3067\u8abf\u3079\u308c\u3070\u3044\u3044\u3093\u3067\u3059\u304c\u3001\u5c11\u306a\u304f\u3068\u3082<mark style=\"background-color:rgba(0, 0, 0, 0);color:#006633\" class=\"has-inline-color\"><strong>\u300c\u5b9f\u88c5\u3054\u3068\u306b\u8a55\u4fa1\u65b9\u6cd5\u306f\u9055\u3046\u300d<\/strong><\/mark>\u3068\u8a00\u3046\u3053\u3068\u3060\u3051\u306f\u77e5\u3063\u3066\u304a\u304b\u306a\u3044\u3068\u3001\u6163\u308c\u3066\u306a\u3044\u5b9f\u88c5\u3067ACL\u3092\u64cd\u4f5c\u3057\u305f\u6642\u306b\u5d4c\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30dd\u30a4\u30f3\u30c8<\/h2>\n\n\n\n<p>\u65b0\u3057\u3044\u30b7\u30b9\u30c6\u30e0\u306eACL\u3092\u64cd\u4f5c\u3059\u308b\u306a\u3089\u4e0b\u8a18\u306f\u306e3\u3064\u306f\u78ba\u8a8d\u3057\u305f\u65b9\u304c\u826f\u3044\u3068\u601d\u3044\u307e\u3059\u3002\u7279\u306b\u30cf\u30de\u308a\u3084\u3059\u3044\u306e\u304c\u6700\u521d\u306e2\u3064\u3067\u3059\u3002\u65b0\u3057\u3044\u5b9f\u88c5\u3092\u89e6\u308b\u5834\u5408\u306f\u78ba\u8a8d\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u6319\u52d5(\u30c7\u30d5\u30a9\u30eb\u30c8\u30dd\u30ea\u30b7\u30fc)<\/li><li>\u30de\u30c3\u30c1\u5f8c\u306e\u6319\u52d5(\u30d5\u30a1\u30fc\u30b9\u30c8\u30de\u30c3\u30c1\u304b\u30e9\u30b9\u30c8\u30de\u30c3\u30c1\u304b)<\/li><li>\u30b9\u30c6\u30fc\u30c8\u30d5\u30eb\u578b\u304b\u30b9\u30c6\u30fc\u30c8\u30ec\u30b9\u578b\u304b<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u6319\u52d5\uff08\u30c7\u30d5\u30a9\u30eb\u30c8\u30dd\u30ea\u30b7\u30fc\uff09<\/h3>\n\n\n\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u6319\u52d5\u3068\u306f\u300cACL\u5185\u3067\u660e\u793a\u3057\u305f\u30eb\u30fc\u30eb\u306b\u30de\u30c3\u30c1\u3057\u306a\u304b\u3063\u305f\u3082\u306e\u300d\u306b\u5bfe\u3059\u308b\u6271\u3044\u3067\u3059\u3002\u4f8b\u3048\u3070\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306aACL\u306e\u3068\u3053\u308d\u306b10.0.5.15\u306eIP\u304c\u6765\u305f\u5834\u5408\u3067\u3059\u306d\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>192.168.0.0\/24 \u2192 \u4e0d\u8a31\u53ef<br>172.16.0.0\/12 \u2192 \u8a31\u53ef<\/code><\/pre>\n\n\n\n<p>\u305f\u307e\u306b\u52d8\u9055\u3044\u3057\u3066\u308b\u65b9\u304c\u3044\u308b\u3093\u3067\u3059\u304c\u3001<strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#990033\" class=\"has-inline-color\">\u300cACL\u306b\u30eb\u30fc\u30eb\u3092\u66f8\u3044\u3066\u306a\u3044=\u6697\u9ed9\u306eDeny(Block)\u300d\u3068\u306f\u9650\u308a\u307e\u305b\u3093<\/mark><\/strong>\u3002\u305d\u3046\u8a00\u3046\u5b9f\u88c5\u3082\u3042\u308a\u307e\u3059\u304c\u3001\u5168\u3066\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>\u4f8b\u3048\u3070Linux\u3067\u4f7f\u308f\u308c\u3066\u308biptables\u3084nftables\u3001FreeBSD\u306eipf\u3084pf\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u8a2d\u5b9a\u306f\u300c\u6697\u9ed9\u306eAllow (Permit)\u300d\u3067\u3059\u3002\u30d6\u30ed\u30fc\u30c9\u30d0\u30f3\u30c9\u30eb\u30fc\u30bf\u306e\u7c21\u6613\u7684\u306aFirewall(FW)\u3082\u30c7\u30d5\u30a9\u30eb\u30c8\u306fAllow\u3060\u3063\u305f\u308a\u3057\u307e\u3059\u3002Apache HTTPd\u306a\u3093\u304b\u306f\u81ea\u5206\u3067\u5b9a\u7fa9\u3057\u305fOrder\u3067\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30dd\u30ea\u30b7\u30fc\u304cAllow\u304bDeny\u304b\u304c\u6c7a\u307e\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u307e\u3041\u3001\u3053\u3093\u306a\u611f\u3058\u3067\u30c7\u30d5\u30a9\u30eb\u30c8Allow\u306e\u5b9f\u88c5\u306f\u610f\u5916\u3068\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u52d5\u4f5c\u306b\u3064\u3044\u3066\u3061\u3083\u3093\u3068\u78ba\u8a8d\u3057\u3068\u304b\u306a\u3044\u3068\u3001Allow List(\u30db\u30ef\u30a4\u30c8\u30ea\u30b9\u30c8)\u3067\u4f5c\u3063\u305f\u3064\u3082\u308a\u306eFirewall\u304c\u3001Default Allow\u306e\u6240\u70ba\u3067\u30ac\u30d0\u30ac\u30d0\u306b\u306a\u3063\u3066\u3066\u3001\u5168\u304f\u30a2\u30af\u30bb\u30b9\u5236\u5fa1\u3055\u308c\u3066\u306a\u304b\u3063\u305f\u3002\u3068\u304b\u8a00\u3046\u4e8b\u6545\u306b\u7e4b\u304c\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3061\u306a\u307f\u306b\u3001nftables\u3084iptables\u306b\u95a2\u3057\u3066\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u30dd\u30ea\u30b7\u30fc\u3092DENY\u3084REJECT\u306b\u5909\u66f4\u51fa\u6765\u307e\u3059\u3002BSD\u306epf\u3084ipfilter\u3082\u305f\u3076\u3093\u3067\u304d\u308b\u3068\u601d\u3044\u307e\u3059\u304c\u77e5\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u8a55\u4fa1\u5f8c\u306e\u6319\u52d5(\u30d5\u30a1\u30fc\u30b9\u30c8\u30de\u30c3\u30c1\u304b\u30e9\u30b9\u30c8\u30de\u30c3\u30c1\u304b)<\/h3>\n\n\n\n<p>\u8a55\u4fa1\u5f8c\u306e\u6319\u52d5\u3068\u306f\u30de\u30c3\u30c1\u3057\u305f\u3042\u3068\u3069\u3046\u306a\u308b\u304b\u3068\u8a00\u3046\u3053\u3068\u3067\u3059\u306d\u3002\u8a00\u3044\u63db\u3048\u308b\u3068\u30d5\u30a1\u30fc\u30b9\u30c8\u30de\u30c3\u30c1\u578b\u304b\u30e9\u30b9\u30c8\u30de\u30c3\u30c1\u578b\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u4e0b\u8a18\u306e\u4f8b\u3067192.168.0.1\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u6301\u3064\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304c\u30a2\u30af\u30bb\u30b9\u3057\u3066\u6765\u305f\u6642\u306b\u3069\u3046\u306a\u308b\u304b\u3092\u8003\u3048\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>192.168.0.0\/24 \u2192 \u4e0d\u8a31\u53ef<br>172.16.0.0\/12 \u2192 \u8a31\u53ef<br>192.168.0.1\/32 \u2192 \u8a31\u53ef<br>\u203bDefault\u306fDeny\u3068\u3057\u307e\u3059\u3002<\/code><\/pre>\n\n\n\n<p>\u3053\u3053\u3067\u3001\u300c192.168.0.1\u306f192.168.0.0\/24\u306b\u542b\u307e\u308c\u308b\u304b\u3089\u30d6\u30ed\u30c3\u30af\u3055\u308c\u308b\u300d\u3068\u89e3\u91c8\u3059\u308b\u306e\u306f\u65e9\u8a08\u3067\u3059\u3002\u5b9f\u88c5\u3084\u66f8\u304d\u65b9\u306b\u4f9d\u5b58\u3057\u307e\u3059\u306e\u3067\u3001\u3082\u3061\u308d\u3093\u6b63\u3057\u3044\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u304c\u5e38\u306b\u6b63\u89e3\u3068\u306f\u9650\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>\u30eb\u30fc\u30eb\u306b\u30de\u30c3\u30c1\u3059\u308b\u3068ACL\u306e\u8a55\u4fa1\u304c\u7d42\u308f\u3063\u3066\u3001\u305d\u306e\u5f8c\u308d\u306b\u66f8\u304b\u308c\u3066\u308b\u30ea\u30b9\u30c8\u306f\u7121\u8996\u3059\u308b\u5b9f\u88c5\u3060\u3068\u4e0a\u8a18\u306e\u300c192.168.0.1\u306f192.168.0.0\/24\u306b\u542b\u307e\u308c\u308b\u304b\u3089\u30d6\u30ed\u30c3\u30af\u3055\u308c\u308b\u300d\u3068\u3044\u3046\u89e3\u91c8\u306f\u6b63\u89e3\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3057\u304b\u3057\u3001<mark style=\"background-color:rgba(0, 0, 0, 0);color:#990033\" class=\"has-inline-color\">\u4e00\u5ea6\u30de\u30c3\u30c1\u3057\u3066\u3082\u8a55\u4fa1\u304c\u6b62\u307e\u3089\u305a\u3001\u6700\u5f8c\u307e\u3067\u30ea\u30b9\u30c8\u3092\u8210\u3081\u3066\u3001\u6700\u5f8c\u306b\u30de\u30c3\u30c1\u3057\u305f\u6761\u4ef6(\u3053\u3053\u3067\u306f192.168.0.1\/32\u306e\u90e8\u5206)\u3067\u8a31\u53ef\u3055\u308c\u308b\u5b9f\u88c5\u3082\u3042\u308a\u307e\u3059<\/mark>\u3002\u4e2d\u306b\u306f\u884c\u672b\u306b\u660e\u793a\u7684\u306b\u66f8\u3044\u304a\u3044\u305fDefault deny\u304c\u30de\u30c3\u30c1\u3057\u3066\u7d50\u5c40\u30d6\u30ed\u30c3\u30af\u3055\u308c\u308b\u5834\u5408\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u3082\u5b9f\u88c5\u306b\u4f9d\u5b58\u3057\u307e\u3059\u3002\u7279\u306b\u4e3b\u6d41\u3089\u3057\u3044\u4e3b\u6d41\u3082\u7121\u3044\u6c17\u304c\u3057\u307e\u3059\u3057\u3001BSD PF\u3084ipfilter\u306e\u3088\u3046\u306b\u3001\u5b9f\u88c5\u306b\u3088\u3063\u3066\u306f\u30eb\u30fc\u30eb\u6bce(\u884c\u6bce)\u306b\u5f53\u8a72\u884c\u4ee5\u964d\u306e\u8a55\u4fa1\u3092\u3084\u3081\u308b\/\u7d9a\u3051\u308b\u3092\u5236\u5fa1\u51fa\u6765\u308b\u3082\u306e\u3092\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4f8b\u3048\u3070BSD PF\u306f\u4e0b\u8a18\u306e\u4e0a\u306e\u884c\u306e\u3088\u3046\u306bquick\u3092\u5165\u308c\u306a\u3044\u5834\u5408\u306f\u30de\u30c3\u30c1\u3057\u3066\u3082\u8a55\u4fa1\u304c\u7d42\u308f\u3089\u305a\u6b21\u306e\u884c\u304c\u8a55\u4fa1\u3055\u308c\u307e\u3059\u3002\u4e0b\u5074\u306e\u3088\u3046\u306b<mark style=\"background-color:rgba(0, 0, 0, 0);color:#cc00cc\" class=\"has-inline-color\">quick<\/mark>\u3092\u5165\u308c\u308b\u3068\u30eb\u30fc\u30eb\u30de\u30c3\u30c1\u3057\u305f\u6642\u70b9\u3067\u30eb\u30fc\u30eb\u306e\u8a55\u4fa1\u304c\u7d42\u4e86\u3057\u3001\u5f8c\u308d\u306e\u30eb\u30fc\u30eb\u7fa4\u306f\u8a55\u4fa1\u3055\u308c\u307e\u305b\u3093(\u7121\u8996\u3055\u308c\u307e\u3059)\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pass in log proto tcp from 172.16.0.1 any to any port 25\nblock in log <strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#cc00cc\" class=\"has-inline-color\">quick<\/mark><\/strong> proto tcp from 172.16.0.0\/12 any to any port 25<\/code><\/pre>\n\n\n\n<p class=\"has-small-font-size\">\u203b\u4e0a\u8a18\u306e\u5834\u5408172.16.0.1\u304b\u3089SMTP\u3078\u306e\u30a2\u30af\u30bb\u30b9\u306f\u30d6\u30ed\u30c3\u30af\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u8a31\u53ef\u3057\u305f\u7b48\u306a\u306e\u306b\u8a31\u53ef\u3055\u308c\u306a\u3044\u3001\u30d6\u30ed\u30c3\u30af\u3057\u305f\u306f\u305a\u306a\u306e\u306b\u30d6\u30ed\u30c3\u30af\u3055\u308c\u3066\u306a\u3044\u3068\u3044\u3046\u30b1\u30fc\u30b9\u306f\u3001(\u305d\u306e\u88fd\u54c1\u7b49\u306b\u30d0\u30af\u304c\u7121\u3044\u306a\u3089)\u3053\u306e\u8a55\u4fa1\u306e\u7d99\u7d9a\u6027\u3084\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u6319\u52d5\u3092\u3061\u3083\u3093\u3068\u628a\u63e1\u3057\u3066\u306a\u3044\u304b\u3001\u8a8d\u8b58\u3092\u8aa4\u3063\u3066\u307e\u3059\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u30b9\u30c6\u30fc\u30c8\u30d5\u30eb\u578b\u304b\u30b9\u30c6\u30fc\u30c8\u30ec\u30b9\u578b\u304b<\/h3>\n\n\n\n<p>\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u901a\u4fe1\u306f\u307b\u307c\u5168\u3066\u304c\u53cc\u65b9\u5411\u3067\u3059\u306e\u3067\u3001\u30b5\u30fc\u30d0\u3067\u3042\u308c\u3070\u5165\u3063\u3066\u304f\u308b\u65b9\u3060\u3051\u3067\u306f\u7121\u304f\u3001\u51fa\u3066\u3044\u304f\u901a\u4fe1\u3082\u8a31\u53ef\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4f8b\u3048\u3070IP\u304c192.168.5.15\u306e\u30e1\u30fc\u30eb\u30b5\u30fc\u30d0(SMTP\u30b5\u30fc\u30d0)\u3067\u3001Source 172.16.0.1:5555\u21e8Destination 192.168.5.15:25\u3068\u3044\u3046\u901a\u4fe1\u304c\u767a\u751f\u3057\u305f\u969b\u306b\u3001\u9006\u65b9\u5411\u306e\u901a\u4fe1\u3001\u3064\u307e\u308a\u30b5\u30fc\u30d0\u304b\u3089\u898b\u3066Source 192.168.5.15:25\u21e8Destination 172.16.0.1:5555\u306e\u901a\u4fe1\u3092\u3001Inbound\u901a\u4fe1\u306eSource\u3084Destinaion\u3092\u898b\u3066\u81ea\u52d5\u7684\u306b\u8a31\u53ef\u3059\u308b\u306e\u304c\u30b9\u30c6\u30fc\u30c8\u30d5\u30eb\u578b\u3001\u305d\u3046\u3044\u3046\u3044\u3044\u3044\u611f\u3058\u306e\u8a31\u53ef\u3092\u30b9\u30c6\u30fc\u30c8\u30ec\u30b9\u578b\u306eFW\u3067\u3059\u3002\u304b\u306a\u308a\u96d1\u306a\u8aac\u660e\u3067\u3059\u304c\u3002<\/p>\n\n\n\n<p>\u3069\u3061\u3089\u304b\u3092\u63a1\u7528\u3057\u3066\u308b\u304b\u306f\u5b9f\u88c5\u306b\u3088\u308a\u307e\u3059\u3057\u3001\u30b9\u30c6\u30fc\u30c8\u30d5\u30eb\u578b\u3067\u3082\u3042\u3063\u3066\u3082\u30b9\u30c6\u30fc\u30c8\u30d5\u30eb\u306b\u8a31\u53ef\u3059\u308b\u8a2d\u5b9a\u304c\u5165\u3063\u3066\u306a\u3044\u3068\u6a5f\u80fd\u3057\u306a\u3044\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u4f8b\u3048\u3070nftables\u3060\u3068\u300cct state established related accept\u300d\u307f\u305f\u3044\u306a\u30ef\u30fc\u30c9\u3092\u5165\u308c\u3066\u3042\u3052\u306a\u3044\u30b9\u30c6\u30fc\u30c8\u30d5\u30eb\u306b\u52d5\u4f5c\u3057\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>\u30b9\u30c6\u30fc\u30c8\u30d5\u30eb\u578b\u306f\u30b3\u30cd\u30af\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u3092\u7ba1\u7406\u3059\u308b\u90fd\u5408\u4e0a\u3001\u5fc5\u8981\u306a\u30e1\u30e2\u30ea\u3084\u51e6\u7406\u91cf\u304c\u30b9\u30c6\u30fc\u30c8\u30ec\u30b9\u3088\u308a\u91cd\u304f\u306a\u308a\u304c\u3061\u3067\u3001CPU\u3084\u30e1\u30e2\u30ea\u3092\u305d\u308c\u306a\u308a\u306b\u30ea\u30c3\u30c1\u306b\u5fc5\u8981\u3068\u3057\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001CPU\u3084\u30e1\u30e2\u30ea\u304c\u30ea\u30fc\u30f3\u306a\u7d44\u8fbc\u7cfb\u306e\u30b7\u30b9\u30c6\u30e0\u3067\u306f\u3001\u30b9\u30c6\u30fc\u30c8\u30ec\u30b9\u578b\u306e\u30a2\u30af\u30bb\u30b9\u5236\u5fa1\u6a5f\u69cb\u3092\u63a1\u7528\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30b9\u30c6\u30fc\u30c8\u30d5\u30eb\u578b\u306f\u30c6\u30fc\u30d6\u30eb\u3092\u6301\u3063\u3066\u308b\u306e\u3067\u9006\u65b9\u5411\u306e\u901a\u4fe1\u306f\u901a\u4fe1\u7d42\u4e86\u304b\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u307e\u3067\u306f\u8a31\u53ef\u3055\u308c\u307e\u3059\u3002\u9006\u306b\u3001\u30b9\u30c6\u30fc\u30c8\u30ec\u30b9\u578b\u306f\u660e\u793a\u7684\u306b\u9006\u65b9\u5411\u306e\u901a\u4fe1\u3092\u8a31\u53ef\u3057\u306a\u3044\u3068\u901a\u4fe1\u304c\u51fa\u6765\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>\u30b9\u30c6\u30fc\u30c8\u30ec\u30b9\u578b\u306f\u6240\u8b02\u8a31\u53ef\u3055\u308c\u305f\u901a\u4fe1\u306e\u623b\u308a\u306e\u901a\u4fe1\u304b\u3069\u3046\u304b\u3092\u898b\u3066\u3044\u307e\u305b\u3093\u306e\u3067\u3002\u305d\u306e\u305f\u3081\u30b9\u30c6\u30fc\u30ec\u30b9\u5074\u306eACL\u306bDefault Deny\u307f\u305f\u3044\u306a\u306e\u5f37\u529b\u306a\u30d6\u30ed\u30c3\u30af\u6027\u80fd\u3092\u6301\u3064\u30eb\u30fc\u30eb\u3092\u30b9\u30c6\u30fc\u30c8\u30d5\u30eb\u578b\u306e\u30ce\u30ea\u3067\u5165\u308c\u308b\u3068\u3001\u5916\u306b\u5411\u3051\u3066\u63d0\u4f9b\u3057\u3066\u3044\u305f\u30b5\u30fc\u30d3\u30b9\u304c\u30d6\u30ed\u30c3\u30af\u3055\u308c\u3066\u6b62\u307e\u3063\u305f\u308a\u3001\u76ee\u306e\u524d\u306e\u30b3\u30f3\u30bd\u30fc\u30eb\u304c\u56fa\u307e\u308b\u3053\u3068\u304c\u3042\u308b\u306e\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u305f\u3060\u3001\u30b5\u30fc\u30d0\u306e\u5834\u5408\u3001\u8a2d\u8a08\u8005\u3084\u904b\u7528\u8005\u306b\u3088\u3063\u3066\u306fOutbound\u304c\u30ac\u30d0\u30ac\u30d0\u306e\u5834\u5408\u306a\u30b1\u30fc\u30b9\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u3046\u8a00\u3046\u5834\u5408\u306f\u3042\u307e\u308a\u6c17\u306b\u3059\u308b\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001Outbound\u5074\u3082\u3088\u308a\u9069\u5207\u306b\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u3057\u305f\u3044\u5834\u5408\u306f\u6ce8\u610f\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u305d\u306e\u4ed6\u306e\u52d8\u6240<\/h2>\n\n\n\n<p>\u305d\u306e\u307b\u304b\u306bYuaiho\u304c\u601d\u3046ACL\u306e\u30cf\u30de\u308a\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">IP\u91cd\u8907\u306e\u53ef\u5426<\/h3>\n\n\n\n<p>\u3053\u308c\u306fnftables\u306a\u3093\u304b\u304c\u8a72\u5f53\u3059\u308b\u3093\u3067\u3059\u304c\u3001ACL\u5185\u90e8\u3067IP\u91cd\u8907\u3092\u8a8d\u3081\u306a\u3044\u5b9f\u88c5\u3082\u3042\u308a\u307e\u3059\u3002\u5b9f\u88c5\u306b\u3082\u3088\u308a\u307e\u3059\u304c\u3001host\u5358\u4f4d(\/32\u3084\/128)\u3060\u3051\u306f\u306a\u304f\u3001\u30ec\u30f3\u30b8\u3068\u3057\u3066\u91cd\u8907\u3057\u3066\u308b\u306e\u3082\u30c0\u30e1\u306a\u5b9f\u88c5\u3082\u3042\u308a\u3001\u4f8b\u3048\u3070\u4e0b\u8a18\u306e\u3088\u3046\u306a\u30eb\u30fc\u30eb\u306fnft\u30b3\u30de\u30f3\u30c9\u3067\u540c\u4e00\u30bb\u30c3\u30c8\u306b\u5165\u308c\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>192.168.0.0\/24<br>192.168.0.1\/32<\/code><\/pre>\n\n\n\n<p>\u4e00\u65b9\u3001nftables\u306e\u524d\u4e16\u4ee3\u306b\u3042\u305f\u308biptables\u306fIP\u30fbIP\u30ec\u30f3\u30b8\u306e\u91cd\u8907\u3092\u8a31\u5bb9\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u306e\u305f\u3081\u96d1\u306b\u4f5c\u3063\u3066\u3066\u91cd\u8907\u7ba1\u7406\u306a\u3093\u304b\u3057\u3066\u3044\u306a\u3044iptables\u306e\u4e2d\u8eab\u3092\u3001\u4f55\u3082\u8003\u3048\u305a\u306bnftables\u306b\u79fb\u690d\u3057\u3066\u304f\u308b\u3068\u30cf\u30de\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3069\u3046\u306a\u308b\u304b\u3068\u3044\u3046\u3068\u3001\u30ea\u30b9\u30c8\u306e\u5f8c\u308d\u5074\u3067\u91cd\u8907\u3057\u3066\u308b\u3082\u306e\u304c\u5f3e\u304b\u308c\u3066\u3001nft\u306e\u518d\u8d77\u52d5\u306b\u5931\u6557\u3059\u308b\u306a\u3069\u3057\u3066\u30cf\u30de\u308a\u307e\u3059\u3002<strong>\u3068\u3044\u3046\u304b\u3001\u79c1\u306f\u30cf\u30de\u308a\u307e\u3057\u305f<\/strong>\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30d6\u30ed\u30c3\u30af\u30dd\u30ea\u30b7\u30fc\u30fbDeny\u30dd\u30ea\u30b7\u30fc<\/h3>\n\n\n\n<p>\u30d6\u30ed\u30c3\u30af\u30dd\u30ea\u30b7\u30fc\/Deny\u30dd\u30ea\u30b7\u30fc\u3068\u3044\u3046\u306e\u306f\u30eb\u30fc\u30eb\u306a\u3069\u306b\u3088\u3063\u3066Deny\u3055\u308c\u305f\u6642\u3001\u305d\u306e\u5f8cDeny\u3055\u308c\u305f\u901a\u4fe1\u3092\u3069\u3046\u59cb\u672b\u3059\u308b\u304b\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3088\u304f\u3042\u308b\u306e\u306fDROP(\u9759\u304b\u306b\u30d1\u30b1\u30c3\u30c8\u7834\u68c4\u3057\u3066\u7121\u8996\u3059\u308b)\u3059\u308b\u304bREJECT(\u62d2\u7d76\u3057\u305f\u65e8\u306e\u5fdc\u7b54\u3092\u8fd4\u3059)\u3059\u308b\u304b\u3067\u3059\u306d\u3002<\/p>\n\n\n\n<p>REJECT\u306fIP FW\u3060\u3068TCP RST\u7b49\u3092\u8fd4\u3057\u305f\u308a\u3001Web\u30b5\u30fc\u30d0\u7b49\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u5834\u5408\u306f403(Forbidden)\u306e\u3088\u3046\u306a\u62d2\u7d76\u3092\u793a\u3059\u5fdc\u7b54\u3092\u8fd4\u3057\u305f\u308a\u3059\u308b\u3053\u3068\u3067\u3059\u3002<\/p>\n\n\n\n<p>DROP\u3068REJECT\u306e\u3069\u3061\u3089\u304b\u304c\u826f\u3044\u304b\u306f\u8003\u3048\u65b9\u6b21\u7b2c\u3067\u3001\u7d50\u5c40\u306f\u81ea\u5206\u304c\u4f55\u3092\u826f\u3057\u3068\u3059\u308b\u304b\u3067\u3059\u3002\u3053\u308c\u306b\u3064\u3044\u3066\u306f\u4ed6\u306e\u30b5\u30a4\u30c8\u306b\u8aac\u660e\u3092\u8b72\u308a\u307e\u3059\u304c\u3001\u3044\u305a\u308c\u306b\u3057\u3066\u3082\u4e0b\u8a18\u306e3\u8981\u7d20\u306f\u8003\u616e\u3057\u305f\u307b\u3046\u304c\u826f\u3044\u3067\u3059\u3002<\/p>\n\n\n\n<p>1\u3064\u3081\u306f\u30eb\u30fc\u30bf\u3084FW\u306a\u3069\u306eOS\u306e\u524d\u6bb5\u3067\u3082ACL\u3092\u7528\u3044\u3066\u30d1\u30b1\u30c3\u30c8\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u3092\u3057\u3066\u308b\u5834\u5408\u3001\u524d\u6bb5\u306b\u3042\u308b\u30eb\u30fc\u30bf\u3084FW\u3068\u3001\u5f8c\u6bb5\u306eOS\u306eIP FW\u306eDeny\u306e\u6319\u52d5\u306f\u5408\u308f\u305b\u305f\u65b9\u304c\u3044\u3044\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u524d\u6bb5\u3068\u5f8c\u6bb5\u3067Deny\u306e\u6319\u52d5\u3092\u5909\u3048\u308b\u3068\u3001\u300c\u7279\u5b9a\u306e\u30dd\u30fc\u30c8\u4ee5\u5916\u306fREJECT\u3067\u4f55\u304b\u8fd4\u3063\u3066\u304f\u308b\u306e\u306b\u3001\u7279\u5b9a\u306e\u30dd\u30fc\u30c8\u306f\u4f55\u3082\u8fd4\u3063\u3066\u3053\u306a\u3044\u300d\u307f\u305f\u3044\u306b\u6319\u52d5\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u305d\u306e\u30dd\u30fc\u30c8\u306b\u306f\u4f55\u3089\u304b\u306e\u30b5\u30fc\u30d3\u30b9\u304c\u3042\u308b\u3053\u3068\u3092\u6697\u793a\u3059\u308b\u3053\u3068\u306b\u7e4b\u304c\u308a\u307e\u3059\u3002\u3053\u308c\u306f\u7ba1\u7406\u7528\u306eSSH\u7b49\u3001\u96a0\u853d\u3057\u305f\u3044\u30b5\u30fc\u30d3\u30b9\u3084\u30dd\u30fc\u30c8\u3092\u958b\u3044\u3066\u3044\u308b\u5834\u5408\u306f\u9069\u5207\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>2\u3064\u3081\u306fIP FW\u3067DROP\u3092\u884c\u3046\u3068\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304cTCP SYN\u7b49\u3092\u518d\u9001\u3057\u3066\u304f\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002FW\u3067SYN\u306e\u6642\u70b9\u3067\u30ed\u30b0\u51fa\u529b\u3059\u308b\u8a2d\u5b9a\u3092\u3057\u3066\u308b\u3068\u3001DROP\u306e\u5834\u5408\u3053\u306e\u518d\u9001\u306b\u3088\u3063\u3066\u30ed\u30b0\u306e\u884c\u6570\u304c\u7121\u99c4\u306b\u5897\u3048\u307e\u3059\u3002\u5927\u4f532\u301c3\u56de\u518d\u9001\u3057\u3066\u304f\u308b\u306e\u3067\u3001\u3053\u308c\u306b\u4f34\u3063\u3066DROP\u30ed\u30b0\u30822\u301c3\u500d\u7121\u99c4\u306b\u306b\u5897\u3048\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4f53\u611f\u7684\u306a\u50be\u5411\u3067\u306f\u3001\u653b\u6483\u89b3\u70b9\u3067\u306fIP FW\u306e\u5834\u5408\u306fREJECT\u306b\u3057\u3066TCP RST\u9001\u3063\u3066\u304a\u304f\u3068\u5373\u5ea7\u306b\u8ae6\u3081\u3066\u304f\u308c\u308b\u3053\u3068\u304c\u591a\u3044\u3067\u3059\u3002\u305f\u3060\u3001REJECT\u3055\u308c\u3066\u3082\u3081\u3052\u306a\u3044IP\u306f\u3061\u3087\u304f\u3061\u3087\u304f\u3044\u307e\u3059\u3002\u307e\u3058\u3067\u30af\u30bd\u3067\u3059\u306d\u3002\u307e\u305f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u884c\u3046REJECT\u5834\u5408\u3001REJET(Web\u306a\u3089403 Forbidden\u7b49)\u3092\u51fa\u3057\u3066\u3082\u8ae6\u3081\u3066\u304f\u308c\u308b\u306e\u306f\u671f\u5f85\u8584\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"has-small-font-size\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-medium-gray-color\">\u3061\u306a\u307f\u306b\u3001Yuaiho\u306fIP FW\u3067\u306fDROP\u6d3e\u3067\u3059\u3002\u4e0a\u8a18\u306f\u4e00\u898bREJECT\u3092\u63a8\u3057\u3066\u307e\u3059\u304c\u3001Yuaiho\u304c\u6240\u6709\u3059\u308b\u6a5f\u6750\u306fDROP\u3057\u3066\u308b\u3053\u3068\u306e\u65b9\u304c\u5727\u5012\u7684\u306b\u591a\u3044\u3067\u3059\u3002<\/mark><\/p>\n\n\n\n<p>3\u3064\u76ee\u306f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u5834\u5408\u3001DROP\u3092\u8fd4\u3059\u3068\u4f55\u3082\u65b9\u6cd5\u3092\u4e0e\u3048\u306a\u3044\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u304c\u3001REJECT\u5fdc\u7b54\u3092\u8fd4\u3059\u3068\u305d\u306e\u30b5\u30fc\u30d3\u30b9\u304c\u7a3c\u50cd\u3057\u3066\u308b\u3053\u3068\u81ea\u4f53\u306f\u308f\u304b\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002\u3053\u3053\u3067\u30d0\u30ca\u30fc\u96a0\u853d\u306a\u3069\u306e\u8a2d\u5b9a\u304c\u6f0f\u308c\u3066\u3044\u308b\u3068\u3001OS\u3084\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u30d0\u30fc\u30b8\u30e7\u30f3\u306a\u3069\u3082\u308f\u304b\u3063\u3066\u3057\u307e\u3046\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u6700\u5f8c\u306b<\/h2>\n\n\n\n<p>ACL\u306f\u3053\u3093\u306a\u611f\u3058\u3067\u5b9f\u88c5\u3054\u3068\u306b\u52d5\u4f5c\u6319\u52d5\u304c\u7570\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u67d0C\u793e\u306e\u300c\u6697\u9ed9\u306eDeny\u300d\u306f\u7d50\u69cb\u6709\u540d\u3067\u3059\u304c\u3001\u300c\u6697\u9ed9\u306eDeny\u300d\u306f\u5225\u306bACL\u306e\u6a19\u6e96\u4ed5\u69d8\u3067\u3082\u30c7\u30d5\u30a1\u30af\u30c8\u30b9\u30bf\u30f3\u30c0\u30fc\u30c9\u3067\u3082\u3042\u308a\u307e\u305b\u3093\u3002\u3053\u308c\u307e\u3067\u898b\u3066\u304d\u305f\u3088\u3046\u306b\u3001\u672c\u5f53\u306b\u5b9f\u88c5\u3054\u3068\u306b\u9055\u3044\u307e\u3059\u3057\u3001\u306a\u3093\u306a\u3089\u6697\u9ed9\u306eAllow\u3082\u666e\u901a\u306b\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u521d\u3081\u3066\u89e6\u308c\u308b\u30a2\u30af\u30bb\u30b9\u5236\u5fa1\u6a5f\u69cb\u3092\u8a2d\u5b9a\u3059\u308b\u3068\u304d\u306f\u3001\u5c11\u306a\u304f\u3068\u3082\u300c\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u6319\u52d5\u300d\u300c\u30de\u30c3\u30c1\u5f8c\u306e\u6319\u52d5\u300d\u3050\u3089\u3044\u306f\u78ba\u8a8d\u3057\u306a\u3044\u3068\u30ac\u30d0\u30ac\u30d0ACL\u3092\u4f5c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u4e8b\u6545\u3063\u305f\u6642\u306b\u30b7\u30e3\u30ec\u306b\u306a\u3089\u306a\u3044\u3053\u3068\u306b\u306a\u308b\u65b9\u306f\u7279\u306b\u6ce8\u610f\u3057\u307e\u3057\u3087\u3046\u30fb\u30fb\u30fb\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u591a\u304f\u306eNW\u6a5f\u5668\u3084FW\u3001OS\u3001\u30b5\u30fc\u30d0\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306b\u306f\u30a2\u30af\u30bb\u30b9\u5236\u5fa1(\u6a5f\u69cb)\u304c\u5b9f\u88c5\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u3053\u306e\u30a2\u30af\u30bb\u30b9\u5236\u5fa1\u6a5f\u69cb\u306f\u591a\u304f\u306e\u5834\u5408\u3001Allow list(\u30db\u30ef\u30a4\u30c8\u30ea\u30b9\u30c8)\u3084Deny list(\u30d6\u30e9\u30c3\u30af\u30ea\u30b9\u30c8)\u3042\u308b\u3044\u306f\u305d\u306e\u4e21\u65b9\u3092 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"class_list":["post-247","post","type-post","status-publish","format-standard","hentry","category-14"],"_links":{"self":[{"href":"https:\/\/yuaiho.com\/blog\/wp-json\/wp\/v2\/posts\/247","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yuaiho.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yuaiho.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yuaiho.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yuaiho.com\/blog\/wp-json\/wp\/v2\/comments?post=247"}],"version-history":[{"count":9,"href":"https:\/\/yuaiho.com\/blog\/wp-json\/wp\/v2\/posts\/247\/revisions"}],"predecessor-version":[{"id":321,"href":"https:\/\/yuaiho.com\/blog\/wp-json\/wp\/v2\/posts\/247\/revisions\/321"}],"wp:attachment":[{"href":"https:\/\/yuaiho.com\/blog\/wp-json\/wp\/v2\/media?parent=247"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yuaiho.com\/blog\/wp-json\/wp\/v2\/categories?post=247"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yuaiho.com\/blog\/wp-json\/wp\/v2\/tags?post=247"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}