{"id":2300,"date":"2023-05-17T11:06:09","date_gmt":"2023-05-17T02:06:09","guid":{"rendered":"https:\/\/manvscloud.com\/?p=2300"},"modified":"2023-05-17T23:50:37","modified_gmt":"2023-05-17T14:50:37","slug":"ncloud-acgaccess-control-group-%ec%a0%84%ec%b2%b4-%ed%97%88%ec%9a%a9-%ec%a0%95%ec%b1%85-%ed%83%90%ec%a7%80%eb%a5%bc-%ec%9c%84%ed%95%9c-serverless-%ec%8b%9c%ec%8a%a4%ed%85%9c-%ea%b5%ac%ec%b6%95","status":"publish","type":"post","link":"https:\/\/manvscloud.com\/?p=2300","title":{"rendered":"[NCLOUD] ACG(Access Control Group) \uc804\uccb4 \ud5c8\uc6a9 \uc815\ucc45 \ud0d0\uc9c0\ub97c \uc704\ud55c Serverless \uc2dc\uc2a4\ud15c \uad6c\ucd95"},"content":{"rendered":"\n<p>\uc548\ub155\ud558\uc138\uc694 MANVSCLOUD \uae40\uc218\ud604\uc785\ub2c8\ub2e4.<\/p>\n\n\n\n<p>\ub124\uc774\ubc84 \ud074\ub77c\uc6b0\ub4dc \ud50c\ub7ab\ud3fc(NCLOUD)\uc740 \ub2e4\uc591\ud55c \uae30\ub2a5\uacfc \uc11c\ube44\uc2a4\ub97c \uc81c\uacf5\ud558\ub294 \uac15\ub825\ud55c \uad6d\ub0b4 \ud074\ub77c\uc6b0\ub4dc \uc11c\ube44\uc2a4\uc785\ub2c8\ub2e4. \uadf8 \uc911\uc5d0\uc11c\ub3c4 ACG(Access Control Group)\ub294 \uc11c\ubc84 \uc811\uadfc\uc744 \uc81c\uc5b4\ud558\ub294 \uc911\uc694\ud55c \uc11c\ube44\uc2a4\ub85c \uc0ac\uc6a9\uc790\ub294 \uc774\ub97c \ud1b5\ud574 \uc11c\ubc84\uc5d0 \uc811\uadfc\ud558\ub294 \ub124\ud2b8\uc6cc\ud06c\ub97c \uc81c\uc5b4 \ubc0f \uad00\ub9ac\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ud558\uc9c0\ub9cc \uc774 \uc11c\ube44\uc2a4\ub97c \uc798 \ud65c\uc6a9\ud558\uace0 \uc788\ub2e4\ub294 \uae30\uc900\uc740 \ubb34\uc5c7\uc77c\uae4c\uc694? <\/p>\n\n\n\n<p>\uac1c\uc778\uc801\uc778 \uae30\uc900\uc774\ub098 \uae30\uc5c5\uc5d0\uc11c \uc815\ud574\uc838\uc788\ub294 \uac70\ubc84\ub10c\uc2a4 \uadf8\ub9ac\uace0 \uc801\uc6a9\ub41c \ubcf4\uc548 \ucef4\ud50c\ub77c\uc774\uc5b8\uc2a4 \ub4f1\uc5d0 \ub530\ub77c\uc11c \uc5b4\ub290\uc815\ub3c4 \ucc28\uc774\uac00 \uc788\uc744 \uc218\ub294 \uc788\uaca0\uc9c0\ub9cc \uacb0\uad6d ACG \uc124\uc815\uc774 \uc798 \ub418\uc5b4\uc788\ub2e4\ub294 \uae30\uc900\uc740  Source Server\uc640 Destination Server\uac00 \ud1b5\uc2e0\ub418\uc5b4\uc57c\ud560 \ud2b9\uc815 \ud3ec\ud2b8\ub85c\ub9cc \ud1b5\uc2e0\ud560 \uc218 \uc788\ub3c4\ub85d \ud5c8\uc6a9\ub418\uc5b4\uc788\ub294 \uac83\uc785\ub2c8\ub2e4. <\/p>\n\n\n\n<p>\uac00\ub054 \uc6b0\ub9ac\ub294 \ud3b8\ub9ac\ud568\uc744 \ubaa9\uc801\uc73c\ub85c  &#8216;0.0.0.0\/0&#8217; \ub300\uc5ed\uc744 \ud5c8\uc6a9\ud558\ub294 \ud070 \uc704\ud611\uc5d0 \ub178\ucd9c\ub418\uae30\ub3c4 \ud569\ub2c8\ub2e4. \uc774\ub294 \ubaa8\ub4e0 IP \uc8fc\uc18c\uc5d0\uc11c \uc811\uadfc\uc774 \uac00\ub2a5\ud568\uc744 \uc758\ubbf8\ud558\ubbc0\ub85c \ud074\ub77c\uc6b0\ub4dc \uc790\uc0b0\uc5d0 \ub300\ud55c \uacf5\uaca9 \ubc94\uc704\uac00 \uad11\ubc94\uc704\ud574\uc9c8 \uc218 \uc788\uc5b4 ACG \uc124\uc815\uc774 \uc801\uc808\ud788 \uc774\ub8e8\uc5b4\uc838 \uc788\ub294\uc9c0 \ud655\uc778\ud558\uace0 \ud544\uc694\ud55c \ubcf4\uc548 \uc870\uce58\ub97c \ucde8\ud574\uc57c \ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<p>\ubcf8 \ud3ec\uc2a4\ud2b8\uc5d0\uc11c\ub294 ACG \uc804\uccb4 \ud5c8\uc6a9 \ub8f0\uc744 \ud0d0\uc9c0\ud558\uace0 \uc774\ub97c Slack\uc73c\ub85c \uc54c\ub9bc\uc774 \ubc1c\uc0dd\ud558\ub3c4\ub85d \ud558\ub294 \uc2dc\uc2a4\ud15c\uc744 Cloud Functions \uc11c\ube44\uc2a4\ub97c \uc774\uc6a9\ud574 \uad6c\ucd95\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uc54c\uc544\ubcfc \uac83\uc785\ub2c8\ub2e4.<\/p>\n\n\n\n<p>\uc774 \ubc29\ubc95\uc744 \ud1b5\ud574 \ud074\ub77c\uc6b0\ub4dc \ud658\uacbd\uc5d0\uc11c\uc758 \ubcf4\uc548 \uad00\ub9ac\ub97c \ub354\uc6b1 \uac15\ud654\ud558\uace0 \uc2e4\uc2dc\uac04\uc73c\ub85c \ubcf4\uc548 \uc0c1\ud0dc\ub97c \ud30c\uc545\ud558\ub294 \ub370 \ub3c4\uc6c0\uc774 \ub420 \uac83\uc785\ub2c8\ub2e4.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"has-white-color has-vivid-cyan-blue-background-color has-text-color has-background wp-block-heading\"> Slack \uc54c\ub9bc<\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"471\" height=\"531\" src=\"https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2023\/05\/17004348\/acg-detection.png\" alt=\"\" class=\"wp-image-2301\" srcset=\"https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2023\/05\/17004348\/acg-detection.png 471w, https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2023\/05\/17004348\/acg-detection-266x300.png 266w\" sizes=\"(max-width: 471px) 100vw, 471px\" \/><\/figure>\n\n\n\n<p>\ub124\uc774\ubc84 \ud074\ub77c\uc6b0\ub4dc \ud50c\ub7ab\ud3fc\uc758 Cloud Functions\ub97c \uc774\uc6a9\ud558\uc5ec ACG \uc815\ucc45\uc758 0.0.0.0\/0 \ub300\uc5ed \ud5c8\uc6a9\uc744 \ud0d0\uc9c0\ud558\ub294 \ucf54\ub4dc\ub97c \uc2e4\ud589\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc774\ub97c \uc774\uc6a9\ud574 \ud0d0\uc9c0\ud55c \uc704\ud5d8\ud55c ACG \uc815\ucc45\uc5d0 \ub300\ud55c \uc54c\ub9bc\uc744 Slack\uc73c\ub85c \ubc1b\uc744 \uc218 \uc788\ub3c4\ub85d \ud574\ubcf4\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n<div class=\"vlp-link-container vlp-layout-basic wp-block-visual-link-preview-link\"><a href=\"https:\/\/slack.com\/intl\/ko-kr\/\" class=\"vlp-link\" title=\"Slack\uc740 \uc0dd\uc0b0\uc131 \ud50c\ub7ab\ud3fc\uc785\ub2c8\ub2e4\" rel=\"nofollow\" target=\"_blank\"><\/a><div class=\"vlp-layout-zone-side\"><div class=\"vlp-block-2 vlp-link-image\"><img decoding=\"async\" src=\"https:\/\/a.slack-edge.com\/98d3bdc\/marketing\/img\/homepage\/e2e-prospects\/unfurl\/slack-e2e-homepage-unfurl.ko-KR.jpg\" style=\"max-width: 150px; max-height: 150px\" \/><\/div><\/div><div class=\"vlp-layout-zone-main\"><div class=\"vlp-block-0 vlp-link-title\">Slack\uc740 \uc0dd\uc0b0\uc131 \ud50c\ub7ab\ud3fc\uc785\ub2c8\ub2e4<\/div><div class=\"vlp-block-1 vlp-link-summary\">Slack\uc740 \ud300\uacfc \ucee4\ubba4\ub2c8\ucf00\uc774\uc158\ud560 \uc218 \uc788\ub294 \uc0c8\ub85c\uc6b4 \ubc29\ubc95\uc785\ub2c8\ub2e4. \uc774\uba54\uc77c\ubcf4\ub2e4 \ube60\ub974\uace0, \ub354 \uc870\uc9c1\uc801\uc774\uba70, \ud6e8\uc52c \uc548\uc804\ud569\ub2c8\ub2e4.<\/div><\/div><\/div>\n\n\n<p>\uba3c\uc800 Slack \uc124\uce58 \ubc0f \uac00\uc785\uc774 \ub418\uc5b4\uc788\uc9c0 \uc54a\ub2e4\uba74 \uc704 \ub9c1\ud06c\ub97c \ud1b5\ud574 \uc9c4\ud589\ud574\uc8fc\uc2dc\uace0 \uc6cc\ud06c\uc2a4\ud398\uc774\uc2a4 \uc0dd\uc131 \ud6c4 \ubaa8\ub2c8\ud130\ub9c1 \uc54c\ub9bc\uc744 \ubc1b\uc744 \uc804\uc6a9 \ucc44\ub110\uc744 \ud558\ub098 \uc0dd\uc131\ud574\uc90d\ub2c8\ub2e4.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"773\" height=\"770\" src=\"https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2022\/08\/16161949\/slack-channel.png\" alt=\"\" class=\"wp-image-1769\" srcset=\"https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2022\/08\/16161949\/slack-channel.png 773w, https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2022\/08\/16161949\/slack-channel-300x300.png 300w, https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2022\/08\/16161949\/slack-channel-150x150.png 150w, https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2022\/08\/16161949\/slack-channel-768x765.png 768w\" sizes=\"(max-width: 773px) 100vw, 773px\" \/><\/figure>\n\n\n\n<p>\uc774\ud6c4 [\uc571 \ucd94\uac00]\uc5d0\uc11c incoming webhooks\uc744 \uac80\uc0c9\ud558\uba74 \uc0ac\uc6a9 \uac00\ub2a5\ud55c \uc571\uc774 \uc544\ub798 \uadf8\ub9bc\uacfc \uac19\uc774 \ubcf4\uc774\ub294 \uac83\uc744 \ud655\uc778\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"471\" src=\"https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2022\/08\/16162001\/slack-app-1024x471.png\" alt=\"\" class=\"wp-image-1770\" srcset=\"https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2022\/08\/16162001\/slack-app-1024x471.png 1024w, https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2022\/08\/16162001\/slack-app-300x138.png 300w, https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2022\/08\/16162001\/slack-app-768x353.png 768w, https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2022\/08\/16162001\/slack-app-1080x497.png 1080w, https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2022\/08\/16162001\/slack-app.png 1141w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\uc2ac\ub799\uc5d0\uc11c \uc124\uc815 \ud574\uc8fc\uc5b4\uc57c\ud560 \ubd80\ubd84\uc740 \ud06c\uac8c \uc5c6\uc2b5\ub2c8\ub2e4. (\uc124\uce58+\uac00\uc785+\uc571 \ucd94\uac00)<\/p>\n\n\n\n<p>\uc774\uc81c \ucd94\uac00\ud55c Incoming WebHooks \uc571\uc744 \uc124\uc815\ud574\uc8fc\uc5b4\uc57c\ud558\ub294\ub370 \uc774 \ubd80\ubd84 \uc5ed\uc2dc \ud06c\uac8c \uc5b4\ub835\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<p>\uba3c\uc800 [Slack\uc5d0 \ucd94\uac00] \ub97c \ub20c\ub7ec \uc571\uc744 \ucd94\uac00\ud574\uc90d\uc2dc\ub2e4.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"497\" src=\"https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2022\/08\/16162937\/webhook-1024x497.png\" alt=\"\" class=\"wp-image-1771\" srcset=\"https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2022\/08\/16162937\/webhook-1024x497.png 1024w, https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2022\/08\/16162937\/webhook-300x146.png 300w, https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2022\/08\/16162937\/webhook-768x373.png 768w, https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2022\/08\/16162937\/webhook-1080x524.png 1080w, https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2022\/08\/16162937\/webhook.png 1495w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\uc774\ud6c4 \uc0c8\ub85c\uc6b4 \ud654\uba74\uc73c\ub85c \ub118\uc5b4\uac00\uac8c\ub418\uba74 \uadf8\ub0e5 \ucb48\uc6b1 \ub0b4\ub824\uc640\uc11c \uc544\ub798 \uadf8\ub9bc\uacfc \uac19\uc740 \ubd80\ubd84\ub9cc \uc124\uc815\ud574\uc8fc\uace0 \ubcf5\uc0ac\ud574\uc8fc\uba74 \ub429\ub2c8\ub2e4.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"952\" src=\"https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2022\/08\/16162948\/webhook-config-1024x952.png\" alt=\"\" class=\"wp-image-1772\" srcset=\"https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2022\/08\/16162948\/webhook-config-1024x952.png 1024w, https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2022\/08\/16162948\/webhook-config-300x279.png 300w, https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2022\/08\/16162948\/webhook-config-768x714.png 768w, https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2022\/08\/16162948\/webhook-config-1080x1004.png 1080w, https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2022\/08\/16162948\/webhook-config.png 1511w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul><li><strong>\ucc44\ub110\uc5d0 \ud3ec\uc2a4\ud2b8<\/strong>&nbsp;: \uc774 \ubd80\ubd84\uc740 \uc704 Slack\uc5d0\uc11c \uc0dd\uc131\ud574\uc900 \ucc44\ub110\uc744 \uc120\ud0dd\ud574\uc90d\ub2c8\ub2e4.<\/li><li><strong>\uc6f9\ud6c4\ud06c URL<\/strong>&nbsp;: \ud574\ub2f9 URL\uc740&nbsp;<strong>[URL \ubcf5\uc0ac]<\/strong>\ub97c \uc774\uc6a9\ud574 \ub530\ub85c \ubcf5\uc0ac\ud574\uc8fc\uc138\uc694.<br>Cloud Functions \ucf54\ub4dc\uc5d0 \ud574\ub2f9 URL\uc744 \ucd94\uac00\ud560 \uac83\uc785\ub2c8\ub2e4.<\/li><li><strong>\uc774\ub984 \uc0ac\uc6a9\uc790 \uc9c0\uc815&nbsp;<\/strong>: \uc608\ub97c \ub4e4\uc5b4 ncloud-cloud-insight \ub77c\uace0 \uc9c0\uc815\ud558\uba74 ncloud-cloud-insight\uc774\ub77c\ub294<br>\uc774\ub984\uc758 \ubd07\uc774 \uc54c\ub9bc\uc744 \uacc4\uc18d \ud574\uc900\ub2e4\uace0 \ubcf4\uba74 \ub429\ub2c8\ub2e4.<\/li><li><strong>[\uc124\uc815 \uc800\uc7a5]<\/strong><\/li><\/ul>\n\n\n\n<p>\uc774\ubbf8\uc9c0 \uc5c5\ub85c\ub4dc \ub4f1 \ub098\uba38\uc9c0 \uc124\uc815\uc740 \uc790\uc720\uc785\ub2c8\ub2e4.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"has-white-color has-vivid-green-cyan-background-color has-text-color has-background wp-block-heading\"> Cloud Functions<\/h3>\n\n\n\n<p><em># VPC, Server \uc0dd\uc131\uc5d0 \ub300\ud55c \uac00\uc774\ub4dc\ub294 \uc0dd\ub7b5\ud569\ub2c8\ub2e4.<br># Python\uc740 3.7 \ubc84\uc804\uc774 \uc0ac\uc6a9\ub418\uc5c8\uc2b5\ub2c8\ub2e4.<\/em><\/p>\n\n\n\n<p>\ucd5c\uadfc \ud3ec\uc2a4\ud2b8\uac00 \ub300\ubd80\ubd84 Cloud Functions\uc744 \uc774\uc6a9\ud55c \ub0b4\uc6a9\uc774 \ub300\ubd80\ubd84\uc774\ub2e4\ubcf4\ub2c8 Trigger\ub098 Package\uc5d0 \ub300\ud55c \ub0b4\uc6a9\uc740 \uc0dd\ub7b5\ud558\uace0 \ubc14\ub85c Action\uc5d0 \ub300\ud55c \ub0b4\uc6a9\uc744 \uc791\uc131\ud574\ubcf4\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<ul><li><strong>\ud0c0\uc785<\/strong>&nbsp;: \uae30\ubcf8<\/li><li><strong>Action \uc774\ub984, \uc124\uba85<\/strong>&nbsp;: \uc790\uc720\ub86d\uac8c \uc785\ub825<\/li><li><strong>\uc5b8\uc5b4<\/strong>(\uc18c\uc2a4\ucf54\ub4dc) : Python 3.7<\/li><li><strong>\ud0c0\uc785<\/strong>(\uc18c\uc2a4\ucf54\ub4dc) : \ucf54\ub4dc<\/li><\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import requests\nimport time\nimport base64\nimport hashlib\nimport hmac\nimport json\nimport urllib.request\n\nmethod = \"GET\"\ntimestamp = int(time.time() * 1000)\ntimestamp = str(timestamp)\napi_server = \"https:\/\/ncloud.apigw.ntruss.com\"\n\ndef ACG_LIST(REGION, access_key, secret_key):\n    method = \"GET\"\n    timestamp = str(int(time.time() * 1000))\n    api_server = \"https:\/\/ncloud.apigw.ntruss.com\"\n\n    result = []\n\n    uri = \"\/vserver\/v2\/getAccessControlGroupList\"\n    uri = uri + \"?responseFormatType=json&amp;regionCode=\" + REGION\n\n    message = method + \" \" + uri + \"\\n\" + timestamp + \"\\n\" + access_key\n    message = bytes(message, 'UTF-8')\n    signingKey = base64.b64encode(hmac.new(secret_key, message, digestmod=hashlib.sha256).digest())\n\n    http_header = {\n        'x-ncp-apigw-signature-v2': signingKey,\n        'x-ncp-apigw-timestamp': timestamp,\n        'x-ncp-iam-access-key': access_key\n    }\n\n    response = requests.get(api_server + uri, headers=http_header)\n\n    data = json.loads(response.text)\n\n    for acg in data['getAccessControlGroupListResponse']['accessControlGroupList']:\n        result.append((acg['accessControlGroupNo'], acg['accessControlGroupName']))\n\n    return result\n\n\ndef ACG_DETECTION(REGION, access_key, secret_key, exceptions=None):\n    ANY_DATA = []\n    secret_key = bytes(secret_key, 'UTF-8')\n\n    ACG_NO = ACG_LIST(REGION, access_key, secret_key)\n\n    for acg in ACG_NO:\n        if acg[0] in exceptions:  \n            continue\n\n        uri = \"\/vserver\/v2\/getAccessControlGroupRuleList\"\n        uri = uri + \"?responseFormatType=json&amp;regionCode=\" + REGION + \"&amp;accessControlGroupNo=\" + acg[0]\n\n        message = method + \" \" + uri + \"\\n\" + timestamp + \"\\n\" + access_key\n        message = bytes(message, 'UTF-8')\n        signingKey = base64.b64encode(hmac.new(secret_key, message, digestmod=hashlib.sha256).digest())\n\n        http_header = {\n            'x-ncp-apigw-signature-v2': signingKey,\n            'x-ncp-apigw-timestamp': timestamp,\n            'x-ncp-iam-access-key': access_key\n        }\n\n        response = requests.get(api_server + uri, headers=http_header)\n\n        data = json.loads(response.text)\n\n        for rule in data['getAccessControlGroupRuleListResponse']['accessControlGroupRuleList']:\n            if rule['ipBlock'] == '0.0.0.0\/0' and rule['portRange'] not in ['80', '443']:   # \uc608\uc678 \ucc98\ub9ac\ud560 \ud3ec\ud2b8\n\n                ANY_DATA.append({\n                    \"accessControlGroupNo\": rule['accessControlGroupNo'],\n                    \"accessControlGroupName\": acg[1],  # add the ACG name\n                    \"protocol\": rule['protocolType']['code'],\n                    \"ipBlock\": rule['ipBlock'],\n                    \"portRange\": rule['portRange'],\n                    \"type\": rule['accessControlGroupRuleType']['codeName']\n                })\n\n    return ANY_DATA\n\ndef post_slack(toSlack):\n    WEBHOOK_URL = \"\ubcf5\uc0ac\ud574\ub454 WebHook URL\"\n    message = toSlack\n    send_data = {\n        \"text\": message,\n    }\n\n    send_text = json.dumps(send_data)\n\n    request = urllib.request.Request(\n        WEBHOOK_URL,\n        data=send_text.encode('utf-8'),\n    )\n\n    with urllib.request.urlopen(request) as response:\n        slack_message = response.read()\n        \ndef main(args):\n    REGION = args[\"REGION\"]\n    access_key = args[\"NCLOUD_ACCESS_KEY\"]\n    secret_key = args[\"NCLOUD_SECRET_KEY\"]\n    exceptions = ['11111', '22222']  # \uc608\uc678 \ucc98\ub9ac\ud560 ACG\uc758 ID\n\n    ACG_DATA = ACG_DETECTION(REGION, access_key, secret_key, exceptions)\n\n    for acg in ACG_DATA:\n        ACG_NO = f\"{acg['accessControlGroupNo']} ({acg['accessControlGroupName']})\"  # include the ACG name\n        PROTOCOL = f\"{acg['protocol']}\"\n        IP = f\"{acg['ipBlock']}\"\n        PORT = f\"{acg['portRange']}\"\n        TYPE = f\"{acg['type']}\"\n\n        post_slack(\"ACG_ID :\" + ACG_NO + \"\\n PROTOCOL:\" + PROTOCOL + \"\\n IP : \" + IP + \"\\n \ud3ec\ud2b8:\" + PORT + \"\\n TYPE: \" + TYPE)\n\n    return {'status': 'OK'}\n\n<\/pre>\n\n\n\n<p>\uc704 \ucf54\ub4dc\uc5d0\uc11c \ud544\uc694\uc5d0 \ub9de\uac8c \uc218\uc815 \ubc0f \ucd94\uac00\uac00 \uc9c4\ud589\ub418\uc5b4\uc57c\ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<p>\ud574\ub2f9 \ucf54\ub4dc\uc5d0\uc11c\ub294 80\uacfc 443\ud3ec\ud2b8\ub294 \uc608\uc678 \ucc98\ub9ac \ud3ec\ud2b8\ub85c \uc9c0\uc815\ub418\uc5b4 \uc788\uc2b5\ub2c8\ub2e4. <br>\ub610\ud55c \uc704\uc5d0\uc11c Incoming WebHooks \uc571 \ucd94\uac00 \ud6c4 \ubcf5\uc0ac\ud574\ub454 WebHook URL\uc744 \ucf54\ub4dc\uc5d0 \uc801\uc808\ud788 \ucd94\uac00\ud574\uc90d\ub2c8\ub2e4. \ucd94\uac00\ub85c \uc608\uc678 \ucc98\ub9ac\uac00 \ud544\uc694\ud55c ACG\uac00 \uc788\ub2e4\uba74 exceptions \ubd80\ubd84\uc5d0 \uc608\uc678 \ucc98\ub9ac\ud560 ACG ID\ub97c \ucd94\uac00\ud558\uc5ec \ucd94\uac00\ud55c ACG\uc5d0 \ub300\ud574\uc11c\ub294 \uc815\ucc45 \uc810\uac80\uc5d0 \ub300\ud55c \uacb0\uacfc\ub97c \uc608\uc678 \ucc98\ub9ac\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. <\/p>\n\n\n\n<ul><li><strong>\ub514\ud3f4\ud2b8 \ud30c\ub77c\ubbf8\ud130(JSON)<\/strong><\/li><\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"json\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\"VPC_ID\":\"6585\",\"NCLOUD_ACCESS_KEY\":\"AAAAAAAAAAA\",\"NCLOUD_SECRET_KEY\":\"BBBBBBBBBBBBBBBBBB\",\"REGION\":\"KR\"}<\/pre>\n\n\n\n<p><strong>VPC_ID<\/strong>&nbsp;: VPC\uc758 ID<br><strong>NCLOUD_ACCESS_KEY<\/strong>&nbsp;: \ud574\ub2f9 \ucf54\ub4dc\uac00 \ub3d9\uc791\ud558\uae30 \uc704\ud55c \ucd5c\uc18c\ud55c\uc758 \uad8c\ud55c\uc744 \uac00\uc9c4 ACCESS KEY<br><strong>NCLOUD_SECRET_KEY<\/strong>&nbsp;: \uc704 ACCESS KEY\uc758 SECRET KEY<br><strong>REGION<\/strong> : \ub9ac\uc804 \ucf54\ub4dc<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"has-white-color has-luminous-vivid-amber-background-color has-text-color has-background wp-block-heading\"> Result<\/h3>\n\n\n\n<p>\uc704 Cloud Functions \uc0dd\uc131 \uacfc\uc815\uc744 \ub9c8\uce5c \ud6c4 Action \uc2e4\ud589 \uc2dc 0.0.0.0\/0 \uc815\ucc45\uc774 \uc788\uc744 \uacbd\uc6b0 \uc544\ub798\uc640 \uac19\uc774 Slack\uc744 \ud1b5\ud574 \uc54c\ub9bc\uc744 \ubc1b\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"477\" src=\"https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2023\/05\/17010252\/acg-detection-slack-1024x477.png\" alt=\"\" class=\"wp-image-2302\" srcset=\"https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2023\/05\/17010252\/acg-detection-slack-1024x477.png 1024w, https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2023\/05\/17010252\/acg-detection-slack-300x140.png 300w, https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2023\/05\/17010252\/acg-detection-slack-768x357.png 768w, https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2023\/05\/17010252\/acg-detection-slack-1536x715.png 1536w, https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2023\/05\/17010252\/acg-detection-slack-2048x953.png 2048w, https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2023\/05\/17010252\/acg-detection-slack-1080x503.png 1080w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>ACG\uc758 \uc774\ub984\uacfc \ud568\uaed8 \uc5b4\ub5a4 \uc815\ucc45\uc774 \uc804\uccb4 \ud5c8\uc6a9\ub418\uc5c8\ub294\uc9c0\ub97c \ubc14\ub85c \ud655\uc778\ud560 \uc218 \uc788\uc73c\ubbc0\ub85c \uad00\ub9ac\uc790\uac00 \uc54c\ub9bc\uc744 \ud1b5\ud574 \uc989\uac01\uc801\uc778 \ub300\uc751\uc774 \uac00\ub2a5\ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"has-white-color has-cyan-bluish-gray-background-color has-text-color has-background wp-block-heading\"> Personal Comments<\/h3>\n\n\n\n<p>\uc9c0\uae08\uae4c\uc9c0 \ub124\uc774\ubc84 \ud074\ub77c\uc6b0\ub4dc \ud50c\ub7ab\ud3fc\uc758 ACG(Access Control Group) \uc815\ucc45\uc744 Cloud Functions\uc73c\ub85c \uc810\uac80\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uc54c\uc544\ubcf4\uc558\uc2b5\ub2c8\ub2e4. \uc774\ub97c \ud1b5\ud574 \uc704\ud5d8\ud55c &#8216;0.0.0.0\/0&#8217; \ub300\uc5ed\uc744 \ud5c8\uc6a9\ud558\ub294 ACG \uc815\ucc45\uc744 \ud0d0\uc9c0\ud558\uace0 \uc774\uc5d0 \ub300\ud55c \uc54c\ub9bc\uc744 \ubc1b\uc744 \uc218 \uc788\ub294 \uc2dc\uc2a4\ud15c\uc744 \uad6c\ucd95\ud574\ubcf4\uc558\uc2b5\ub2c8\ub2e4. \uc774\ub7ec\ud55c \ubc29\ubc95\uc740 \ud074\ub77c\uc6b0\ub4dc \ud658\uacbd\uc5d0\uc11c\uc758 \ubcf4\uc548 \uad00\ub9ac\ub97c \uac15\ud654\ud558\ub294\ub370 \ud070 \ub3c4\uc6c0\uc774 \ub420 \uac83\uc785\ub2c8\ub2e4.<\/p>\n\n\n\n<p>Cloud Functions\uc640 Slack\uc758 Incoming WebHooks \uc571\uc744 \uc774\uc6a9\ud558\uba74 \ubcf5\uc7a1\ud55c \uc778\ud504\ub77c \uc5c6\uc774\ub3c4 \uc2e4\uc2dc\uac04 \ubcf4\uc548 \uc54c\ub9bc \uc2dc\uc2a4\ud15c\uc744 \uad6c\ucd95\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc774\ub294 \uc2dc\uc2a4\ud15c\uc744 \ub354\uc6b1 \uc720\uc5f0\ud558\uac8c \ub9cc\ub4e4\uace0 \ubcf4\uc548 \uc774\uc288\uc5d0 \ub300\ud55c \uc2e0\uc18d\ud55c \ub300\uc751\uc744 \uac00\ub2a5\ud558\uac8c \ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<p>\uc774 \ud3ec\uc2a4\ud2b8\uac00 \uc5ec\ub7ec\ubd84\uc758 \ud074\ub77c\uc6b0\ub4dc \ubcf4\uc548 \uac15\ud654\uc5d0 \ub3c4\uc6c0\uc774 \ub418\uae38 \ubc14\ub78d\ub2c8\ub2e4.<\/p>\n\n\n\n<p>\uae34 \uae00 \uc77d\uc5b4\uc8fc\uc154\uc11c \uac10\uc0ac\ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"773\" height=\"133\" src=\"https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2021\/08\/12213914\/Ncloud_Master_logo-1.png\" alt=\"\" class=\"wp-image-1234\" srcset=\"https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2021\/08\/12213914\/Ncloud_Master_logo-1.png 773w, https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2021\/08\/12213914\/Ncloud_Master_logo-1-300x52.png 300w, https:\/\/cdn.manvscloud.com\/wp-content\/uploads\/2021\/08\/12213914\/Ncloud_Master_logo-1-768x132.png 768w\" sizes=\"(max-width: 773px) 100vw, 773px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\uc548\ub155\ud558\uc138\uc694 MANVSCLOUD \uae40\uc218\ud604\uc785\ub2c8\ub2e4. \ub124\uc774\ubc84 \ud074\ub77c\uc6b0\ub4dc \ud50c\ub7ab\ud3fc(NCLOUD)\uc740 \ub2e4\uc591\ud55c \uae30\ub2a5\uacfc \uc11c\ube44\uc2a4\ub97c \uc81c\uacf5\ud558\ub294 \uac15\ub825\ud55c \uad6d\ub0b4 \ud074\ub77c\uc6b0\ub4dc \uc11c\ube44\uc2a4\uc785\ub2c8\ub2e4. \uadf8 \uc911\uc5d0\uc11c\ub3c4 ACG(Access Control Group)\ub294 \uc11c\ubc84 \uc811\uadfc\uc744 \uc81c\uc5b4\ud558\ub294 \uc911\uc694\ud55c \uc11c\ube44\uc2a4\ub85c \uc0ac\uc6a9\uc790\ub294 \uc774\ub97c \ud1b5\ud574 \uc11c\ubc84\uc5d0 \uc811\uadfc\ud558\ub294 \ub124\ud2b8\uc6cc\ud06c\ub97c \uc81c\uc5b4 \ubc0f \uad00\ub9ac\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ud558\uc9c0\ub9cc \uc774 \uc11c\ube44\uc2a4\ub97c \uc798 \ud65c\uc6a9\ud558\uace0 \uc788\ub2e4\ub294 \uae30\uc900\uc740 \ubb34\uc5c7\uc77c\uae4c\uc694? \uac1c\uc778\uc801\uc778 \uae30\uc900\uc774\ub098 \uae30\uc5c5\uc5d0\uc11c \uc815\ud574\uc838\uc788\ub294 \uac70\ubc84\ub10c\uc2a4 \uadf8\ub9ac\uace0 \uc801\uc6a9\ub41c \ubcf4\uc548 \ucef4\ud50c\ub77c\uc774\uc5b8\uc2a4 \ub4f1\uc5d0 \ub530\ub77c\uc11c \uc5b4\ub290\uc815\ub3c4 \ucc28\uc774\uac00 \uc788\uc744 \uc218\ub294 \uc788\uaca0\uc9c0\ub9cc \uacb0\uad6d ACG \uc124\uc815\uc774 \uc798 \ub418\uc5b4\uc788\ub2e4\ub294 \uae30\uc900\uc740 Source Server\uc640 Destination Server\uac00 \ud1b5\uc2e0\ub418\uc5b4\uc57c\ud560 \ud2b9\uc815 \ud3ec\ud2b8\ub85c\ub9cc \ud1b5\uc2e0\ud560 \uc218 \uc788\ub3c4\ub85d \ud5c8\uc6a9\ub418\uc5b4\uc788\ub294 \uac83\uc785\ub2c8\ub2e4. \uac00\ub054 \uc6b0\ub9ac\ub294 \ud3b8\ub9ac\ud568\uc744 \ubaa9\uc801\uc73c\ub85c &#8216;0.0.0.0\/0&#8217; \ub300\uc5ed\uc744 \ud5c8\uc6a9\ud558\ub294 \ud070 \uc704\ud611\uc5d0 \ub178\ucd9c\ub418\uae30\ub3c4 \ud569\ub2c8\ub2e4. \uc774\ub294 \ubaa8\ub4e0 IP \uc8fc\uc18c\uc5d0\uc11c \uc811\uadfc\uc774 \uac00\ub2a5\ud568\uc744 \uc758\ubbf8\ud558\ubbc0\ub85c \ud074\ub77c\uc6b0\ub4dc \uc790\uc0b0\uc5d0 \ub300\ud55c \uacf5\uaca9 \ubc94\uc704\uac00 \uad11\ubc94\uc704\ud574\uc9c8 \uc218 \uc788\uc5b4 ACG \uc124\uc815\uc774 \uc801\uc808\ud788 \uc774\ub8e8\uc5b4\uc838 \uc788\ub294\uc9c0 \ud655\uc778\ud558\uace0 \ud544\uc694\ud55c \ubcf4\uc548 \uc870\uce58\ub97c \ucde8\ud574\uc57c \ud569\ub2c8\ub2e4. \ubcf8 \ud3ec\uc2a4\ud2b8\uc5d0\uc11c\ub294 ACG \uc804\uccb4 \ud5c8\uc6a9 \ub8f0\uc744 \ud0d0\uc9c0\ud558\uace0 \uc774\ub97c Slack\uc73c\ub85c \uc54c\ub9bc\uc774 \ubc1c\uc0dd\ud558\ub3c4\ub85d \ud558\ub294 \uc2dc\uc2a4\ud15c\uc744 Cloud Functions \uc11c\ube44\uc2a4\ub97c \uc774\uc6a9\ud574 \uad6c\ucd95\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uc54c\uc544\ubcfc \uac83\uc785\ub2c8\ub2e4. \uc774 \ubc29\ubc95\uc744 \ud1b5\ud574 \ud074\ub77c\uc6b0\ub4dc \ud658\uacbd\uc5d0\uc11c\uc758 \ubcf4\uc548 \uad00\ub9ac\ub97c \ub354\uc6b1 \uac15\ud654\ud558\uace0 \uc2e4\uc2dc\uac04\uc73c\ub85c \ubcf4\uc548 \uc0c1\ud0dc\ub97c \ud30c\uc545\ud558\ub294 \ub370 \ub3c4\uc6c0\uc774 \ub420 \uac83\uc785\ub2c8\ub2e4. Slack \uc54c\ub9bc \ub124\uc774\ubc84 \ud074\ub77c\uc6b0\ub4dc \ud50c\ub7ab\ud3fc\uc758 Cloud Functions\ub97c \uc774\uc6a9\ud558\uc5ec ACG \uc815\ucc45\uc758 0.0.0.0\/0 \ub300\uc5ed \ud5c8\uc6a9\uc744 \ud0d0\uc9c0\ud558\ub294 \ucf54\ub4dc\ub97c \uc2e4\ud589\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc774\ub97c \uc774\uc6a9\ud574 \ud0d0\uc9c0\ud55c \uc704\ud5d8\ud55c ACG \uc815\ucc45\uc5d0 \ub300\ud55c \uc54c\ub9bc\uc744 Slack\uc73c\ub85c \ubc1b\uc744 \uc218 \uc788\ub3c4\ub85d \ud574\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \uba3c\uc800 Slack \uc124\uce58 \ubc0f \uac00\uc785\uc774 \ub418\uc5b4\uc788\uc9c0 \uc54a\ub2e4\uba74 \uc704 \ub9c1\ud06c\ub97c \ud1b5\ud574 \uc9c4\ud589\ud574\uc8fc\uc2dc\uace0 \uc6cc\ud06c\uc2a4\ud398\uc774\uc2a4 \uc0dd\uc131 \ud6c4 \ubaa8\ub2c8\ud130\ub9c1 \uc54c\ub9bc\uc744 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"[NCLOUD] ACG(Access Control Group) \uc804\uccb4 \ud5c8\uc6a9 \uc815\ucc45 \ud0d0\uc9c0\ub97c \uc704\ud55c Serverless \uc2dc\uc2a4\ud15c \uad6c\ucd95","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3],"tags":[297,299,457,243,867,656,32,87,91,17,90,16,126,220,805,654,655,89,202,398,540,221,866,864,865],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/manvscloud.com\/index.php?rest_route=\/wp\/v2\/posts\/2300"}],"collection":[{"href":"https:\/\/manvscloud.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/manvscloud.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/manvscloud.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/manvscloud.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2300"}],"version-history":[{"count":3,"href":"https:\/\/manvscloud.com\/index.php?rest_route=\/wp\/v2\/posts\/2300\/revisions"}],"predecessor-version":[{"id":2307,"href":"https:\/\/manvscloud.com\/index.php?rest_route=\/wp\/v2\/posts\/2300\/revisions\/2307"}],"wp:attachment":[{"href":"https:\/\/manvscloud.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2300"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/manvscloud.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2300"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/manvscloud.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2300"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}