<?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 Viraj Rane on Medium]]></title>
        <description><![CDATA[Stories by Viraj Rane on Medium]]></description>
        <link>https://medium.com/@vsr061?source=rss-493f13e8d0ef------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*lGPmRVEPc6xDl_7CUSbWPg.jpeg</url>
            <title>Stories by Viraj Rane on Medium</title>
            <link>https://medium.com/@vsr061?source=rss-493f13e8d0ef------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 01:33:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vsr061/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[Develop Front End Components with AEM Coral UI]]></title>
            <link>https://medium.com/@vsr061/develop-front-end-components-with-aem-coral-ui-2da905096cce?source=rss-493f13e8d0ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/2da905096cce</guid>
            <category><![CDATA[adobe-experience-manager]]></category>
            <category><![CDATA[aem-features]]></category>
            <category><![CDATA[adobe]]></category>
            <category><![CDATA[aem]]></category>
            <category><![CDATA[adobe-experience-platform]]></category>
            <dc:creator><![CDATA[Viraj Rane]]></dc:creator>
            <pubDate>Tue, 14 Apr 2020 22:00:47 GMT</pubDate>
            <atom:updated>2020-04-14T22:00:47.638Z</atom:updated>
            <cc:license>http://creativecommons.org/publicdomain/zero/1.0/</cc:license>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W9DEeR3y6t_5_rnSsWlagQ.png" /></figure><p><a href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/coral-ui/coralui3/index.html"><strong>Coral UI</strong></a> is a library of touch-first web components, used to ease the work of a front end developer. All components build in Coral UI are simple to use and responsive. These components help to keep the look and style of the platform uniform.</p><blockquote><strong>You can find Coral UI cilentlibs under:</strong><br><strong>Coral UI2: </strong><em>/libs/clientlibs/granite/coralui2</em><br><strong>Coral UI3</strong>: <em>/libs/clientlibs/granite/coralui3<br></em><strong>Also, here are the clientlibs categories for Coral UI:</strong><br><strong>Coral UI2:</strong> granite.ui.foundation, granite.ui.foundation.admin, coralui2<br><strong>Coral UI3</strong>: granite.ui.coral.foundation, coralui3</blockquote><h3>🤔 Why use Coral UI?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y3q4AlPeQsj7qtH_kWxs3A.png" /><figcaption><a href="https://docs.adobe.com/content/help/en/experience-manager-65/deploying/upgrading/sustainable-upgrades.html"><strong>Non-overlay safe</strong></a></figcaption></figure><p>We can add different components on any AEM UI page/toolbar using <a href="https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/index.html"><strong><em>Granite Server Side Components</em></strong></a><strong><em>. </em></strong>We can simply overlay the respective node in AEM and add a custom component node in it (<a href="https://medium.com/@vsr061/create-custom-aem-menu-tools-with-granite-ui-shell-53c56e435f8a">checkout for more information</a>). But, Some nodes in AEM are not safe to overlay <strong><em>(granite:FinalArea, granite:InternalArea) </em></strong>like<em> /libs/cq/inbox/content/inbox</em>,<br>/libs/cq/workflow/admin/console/content/instances, etc 😥. So, to add our custom components like buttons, drop-downs, text fields, etc., we can utilize the existing Coral UI library and initialize these components using javascript and then add respective toolbar clientlibs category to load our js with the OOTB clientlibs 😊. Even you can override existing js event handlers with this and add some extra features to buttons or components 🤩.<br>In this tutorial, we will add two buttons in the AEM Inbox action bar.</p><h3>Add buttons in the AEM Inbox action bar</h3><ul><li><strong>Step 1: </strong>Get the clientlibs category of the target page. We need to create a<br>clientlibs folder in our project with this category. So, it will get loaded after the targeted page’s clientlibs.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bi-UV8xJYJ8jWLivUKpPzQ.png" /></figure><ul><li><strong>Step 2:</strong> Create a clientlibs folder with the category received from <strong>Step 1</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B0WcgTsNQqOPaku5rXwOXA.png" /><figcaption><strong>Here, I have created the folder with categories(String[]) = cq.inbox.gui, which is same as the category we received in Step 1</strong></figcaption></figure><ul><li><strong>Step 3: <em>Start Coding with the Coral UI library!<br></em></strong>So, before starting with actual code we will understand the folder structure and what each file is for. Check the following image of the folder structure:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/382/1*zjyyWp_Y3qZlkM5ZRNe71w.png" /><figcaption><strong>Project file structure</strong></figcaption></figure><ol><li><strong>actions: </strong>This folder has JS code to handle button click events. This is based on <a href="https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/clientlibs/foundation/index.html">Granite UI client-side JS components</a> called <a href="https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/clientlibs/foundation/js/collection/action/index.html">foundation-collection-action</a>.</li><li><strong>buttons: </strong>It contains the <a href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/coral-ui/coralui3/Coral.Button.html">Coral UI library</a> code to initialize button components.</li><li><strong>init.js: </strong>It initializes the buttons’ code written in the above folder.</li><li><strong>show-hide.js: </strong>As we are developing these buttons for assets, this show-hide.js handles the item select event in AEM Inbox and show the buttons if the item’s payload in under DAM, else hide the buttons.</li></ol><p>Now, let’s talk about the individual code:</p><ol><li><strong>foundation-collection-action:</strong></li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/120212c25d65068174c04ccdf5cba227/href">https://medium.com/media/120212c25d65068174c04ccdf5cba227/href</a></iframe><p>Granite UI has a client-side JS component called <a href="https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/clientlibs/foundation/js/collection/action/index.html"><strong>foundation-collection-action</strong></a><strong>. </strong>foundation-collection-action is a control to perform an action related to <a href="https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/clientlibs/foundation/vocabulary/selections.html">foundation-selections</a>. So, when you select any item in Inbox this event can be handled using foundation-collection-action to get selected items easily. handler function triggers on the <em>“click”</em> event and passes the selected items ( selections ) and config(a configuration stored in the button as JSON in the HTML data attribute), which has an action name and other parameters to read data from selected items. For the above code linkAttributeName has a value payloadLink stored in button configuration to read data from Inbox item that is payload link of the selected item (check button configuration <a href="https://github.com/vsr061/coral-ui-components/blob/65ff4b2a46743bb01891a871cb18e5ef9ffe47b9/ui.apps/src/main/content/jcr_root/apps/coraluicomponents/clientlibs/clientlib-inbox/js/buttons/download.js#L23"><strong>code</strong></a>). The action handler will be called when the name matches. A chain of registered actions is created using LIFO (last in, first out) algorithm. So, you can override the default handler easily, just by registering custom handler code later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_whWi8Cbq98XdwLAVJlxNQ.png" /><figcaption><strong>Payload link data attribute</strong></figcaption></figure><p><strong>2. Coral UI Button:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/37f7cef8baa91404b8eabe78e102bdf4/href">https://medium.com/media/37f7cef8baa91404b8eabe78e102bdf4/href</a></iframe><p>Coral UI has many components and all can be instantiated easily with JS, without adding a hardcoded string of HTML. Learn more about the Coral Button component <a href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/coral-ui/coralui3/Coral.Button.html">here</a>.</p><p><strong>3. Coral UI Action Bar (</strong><a href="https://github.com/vsr061/coral-ui-components/blob/master/ui.apps/src/main/content/jcr_root/apps/coraluicomponents/clientlibs/clientlib-inbox/js/init.js"><strong>init.js</strong></a><strong>):</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/12b86efe0987586604b04ceffe9f3ebe/href">https://medium.com/media/12b86efe0987586604b04ceffe9f3ebe/href</a></iframe><p>To add these buttons in the Inbox action bar we can use the existing appendChild() method and pass the respective buttons. leftItems are the buttons which we see on the left side of the action bar like complete, step back, etc. Here, <a href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/coral-ui/coralui3/Coral.commons.html#Coral.commons:.ready">Coral.commons.ready()</a> checks whether Coral components and all nested components are ready, which assures their _initialize and _render methods have been called. If so, the provided callback function is executed.</p><p><strong>4. Hide buttons for payload other than assets:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/43a7d2319ed6d63159511c8775ac3b3b/href">https://medium.com/media/43a7d2319ed6d63159511c8775ac3b3b/href</a></iframe><p>This is a simple <em>“click”</em> event handler which gets triggered when we click on the item’s checkbox. As these buttons are specifically for assets, if the selected item payload is not under /content/dam then, these buttons should not be visible.</p><h3>Conclusion:</h3><p>Coral UI is a very useful library while developing the front end components which are part of AEM UI. This makes components uniform throughout the platform. Also, code management gets easy as many lines of boilerplate code are avoided.</p><h3>Code:</h3><p><a href="https://github.com/vsr061/coral-ui-components">Github</a></p><blockquote><em>Check my other stories </em><a href="https://medium.com/@vsr061"><strong>here</strong></a></blockquote><h3>References:</h3><ol><li><a href="https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/coral-ui/coralui3/index.html">Coral UI</a></li><li><a href="https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/index.html">Granite UI</a></li></ol><p><a href="https://www.linkedin.com/in/viraj-rane">Viraj Rane - Analyst - Goldman Sachs | LinkedIn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2da905096cce" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create Custom AEM Menu Tools with Granite UI Shell]]></title>
            <link>https://medium.com/@vsr061/create-custom-aem-menu-tools-with-granite-ui-shell-53c56e435f8a?source=rss-493f13e8d0ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/53c56e435f8a</guid>
            <category><![CDATA[customization]]></category>
            <category><![CDATA[aem]]></category>
            <category><![CDATA[aem-dialog]]></category>
            <category><![CDATA[adobe]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Viraj Rane]]></dc:creator>
            <pubDate>Sat, 10 Aug 2019 16:36:01 GMT</pubDate>
            <atom:updated>2019-08-13T17:40:16.330Z</atom:updated>
            <cc:license>https://creativecommons.org/publicdomain/mark/1.0/</cc:license>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JbIvnUjU3E3C4QtulKbgIw.png" /></figure><p><a href="https://en.wikipedia.org/wiki/Eps1.0_hellofriend.mov">Hello Friend!</a> Have you ever wanted to build your custom menus under <strong><em>AEM Tools</em></strong> like<em> </em><strong><em>ACS AEM </em></strong><a href="https://adobe-consulting-services.github.io/acs-aem-commons/"><strong><em>Commons</em></strong></a><em> or</em><strong><em> </em></strong><a href="https://adobe-consulting-services.github.io/acs-aem-tools/"><strong><em>Tools</em></strong></a>, then this story is for you!</p><p>Here, I have developed a <a href="https://github.com/vsr061/aem-excel-to-json"><strong>XLS/XLSX to JSON Converter tool</strong></a> which converts Excel file to a JSON and stores in JCR.</p><blockquote>Code will be available<strong> </strong><a href="https://github.com/vsr061/aem-excel-to-json"><strong>here</strong></a></blockquote><p>In this tutorial we will learn about two major concepts which get used while <em>customizing</em> AEM</p><ul><li><strong>Sling Resource Merger</strong></li><li><strong>Granite UI</strong></li></ul><p>So, let’s get started.</p><h3><strong>Sling Resource Merger</strong></h3><p>The <a href="https://helpx.adobe.com/in/experience-manager/6-4/sites/developing/using/sling-resource-merger.html">Sling Resource Merger</a> provides services to access and merge resources. It provides diff (differencing) mechanisms for both:</p><ol><li><strong><em>Overlays:</em></strong> For overlays the resource delivered is an aggregate of the resources and properties retrieved, depending on search paths that can be defined.In a standard installation the primary defaults are <strong><em>/apps</em></strong><em>, </em><strong><em>/libs</em></strong><em> </em>— so the content of <strong><em>/apps</em></strong> has a higher priority than that of <strong><em>/libs</em></strong> (i.e. it <em>overlays</em> it). Means if you have a same node under <strong><em>/apps</em></strong> as that of under <strong><em>/libs</em></strong>, then AEM will read the results from <strong><em>/apps</em></strong></li><li><strong><em>Overrides: </em></strong>It overrides of component dialogs for the touch-enabled UI (<strong>cq:dialog</strong>), using the resource type hierarchy (by means of the property <strong>sling:resourceSuperType</strong>).</li></ol><blockquote><strong>The goal for using the Sling Resource Merger in AEM is to:</strong></blockquote><blockquote>ensure that customization changes are not made in <strong>/libs</strong>.</blockquote><blockquote>This is because the content of <strong>/libs</strong> is overwritten the next time you upgrade your instance (and may well be overwritten when you apply either a hotfix or feature pack).</blockquote><p>for our tutorial we will use <strong><em>Overlays </em></strong>to overlay the AEM Tools node under <strong><em>/libs</em></strong> and create a similar node structure under <strong><em>/apps</em></strong></p><p>It’s easy and can be done with one <strong>right-click</strong> on the following path and then select <strong>Overlay Node …</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fp2_WMdh0zPR2mNq0YFRmQ.png" /><figcaption><strong>Path: </strong><em>/libs/cq/core/content/nav/tools</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/424/1*1hTLPJiIqv0dN_dss5ofSQ.png" /><figcaption>Then, select <strong>Match Node Types</strong>(Optional)</figcaption></figure><p>So, it will create similar node structure as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/443/1*B_TjuK5PPuWR_p0igLK-QQ.png" /><figcaption><strong>New Path: </strong>/apps/cq/core/content/nav/tools</figcaption></figure><p>Now, we can add custom nodes here to add our Menu under Tools. So, to add new item to the Menu List, we can add a node of type <strong>nt:unstructured </strong>or a folder. I have added a folder of type <strong>sling:OrderedFolder. </strong>The next part is to add <strong><em>id </em></strong>and <strong><em>jcr:title,</em></strong></p><ol><li><strong>id:</strong> Here, id should be <strong>unique</strong>( The recommended value is hierarchical separated by “-“. e.g. “<strong>cq-commerce-report</strong>”)</li><li><strong>jcr:title:</strong> Renders the Title of the Menu Item.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h-pvUHWzzM3wkiHJu1R86g.png" /><figcaption>New node of <strong>custom-tools</strong> under <strong>tools</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i2Rwf-nyXLstNXi1zQNHWg.png" /><figcaption><strong>custom-tools</strong> node gets render as <strong>Custom Tools</strong> menu item with title coming from <strong>jcr:title </strong>property on the node</figcaption></figure><p>Now, to create an actual tool option, we will add one more <strong>nt:unstructured </strong>node with following properties:</p><ol><li><strong>href:</strong> Location of the <strong>Tool’s landing page</strong> (generally <strong>cq:Page</strong> under <strong>/apps</strong> or <strong>/content</strong>)</li><li><strong>target: href </strong>target attribute</li><li><strong>icon:</strong> You can give a name of a available icon in the <a href="https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/reference-materials/coral-ui/coralui3/Coral.Icon.html#availableIcons">Coral UI</a></li><li><strong>id:</strong> Here, id should be <strong>unique</strong>( The recommended value is hierarchical separated by “-“. e.g. “<strong>cq-commerce-report</strong>”)</li><li><strong>jcr:description:</strong> Description for your tool</li><li><strong>jcr:title: </strong>Title for your tool</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sr4r9_MNcMCeVR-zfGfMHA.png" /><figcaption>Actual tool node: <strong>xls-to-json</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h8MZflcdu5kenBecyT3UfQ.png" /><figcaption>Rendered Menu Option</figcaption></figure><h3><strong>Granite UI</strong></h3><blockquote>Granite Documentation will be available <a href="https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/index.html">here</a></blockquote><p>It’s a time to develop the Landing Page for our tool and this can be done in many ways, but still I have used Granite UI for the following reasons:</p><ol><li>It’s easy; just like creating your Touch UI Dialog with LEGO® Architecture.</li><li>Easy to maintain.</li><li>Less or no code required.</li></ol><p>To create Landing Page, I have created a AEM multi-module maven project and added a page under <strong><em>/apps/excel-to-json/components/content </em></strong>developed using <a href="https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/shell/page/index.html"><strong>Granite UI Shell Page</strong></a> component.</p><p>I have added the <strong>Granite Server Side components</strong> like <a href="https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/fileupload/index.html"><strong>FileUpload</strong></a><strong> </strong>and <a href="https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/pathfield/index.html"><strong>PathField</strong></a><strong> </strong>to upload the Excel file and to select the path to store converted JSON.</p><p>Excel file gets uploaded to a <a href="https://github.com/vsr061/aem-excel-to-json/blob/master/core/src/main/java/com/excel/json/core/servlets/ExcelToJSONServlet.java"><strong>Servlet</strong></a> and then it converts the table to JSON format, where each <em>row </em>gets converted to a <em>JSON object</em> with <em>column name</em> as <em>property</em> and cell value as the <em>property value</em>.</p><h4><strong>Granite UI Shell Page</strong></h4><p>Granite Shell Page is the generic page to render Shell. So, it will get rendered as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tBkTw2hSycLi-0LGD7PwOQ.png" /><figcaption>Blank Shell Page</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j-zWVA4SvaYdxB1VHrIOlQ.png" /><figcaption>cq:Page Node Structure for the Shell Page</figcaption></figure><p>To know all the Shell page properties, you can refer <a href="https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/shell/page/index.html"><strong>this</strong></a><strong> </strong>page. I will focus on some main properties required to render the page:</p><p><strong>head: </strong>A folder to specify the content of &lt;head&gt; of the page. Its child resources are iterated and included as is. You need to use <a href="https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/includeclientlibs/index.html"><strong><em>IncludeClientlibs</em></strong></a><strong><em> </em></strong>component to add your js and css libraries. Don’t forget to add “<strong>granite.ui.coral.foundation</strong>” category.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rrgnyxsx-rGa3ZLgQcOcIA.png" /><figcaption><strong>IncludeClientlibs </strong>under head</figcaption></figure><p><strong>title: </strong>The component to render the title.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q3dJ0qMejf8czI3-uwXwBw.png" /><figcaption>title node</figcaption></figure><p><strong>title </strong>gets rendered to as shown below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cVXDoqhwoOWkc4Vv8vXEkg.png" /><figcaption>Rendered Title from <strong>title node</strong></figcaption></figure><p><strong>content: </strong>The actual content of the page. Here, you can add <em>sling:resourceType</em><strong> </strong>for rendering script or use Granite UI Components as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2gzpJgjatltt4p3NYCpFHQ.png" /><figcaption>Granite UI Server Side components</figcaption></figure><blockquote><strong>Final Page:</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uJNsqaaDUa3TPRVVCaQOxg.png" /><figcaption>Final Landing Page</figcaption></figure><h3><strong>Code:</strong></h3><p><a href="https://github.com/vsr061/aem-excel-to-json">Github</a></p><blockquote>Check my other stories <a href="https://medium.com/@vsr061"><strong><em>here</em></strong></a></blockquote><h3><strong>References:</strong></h3><ol><li><a href="https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/index.html#">Granite UI Documentation</a></li><li><a href="https://helpx.adobe.com/in/experience-manager/6-4/sites/developing/using/sling-resource-merger.html">Sling Resource Merger</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=53c56e435f8a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adobe Experience Manager Security Issues]]></title>
            <link>https://medium.com/@vsr061/adobe-experience-manager-security-issues-9b5bd24e0eb0?source=rss-493f13e8d0ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b5bd24e0eb0</guid>
            <category><![CDATA[adobe-experience-manager]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[aem]]></category>
            <dc:creator><![CDATA[Viraj Rane]]></dc:creator>
            <pubDate>Sat, 13 Jul 2019 14:26:39 GMT</pubDate>
            <atom:updated>2019-07-13T14:26:39.538Z</atom:updated>
            <cc:license>http://creativecommons.org/publicdomain/zero/1.0/</cc:license>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fz_VDXrLvIEIiEoes0hToA.png" /></figure><p><a href="https://en.wikipedia.org/wiki/Eps1.0_hellofriend.mov"><strong>Hello, Friend</strong></a><strong>!</strong> Today I want to share some information about general security issues which I found in sites developed with Adobe Experience Manager<strong>(AEM)</strong>. AEM is a leader in the <strong>Web Content Management Platform</strong> and it is proved with <strong>Gartner</strong>’s past few years’ magic quadrants. It is easy to manage content, assets, and websites with AEM and takes less time to deliver your website. Also, it is <strong>Omnichannel </strong>so, you can easily share your content across all your devices.</p><p>Personally, I love AEM and working with it from last 1 year (although, I have started career 1 year back only 😛).</p><blockquote>AEM is a powerful tool which you can customize to a great extent but, <a href="https://en.wikipedia.org/wiki/Uncle_Ben"><strong>“With great power comes great responsibility”</strong></a> and here sometimes AEM Administrators fail. AEM is complex as it is built on many frameworks with custom modules to glue these different frameworks and when there is complex stuff, there can be a chance for security bugs.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*dQvHPO8ukWjqXUzkUrbYcg.png" /><figcaption>AEM Architecture</figcaption></figure><blockquote>So, if you ignore security, <a href="https://en.wikipedia.org/wiki/Mr._Robot"><strong>Mr. Robot</strong></a> and <strong>fsociety </strong>will definitely get into your home without your realization.</blockquote><p>So, let’s start with the security issues I found:</p><h3><strong>First Thing First</strong></h3><p>If your AEM Administrator, please go through the <a href="https://helpx.adobe.com/in/experience-manager/6-4/sites/administering/using/security-checklist.html"><strong>AEM’s Security checklist</strong> </a>and follow it strictly and never ever forget to use <strong>“nosamplecontent”</strong> with <strong>“publish” </strong>mode.</p><p>If you are not using <strong>“nosamplecontent”</strong> then, you can see below what will happen:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l-HdKg67pn-KRTK--PCQOw.png" /><figcaption><a href="https://www.maxlifeinsurance.com/content/geometrixx/en.html">https://www.maxlifeinsurance.com/content/geometrixx/en.html</a></figcaption></figure><p>This issue becomes big when users available with these sample websites are still production server as people know the default passwords for these sample users. They can try to login with these credentials with <strong>Basic Auth</strong> setup in <a href="https://www.getpostman.com/"><strong>Postman</strong></a><strong> </strong>but, guess what AEM login page is available 😋.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DxFeV3a3VC05moq_PKBlFQ.png" /><figcaption><a href="https://www.maxlifeinsurance.com/login.html">https://www.maxlifeinsurance.com/login.html</a></figcaption></figure><p>Sometimes, even <strong>/login.html</strong> path is not blocked on Dispatcher and many developers forget to select <strong>Account Locking option</strong> in Administration Console. So, Brute Force is possible here.</p><p>I also found on one website that Replication Agent’s path (<strong>/etc/replication/agents.publish.html</strong>) is not blocked. But I will not disclose the name of that website as I have already reported them a issue.</p><p>So, before going further, please check for these paths and block them on the dispatcher.</p><h3>Elementary, my dear JSON</h3><p>As AEM is built on a <strong>Sling Framework</strong> and it can export data in <strong>JSON </strong>format easily, sometimes just replacing .html extension of website’s page with .json will let you know at what date and time it is modified. Adding extra <strong>/jcr:content.json</strong> will tell you who authored this page and some metadata or details which are on the page node.</p><p>Sometimes it’s okay and not a big security threat as it just a data which is intended to be public. But, sometimes business email ids are stored in AEM which can expose the business people email ids who are managing the content for the website. As it is not possible to disable the JSON rendering (which is more like a feature rather than an issue). We can take preventive measures to protect our data, like limiting <strong>JSON Max result size</strong> in <strong>Apache Sling GET Servlet configuration</strong> and all these details are already added in AEM Security checklist.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xLHTTQ2C56RRFZvu84KM9Q.png" /><figcaption><strong>Business Email ID</strong></figcaption></figure><p>This is the small problem and will not hurt you much, but what if somehow end user executes query and get your entire repository and check what is there which is accessible to an anonymous user. This problem is there with many websites and can be seen directly using <strong>/bin/querybuilder.json</strong> path. Here, users can execute a query in the repository by passing the query parameters in URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ga55Rj_BMYrJIjingMtWVg.png" /><figcaption><a href="https://www.maxlifeinsurance.com/bin/querybuilder.json?path=/content&amp;type=cq:Page&amp;p.limit=1000">https://www.maxlifeinsurance.com/bin/querybuilder.json?path=/content&amp;type=cq:Page&amp;p.limit=1000</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jDlV1bp6yNykHaF4oZp-Qg.png" /><figcaption><a href="https://www.iciciprulife.com/bin/querybuilder.json?path=/content&amp;type=cq:Page&amp;p.limit=1000">https://www.iciciprulife.com/bin/querybuilder.json?path=/content&amp;type=cq:Page&amp;p.limit=1000</a></figcaption></figure><p>If it is not working directly then confuse the Sling with the following path:</p><p><strong>/bin/querybuilder.json.servlet.css</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H0c97LDW7TwOy14lYH6DOA.png" /><figcaption><a href="https://www.samsung.com/bin/querybuilder.json.servlet.css?path=/content&amp;type=cq:Page&amp;p.limit=1000">https://www.samsung.com/bin/querybuilder.json.servlet.css?path=/content&amp;type=cq:Page&amp;p.limit=1000</a></figcaption></figure><p>With this magic tool, I found that on one website anonymous user has the access to <strong>/apps</strong> and there I found the treasure of different <strong>OSGI Configurations</strong> filled with <strong>Database details</strong>, <strong>AMP Page Server details</strong>, <strong>Solr Server detail</strong>, and the most precious gem was <strong>Marketo API configuration</strong> with <strong>Marketo Client Secret Key</strong> stored as plain text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*48Pa8S0IzZjCu6cEzM1HiQ.png" /><figcaption>AEM Maven Package with OSGI Configurations</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1003/1*UHGOJxEGe0-s6sRTVDs4tg.png" /><figcaption><strong>Marketo Client Secret Key</strong></figcaption></figure><p>I got the above package from the same website as the anonymous user has the access to <strong>/etc/packages</strong>. But now these issues are reported and resolved. Now they have a more secure site than before.</p><p>So, the moral of the story is to manage <strong>anonymous user’s access very seriously</strong> and use <strong>encryption</strong> while storing the sensitive data in OSGI Configurations (Check <strong>Crypto Support</strong> in AEM Web Console under Main -&gt; Crypto Support). Also, try to block querybuilder on the dispatcher.</p><blockquote><strong>TIP:</strong> <em>First block all the access on the dispatcher and then give access one by one.</em></blockquote><h3><strong>Conclusion:</strong></h3><p>AEM is superb and I really love it. Just check your security checklist strictly and keep it updated with <strong>CVE database </strong>(<a href="https://www.cvedetails.com/vulnerability-list/vendor_id-53/product_id-33138/Adobe-Experience-Manager.html">https://www.cvedetails.com/vulnerability-list/vendor_id-53/product_id-33138/Adobe-Experience-Manager.html</a>). Also, keep your AEM instance updated with Adobes’ Security patches and before going live try to do some penetration testing and general security tests.</p><p><strong>P.S. </strong><em>Keep sharing your security issues with communities.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b5bd24e0eb0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>