<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[eCloudture - Medium]]></title>
        <description><![CDATA[Enable Next-Generation Cloud Talents - Medium]]></description>
        <link>https://medium.com/ecloudture?source=rss----55265c636a4b---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>eCloudture - Medium</title>
            <link>https://medium.com/ecloudture?source=rss----55265c636a4b---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 09:21:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/ecloudture" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[SpringShell — Spring Core 0day REC 漏洞說明（CVE-2022–22965）]]></title>
            <link>https://medium.com/ecloudture/springshell-spring-core-0day-rec-%E6%BC%8F%E6%B4%9E%E8%AA%AA%E6%98%8E-cve-2022-22965-4854c9a316e5?source=rss----55265c636a4b---4</link>
            <guid isPermaLink="false">https://medium.com/p/4854c9a316e5</guid>
            <category><![CDATA[spring]]></category>
            <category><![CDATA[cve]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Kun Yi Pan]]></dc:creator>
            <pubDate>Fri, 15 Apr 2022 06:36:27 GMT</pubDate>
            <atom:updated>2022-04-15T06:36:27.265Z</atom:updated>
            <content:encoded><![CDATA[<h3>SpringShell — Spring Core 0day REC 漏洞說明（CVE-2022–22965）</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cTqupU5LC8R7Vsn1Vs80HQ.png" /></figure><p><a href="https://github.com/spring-projects/spring-framework">Spring Framework</a> 集結旗下所有 Spring Projects 提供全站式的模組框架，有 Web、AOP、Data Access/Integration、Core controller…等模組，主要協助 Java developer 開發出架構完善、維護性高且測試方便的應用程式，一般常聽到的稱呼為「Spring」。</p><p>此安全漏洞於 3/31 被賦予 CVE 編號 <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-22965">CVE-2022–22965</a>，並正式以 「SpringShell 」作為代稱。</p><p>在 3/29 有研究人員揭露存在於 Spring Core 模組當中的 zero-day 零時差漏洞，建議在 Spring 官方修補釋出之前，Spring Framework 的使用者可以先行限制「DataBinder」的 Class 使用，得以緩解此 PoC 攻擊程式曝光而造成的安全風險。</p><p>透過釋出的 PoC 範例 <a href="https://github.com/tweedge/springcore-0day-en">tweedge/springcore-0day-en</a> ，可以得知該漏洞的先決條件：</p><ul><li>使用 JDK 9+ 的版本</li><li>使用 Spring Beans</li><li>使用 Spring Parameter Binding</li><li>Spring Parameter Binding 必須設定為使用 non-basic parameter type， 像是 POJOs 即可</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*exG7awTjhy9jTBDJbDjoJg.png" /></figure><p>在以 POJO 型態執行 DataBinder 動作時，該研究人員發現在 DataBinder 的過程中出現了一個 Class ，攻擊者可以以類似操作針對該 Class 做參數的改寫，進而透過 HTTP Request &amp; HTTP Header 傳入相關攻擊行為、入侵至 Server 當中執行 Shell，實現 WebShell 來做 RCE 遠端執行程式碼攻擊。</p><p>SpringShell 的漏洞執行相當簡單，但因為其要被觸發的條件過於的「嚴苛」，需要在特定 DataBinder 的動作底下以特定的 Payload 來傳遞攻擊內容，才能觸發該漏洞。</p><p>也因為其「規則」明確，可以透過 WAF 做 HTTP/S、Layer 7 防護擋掉 Injection，或是限制 DataBinder 的功能來規避掉，因此大多數的資安廠商與社群認為 SpringShell 的嚴重性遠不如 Log4Shell 危險。</p><h3>漏洞 Demo</h3><ol><li>部署 Vulnerable application，訪問其應用</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zk2TgkJiRnVDT1bfJiku1Q.png" /><figcaption>Visiting vulnerable application</figcaption></figure><p>2. 執行範例腳本 <a href="https://github.com/dinosn/spring-core-rce/blob/main/test.py">spring-core-rce/test.py</a>，確認漏洞是否存在</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VG1MGOvW30N7809AoUG95A.png" /><figcaption>Sample — Inject the webshell</figcaption></figure><p>3. 若漏洞存在，腳本執行後會回傳 WebShell 位址</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g805YP8tx_BGRFdtvhCpng.png" /><figcaption>Return the webshell endpoint</figcaption></figure><p>4. 透過 WebShell 執行 RCE，取得相關資訊</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BGRPUD7F8W_CXyoKkWPn0Q.png" /><figcaption>Achieved the RCE</figcaption></figure><h3>安全建議措施</h3><ol><li>升級 Spring Framework 至 5.3.18+ 或是 5.2.20+</li><li>升級 Spring Boot 及相關生態版本至 2.6.6+ 或是 2.5.12+</li><li>升級 Apache Tomcat 至 10.0.20+、9.0.62+ 或是 8.5.78+</li><li>降級至 Java 8</li><li>如不方便升級，可以在 Server/Application 前面部署相關 WAF Rules 來阻擋掉相關 Payload</li></ol><h3>Reference</h3><ul><li><a href="https://github.com/tweedge/springcore-0day-en">tweedge/springcore-0day-en</a></li><li><a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-22965">CVE — CVE-2022–22965 (mitre.org)</a></li><li><a href="https://spring.io/blog/2022/03/31/spring-framework-rce-early-announcement">Spring Framework RCE, Early Announcement</a></li><li><a href="https://www.microsoft.com/security/blog/2022/04/04/springshell-rce-vulnerability-guidance-for-protecting-against-and-detecting-cve-2022-22965/">SpringShell RCE vulnerability: Guidance for protecting against and detecting CVE-2022–22965 — Microsoft Security Blog</a></li><li><a href="https://unit42.paloaltonetworks.com/cve-2022-22965-springshell/">CVE-2022–22965 (SpringShell): RCE Vulnerability Analysis and Mitigations (paloaltonetworks.com)</a></li><li><a href="https://feifei.tw/springshell-spring-core-rce/">[漏洞複現] Spring4Shell: Spring Core RCE JDK 9+ CVE-2022–22965 » 資安這條路 (feifei.tw)</a></li><li><a href="https://www.youtube.com/watch?v=JzObzkZVm3k&amp;t=785s&amp;ab_channel=%E8%82%B2%E6%AD%A3%E8%91%9B%E8%91%9B%E7%9A%84%E8%B3%87%E5%AE%89%E9%81%8A%E6%A8%82%E5%A0%B4">[漏洞建立解說] 讓人進退兩難的春天漏洞~~??!!! 建立Docker Spring Core RCE (SpringShell) (CVE-2022–22965) 的漏洞環境 — YouTube</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4854c9a316e5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ecloudture/springshell-spring-core-0day-rec-%E6%BC%8F%E6%B4%9E%E8%AA%AA%E6%98%8E-cve-2022-22965-4854c9a316e5">SpringShell — Spring Core 0day REC 漏洞說明（CVE-2022–22965）</a> was originally published in <a href="https://medium.com/ecloudture">eCloudture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a container application on Azure (中)]]></title>
            <link>https://medium.com/ecloudture/build-a-container-application-on-azure-%E4%B8%AD-7914a1b1dc44?source=rss----55265c636a4b---4</link>
            <guid isPermaLink="false">https://medium.com/p/7914a1b1dc44</guid>
            <category><![CDATA[容器服務]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[azure-container-instances]]></category>
            <category><![CDATA[containers]]></category>
            <dc:creator><![CDATA[Josie Tseng]]></dc:creator>
            <pubDate>Fri, 28 Jan 2022 09:05:23 GMT</pubDate>
            <atom:updated>2022-01-28T09:05:23.846Z</atom:updated>
            <content:encoded><![CDATA[<p>在上集，為大家介紹該如何在 Azure 上建立映像檔及管理，下一步就是在 Azure 上創建容器。</p><p>其實在 Azure 上面創建容器的方式有兩種 — AKS 及 ACI，那在這集我們要來為大家介紹如何透過 ACI 透過建立容器。</p><h4><strong>什麼是 ACI</strong></h4><p>ACI 全名為 <strong>A</strong>zure <strong>C</strong>ontainer <strong>I</strong>nstance，是一款無伺服器的容器服務，類似 AWS Fargate，主打無需管理虛擬機器，就能在 Azure 上創建容器，可以讓使用者專注在開發上，對於新手來說也相當友善。使用者可以透過 ACI 創建簡單的應用程式，自動化的工作。</p><h4>如何建置容器</h4><ul><li>首先登入到 Azure 平台，進到 ACI 的服務介面，按下 <strong>Create，</strong>就會進到設置的頁面</li><li>選取將資源建立在哪個 Subscription 及 Resource Group，再來就是為這個Container 命名</li><li>Image 目前支援三種：Quickstart、ACR 、Docker Hub 或其他的 registry，使用者可以根據需求選取適合的 Image</li><li>配置 Container 所需的 cpu、memory</li></ul><blockquote>目前最大支援 4 vcpu、16GiB</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*TQxtgBjuqDQHrTAhlz2_ag.png" /></figure><ul><li>在網路配置的部分，你可以選擇讓你的容器是 <strong>Public</strong>、<strong>Private</strong> 還是 <strong>None，</strong>以及設置要開哪一個Port</li></ul><blockquote>如果選擇的是 <strong>Public</strong>，可以對 Container 設定 DNS Name</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*-ePX-7HNNhPyxjwpSHjIMw.png" /></figure><ul><li>在進階設定裡，可以選擇容器 Restart Policy，也就是在哪種狀況下會做Restart</li></ul><blockquote>共有 Always 、Never 及 On failure 三個選項</blockquote><ul><li>配置所需的環境變數及 Command</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*RKmkIEWp-mtlsefuPIR9Xg.png" /></figure><p>最後確認好設定無誤後，按下 Create 就完成摟！</p><p>可以回到 ACI 的 Portal 就可以看到剛剛創建的 Container 的資訊</p><p>然後複製 DNS Name 到網頁上，查看你的應用程式是否有成功建立</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*XiDDUu8O3SByE1I-ZbY35g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*99d-PrdYbtOCG7qRRm_tqA.png" /></figure><p>也可以在左側導覽格頁面，點選 <strong>Container</strong>，就能看到你剛剛創建資源 log ！</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wzGukUHKDrRUhQcXhdsCNg.png" /></figure><h4>總結</h4><p>ACI 除了可以自定義運算資源的多寡，且啟動速度也相當快，也能掛載 Azure File Share，整體的過程是不是相當簡單、直覺、好上手呢！如果是比較簡單、不需要自動擴展的情境，透過 ACI 來去做建立是非常適合的，但如果是較複雜情境，相較之下 AKS 會比較適合。那我們也會在下一集跟大家分享 AKS 的介紹！</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7914a1b1dc44" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ecloudture/build-a-container-application-on-azure-%E4%B8%AD-7914a1b1dc44">Build a container application on Azure (中)</a> was originally published in <a href="https://medium.com/ecloudture">eCloudture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a container application on Azure (上)]]></title>
            <link>https://medium.com/ecloudture/build-a-container-application-on-azure-%E4%B8%8A-3162ede54dca?source=rss----55265c636a4b---4</link>
            <guid isPermaLink="false">https://medium.com/p/3162ede54dca</guid>
            <category><![CDATA[microsoft]]></category>
            <category><![CDATA[acr]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[容器服務]]></category>
            <category><![CDATA[azure]]></category>
            <dc:creator><![CDATA[Josie Tseng]]></dc:creator>
            <pubDate>Fri, 21 Jan 2022 08:42:27 GMT</pubDate>
            <atom:updated>2022-01-21T08:42:27.545Z</atom:updated>
            <content:encoded><![CDATA[<h4>什麼是容器</h4><p>容器化技術（Containerization）在近期非常的火紅，其實這項技術早在 2008 年就出現了，是由 Linux 提出 LXC（Linux Container）的概念，為了解決當時虛擬化技術（hypervisor）繁雜的程序，讓使用者更專注在開發應用程式上。</p><p>而容器化技術是什麼呢？</p><p>就是將應用程式（application）、運行環境（running environment）、函式庫（library）⋯ 等這些應用程式所需的元件，全部封裝在一起，應用程式不必受到作業系統或環境影響，到哪都可以執行，猶如筆電一樣，不管到哪裡，可以隨時隨地使用它，而不像是桌上型電腦，需要環境配置才能做使用。</p><h4>什麼是 Docker</h4><p>每當提到容器時，相信大家都對 Docker 這個名詞不陌生。</p><p>那其實 Docker 是一種容器的標準，是基於 LXC 概念所衍生出來的容器化技術，同時也是 Open source 的軟體平台，你可以在上面快速建立、測試及部署應用程式。</p><p>Docker 有三大重要的基本概念，分別是 Docker 映像檔（images）、Docker 容器（Container）以及 Docker 倉庫（registries）。</p><ul><li>Docker 映像檔（images）: Docker 映像檔為 Docker 容器被啟動時，所執行的應用程式環境。與虛擬機的映像檔相似，虛擬機透過映像檔啟動作業系統，而 Docker 則是將檔案系統的狀態儲存於映像檔中。其中 Docker 映像檔是唯讀的模板。</li><li>Docker 容器（Container）: Docker 容器是應用程式執行的 Instance。開發者透過映像檔啟動容器，就可在容器上運行服務。</li><li>Docker 倉庫（registries）: Docker 倉庫是儲存映像檔的地方，開發者可以將自己的映像檔上傳至倉庫上，供別人下載使用，也可透過 Docker 倉庫讓映像檔在不同裝置上輕鬆的搬移。</li></ul><p>那在 Azure 上要如何建置 Container 呢？</p><p>首先你必須要建立映像檔，在 Azure 上有一個服務是專門存放映像檔 — Azure Container Registry，在這次的文章即將教大家如何建立映像檔。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*u95hmfFx5EYklj93gQVx6w.png" /></figure><h4>如何建置映像檔</h4><ul><li>首先登入到 Azure 平台，進到 ACR 的服務介面，建立一個 Container Registry。</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*IpQ_mMv6cct-3uUS" /></figure><ul><li>建立完成後，在你的電腦或是虛擬機上，確認是否有安裝 Docker。</li></ul><pre>$ docker -v<br>Docker version 20.10.11, build dea9396</pre><ul><li>建置 Dockerfile 來建立所需要的映像檔。</li></ul><pre>FROM php:7.2-apache<br><br>RUN echo &quot;Hello World!&quot; &gt; /var/www/html/index.html</pre><ul><li>將此映像檔 Push 到 ACR 上，輸入 az acr build --registry &lt;your-registry-name&gt; --image &lt;image-name&gt;:&lt;version&gt; .。</li></ul><blockquote>此步驟是透過 Azure cli 執行，請先登入再進行以下操作。</blockquote><ul><li>接著返回 ACR portal 頁面，在左側導覽格點選 <strong>Repositories</strong>，即可看到剛剛推上來的映像檔！</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/0*-rK_ioYeYpwUoT47" /></figure><h4>結論</h4><p>此映像檔是在構建容器的其中一部分，它就像模具一樣，透過它刻畫出想要的應用程式，然而使用者可以搭配 ACI 、 AKS 及 Azure Container app 這類 Instance 服務來建立容器應用程式！我們也會再一一跟大家做介紹。</p><p>如果對 Azure Container app 有興趣的民眾，也可以參考此篇部落格 <a href="https://www.ecloudture.com/2021-microsoft-ignite-azure-container-apps/">【2021 Microsoft Ignite 特輯】- Azure Container Apps</a>。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3162ede54dca" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ecloudture/build-a-container-application-on-azure-%E4%B8%8A-3162ede54dca">Build a container application on Azure (上)</a> was originally published in <a href="https://medium.com/ecloudture">eCloudture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[檢測環境是否含有 Log4j 漏洞]]></title>
            <link>https://medium.com/ecloudture/%E6%AA%A2%E6%B8%AC%E7%92%B0%E5%A2%83%E6%98%AF%E5%90%A6%E5%90%AB%E6%9C%89-log4j-%E6%BC%8F%E6%B4%9E-82b779755675?source=rss----55265c636a4b---4</link>
            <guid isPermaLink="false">https://medium.com/p/82b779755675</guid>
            <category><![CDATA[log4j]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Kun Yi Pan]]></dc:creator>
            <pubDate>Thu, 06 Jan 2022 03:02:55 GMT</pubDate>
            <atom:updated>2022-01-06T03:02:55.444Z</atom:updated>
            <content:encoded><![CDATA[<h3>檢測環境是否含有 Log4j 風險</h3><p>從 12 月中上旬開始爆出 Apache Log4j 漏洞後，各家開發仔、維運、SRE 都在這一陣子當中奮力盤查有哪些 Service、Application、Server 上面有相關的問題，並且開始著手做 dependency update 來加以排解 RCE 的可能性。</p><p>瑞士政府也有提出 Apache Log4j 的防護方式分為幾個階段，詳見下圖</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xnGmnOjhXNHd687v.png" /><figcaption><a href="https://www.govcert.ch/blog/zero-day-exploit-targeting-popular-java-library-log4j/">Zero-Day Exploit Targeting Popular Java Library Log4j (govcert.ch)</a></figcaption></figure><p>本文將會介紹幾個可以加快大家做應用盤查的工具，應急的話也可以透過 WAF Rules 先 Filter &amp; Drop 埋藏在 Header 中的有害 Request！</p><p>有關於 Apache Log4j 與其漏洞的資訊，可以參閱另一篇專題：<a href="https://medium.com/ecloudture/log4shell-apache-log4j-%E6%97%A5%E8%AA%8C%E6%A1%86%E6%9E%B6%E7%B3%BB%E7%B5%B1%E9%87%8D%E5%A4%A7%E6%BC%8F%E6%B4%9E-cve-2021-44228-bfacc5e8bff2">Log4Shell / Apache Log4j 日誌框架系統重大漏洞（CVE-2021–44228） | Medium</a></p><h3>環境建置 — 如果你沒有環境</h3><p><a href="https://github.com/BabooPan/Log4Shell-CVE-2021-44228-Demo">BabooPan/Log4Shell-CVE-2021–44228-Demo: Log4Shell Demo with AWS (github.com)</a></p><ul><li>Application 建置請參閱 <a href="https://github.com/BabooPan/Log4Shell-CVE-2021-44228-Demo/blob/main/README.md">README.md</a></li><li>基於 EC2 搭配 AWS ALB &amp; AWS WAF 寫在 <a href="https://github.com/BabooPan/Log4Shell-CVE-2021-44228-Demo/blob/main/demo-aws-mitigation.md#environment-setup">demo-aws-mitigation.md</a> 中</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AEnlDmZAAY5G98jNzDBKpg.png" /></figure><p>準備好環境後，便能著手利用各種工具來檢測／驗證應用程式、Server 上是否有 apache log4j 的漏洞囉！</p><h3>AWS WAF / Filter Injection Attack</h3><p>在 <a href="https://medium.com/ecloudture/aws-waf-web-%E6%87%89%E7%94%A8%E7%A8%8B%E5%BC%8F%E9%98%B2%E7%81%AB%E7%89%86-7874670dc5b6">AWS WAF — Web 應用程式防火牆 — eCloudture — Medium</a> 中，我們認識 AWS WAF 基於 Application Layer 針對所設立之 WAF Rules 做 HTTP/S Request Filte；若有和 WAF Rules 相符之 Request，能進一步決定要讓該 Request pass throught / deny，在 Application 的最外層做檢驗與放行。</p><p>在 AWS WAF 中有提供兩條 AWS Managed Rules：</p><ul><li>AWSManagedRulesKnownBadInputsRuleSet 針對 HTTP Request URI、Body 和 Header 做透過 Regex 表示式，檢測是否含有已知的有害 Injection；詳細可以參閱<a href="https://docs.aws.amazon.com/waf/latest/developerguide/aws-managed-rule-groups-baseline.html#aws-managed-rule-groups-baseline-known-bad-inputs">文件</a></li><li>AWSManagedRulesAnonymousIpList 會檢查 Request Source From 是不是來自於會隱匿使用者來源的區段，包含 VPN、Tor 網路節點、Proxy 代理或是含 AWS 的 Hosting Provider…等，阻擋掉屬於隱匿使用者來源的請求訪問有助於繞掉 Bot 等自動腳本的掃描，降低成為攻擊目標的可能性；詳細可以參閱<a href="https://docs.aws.amazon.com/waf/latest/developerguide/aws-managed-rule-groups-ip-rep.html#aws-managed-rule-groups-ip-rep-anonymous">文件</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xPGy_rWv3wzimAXQr4K1Kg.png" /></figure><p>若使用者的應用場景在短時間內無法異動 log4j 的版本，建議先透過 CloudFront 或 ELB 掛載服務端點、前面再透過 AWS WAF 做一層 Request Filter 來過濾掉有害的請求，也可以利用 WhiteList IP Set 加入受信任的來源位置，來確保服務與應用如以往運作的同時，也有效降低 log4j 漏洞的威脅。</p><p>AWS WAF 建置流程與測試方式可以參閱：</p><ul><li><a href="https://aws.amazon.com/tw/solutions/implementations/aws-waf-security-automations/">AWS WAF Security Automations | AWS 解決方案 (amazon.com)</a></li><li><a href="https://github.com/BabooPan/Log4Shell-CVE-2021-44228-Demo/blob/main/demo-aws-mitigation.md#associate-waf-with-alb">Log4Shell-CVE-2021–44228-Demo/demo-aws-mitigation.md at main · BabooPan/Log4Shell-CVE-2021–44228-Demo (github.com)</a></li></ul><h3>log4jscanner / Code and Package Analyzer</h3><p><a href="https://github.com/google/log4jscanner">log4jscanner</a> 是由 Google 推出針對整個 Application Package 與原始碼做檢測的靜態分析工具。透過 log4jscanner 可以找出目錄中是否含有 Apache Log4j 漏洞的 JAR 檔，還能透過 --rewrite 的參數來自動將 JndiLookup.class 從 Package 中移除，此為其中一個 Remediation 方式。</p><p>在 GitHub 上有詳細描述是如何檢測 JAR 檔、盤查出是否有漏洞風險，有興趣可以參考看看！</p><h3>log4j-scan / Vulnerabilities Scan</h3><p><a href="https://github.com/fullhunt/log4j-scan">log4j-scan</a> 由資訊安全公司 <a href="https://fullhunt.io/">FullHunt</a> 開發針對 CVE-2021–44228 漏洞的開源掃描工具，協助管理人員可以利用 log4j-scan 工具對 Service Endpoint、URL、虛擬主機的 IP 位址做掃瞄，以檢測出是否有 log4j RCE 的潛在威脅。</p><p>log4j-scan 在使用上僅需要 git pull 下來、皆換至該目錄中執行 python3 log4j-scan.py 便能開始檢測，log4j-scan 也提供了下列功能：</p><ul><li>支援 -u 針對一個、或是 -l 多個 URLs 做清單掃描</li></ul><pre># 針對一個 Service Endpoint 做檢測<br>$ python3 log4j-scan.py -u ENDPOINT</pre><pre># 想要一次針對多個 Service Endpoints 做檢測，則可以透過 `-l` 帶入 txt list<br>$ python3 log4j-scan.py -l urls.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZL3DmrGlXuwJ4u3w4pm1aA.png" /></figure><ul><li>支援 --headers-file 參數帶入 HTTP Request Headers 做測試，提供三種範圍 <a href="https://github.com/fullhunt/log4j-scan/blob/master/headers.txt">headers</a>、<a href="https://github.com/fullhunt/log4j-scan/blob/master/headers-minimal.txt">headers-minimal</a>、<a href="https://github.com/fullhunt/log4j-scan/blob/master/headers-large.txt">headers-large</a> 最高達一千多種！<br>以範例應用做測試，要帶入 X-Api-Version 才會有 Response，與單純檢測 Service Endpoint 的結果便有所差異，發現在 Header 上是有風險的！</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*maEDrplafn7KA9NJnpjOAg.png" /></figure><ul><li>支援 --request-type 參數送出 HTTP Post Request、以 JSON 送入 Request data</li><li>支援 —-test-CVE-2021-45046 參數針對 CVE-2021–45046 測試會不會有 infinite loop 導致應用中斷的風險</li><li>支援 --waf-bypass 參數來嘗試繞過 WAF 的檢查邏輯</li><li>支援 --dns-callback-provider參數來檢查確認 DNS callback 是否有異常</li><li>懶人參數 --run-all-test 一次測試針對 Service Endpoint 跑 log4j-scan 支援的檢測項目</li></ul><p>log4j-scan 也被美國網路安全暨基礎安全局 CISA 用來封裝、推出 GitHub 開元項目 <a href="https://github.com/cisagov/log4j-scanner">log4j-scanner</a> ，協助各個政府機構與民間使用者來掃描 Web Service 是否 Apache Log4j RCE 潛在風險。</p><h3>Amazon Inspector / Vulnerabilities Scan</h3><p>Amazon Inspector 是一項安全性評估服務，協助使用者改善部署於 EC2 Instances 之應用程式、放置於 ECR Repository Container Images 的安全及合規，透過 Inspector 評估是否有弱點、漏洞，並提供改善意見給使用者作參考。</p><p>詳細關於 Inspector 的介紹可以參閱：<a href="https://medium.com/ecloudture/amazon-inspector-v2-%E7%99%BC%E5%B8%83-%E6%BC%8F%E6%B4%9E%E6%AA%A2%E6%B8%AC%E6%9C%8D%E5%8B%99%E5%85%A8%E6%96%B0%E9%AB%94%E9%A9%97-5c6e00a8309f">Amazon Inspector v2 發布！漏洞檢測服務全新體驗 — eCloudture — Medium</a></p><p>只要確保待掃描的 Instances 配有 <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/ssm-agent.html">ssm agent</a> 以及 AmazonEC2RoleforSSM Policy 的權限，Inspector 便會自動掃描對應的虛擬主機，如下圖 by Instances 呈現虛擬主機上有哪些需要改善的項目：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JQuflx-1NlSRxXpDLVQukA.png" /></figure><p>若主機或是放置在 ECR 上的 Container Images 有對應的漏洞，這邊以 <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44228">CVE-2021–44228</a> 為例，Inspector 會盤查出有哪些受影響的 Packages、Package manager 層級為 Application 或是 OS、CVSS 評分等資訊</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*trZVpnO20UsmhPcw-7mE7w.png" /></figure><p>並且針對不同的 Vulnerable 弱點，提供對應的 Remediation 排解方式給使用者／管理員參考，以下圖為例有：更新 log4j 版本、移除 JNDI Lookup Class、更改套件變數等方式</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*b7yc4E8LR8Do6S14iq8iKA.png" /></figure><p>Inspector 改版上線後，不僅大幅度降低 Vulnerable Scanning 的執行成本，還隨時提供最新的弱點資訊給使用者做 Review，也能再串接 EventBridge 來通知管理人員在第一時間收到通知，大大地縮短弱點暴露到改善的時間。</p><h3>Reference</h3><ul><li><a href="https://aws.amazon.com/security/security-bulletins/AWS-2021-006/">AWS — Update for Apache Log4j2 Issue (CVE-2021–44228)</a></li><li><a href="https://alas.aws.amazon.com/ALAS-2021-1553.html">Amazon Linux Security Center</a></li><li><a href="https://github.com/fullhunt/log4j-scan">fullhunt/log4j-scan: A fully automated, accurate, and extensive scanner for finding log4j RCE CVE-2021–44228 (github.com)</a></li><li><a href="https://github.com/google/log4jscanner">google/log4jscanner: A log4j vulnerability filesystem scanner and Go package for analyzing JAR files. (github.com)</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82b779755675" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ecloudture/%E6%AA%A2%E6%B8%AC%E7%92%B0%E5%A2%83%E6%98%AF%E5%90%A6%E5%90%AB%E6%9C%89-log4j-%E6%BC%8F%E6%B4%9E-82b779755675">檢測環境是否含有 Log4j 漏洞</a> was originally published in <a href="https://medium.com/ecloudture">eCloudture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Amazon SageMaker Studio Lab 把玩心得]]></title>
            <link>https://medium.com/ecloudture/amazon-sagemaker-studio-lab-%E6%8A%8A%E7%8E%A9%E5%BF%83%E5%BE%97-de5643018871?source=rss----55265c636a4b---4</link>
            <guid isPermaLink="false">https://medium.com/p/de5643018871</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[sagemaker]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[X]]></dc:creator>
            <pubDate>Tue, 04 Jan 2022 08:26:53 GMT</pubDate>
            <atom:updated>2022-01-04T08:26:05.510Z</atom:updated>
            <content:encoded><![CDATA[<h3>簡介</h3><p><a href="https://studiolab.sagemaker.aws/">Amazon SageMaker Studio Lab</a> 為去年底 re:Invent 所推出的全新服務，方便學生及 ML 開發者更方便的在無需前置繁瑣的安裝使用帶有 GPU、CPU 運算資源的 <a href="https://jupyter.org/">Jupyter notebook</a> 。</p><p>此外 Amazon SageMaker Studio Lab 可以用非 AWS 帳號註冊，在使用上又更方便了!</p><pre>Google 上對應的服務為 <a href="https://colab.research.google.com/"><strong>Colab</strong></a>，以及另一個 ML 學習平台 <a href="https://www.kaggle.com/"><strong>Kaggle</strong></a></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aMOB4xG_DHr4dMZP" /></figure><h3>如何申請 Amazon Sagemaker Studio Lab ?</h3><p>只要 2 步驟:</p><ol><li>到 <a href="https://studiolab.sagemaker.aws/requestAccount">這邊</a> 填帳號申請單</li><li>等待 2 ~ 3 天即可得到帳號</li><li>開始玩 ~</li></ol><pre>小秘密: <strong>Why are you interested in Amazon SageMaker Studio Lab?</strong> 選取 <strong>Hacksthon</strong> 貌似會比較快過審核</pre><h3>如何使用 Amazon Sagemaker Studio Lab ?</h3><p>先選取運算型態</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FaeASxNaGTwhh1b6" /></figure><pre><em>CPU 有 12 小時的 runtime，GPU 只有 4 小時。</em></pre><p>按下 Start runtime</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GkAVg2xhS1Lw59Hs" /></figure><p>這時候按下 Open project，即可看到熟悉的 Jupyter notebook 畫面</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2QNLsgKpmH5EbcAH" /></figure><h3>Getting Started with Amazon SageMaker Studio Lab</h3><h4>Installing Python packages</h4><p>這邊強烈建議使用 conda install 指令來安裝各種 python packages，因為權限問題，若遇安裝的 packeage 需要其他 dependency 時會安裝失敗無法使用。</p><pre><em>ref: </em><a href="https://github.com/aws/studio-lab-examples/issues/31"><em>htop installing issue</em></a><em>、 </em><a href="https://github.com/aws/studio-lab-examples/issues/14"><em>opencv installing issue</em></a><em> in Amazon SageMaker Studio Lab</em></pre><h4>Create env in Amazon SageMaker Studio Lab</h4><p>在 Amazon SageMaker Studio Lab 使用者也可以開很多不同的 pytohn runtime 來區分不同專案所需要的環境。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*G6dOgyEcOVIn4CRF" /></figure><p>點選 File -&gt; New -&gt; Terminal 即可開啟 Terminal 視窗</p><ul><li>在 Terminal 視窗中輸入以下指令即可創立一個 Python 3.9，名為 my_environment 的環境</li></ul><pre>$ conda create --name my_environment python=3.9</pre><pre>#這樣就可以開啟一個 python 3.9 的環境，但是在 Kernel list 還不會被列出來</pre><ul><li>接著在 Terminal 視窗中輸入以下指令即可切換 Python 執行環境到 my_environment</li></ul><pre>$ conda activate my_environment</pre><ul><li>最後在 Terminal 視窗中輸入以下，並等待 1 ~ 2 分鐘即可在 Kernel list 選取到 my_environment 環境</li></ul><pre>$ conda install ipykernel</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LX3PpUVAjCi51hV8" /></figure><h3>Amazon SageMaker Studio Lab 香嗎?</h3><pre><em>這邊會以 GPU runtime 來討論</em></pre><ul><li>首先是硬體規格，GPU 使用的是 Tesla T4，colab 免費方案使用的為 K80，Kaggle 為 P100</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/0*Bzwg5-xwE2Dtr_2a" /><figcaption>Amazon SageMaker Studio Lab</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/0*qXkzS28OwgNlV7Oq" /><figcaption>Colab</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/0*sKlBgZRcab9icSMp" /><figcaption>Kaggle</figcaption></figure><ul><li>再來是實際工作負載(mnist CNN)</li></ul><pre>from tensorflow.keras.datasets import mnist <br>from tensorflow.keras.utils import to_categorical <br>import time  </pre><pre>start = time.time()</pre><pre>(train_images, train_labels), (test_images, test_labels) = mnist.load_data() <br>train_images = train_images.reshape((60000, 28, 28, 1)) <br>train_images = train_images.astype(&#39;float32&#39;) / 255 <br>test_images = test_images.reshape((10000, 28, 28, 1)) <br>test_images = test_images.astype(&#39;float32&#39;) / 255 <br>train_labels = to_categorical(train_labels) <br>test_labels = to_categorical(test_labels)   </pre><pre>from tensorflow.keras import layers <br>from tensorflow.keras import models  </pre><pre>model = models.Sequential() <br>model.add(layers.Conv2D(32, (3, 3), activation=&#39;relu&#39;, input_shape=(28, 28, 1))) <br>model.add(layers.MaxPooling2D((2, 2))) <br>model.add(layers.Conv2D(64, (3, 3), activation=&#39;relu&#39;)) <br>model.add(layers.MaxPooling2D((2, 2))) <br>model.add(layers.Conv2D(64, (3, 3), activation=&#39;relu&#39;)) model.add(layers.Flatten()) <br>model.add(layers.Dense(64, activation=&#39;relu&#39;)) model.add(layers.Dense(10, activation=&#39;softmax&#39;)) <br>model.summary()  </pre><pre>model.compile(optimizer=&#39;rmsprop&#39;, loss=&#39;categorical_crossentropy&#39;,               metrics=[&#39;accuracy&#39;]) <br>model.fit(train_images, train_labels, epochs=5, batch_size=64) <br>test_loss, test_acc = model.evaluate(test_images, test_labels) print(test_acc) </pre><pre>done = time.time() <br>elapsed = done - start <br>print(f&quot;time spend {elapsed} s&quot;)</pre><ul><li>Result of Amazon SageMaker Studio Lab @ T4</li></ul><pre>Model: &quot;sequential_1&quot; _________________________________________________________________ Layer (type) Output Shape Param # ================================================================= conv2d (Conv2D) (None, 26, 26, 32) 320 _________________________________________________________________ max_pooling2d (MaxPooling2D) (None, 13, 13, 32) 0 _________________________________________________________________ conv2d_1 (Conv2D) (None, 11, 11, 64) 18496 _________________________________________________________________ max_pooling2d_1 (MaxPooling2 (None, 5, 5, 64) 0 _________________________________________________________________ conv2d_2 (Conv2D) (None, 3, 3, 64) 36928 _________________________________________________________________ flatten (Flatten) (None, 576) 0 _________________________________________________________________ dense_2 (Dense) (None, 64) 36928 _________________________________________________________________ dense_3 (Dense) (None, 10) 650 ================================================================= Total params: 93,322 <br>Trainable params: 93,322 <br>Non-trainable params: 0 _________________________________________________________________ Epoch 1/5 938/938 [==============================] - 7s 3ms/step - loss: 0.1776 - accuracy: 0.9439 <br>Epoch 2/5 938/938 [==============================] - 2s 2ms/step - loss: 0.0468 - accuracy: 0.9857 <br>Epoch 3/5 938/938 [==============================] - 2s 3ms/step - loss: 0.0323 - accuracy: 0.9899 <br>Epoch 4/5 938/938 [==============================] - 2s 3ms/step - loss: 0.0242 - accuracy: 0.9926 <br>Epoch 5/5 938/938 [==============================] - 2s 2ms/step - loss: 0.0188 - accuracy: 0.9944 <br>313/313 [==============================] - 1s 1ms/step - loss: 0.0317 - accuracy: 0.9909 </pre><pre>0.9908999800682068 <br>time spend 17.8512921333313 s</pre><ul><li>Result of Colab @ K80</li></ul><pre>Model: &quot;sequential_2&quot; _________________________________________________________________ Layer (type) Output Shape Param # ================================================================= conv2d_6 (Conv2D) (None, 26, 26, 32) 320 </pre><pre>max_pooling2d_4 (MaxPooling (None, 13, 13, 32) 0 2D) </pre><pre>conv2d_7 (Conv2D) (None, 11, 11, 64) 18496 </pre><pre>max_pooling2d_5 (MaxPooling (None, 5, 5, 64) 0 2D) </pre><pre>conv2d_8 (Conv2D) (None, 3, 3, 64) 36928 </pre><pre>flatten_2 (Flatten) (None, 576) 0 </pre><pre>dense_4 (Dense) (None, 64) 36928 </pre><pre>dense_5 (Dense) (None, 10) 650 ================================================================= Total params: 93,322 <br>Trainable params: 93,322 <br>Non-trainable params: 0 _________________________________________________________________ Epoch 1/5 938/938 [==============================] - 14s 13ms/step - loss: 0.1738 - accuracy: 0.9450 <br>Epoch 2/5 938/938 [==============================] - 9s 10ms/step - loss: 0.0486 - accuracy: 0.9853 <br>Epoch 3/5 938/938 [==============================] - 9s 9ms/step - loss: 0.0327 - accuracy: 0.9901 <br>Epoch 4/5 938/938 [==============================] - 9s 9ms/step - loss: 0.0253 - accuracy: 0.9922 <br>Epoch 5/5 938/938 [==============================] - 9s 9ms/step - loss: 0.0203 - accuracy: 0.9937 <br>313/313 [==============================] - 1s 4ms/step - loss: 0.0258 - accuracy: 0.9926 <br>0.9926000237464905 <br>time spend 53.64968514442444 s</pre><ul><li>Result of Kaggle @ P100</li></ul><pre>Model: &quot;sequential&quot; _________________________________________________________________ Layer (type) Output Shape Param # ================================================================= conv2d (Conv2D) (None, 26, 26, 32) 320 _________________________________________________________________ max_pooling2d (MaxPooling2D) (None, 13, 13, 32) 0 _________________________________________________________________ conv2d_1 (Conv2D) (None, 11, 11, 64) 18496 _________________________________________________________________ max_pooling2d_1 (MaxPooling2 (None, 5, 5, 64) 0 _________________________________________________________________ conv2d_2 (Conv2D) (None, 3, 3, 64) 36928 _________________________________________________________________ flatten (Flatten) (None, 576) 0 _________________________________________________________________ dense (Dense) (None, 64) 36928 _________________________________________________________________ dense_1 (Dense) (None, 10) 650 ================================================================= Total params: 93,322 <br>Trainable params: 93,322 <br>Non-trainable params: 0 _________________________________________________________________ Epoch 1/5 938/938 [==============================] - 12s 5ms/step - loss: 0.1769 - accuracy: 0.9445 <br>Epoch 2/5 938/938 [==============================] - 5s 5ms/step - loss: 0.0478 - accuracy: 0.9849 <br>Epoch 3/5 938/938 [==============================] - 5s 5ms/step - loss: 0.0317 - accuracy: 0.9898 <br>Epoch 4/5 938/938 [==============================] - 5s 6ms/step - loss: 0.0248 - accuracy: 0.9924 <br>Epoch 5/5 938/938 [==============================] - 5s 5ms/step - loss: 0.0197 - accuracy: 0.9936 <br>313/313 [==============================] - 1s 3ms/step - loss: 0.0368 - accuracy: 0.9904 <br>0.9904000163078308 <br>time spend 35.18884539604187 s</pre><h3>Amazon SageMaker Studio Lab 使用心得</h3><p>Amazon SageMaker Studio Lab 在使用上不像 Colab、Kaggle 已經有預建好的環境可供使用，使用者需要自己安裝各種 python package 及建立 python 執行環境，這點相對於其他平台帶來的是更高的自由度，但也會造成某些package 不好安裝，或需要特殊版本安裝的問題。</p><p>其他比較項目如下表所示，整體來說 Amazon SageMaker Studio Lab 的出現也讓這樣的運算服務有了新選擇。憑藉著較原生的 Jupyter notebook 環境，對於某些使用者說不定是一種更合適的選擇。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*Q9ggJiaumVqmRZrbJ4erJg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de5643018871" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ecloudture/amazon-sagemaker-studio-lab-%E6%8A%8A%E7%8E%A9%E5%BF%83%E5%BE%97-de5643018871">Amazon SageMaker Studio Lab 把玩心得</a> was originally published in <a href="https://medium.com/ecloudture">eCloudture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Don’t We Just Call It Directly with “gRPC” ?]]></title>
            <link>https://medium.com/ecloudture/why-dont-we-just-call-it-directly-with-grpc-c9f86afaf0a4?source=rss----55265c636a4b---4</link>
            <guid isPermaLink="false">https://medium.com/p/c9f86afaf0a4</guid>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[grpc]]></category>
            <category><![CDATA[ecloudture]]></category>
            <dc:creator><![CDATA[Geoffrey Aaron]]></dc:creator>
            <pubDate>Tue, 04 Jan 2022 06:51:08 GMT</pubDate>
            <atom:updated>2022-01-04T06:51:08.906Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why Don’t We Just Call it Directly with “gRPC”?</h3><blockquote>Let’s make The Coolest Distributed Applications and Services</blockquote><p>As developers, we can join with “<strong>FAANG</strong>” (Facebook, Amazon, Apple, Netflix, and Google), one of our wanted dreams to achieve. Maybe some people around us already got that ticket, but not a few of them are still trying to get that “<strong>golden ticket.” </strong>We can get many benefits by joining one of that “Big Five” Tech companies, one of which is the latest technology in this era. Wondering how they can manage an extensive scale application with almost zero downtime makes all developers want more to join their team.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*1MLrDHYg7i0yTRFR_zWh4g.png" /><figcaption><strong>FAANG </strong>(Facebook, Amazon, Apple, Netflix, and Google)</figcaption></figure><blockquote><strong>If you want to go fast, go alone</strong></blockquote><blockquote><strong>if you’re going to go far, go together</strong></blockquote><p>Maybe hard to get “<strong>FAANG</strong>” all secret recipes about how they manage their fantastic app, but one thing that they give to the public is their application architecture use <strong>Microservice</strong>. <strong>Microservice</strong> is one of the architecture styles with a service-oriented structure, consisting of a collection of small independent services. Each service is self-sustaining and should perform a single business capability within a bounded connection. We can get significant benefits from Microservice: <strong>Easier to build and maintain</strong>, <strong>Robust and Scalable</strong>, <strong>Continuously delivering faster than before</strong>, <strong>Resilient</strong>, <strong>Loosely Coupled</strong>, and still a lot more else.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*YVilYO4txm3ovK1mETYEvw.png" /><figcaption>Illustration Microservice</figcaption></figure><p>In a team, communication is essential. How each member’s team communicates with each other should be <strong>efficient</strong>, <strong>fast</strong>, and <strong>direct</strong>. <strong>Microservice</strong> is also the same. Communication between services in <strong>Microservice</strong> architecture is a crucial thing that we need to manage. To manage Microservice, it will have an extensive operational load, but it is worth it compared to its benefits. based on this <a href="https://www.cncf.io/case-studies/netflix/">blog</a>, Netflix put trust in <strong>gRPC</strong> for their internal services communication in their <strong>Microservice</strong> architecture. <strong>gRPC</strong> is an open-source, high-performance <strong>Remote Procedure Call (RPC) framework</strong> developed by Google that can run in any environment and language. It can efficiently connect services in and across data centers and microservice apps with pluggable support for load balancing, tracing, health checking, and authentication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wwnkBmByI7Yk18OC.png" /></figure><p>With <strong>gRPC</strong>, client services can directly call a method on a server application on a different machine and different language as if it were a local object, making it easier for you to create distributed applications and services. <strong>gRPC</strong> uses ideas by defining a service, specifying the methods to be called remotely with their parameters and return types that have been decided before in the <strong>proto</strong> file. The services implement the interface in <strong>proto</strong> and run a gRPC server to handle client calls on the server services. The clients have a stub that provides the same methods as the server services have on the client services. By default, language that gRPC uses is <a href="https://developers.google.com/protocol-buffers/docs/overview">Protocol Buffers</a>. Protocol buffers is the language which is developed by Google.</p><p>It’s heard so scary and complicated, but actually that just as simple as like we create Monolith Architecture. Let’s get our hands on.</p><h3>Talk Less, Practice More !!</h3><p>In this blog, we will make a simple application to order food with Microservice Architecture with internal communication using gRPC. Maybe request food application, but it will need many services, for example, <strong>Check Food Store and Check User Profile</strong>. From now on, we are only going to check user profiles and food stores. If you want to contribute or scale the example, just fork or send PR to this <a href="https://github.com/mvgeoffreya/gRPC-Order-Food">Github</a>. Without any further ado, let’s started. Replace relative path on user data</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*LG3TmTozaeDUxT7ytAkxgQ.png" /><figcaption>Scenario</figcaption></figure><p>To start this project, we should install all necessary dependencies. We need install <a href="https://golang.org/dl/"><strong>Go</strong></a>, <a href="https://dotnet.microsoft.com/download"><strong>.Net</strong></a>, and <a href="https://grpc.io/"><strong>gRPC generator</strong></a>. We will use <strong>Go</strong> language for server services and <strong>.Net </strong>for client services.</p><p>After install all necessary dependencies, let we create <strong>proto</strong> file. <strong>Proto</strong> File is file to define a service definition. In that file we will define all <strong>request</strong>, <strong>response</strong>, <strong>message</strong>, and <strong>direction of communication</strong> type. In this scenario, we will create 3 proto files; <strong>common</strong>, <strong>foodStore</strong>, and <strong>UserProfile.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/316/1*Sjtzy1tFVeQuoZqm0wOCUg.png" /><figcaption>common.proto</figcaption></figure><blockquote><strong><em>common.proto </em></strong><em>is</em><strong><em> </em></strong><em>for defining enum and message type</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*m52QO3jFZ8e-jVnNp6A5bg.png" /><figcaption>foodStore.proto</figcaption></figure><blockquote><strong><em>foodStore.proto </em></strong><em>is</em><strong><em> </em></strong><em>for defining FoodStore service</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/510/1*7TM4g8UWMFJlBKDl9FjsJw.png" /><figcaption>userProfile.proto</figcaption></figure><blockquote><strong><em>userProfile.proto </em></strong><em>is</em><strong><em> </em></strong><em>for defining user profile service</em></blockquote><p>We have created 3 proto files to define message and method type between services. Next step we will create server service for userProfile and foodStore. we will use Go language to build our server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*ScxzhbN4XTZPsUD-3x8obg.png" /><figcaption>foodStore service</figcaption></figure><blockquote><strong><em>foodStore</em></strong><em> service is for get food store data</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*5YkvPlBFR1aOtgHs2tPZSw.png" /><figcaption>userProfile service</figcaption></figure><blockquote><strong><em>userProfile</em></strong><em> service is for get user data</em></blockquote><p><strong>Proto</strong> and Server are done. Last service that we need to create is Client to order food. We will use <strong>.Net</strong> to be our client service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*PUcPWbdya2SYn51jNKVeJg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*o4cto6xhQ0H-vY-VlcyOUA.png" /><figcaption>Client (left) and Controller (right)</figcaption></figure><p>As we can see pictures above, we call the server method directly from the client, e.g., Monolith Architecture.</p><h3>The Moment of The Truth !!</h3><p>After everything is ready, we can run our app. To run our Server services, we can use :</p><pre>go run main.go</pre><p>And for Client service:</p><pre>dotnet run</pre><p>Server done, Client done, so let’s call the endpoint. You can call the API http://localhost:5000/Food/1 to test it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*sYd2GWB2ivN0Upxg1bvjyQ.png" /><figcaption>Result when we call <a href="http://localhost:5000/Food/1">http://localhost:5000/Food/1</a></figcaption></figure><p>One of the Microservice benefits is that when a service goes down, we still can call the API without having the response Internal Server Error 500. Let’s close one of our Server services, userProfile server. We call it again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*d33F2FJ2HxiqToZ0Ou9KmA.png" /><figcaption>Result when userProfile Server down</figcaption></figure><blockquote>Where is the ordering part? We only check data of user and food store</blockquote><p>This application hasn’t completed yet. You can complete this application by yourself! Please contribute to this <a href="https://github.com/mvgeoffreya/gRPC-Order-Food">Github</a> or fork the repo and scale it. Order to complete this app is your challenge!</p><p>If you want to explore other cool blogs of technologies, please stay tune on <a href="https://medium.com/ecloudture"><strong><em>eCloudture Medium</em></strong></a><strong><em> !!!</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9f86afaf0a4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ecloudture/why-dont-we-just-call-it-directly-with-grpc-c9f86afaf0a4">Why Don’t We Just Call It Directly with “gRPC” ?</a> was originally published in <a href="https://medium.com/ecloudture">eCloudture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Svelte, A New Challenger in Frontend World]]></title>
            <link>https://medium.com/ecloudture/svelte-a-new-challenger-in-frontend-world-ef939be4561a?source=rss----55265c636a4b---4</link>
            <guid isPermaLink="false">https://medium.com/p/ef939be4561a</guid>
            <category><![CDATA[sveltekit]]></category>
            <category><![CDATA[svelte]]></category>
            <category><![CDATA[ecloudture]]></category>
            <category><![CDATA[sveltejs]]></category>
            <category><![CDATA[frontend]]></category>
            <dc:creator><![CDATA[Geoffrey Aaron]]></dc:creator>
            <pubDate>Tue, 04 Jan 2022 06:51:06 GMT</pubDate>
            <atom:updated>2022-01-04T06:51:06.886Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>“What new technology does is create new opportunities to do a job that customers want done.” — </em></strong>Tim O’Reilly<strong><em> —</em></strong></p><p>Since the 20th century, Web Development has been growing so fast. Start from Hypertext in 1969; and then HTML-HTTP; until one of the famous Web Programming Language, PHP in 1994; Javascript in 1996; and continued growing until 2013, Facebook founded the Second Most Popular Web Framework, React, based on <a href="https://insights.stackoverflow.com/survey/2020#technology-web-frameworks">Stack Overflow Developer Survey 2020</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*60oUGT5m8lUfMEy0vXxT7Q.jpeg" /></figure><p>To defeat the traditional technology, such as Vue, Angular, React, or Amber; Svelte comes to beat them. Svelte was founded in 2016 by Rich Harris. Svelte is a radically novel approach to building Web Frontend. It isn’t like the traditional frameworks, like React, do the bulk of their work in the <em>browser</em>, Svelte shifts that work into a <em>compile step</em> that happens when you build your Web app. Instead of using techniques like virtual DOM diffing, Svelte writes code that surgically updates the DOM when the state of your app changes.</p><p>Svelte has 3 significant points that make it so gorgeous than another framework, there are:</p><h4>Write less Code</h4><p>The problem that developers usually face <em>is “Buggy-Code.” </em>Buggy-Code is the way developers write code using poor coding practices and/or poor testing practices. Their code is likely to have a greater-than-average number of bugs and/or is difficult to maintain without introducing bugs. Therefore, it stands to reason that the more code you have to write, the “<em>Buggier”</em> your apps will be.</p><p>Another reason we need to write code as few as possible is that writing more code will consume more time. If we waste time coding, it will make us have less time for other things, such as optimisation, creating additional features, etc.</p><p>Let’s see why Svelte has a point <strong><em>“Write less Code”</em></strong></p><p>On React, when we need to write a simple counter, it will look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TC1cQ0Z6Yjg1SIVIkPdMXA.png" /></figure><p>But on the Svelte, it will look like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*q-n7rwmigdFGE8hz41Vo4g.png" /></figure><h4>No Virtual DOM</h4><p>Another point that makes Svelte a radically novel approach to building Web Frontend is that Svelte doesn’t use Virtual DOM. As we know, the traditional system uses Virtual DOM diffing. “<a href="https://twitter.com/pcwalton/status/1015694528857047040"><strong><em>Diffing isn’t free</em></strong></a><strong><em>”</em></strong>. The browser must do extra work to convert those declarative structures into DOM operations, using techniques like virtual DOM diffing that eat into your frame budget and tax the garbage collector. You can’t apply changes to the actual DOM without first comparing the new virtual DOM with the previous snapshot. Svelte is a compiler. Svelte doesn’t need to use Virtual DOM diffing to do it. Svelte knows how things could change in your app at <em>build time</em>, rather than waiting to do the work at <em>runtime</em>.</p><h4>Rethinking Reactivity</h4><p>The last point that makes Svelte is so unique is “<strong><em>Rethinking Reactivity.” </em></strong>Svelte has a novel approach to make Frontend Framework is more reactive and easy to develop. On the first time, they use API to make State management, such as this.state. As time goes by, they realise that using API makes some unnatural code and creates unnecessary work for the garbage collector.</p><blockquote>“What kind of API would work for us?” The best API is no API at all!!</blockquote><p>So, They move the reactivity into the language instead of API. With Svelte, Updating some state value should be as simple as just updating variable; it will look like:</p><pre>state= +1</pre><p>Since Svelte is a compiler, the behind the scenes will look like:</p><pre>state += 1; $$invalidate(&#39;state&#39;, state);</pre><p>If you want to explore other cool blogs of technologies, please stay tune on <a href="https://medium.com/ecloudture"><strong><em>eCloudture Medium</em></strong></a><strong><em> !!!</em></strong></p><p>ref: <a href="https://svelte.dev/">svelte</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef939be4561a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ecloudture/svelte-a-new-challenger-in-frontend-world-ef939be4561a">Svelte, A New Challenger in Frontend World</a> was originally published in <a href="https://medium.com/ecloudture">eCloudture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Macros! The Next Level of Rust’s Function]]></title>
            <link>https://medium.com/ecloudture/macros-the-next-level-of-rusts-function-d64dd38def80?source=rss----55265c636a4b---4</link>
            <guid isPermaLink="false">https://medium.com/p/d64dd38def80</guid>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[rustlang]]></category>
            <category><![CDATA[rust-programming-language]]></category>
            <category><![CDATA[ecloudture]]></category>
            <dc:creator><![CDATA[Geoffrey Aaron]]></dc:creator>
            <pubDate>Tue, 04 Jan 2022 06:51:04 GMT</pubDate>
            <atom:updated>2022-01-04T06:51:04.737Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Write it once, and it always there when you need it…</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wL9FvRCwlO8X0ysJ8348kw.png" /></figure><p>In In last month’s <a href="https://mv-geoffrey-aaron.medium.com/most-loved-languages-in-this-century-rust-d2c039d7c9df">blog</a>, we talk about writing the first our Rust code, “<em>Hello, world!”,</em> like newbies usually do. Inside that program, we used one <em>Macros</em> to print our “<em>Hello, world!”. </em>Do you wonder how Rust print that statement? Don’t need to be discombobulated!! Let’s discuss it in this Blog.</p><h4>First, What are Macros in Rust?!</h4><p>Macros are a way in Rust that can help us write other code. For the Developer community, they knew this method as <em>meta-programming</em>. <em>Meta-programming</em> is very helpful to us when we code a bunch of lines and use it frequently. With that, we can reduce the amount of code we have to write and maintain.</p><blockquote>Wait, a minute! What’s the difference with general function?</blockquote><p>The general function may help us reduce the amount of code we have to write and maintain if we use it frequently. But on the other hand, when we code the general function, the number and type of parameters the function is had to be declared first. Because of that point, it makes Macros is more special than general functions. Macros haven’t that limitation. For example, when we want to print a statement, we can use do it like:</p><pre>println!(&quot;Hello, world!&quot;);</pre><p>There is another way to use println!:</p><pre>println!(&quot;Hello, {}!&quot;, world);</pre><h4>Talk Less, Practice More !!</h4><p>It will be hard to understand all theories and understanding above without practice. Now let’s do one typical example that we will use in any kind of program.<br>When we want to declare Vector data with default values, we will write it like this:</p><pre>let mut vec_data = Vec::new();<br>vec_data.push(1);<br>vec_data.push(2);</pre><p>If every program or function needs to declare Vector data with default values, the way we use above is very inconvenient. The best way to solve it is by using <em>Meta-programming / Macros. </em>We can write a Macro to help us declare Vector data, for example:</p><pre>#[macro_export]<br>macro_rules! vec { ($( $x:expr ),* ) =&gt; { <br>  {<br>    let mut vec_data = Vec::new();<br>    $(<br>      vec_data.push($x);<br>    )*<br>    vec_data<br>  }<br>};}</pre><p>With the macro code above, now we don’t need to push one by one every time we declare Vector data with default values. How we use the macro code above will be like this:</p><pre>let v: Vec&lt;u32&gt; = vec![1, 2];</pre><p>If we solve it with a general function, we need to decide the parameter with specific values and types that will limit our input.</p><p>Now you should understand the basics of <em>Macros </em>/ <em>Meta-programming </em>in Rust.</p><p>If you want to explore other cool blogs of technologies, please stay tune on <a href="https://medium.com/ecloudture"><strong><em>eCloudture Medium</em></strong></a><strong><em> !!!</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d64dd38def80" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ecloudture/macros-the-next-level-of-rusts-function-d64dd38def80">Macros! The Next Level of Rust’s Function</a> was originally published in <a href="https://medium.com/ecloudture">eCloudture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Most Loved Languages in This Century, Rust]]></title>
            <link>https://medium.com/ecloudture/most-loved-languages-in-this-century-rust-d2c039d7c9df?source=rss----55265c636a4b---4</link>
            <guid isPermaLink="false">https://medium.com/p/d2c039d7c9df</guid>
            <category><![CDATA[rust-programming-language]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[rustlang]]></category>
            <category><![CDATA[ecloudture]]></category>
            <dc:creator><![CDATA[Geoffrey Aaron]]></dc:creator>
            <pubDate>Tue, 04 Jan 2022 06:50:44 GMT</pubDate>
            <atom:updated>2022-01-04T06:50:44.529Z</atom:updated>
            <content:encoded><![CDATA[<h4>“Wondering if there is a programming language that is as fast as C/C++ and as safe as Ruby/Python, it would be beyond perfection…”</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eh5NBQtQAJr3w_hv.png" /></figure><p>Based on <a href="https://insights.stackoverflow.com/survey/2020#technology-most-loved-dreaded-and-wanted-languages-loved">Stack Overflow Developer Survey 2020</a>, The Most Loved programming language was achieved by <a href="https://www.rust-lang.org/"><strong>Rust</strong></a>. Since its launch in 2010, Rust has stolen the attention of the developer’s community with its superiority.</p><p>Rust is an open-source programming language focused on <strong><em>safety</em></strong>, <strong><em>speed</em></strong>, and <strong><em>concurrency</em></strong>. With Rust, you can write faster, more reliable software.</p><p>The first appearance of Rust was <strong>on July 7, 2010</strong>. It was created by Graydon Hoare and sponsored by Mozilla Research. Back in 2010, Graydon Hoare presented work on Rust, and he hoped Rust would become a<strong><em> “Memory Safety and More Concurrency”</em></strong> programming language. One of the famous platforms, <a href="https://www.figma.com/blog/rust-in-production-at-figma/"><strong>Figma</strong></a>, already used Rust in their production environment. There are also many organizations using Rust in production, such as <a href="https://www.wired.com/2016/03/epic-story-dropboxs-exodus-amazon-cloud-empire/">Dropbox</a>, <a href="https://medium.com/coursera-engineering/rust-docker-in-production-coursera-f7841d88e6ed">Coursera</a>, etc.</p><h3>Why do we should use Rust ?</h3><p>Even though Rust and C /C++ have almost same speed and performance, the Even though Rust and C /C++ have almost the same speed and performance, the big difference is that Rust is <strong><em>safe by default, </em></strong>which means the rate of successful compile is much higher. Rust will guarantee of correctness of your code than another programming language. With Rust’s characteristics, <strong>statically </strong><em>(all types are known at compile-time)</em> and <strong>strongly<em> </em></strong><em>(these types are designed to make it harder to write incorrect programs), </em>Rust will be perfect for “<strong><em>Hardcore”</em></strong><em>, such as </em>operating systems, device drivers, and embedded systems that might not even have an operating system. However, it’s a very adorable programming language to write standard or web application code.</p><p>Rust makes the best possible machine code with complete control of memory and data. Rust checks all memory and data type accesses. It is <strong>almost impossible</strong> to corrupt memory by accident. With strictly enforcing <strong><em>safe borrowing</em></strong> of data, it makes Rust code “<strong>Beautiful</strong>.”</p><h3>Let’s Get Started with Newbie’s Tradition, Hello World…</h3><h4>First, environment...</h4><p>As usual, we do need to set up an environment for Rust. We’ll download Rust through rustup, a command-line tool for managing Rust versions and associated tools.</p><p>On Linux or macOS, we can install it by open terminal and enter the following command:</p><pre>$ curl --proto &#39;=https&#39; --tlsv1.2 <a href="https://sh.rustup.rs/">https://sh.rustup.rs</a> -sSf | sh</pre><p>For Windows, go <a href="https://www.rust-lang.org/tools/install"><strong><em>here</em></strong></a> and follow the instructions for installation.</p><blockquote>We’ll need the C++ build tools for Visual Studio 2013 or later. The easiest way to acquire the build tools is to install <a href="https://visualstudio.microsoft.com/visual-cpp-build-tools/">Build Tools for Visual Studio 2019</a>.</blockquote><h4>Coding Time !!</h4><p>Rust files always end with the <em>.rs</em> extension. If you want to use more than one word for your filename, you can use an underscore to separate them. For example, <em>hello_world.rs</em>. For now, let’s name it with <em>main.rs</em>.</p><p>The basic structure of Rust code is :</p><pre>fn main() {<br>    println!(&quot;Hello, world!&quot;);<br>}</pre><p>The code above is a <strong><em>main function. </em></strong>The main function is special. As like C/C++, it’s the function that will be called for every executable Rust program. The first line declares a function named main that has no parameters and returns nothing.</p><p>Inside the main function, we have println!(&quot;Hello, World&quot;);. The println!is called a Rust <em>macro</em>, which is how meta-programming is done in Rust (<em>For further explanation please wait for the next month&#39;s blog...</em>). Basically with println!, Rust will print the argument inside, &quot;Hello, World&quot;. The line ends with a semicolon (;). The <strong><em>;</em></strong> indicates that this expression is over.</p><h4>Finish it !!!</h4><p>Save the code, and go back to your terminal window. On Linux or macOS, enter the following commands:</p><pre>$ rustc main.rs<br>$ ./main<br>Hello, world!</pre><p>If you are Windows team, use .\main.exe instead of ./main.</p><pre>&gt; rustc main.rs<br>&gt; .\main.exe<br>Hello, world!</pre><p>If you did see Hello, world!, then congratulations! You’ve finished the Newbie’s Tradition~ Now you have officially become Rust programmer! Welcome!!!</p><p>If you want to explore other cool blogs of technologies, please stay tune on <a href="https://medium.com/ecloudture"><strong><em>eCloudture Medium</em></strong></a><strong><em> !!!</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2c039d7c9df" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ecloudture/most-loved-languages-in-this-century-rust-d2c039d7c9df">Most Loved Languages in This Century, Rust</a> was originally published in <a href="https://medium.com/ecloudture">eCloudture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[使用 Azure QnA Maker 快速建立 Line AI 聊天機器人]]></title>
            <link>https://medium.com/ecloudture/%E4%BD%BF%E7%94%A8-azure-qna-maker-%E5%BF%AB%E9%80%9F%E5%BB%BA%E7%AB%8B-line-ai-%E8%81%8A%E5%A4%A9%E6%A9%9F%E5%99%A8%E4%BA%BA-7c6621d81bcf?source=rss----55265c636a4b---4</link>
            <guid isPermaLink="false">https://medium.com/p/7c6621d81bcf</guid>
            <category><![CDATA[qna-maker]]></category>
            <category><![CDATA[microsoft]]></category>
            <category><![CDATA[azure]]></category>
            <dc:creator><![CDATA[Josie Tseng]]></dc:creator>
            <pubDate>Tue, 04 Jan 2022 03:54:39 GMT</pubDate>
            <atom:updated>2022-01-04T03:54:39.120Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>聊天機器人為何越來越重要？</strong></h4><p>各家通訊平台如 Facebook、Slack、Line、Telegram 等陸續開放了聊天機器人 API 之後，使得品牌與使用者之間，逐漸習慣透過通訊軟體互動，進而成為最主要的溝通管道之一。再加上後端導入 AI 相關應用延伸技術，聊天機器人不僅可以回應客戶的提問，收集客戶需求，還可以分析與預測客戶，或是透過對話完成流程中的主要任務，例如：餐廳訂位、查詢訂位紀錄等，演進成為兼具客服與行銷的全能聊天機器人。</p><h4><strong>如何開發聊天機器人？</strong></h4><p>然而，想要建立一個聰明的聊天機器人，往往需要事前的需求分析，規劃對話的 Function 與 Flow，根據不同的通訊平台所提供的 API、介面和元件，設計回應的呈現方式，再將整理好的相關對話文本，輸入各家通訊平台的後台中，如果要加上特殊的功能需求，就需要額外串接 API 的程式碼，反覆測試後，才能開發出一個有聰明感的聊天機器人。不僅有技術門檻，還需要跨部門的團隊合作，因此有許多的相關業者，受限於技術門檻及有限資源而不敢輕易投入。</p><h4><strong>一址就可入魂的 Azure QnA Maker</strong></h4><p>那麼，市場現有的服務內容中，是否有簡易導入的方法，只需要以現有的常見問題集文件為基礎，加上簡單的設定，就可以快速建立可交談式的聊天機器人，即刻上線協助企業處理大量的客戶服務需求呢？ 答案是肯定的。只需透過 Azure QnA Maker 及內建的 Knowledge Base 服務，從公開網址匯入資料後，就可以建立企業專屬的客戶服務知識庫。 Azure QnA Maker 支援多達數十種的語言，當然也包含繁體中文，因此無論是哪種語言的使用者都可以輕易地建立相對應的聊天機器人。</p><h4><strong>情境</strong></h4><p>以下介紹如何透過 Azure QnA Maker 建立中文聊天機器人的流程，並教您如何快速導入專屬的 LINE Chatbot 當中。</p><p>首先，我們需要先建立 Azure QnA Maker，接著新增對應的 Knowledge Base ，成功匯入常見問題集的 Q&amp;A 後，發佈新增好的 Knowledge Base，出現成功發佈的畫面後，繼續新增 Azure Bot Web APP 服務。將取得 LINE Messaging API 的 Credentials ，儲存到 Azure Bot Channel ，最後將 Azure Bot 產出的 webhook URL ，儲存在 LINE Channel 屬性裡，即可打通 Azure 與 LINE 的聊天機器人。</p><p>其次，本次操作使用的常見問題集，以 [eCloudture E-learning Platform FAQ ](https://faq.ecloudture.com/) 為範例，預設 Chatbot 問題如下 :</p><ul><li>要如何進行註冊呢？</li><li>為何我無法註冊或是註冊失敗呢？</li><li>我確認輸入了正確帳密，卻顯示網站為惡意網頁無法登入</li><li>要如何查看課程完成進度呢？</li></ul><p><strong>使用資源包括 :</strong></p><ul><li>Azure QnA Maker 自然語言處理 (NLP) 服務</li><li>Knowledge base 自訂義 QnA Maker 問答內容</li><li>Azure Search 內建的 AI 雲端搜尋服務</li><li>Azure Bot 建立交談式聊天機器人服務</li><li>LINE developer accounts</li><li>常見問題公開網址(URL)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZGwZEgC9xQfWT6fQHfOcqg.png" /></figure><h4><strong>設置方法及步驟</strong></h4><h4><strong>Task 1：在 Azure 平台新增一個 QnA Maker 服務</strong></h4><ul><li>進入 Azure Portal 搜尋 QnA Makedr，按下<strong>新增</strong></li><li>選擇免費方案，提供您這一次的測試</li><li>Pricing tier : <strong>Free F0</strong></li><li>Azure Search pricing tier: <strong>Free F (3 index)</strong></li></ul><h4><strong>Task 2：新增 QnA Maker 知識庫</strong></h4><ul><li>使用 Azure 帳號登入 <a href="https://www.qnamaker.ai/">Qnamaker.ai</a></li><li>Create a knowledge base</li><li>在 STEP 2 中</li><li>Azure QnA service : 找到您剛剛建立的 Azure QnA Service</li><li>Language : <strong>Chinese Traditional</strong></li><li>在 STEP 3 為您的知識庫命名</li><li>在 STEP 4，可直接輸入既有的常見問題網頁位址，如 ecloudture elearning 學習平台常見問題 URL : <a href="https://faq.ecloudture.com/"><strong>https://faq.ecloudture.com/</strong></a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hr0aeMyLY2j0faGIFp_FdA.png" /></figure><ul><li>在 STEP 5 按下 <strong>Create your KB</strong></li><li>按下右上角 <strong>Test</strong> 嘗試與 Bot 對話</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q6ANY-exRNFqoaIKoRzsrg.png" /></figure><ul><li>可自行新增問題關鍵字組，記得按下 <strong>Save and Train</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fbx6cL0OyY6v0yuoJ15XeQ.png" /></figure><ul><li>最後，記得按下 <strong>Publish</strong>，才算建立完成</li><li>成功發佈後，按下 <strong>Creat Bot</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cmh6xXIWG8yxW_K8RBj6ZQ.png" /></figure><h4><strong>Task 3: 在 Azure 平台新增 Web App Bot 服務</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*CsecEAMqrY6gllkwMpKixQ.png" /></figure><h4><strong>Task 4：將 Azure Bot Services 串接到 Line</strong></h4><ul><li>使用 LINE 帳號登入到 <a href="https://developers.line.biz/console/">LINE developer console</a></li></ul><blockquote>登入後，如果您尚未擁有 LINE developer 帳號，請先進行註冊</blockquote><ul><li>Create a new provider</li><li>Create Messaging API channel</li><li>Create a channel 填寫頻道資訊</li><li>選擇同意</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/1*d3sHnu3YTiCl6aOdB7VWEA.png" /></figure><ul><li>複製好 Channel secret</li><li>切換到 Tab : <strong>Messaging API</strong></li><li><strong>Channel access token</strong></li><li>點擊 issue 取得 access token</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*09i0GiO0ahC3RbNT3lDyjQ.png" /></figure><ul><li>channel secret 與 access token 儲存好在文件中</li><li><strong>回到 Azure Portal Web App Bot &gt; Channels &gt; 找到 LINE</strong></li><li>將 channel secret 與 access token 輸入 <strong>LINE credentials</strong></li><li>複製 webhook URL</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YfyvxRRebP4mCrONsgBzJA.png" /></figure><ul><li><strong>回到 LINE developer console</strong></li><li>在 Tab : Messaging API &gt; webhook URL &gt; 貼上 Azure 提供的 webhook URL</li><li>更新並點撃 <strong>Verify</strong> 驗證成功後，開啟 <strong>Use webhook</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*re0SPld20sFuuytqaOsU5A.png" /></figure><ul><li>關閉 LINE 聊天機器人自動回覆功能</li></ul><h4><strong>Task 5：將建好的 ChatBot 加入 Line</strong></h4><ul><li>用 Bot basic ID 加入 或掃描 QR code</li><li>與 LINE 機器人對話</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3XbbK1oKnnaw9vGkdYSHZA.png" /></figure><h4><strong>結論</strong></h4><p>企業經常使用的聊天機器人有兩種 :</p><ul><li>交易型聊天機器人，屬於問題解決導向，通常會透過設計好的選單，引導使用者取得較少變動的資訊，或特定流程，因此依賴 AI 技術的層級較低。</li><li>交談式聊天機器人，目的是透過與使用者交談式，來理解使用者訊息，必須依賴 AI 自然語言處理 (NLP) 技術，模擬人類交談方式，與使用者進行溝通，並回應相對應的知識資料庫的存取。</li></ul><p>本篇文章僅介紹簡單介紹創建 Azure QnA Maker 服務，事實上 Azure QnA Maker 還提供<a href="https://docs.microsoft.com/en-us/azure/cognitive-services/qnamaker/how-to/chit-chat-knowledge-base?tabs=v1">閒聊系統</a>建立，以及可<a href="https://docs.microsoft.com/zh-tw/azure/cognitive-services/qnamaker/reference-precise-answering">精確應答的功能</a>...等功能，希望賦予聊天機器人更聰明、更人性化的可能性 。企業只需導入雲端機器人服務 ，不需要耗時費力訓練自己的 AI 模型，就可以隨時建立可用的客戶服務，從而提高客戶滿意度。因此，建議所有企業建立專屬的 AI 聊天機器人，為下一個世代的戰場打下基礎。</p><h4><strong>參考來源</strong></h4><ul><li><a href="https://docs.microsoft.com/zh-tw/azure/cognitive-services/qnamaker/overview/overview">什麼是 QnA Maker？</a></li><li><a href="https://docs.microsoft.com/en-us/azure/cognitive-services/qnamaker/concepts/data-sources-and-content#content-types-of-documents-you-can-add-to-a-knowledge-base">Importing from data sources</a></li><li><a href="https://docs.microsoft.com/zh-tw/azure/bot-service/bot-service-channel-connect-line?view=azure-bot-service-4.0">將 Bot 連線至 LINE</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c6621d81bcf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ecloudture/%E4%BD%BF%E7%94%A8-azure-qna-maker-%E5%BF%AB%E9%80%9F%E5%BB%BA%E7%AB%8B-line-ai-%E8%81%8A%E5%A4%A9%E6%A9%9F%E5%99%A8%E4%BA%BA-7c6621d81bcf">使用 Azure QnA Maker 快速建立 Line AI 聊天機器人</a> was originally published in <a href="https://medium.com/ecloudture">eCloudture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>