<?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 Japneet Sahni on Medium]]></title>
        <description><![CDATA[Stories by Japneet Sahni on Medium]]></description>
        <link>https://medium.com/@japneetsahni?source=rss-21381336a990------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*c4_p4bYrx80-gvzKtw6ygA.jpeg</url>
            <title>Stories by Japneet Sahni on Medium</title>
            <link>https://medium.com/@japneetsahni?source=rss-21381336a990------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 19 May 2026 04:00:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@japneetsahni/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[Empowering Credential Injection at scale using HashiCorp Boundary]]></title>
            <link>https://medium.com/@japneetsahni/empowering-credential-injection-at-scale-using-hashicorp-boundary-ee1b877333a5?source=rss-21381336a990------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee1b877333a5</guid>
            <dc:creator><![CDATA[Japneet Sahni]]></dc:creator>
            <pubDate>Sun, 01 Dec 2024 00:00:38 GMT</pubDate>
            <atom:updated>2024-12-03T22:19:11.534Z</atom:updated>
            <content:encoded><![CDATA[<p>In cloud environments, if we have to move towards zero trust security philosophy, we need to bring HashCorp Boundary and Vault integration into play.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/0*XQ3s5TK5DVMIAPoH.gif" /></figure><p>Boundary is an identity-aware proxy solution that provides a simple, secure way to access hosts and critical systems on your network and Vault is HashiCorp’s comprehensive secrets management solution. The typical workflow would be like:</p><ul><li>The Boundary user, through CLI/Desktop app, authenticates to Boundary Control Plane using an identity provider.</li><li>Once authenticated, based on their role in the organization, they are shown certain targets which they can connect to.</li><li>Once they connect to a target, the Boundary Control Plane gets the required dynamic credentials from Hashicorp Vault.</li><li>These dynamic credentials are either brokered or injected in Boundary workers and a proxy connection is made to the target.</li></ul><p>One of the key advantages of this approach is that you will not be specifically bridging the client onto the private network, so, we stay in line with sort of a zero-trust network philosophy where we’re not bridging users onto this private network.</p><h4><strong><em>However, as with any technology, adopting and scaling Boundary across large or complex environments comes with its own set of challenges.</em></strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RVpnNkqwpAX0JRzJ.png" /></figure><p>Let’s take a quick look at some of these challenges. So, during adoption phase, you’ll notice that the credentials are still exposed to the users in case they’re using credential brokering feature or they still end up leveraging static SSH keys from Vault’s KV secret engine. Whereas during scaling phase, you often struggle with accountability and traceability issues in case of shared-user Linux accounts. Also, you might see some resource sprawling in case of multi-user Linux accounts. And then we can’t forget about automating these Boundary and host configurations when you’re talking about thousands of machines which you need to manage.</p><h3>Challenge 1 : Credentials still exposed to the users</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*O44_XVcvOf-A8Rsj.gif" /></figure><p>Organizations often using Boundary OSS rely on <strong><em>credential brokering.</em></strong> However, this approach lacks the ability to fully hide credentials from users. When a user attempts to connect to a target, Boundary’s control plane retrieves the necessary credential from Vault. Unfortunately, this credential is then visible to the user, allowing them to copy and use it to connect to the target. Even if the credential is dynamically generated, it is still exposed to the user, which poses potential security risks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/0*EeXCyqwu_UhtKeUE.gif" /></figure><p>This is where <strong><em>credential injection</em></strong> comes into play. As part of this feature, when a user attempts to connect to a target, Boundary’s control plane retrieves the necessary credential from Vault. But this time, instead of exposing credentials to the user, the Boundary control plane directly injects the credential to the worker and the session is established. This gives a passwordless experience to the user. This is an Enterprise/HCP only feature.</p><h3>Challenge 2 : Using static SSH keys from Vault’s KV secret engine</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/0*6g-iVNmYDuSpnwk9.gif" /></figure><p>We can solve this issue with <strong><em>SSH certificates</em></strong>. With SSH certificates, the user’s authenticity is based on possession of a certificate signed by the trusted certificate authority (CA). Instead of having to provision and deprovision keys across your infrastructure, SSH certificates allow you to specify how long a certificate is valid for or which users the certificate holder can login as. In this workflow:</p><ul><li>Boundary generates SSH key-pair and sends to Vault</li><li>Vault signs the certificate and sends back to Boundary control plane</li><li>Control plane injects credentials to worker</li></ul><h3>Demo for passwordless authentication</h3><p>Please follow the demo in below talk which I presented during HashiConf 2024 in Boston.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FChXaKV0XYHE%3Fstart%3D636%26feature%3Doembed%26start%3D636&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DChXaKV0XYHE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FChXaKV0XYHE%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/41d74b6c15f4a83da7365cc0e8548084/href">https://medium.com/media/41d74b6c15f4a83da7365cc0e8548084/href</a></iframe><p>From an organization’s perspective, there may be good reasons for sharing usernames on the hosts, such as making it easier to configure unix permissions, configuring common reusable scripts, resource limits or maybe simplifying the overall provisioning of the hosts.</p><ul><li>Different Boundary users are authenticating using one single shared-user.</li><li>A single credential library is created in a credential store with shared user as username. This causes accountability and traceability issues.</li></ul><p>To solve this, you can enable <strong>SSH Recording</strong> feature.</p><ul><li>With SSH Session Recording feature, every session recording will be associated with a user.</li><li>Create a storage bucket with a given provider and then enable session recording at target level.</li></ul><h3>Challenge 4 : Resource sprawling issues with multi-user Linux accounts</h3><p>I have created a dedicated blog on this <a href="https://medium.com/@japneetsahni/avoid-resource-sprawling-using-dynamic-credential-templating-in-hashicorp-boundary-3704b346cf9d">issue</a></p><h3>Challenge 5 : Struggling with automating configurations?</h3><ul><li>With credential injection, you need to add public key of CA (Hashicorp Vault) in every host/target.</li><li>Creating Boundary projects, targets, credential stores and libraries can be difficult while scaling.</li></ul><p>To solve this:</p><ul><li>Use <strong><em>HashiCorp Packer</em></strong> to create golden images with public key of Vault (as a CA), embedded in the image.</li><li>Use <strong><em>HashiCorp Terraform’s Boundary provider</em></strong> to configure all resources within Boundary</li></ul><h3>Conclusion</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/0*Chvsjyzs9WYis1lC.gif" /></figure><p>So, if we have to summarize this blog, in order to introduce a robust solution for dynamically creating and managing SSH certificates at scale, you need to:</p><ul><li>Enable SSH Certificates in HashiCorp Vault</li><li>Use HashiCorp Packer to embed the public key of CA in the golden image to spin up the SSH machines.</li><li>Use HashiCorp Terraform to automate all Boundary configurations.</li><li>Enable dynamic credential templatiing for credential libraries.</li><li>Introdduce SSH credential injection.</li><li>Enable SSH recording for all SSH targets.</li></ul><p><em>Originally published at </em><a href="https://japneetsahni.com/blog/empowering-credential-injection-using-boundary/"><em>https://japneetsahni.com</em></a><em> on December 1, 2024.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee1b877333a5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Avoid resource sprawling using dynamic credential templating in Hashicorp Boundary]]></title>
            <link>https://medium.com/@japneetsahni/avoid-resource-sprawling-using-dynamic-credential-templating-in-hashicorp-boundary-3704b346cf9d?source=rss-21381336a990------2</link>
            <guid isPermaLink="false">https://medium.com/p/3704b346cf9d</guid>
            <category><![CDATA[privileged-access-mgmt]]></category>
            <category><![CDATA[hashicorp-boundary]]></category>
            <category><![CDATA[hashicorp]]></category>
            <category><![CDATA[zero-trust-security]]></category>
            <category><![CDATA[hashicorp-vault]]></category>
            <dc:creator><![CDATA[Japneet Sahni]]></dc:creator>
            <pubDate>Mon, 22 May 2023 15:53:08 GMT</pubDate>
            <atom:updated>2023-05-28T01:38:06.252Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nDuiv_PWT--Is8HWHxvS4w.png" /></figure><h3><strong>Background</strong></h3><ul><li>Is your organisation using Hashicorp Boundary as a PAM (privileged access management) solution for thousands of hosts residing in private network?</li><li>Are you using Hashicorp Vault for generating dynamic secrets for multiple users and hosts?</li><li>Have you faced a challenge of maintaining user specific targets and credential libraries in Boundary and eventually ended up in a resource sprawl?</li></ul><p>In this article, I am going to highlight the solution using dynamic credential templating in Hashicorp Boundary which will help in avoiding resource sprawl.</p><h3>Problem Statement</h3><ul><li>In Boundary, a credential store is a resource that can retrieve, store, and potentially generate credentials (like Hashicorp Vault).</li><li>Credential Store will contain credential libraries pointing to specific paths within Vault.</li><li>These credential libraries are then mapped to Boundary targets which allows a Boundary user to connect to a host residing in private network. Now, if Vault is making use of a secret engine where we have defined user-specific roles like SSH-OTP (for linux servers) or LDAP (for Windows servers), in Boundary, we end up creating user-specific credential libraries pointing to user-specific Vault paths as shown below. This leads to resource sprawl within Boundary, resulting in hundreds to thousands of individual credential libraries at scale.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/0*kRaxoRcWL2Fis04W.png" /></figure><p>In Boundary 0.12, support for credential templating within credential libraries was added. This allows Boundary administrators to configure one target with one credential library that generates per-user credentials. hence, you don’t need to maintain a target for each user as shown below. The paths in these credential libraries can be mapped to Boundary user’s or account’s information as highlighted here. The user’s/account’s information is dynamically populated while accessing credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/0*bVGunAqXo5y1ApcL.png" /></figure><h3>Code Snippet &amp; Snapshots (Before vs After)</h3><h4>Before : Using Static Credential Libraries and Targets</h4><pre># Static Linux Host Set<br>resource &quot;boundary_host_set_static&quot; &quot;linux_servers_ssh&quot; {<br>  type            = &quot;static&quot;<br>  name            = &quot;linux_servers_ssh&quot;<br>  description     = &quot;Host set for linux servers&quot;<br>  host_catalog_id = boundary_host_catalog_static.linux_servers_catalog.id<br>  host_ids        = [for host in boundary_host_static.linux_servers_host : host.id]<br>}<br></pre><pre># User specific credential libraries pointing to user-specific Vault paths.<br>resource &quot;boundary_credential_library_vault&quot; &quot;cl_vault_ssh&quot; {<br>  name                = &quot;cl-ssh-${each.key}&quot;<br>  for_each            = var.linux_users<br>  credential_store_id = boundary_credential_store_vault.cs_vault.id<br>  path                = &quot;ssh/creds/${each.key}&quot;<br>  http_method         = &quot;POST&quot;<br>  http_request_body   = &lt;&lt;EOT<br>{<br>  &quot;ip&quot;: &quot;1.2.3.4&quot;<br>}<br>EOT<br>}<br></pre><pre># 1:1 mapping between user-specific targets and user-specific credential libraries<br>resource &quot;boundary_target&quot; &quot;linux_servers_target&quot; {<br>  for_each     = var.linux_users<br>  type         = &quot;tcp&quot;<br>  name         = &quot;linux-target-${each.key}&quot;<br>  description  = &quot;Linux Server Target&quot;<br>  scope_id     = boundary_scope.project.id<br>  default_port = &quot;22&quot;<br></pre><pre>  host_source_ids = [<br>    boundary_host_set_static.linux_servers_ssh.id<br>  ]<br>  brokered_credential_source_ids = [<br>    boundary_credential_library_vault.cl_vault_ssh[&quot;${each.key}&quot;].id<br>  ]<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*icwzy2sdG7_XFOjm.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*t-YwFtmxUUAKZHOv.png" /></figure><h4>After : Using dynamic credential libraries and targets</h4><pre># Credential Store for Vault<br>resource &quot;boundary_credential_store_vault&quot; &quot;cs_vault&quot; {<br>  name            = &quot;cs-pam-vault&quot;<br>  description     = &quot;Vault for PAM&quot;<br>  address         = var.vault_address<br>  token           = var.vault_token<br>  scope_id        = boundary_scope.project.id<br>}</pre><pre># Dynamic Credential Library for Vault SSH-OTP paths<br>resource &quot;boundary_credential_library_vault&quot; &quot;cl_vault_dynamic_ssh&quot; {<br>  name                = &quot;cl-dynamic-ssh&quot;<br>  credential_store_id = boundary_credential_store_vault.cs_vault.id<br>  path                = &quot;ssh/creds/{{ .User.Name }}&quot;<br>  http_method         = &quot;POST&quot;<br>  http_request_body   = &lt;&lt;EOT<br>{<br>  &quot;ip&quot;: &quot;1.2.3.4&quot;<br>}<br>EOT<br>}</pre><pre># Dynamic Host Set for every team<br>resource &quot;boundary_host_set_plugin&quot; &quot;dynamic_host_set_team&quot; {<br>  name            = &quot;dynamic-host-set-${var.team}&quot;<br>  host_catalog_id = var.host_catalog_id<br>  attributes_json = jsonencode({<br>    &quot;filter&quot; = &quot;tagName eq &#39;team&#39; and tagValue eq &#39;${var.team_tag}&#39;&quot;,<br>  })<br>}</pre><pre># Dynamic Target for every team<br>resource &quot;boundary_target&quot; &quot;dynamic_target_team&quot; {<br>  type                           = &quot;tcp&quot;<br>  name                           = &quot;dynamic-target-${var.team}&quot;<br>  description                    = &quot;Dynamic Target for team - ${var.team}&quot;<br>  scope_id                       = var.project_id<br>  default_port                   = 22<br>  host_source_ids                = [boundary_host_set_plugin.dynamic_host_set_team.id]<br>  brokered_credential_source_ids = boundary_credential_library_vault.cl_vault_dynamic_ssh.id<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cEFJh8Xh4tw_GSEh.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FnKtP_wfVsdJjNWT.png" /></figure><h3>Conclusion</h3><p>Due to dynamic credential templating, you can very easily create managed groups in Boundary and assign team-specific targets mapped to dynamic host catalogs and single dynamic credential library path using user’s information as shown in the above code snippet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mGb-8rUu4MuS4zwb.png" /></figure><p>For more insights and to get notifications on upcoming content, follow me on <a href="https://www.linkedin.com/in/japneet-sahni/">LinkedIn</a> and <a href="https://medium.com/@japneetsahni">Medium</a></p><p><em>Originally published at </em><a href="https://japneetsahni.com/blog/avoid-resource-sprawling-in-hashicorp-boundary/"><em>https://japneetsahni.com</em></a><em> on February 16, 2023.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3704b346cf9d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Solving PAM in hybrid environment using multi-hop sessions with HCP Boundary]]></title>
            <link>https://medium.com/@japneetsahni/solving-pam-in-hybrid-environment-using-multi-hop-sessions-with-hcp-boundary-d3b0835b6814?source=rss-21381336a990------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3b0835b6814</guid>
            <category><![CDATA[zero-trust-security]]></category>
            <category><![CDATA[privileged-access-mgmt]]></category>
            <category><![CDATA[hashicorp]]></category>
            <category><![CDATA[hashicorp-boundary]]></category>
            <category><![CDATA[hashicorp-vault]]></category>
            <dc:creator><![CDATA[Japneet Sahni]]></dc:creator>
            <pubDate>Mon, 15 May 2023 00:00:38 GMT</pubDate>
            <atom:updated>2023-05-28T01:39:23.304Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*_RBww4kcuFfRsnuwCUTmJg.png" /><figcaption>Multi-hop sessions in HCP Boundary</figcaption></figure><h3>Background</h3><ul><li>Is your organisation using HCP Boundary as a PAM (privileged access management) solution for hosts residing in private network across multiple cloud providers?</li><li>Does your organisation has strict networking constraints like resources residing in private network having only outbound access?</li><li>Does your organisation require to use your own Boundary workers instead of HCP workers?</li></ul><p>In this article, I am going to highlight and demo the solution using multi-hop sessions with HCP Boundary and how you can access resources in private networks across Azure and AWS.</p><h3>What we’ll be seeing in this article/demo?</h3><ul><li>Working with self managed PKI ingress workers (Installation &amp; Registration)</li><li>Creating worker-aware targets</li><li>Connecting to targets using Boundary Desktop Application</li><li>Challenges with ingress workers</li><li>Introducing multi-hop sessions with HCP Boundary</li><li>Working demo of multi-hop sessions</li></ul><h3>Working with self managed workers</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HrdQDsUmBvVeHlvA.png" /></figure><p>Self-managed workers allow Boundary users to securely connect to private resources without exposing their organizations’ networks to the public. Self-managed workers use public key infrastructure (PKI) for authentication. PKI workers authenticate to Boundary using a certificate-based method</p><h4>Networking requirements</h4><ul><li>Outbound access to HCP Boundary Control Plane (worker -&gt; HCP control plane)</li><li>Outbound access to the private target (worker -&gt; host)</li><li>Inbound access from user trying to establish the session (user -&gt; worker on port 9202)</li></ul><h4>Installation of Ingress worker</h4><p>Assuming you have a running HCP Boundary cluster, follow below steps:</p><ul><li>Create Azure VM and AWS EC2 linux machines with just private IP (no public IPs associated).</li><li>Create Azure and AWS Ingress workers in the respective cloud providers using below steps:</li><li>Install boundary-worker utility on both workers</li></ul><pre>mkdir /home/japneet/boundary/ &amp;&amp; cd /home/japneet/boundary/ <br>curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add <br>sudo apt-add-repository &quot;deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main&quot; <br>sudo apt-get update &amp;&amp; sudo apt-get install boundary-worker-hcp -y-</pre><ul><li>Add pki-worker.hcl on both workers at path /home/username/boundary. Replace value of hcp_boundary_cluster_id with actual value.</li></ul><pre>./boundary-worker server -config= &quot;/home/japneet/boundary/pki-worker.hcl&quot;</pre><h4>Registration of Ingress Worker</h4><ul><li>Go to HCP Boundary cluster URL and authenticate with admin credentials.</li><li>Once logged in, navigate to the Workers page.</li><li>Click New and scroll down to the bottom of the New PKI Worker page and paste the Worker Auth Registration Request key you copied earlier.</li><li>Click Register Worker.</li><li>Follow the above steps for next Ingress worker.</li></ul><p>Awesome ! You now have two self-managed PKI Ingress workers (one for Azure and one for AWS) registered in HCP Boundary cluster. But how do you tell which ingress worker to use while connecting Azure or AWS target? Let’s see this now.</p><h4>Creating worker-aware targets</h4><ul><li>Open the HCP Boundary Admin Console UI and create a organisation called “multi-hop” followed by a project called “multi-hop”.</li><li>Navigate to the targets page within the multi-hop project.</li><li>Create 2 targets (one for Azure and one for AWS) with following details:</li></ul><p>— Target name (aws-target and azure-target)</p><p>— Target address (private IP of AWS EC2 and Azure VM respectively)</p><p>— Default port 22</p><p>— Toggle the Ingress worker filter switch to add an ingress worker filter that searches for workers that have the following tag:</p><h4>Connecting to targets using Boundary Desktop Application</h4><p>With the ingress filters assigned above, any connections to target will be forced to proxy through the assigned ingress worker.</p><ul><li>The end user authenticates to HCP Boundary cluster using Boundary Desktop application.</li><li>The user navigates to Targets section and will the authorized targets based on his roles and permissions.</li><li>The user connects to the aws/azure target using “Connect” button.</li><li>A proxy URL is published which user uses to establish a session</li></ul><pre>ssh username@127.0.0.1 -p &lt;port mentioned in proxy url&gt;</pre><h3>Challenges with Ingress workers</h3><ul><li>The Boundary ingress workers have to be accessed by user/clients which means either those users need to have some VPN access or the ingress worker is publicly accessible using a public IP. Some organisations may not allow this.</li><li>Other organisations might give access to boundary ingress workers residing in public network but resources are in private network with only outbound access, hence boundary ingress worker won’t be able to proxy the connection.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GLn0LI1MflNQPjfp.png" /></figure><h3>Managing multi-hop sessions with HCP Boundary</h3><p>In order to mitigate the above networking challenges with some organisations, 0.12 release of HCP Boundary introduced a feature of multi-hop sessions wherein now you can configure different types of Boundary workers based on their networking requirements and eventually create a chain of workers through reverse-proxy connections. This creates multiple “hops” in the chain from a worker to a controller.</p><ul><li>The new type of worker which is introduced as part of this feature is called an “Egress” worker.</li><li>This worker has network access into the hosts and connects to an existing upstream/ingress worker which is accessible to the clients.</li><li>The “Egress” worker can reside in a private network with only outbound access and inaccessible to the clients.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5DvyOp9ngungEQcF.png" /></figure><h4>Installation of Egress Worker</h4><ul><li>Create 2 Egress workers (one in each cloud) with private IP’s and only outbound access.</li><li>Install same boundary-worker utility similar to Ingress worker.</li><li>Add pki-worker.hcl on both workers at path /home/username/boundary. Note initial_upstreams parameter which tells which ingress worker to connect to.</li></ul><pre>./boundary-worker server -config= &quot;/home/japneet/boundary/pki-worker.hcl&quot;</pre><h4>Registration of Egress Worker</h4><p>Follow same steps as ingress worker for registering the egress worker.</p><h4>Modifying worker-aware targets</h4><ul><li>Open the Boundary Admin Console UI navigate to the targets page within the “multi-hop” org.</li><li>Click on the aws-target/azure-target. Scroll to the bottom the the target details page and click Edit Form.</li><li>Toggle the Egress worker filter switch to add an egress worker filter that searches for workers that have the following tag:</li></ul><h3>Working Demo</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FiCBOiykoORU%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DiCBOiykoORU&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FiCBOiykoORU%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/ed96f5d23daffb67dd0099e657676b51/href">https://medium.com/media/ed96f5d23daffb67dd0099e657676b51/href</a></iframe><h3>Conclusion</h3><p>Awesome ! You have now connected to a target residing in a private network with only outbound access by creating a chain of “ingress” and “egress” workers and establishing a “hop” in the session.</p><p>For more insights and to get notifications on upcoming content, follow me on <a href="https://www.linkedin.com/in/japneet-sahni/">LinkedIn</a> and <a href="https://medium.com/@japneetsahni">Medium</a></p><p><em>Originally published at </em><a href="https://japneetsahni.com/blog/multi-hop-sessions-in-hcp-boundary/"><em>https://japneetsahni.com</em></a><em> on May 15, 2023.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3b0835b6814" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Zero trust Security using Hashicorp Boundary and Vault]]></title>
            <link>https://medium.com/@japneetsahni/zero-trust-security-using-hashicorp-boundary-and-vault-37f75c081cab?source=rss-21381336a990------2</link>
            <guid isPermaLink="false">https://medium.com/p/37f75c081cab</guid>
            <category><![CDATA[hashicorp]]></category>
            <category><![CDATA[hashicorp-boundary]]></category>
            <category><![CDATA[zero-trust-security]]></category>
            <category><![CDATA[hashicorp-vault]]></category>
            <category><![CDATA[privileged-access-mgmt]]></category>
            <dc:creator><![CDATA[Japneet Sahni]]></dc:creator>
            <pubDate>Thu, 16 Feb 2023 00:00:01 GMT</pubDate>
            <atom:updated>2023-05-29T03:22:51.795Z</atom:updated>
            <content:encoded><![CDATA[<p>In cloud environments, resources often reside in private networks. In traditional approaches, for developers or operators to access these resources, organizations often end up with VPNs or bastion hosts. Moreover, they also use static credentials for accessing these applications. But this approach has many challenges like scalability and eventually increases the attack surface.</p><p>In this context, I’ll discuss how <strong><em>HashiCorp Boundary and Vault</em></strong> come to the rescue and how their integration helps us achieve the core fundamental of <strong><em>Zero Trust Security: “Trust Nothing. Authenticate and Authorize Everything.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YEVDXn1t7-BLsehsLSNUGQ.png" /></figure><h3>Traditional workflow for privileged access management (PAM)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zhvcXBPR80rgvPbU.png" /></figure><p>Let’s say we have to access a private resource, it can be a database or a virtual machine and these machines reside on private datacenter on-premises or any private network of a cloud service provider.</p><p>Now a user, let’s take an example of a database administrator who wants to access the database in this private network, he is ideally not on the private network, they’re either working in their office or they’re working in their home.</p><ul><li><strong>VPN/Bastion Hosts</strong>: Now, if this user has to connect themselves to the private network, first of all, the organisations set up a VPN gateway or a bastion host. In case of VPN, they might get an IP address that puts them on the network, or in the case of bastion host, they need to get their SSH keys configured.</li><li><strong>Firewalls</strong>: Once, we are inside the private network, we can literally access everything. So in practice, what we probably also do is, have some form of a firewall setup that’s going to restrict traffic. So, in our case, we’re going to create a firewall that says, ok, traffic can go from our bastion host or from our VPN to this database residing in the private network.</li><li><strong>Application Credentials</strong>: And finally, once the user connects all the way through to the database, they also need a username and password to connect to it.</li></ul><p>If we consider this workflow, you will notice that there’s a bunch of information the user needed.</p><ol><li>Firstly, the user needed to have VPN or SSH credentials.</li><li>Secondly, they needed to know the IP or the host name to connect to.</li><li>Then finally, they actually needed the database credentials to get all the way through to that system.</li></ol><h3>Challenges with traditional workflow</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RCzBv9n8m_novJ9e.png" /></figure><p>So, let’s see what are the challenges with this traditional workflow.</p><ul><li><strong>Onboarding/Off-boarding</strong>: The very first one being the onboarding and off-boarding of users. I don’t want to distribute VPN credentials and SSH keys to everyone who joins the company or everyone who leaves the company. This would definitely become a burden, especially if we consider best practices like key rotation on a regular interval.</li><li><strong>Increasing the attack surface</strong>: Secondly, once the user has VPN access or access to Bastion Host, he/she literally has a wider network access thus increasing the attack surface. As seen in last slide, we will try to bring firewalls in order to mitigate this issue.</li><li><strong>Managing IP’s in dynamic environment</strong>: Now this firewall setup is fine unless and until we have small number of static hosts where IP’s aren’t changing much but this wouldn’t scale when we have a highly dynamic infrastructure especially that auto-scales. Also, nowadays we are moving to ephemeral platforms like Kubernetes, where if a node dies, applications might be migrated to a different node. We’re also adopting more serverless things where you really don’t think about a host or a node or an IP anymore. It’s really about this logical service that you’re trying to route to. With all of these, we’re really moving away from relatively static infrastructure to much more dynamic infrastructure.</li><li><strong>Static Credentials</strong>: Lastly, if I have to expose database credentials directly to my user, what happens if those get exposed or compromised somehow? I don’t want to have a static, long-lived credential that gets leaked. Someone might store it on their laptop, or they put it in a confluence doc which might be exposed to Internet, or they paste it into Slack conversations or might even get saved into a log file somewhere. Ideally why should I even give those credentials directly to an end user?. So, the question is how do we move away from static credentials and instead create a credential on-demand that’s short-lived and we revoke it when we don’t need it anymore? So there are a number of challenges in this workflow and if we have to move towards zero trust security philosophy wherein I really don’t have to trust my private network, I definitely need to do something differently.</li></ul><h3>How Boundary-Vault Integration comes to the rescue?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*o_RVctlufj10N5AX.png" /></figure><p>So, let’s see how boundary vault integration solves all the challenges we discussed with the traditional workflow.</p><ul><li><strong>Authentication Using IDP</strong>: Firstly, with Boundary, every user is going to login through Identity provider. If your organization already uses Azure AD or Okta or any other IDP, the Boundary administrator can configure the same IDP for authentication. Once authenticated using this IDP, you prove that you are a valid user. Now, when we talk about on-boarding and off-boarding of users, it is just about adding or removing them from the IdP. There’s no additional step of distributing VPN or SSH credentials or rotation of SSH keys. <strong><em>Thus you solve the authentication very easily with Boundary.</em></strong></li><li><strong>Authorization based on roles</strong>: Now, once the user has actually authenticated, there’s going to be an authorization based on certain set of roles and permissions. So we’re going to have a role and that role is really going to drive role-based access control. For example in our case, our database administrators, they get access to the databases and Web developers get access to web tier. But we aren’t going to specify this role for a single host or a single IP, it’s actually going to be at the logical service because that’s what we really care about now. This is really important because the logical service lets us elevate from the details that are dynamic. You can basically differentiate between these logical services in a cloud service provider using tags. So if, the database administrators have to connect to the database, the set of databases can be dynamic, the IPs can come and go, they can change, they can be scaled up and down but the overall control stays the same.</li><li><strong>Dynamic Services</strong>: Now, once the user sees his host, and clicks on <strong><em>Connect</em></strong>, Boundary will directly establish a connection to the target system. One of the key advantages of this approach is that <strong><em>you will not be specifically bridging the client onto the private network</em></strong>. So, we stay in line with sort of a zero trust network philosophy where we’re not bridging users onto this private network.</li><li><strong>Dynamic Credentials from vault</strong>: Finally, let’s talk about those scary static credentials. This is where Hashicorp Vault comes into picture. Vault is a secrets management tool from Hashicorp which is capable of generating dynamic and short-lived credentials through its different secret engines. These secret engines can generate <strong><em>dynamic credentials</em></strong> for any kind of a database, it can generate/rotate LDAP passwords for Active directory or it can even generate OTPs for linux machines. These credentials are tied to a TTL or in some cases can be used only once. Boundary integrates with Vault seamlessly to broker the credential which will then be used when the user connects to the target system using Boundary.</li></ul><h3>Demo to understand use-cases for accessing Windows &amp; Linux using Boundary &amp; Vault</h3><blockquote>I presented a talk on Zero Trust Security using Hashicorp Vault and Boundary in <a href="https://events.hashicorp.com/hashitalks2023">HashiTalks, 2023</a></blockquote><p><strong>Use Case 1 : Accessing Domain Joined Windows Servers using OpenLDAP secret engine</strong></p><p><strong>Use Case 2 : Accessing Linux servers with local accounts using SSH-OTP secret engine</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FhGaph1GRH08%3Fstart%3D989%26feature%3Doembed%26start%3D989&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DhGaph1GRH08&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FhGaph1GRH08%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/22a044f3f37c455b73887f6f1bbb41d4/href">https://medium.com/media/22a044f3f37c455b73887f6f1bbb41d4/href</a></iframe><h3>Conclusion</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zr7KAwjGyZsReR1Z.png" /></figure><p>So, if we have to summarize this blog, you will notice that</p><ul><li>Boundary users will authenticate to Boundary using an Identity provider.</li><li>Once authenticated, they will see only certain set of hosts or targets which they are authorized to see courtesy roles and permissions.</li><li>Finally they make a proxy connection to the target system using Boundary and gets the dynamic credentials for the target system from Hashicorp Vault. These set of credentials will either expire after certain TTL or can be configured to be used only once.</li></ul><p>For more insights and to get notifications on upcoming content, follow me on <a href="https://www.linkedin.com/in/japneet-sahni/">LinkedIn</a> and <a href="https://medium.com/@japneetsahni">Medium</a></p><p><em>Originally published at </em><a href="https://japneetsahni.com/blog/zero-trust-security-using-hashicorp-boundary-vault/"><em>https://japneetsahni.com</em></a><em> on February 16, 2023.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37f75c081cab" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>