<?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 Tayyab Awais on Medium]]></title>
        <description><![CDATA[Stories by Tayyab Awais on Medium]]></description>
        <link>https://medium.com/@tayyab.awais?source=rss-b0fd55dbe94b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*EgALr-WyxhOmOHym</url>
            <title>Stories by Tayyab Awais on Medium</title>
            <link>https://medium.com/@tayyab.awais?source=rss-b0fd55dbe94b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 11:57:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tayyab.awais/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[Temporary Access for Non-AWS Virtual Machines Using AWS IAM Roles Anywhere]]></title>
            <link>https://medium.com/emumba/temporary-access-for-non-aws-virtual-machines-using-aws-iam-roles-anywhere-a18797c084f9?source=rss-b0fd55dbe94b------2</link>
            <guid isPermaLink="false">https://medium.com/p/a18797c084f9</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[pki]]></category>
            <category><![CDATA[aws-iam-roles-anywhere]]></category>
            <category><![CDATA[secure-access]]></category>
            <dc:creator><![CDATA[Tayyab Awais]]></dc:creator>
            <pubDate>Wed, 22 Jan 2025 05:30:51 GMT</pubDate>
            <atom:updated>2025-01-22T05:30:51.083Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>AWS IAM Roles Anywhere allows you to extend the benefits of AWS Identity and Access Management (IAM) to workloads running outside of AWS. With IAM Roles Anywhere, you can securely provide temporary access to resources for virtual machines (VMs) running on-premises or in other cloud providers by leveraging certificates and trust anchors.</p><p>This blog will demonstrate how to set up temporary read-only access to Amazon S3 for a non-AWS VM using AWS IAM Roles Anywhere.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*OMREBJPslhM8q75QeHL4dQ.png" /></figure><h3>Prerequisites</h3><p>Before you start, ensure you have the following:</p><ol><li><strong>AWS Private Certificate Authority (CA):</strong> An active private CA in AWS Certificate Manager (ACM) Private CA.</li><li><strong>Non-AWS VM:</strong> A running virtual machine (e.g., on-premises, Azure, or GCP).</li><li><strong>IAM Role:</strong> An IAM role with the necessary permissions (e.g., read-only access to S3).</li><li><strong>AWS CLI Credential Helper:</strong> The aws_signing_helper tool installed on your VM.</li></ol><h3>Step 1: Set Up AWS Private Certificate Authority</h3><h3>1.1 Create a Private CA</h3><ol><li>Navigate to the <a href="https://console.aws.amazon.com/acm-pca/home">AWS Certificate Manager Private CA</a> console.</li><li>Create a root or subordinate CA.</li><li>Once the CA is created, activate it and download the certificate.</li></ol><h3>1.2 Issue a Certificate for the VM</h3><ol><li>Use the ACM PCA to issue a client certificate:</li></ol><pre>aws acm-pca issue-certificate \   --certificate-authority-arn &lt;CA_ARN&gt; \   --csr file://vm.csr \   --signing-algorithm SHA256WITHRSA \   --validity Value=365,Type=DAYS</pre><p>2. Retrieve the issued certificate:</p><pre>aws acm-pca get-certificate \   --certificate-authority-arn &lt;CA_ARN&gt; \   --certificate-arn &lt;CERTIFICATE_ARN&gt;aws acm-pca get-certificate \   --certificate-authority-arn &lt;CA_ARN&gt; \   --certificate-arn &lt;CERTIFICATE_ARN&gt;</pre><p>3. Save the certificate and private key securely on your VM.</p><h3>Step 2: Configure IAM Roles Anywhere</h3><h3>2.1 Create a Trust Anchor</h3><ol><li>Navigate to the <a href="https://console.aws.amazon.com/rolesanywhere/home">IAM Roles Anywhere</a> console.</li><li>Create a trust anchor and attach the CA certificate.</li></ol><h3>2.2 Create an IAM Role</h3><ol><li>Create an IAM role (e.g., s3-readonly-role) with the following permissions:</li></ol><pre>{   &quot;Version&quot;: &quot;2012-10-17&quot;,   &quot;Statement&quot;: [     {       &quot;Effect&quot;: &quot;Allow&quot;,       &quot;Action&quot;: &quot;s3:ListBucket&quot;,       &quot;Resource&quot;: &quot;arn:aws:s3:::*&quot;     },     {       &quot;Effect&quot;: &quot;Allow&quot;,       &quot;Action&quot;: &quot;s3:GetObject&quot;,       &quot;Resource&quot;: &quot;arn:aws:s3:::*/*&quot;     }   ] }{   &quot;Version&quot;: &quot;2012-10-17&quot;,   &quot;Statement&quot;: [     {       &quot;Effect&quot;: &quot;Allow&quot;,       &quot;Action&quot;: &quot;s3:ListBucket&quot;,       &quot;Resource&quot;: &quot;arn:aws:s3:::*&quot;     },     {       &quot;Effect&quot;: &quot;Allow&quot;,       &quot;Action&quot;: &quot;s3:GetObject&quot;,       &quot;Resource&quot;: &quot;arn:aws:s3:::*/*&quot;     }   ] }</pre><p>2. Attach a trust relationship to the role, referencing the IAM Roles Anywhere profile.</p><h3>2.3 Create a Profile</h3><ol><li>Create a profile in the IAM Roles Anywhere console.</li><li>Attach the s3-readonly-role to the profile.</li></ol><h3>Step 3: Install and Configure AWS Signing Helper on the VM</h3><h3>3.1 Install the Credential Helper</h3><ol><li>Download the aws_signing_helper binary:</li></ol><pre>curl -Lo /usr/local/bin/aws_signing_helper https://github.com/aws/rolesanywhere-credential-helper/releases/latest/download/aws_signing_helper-linux-amd64</pre><p>2. Make the binary executable:</p><pre>sudo chmod +x /usr/local/bin/aws_signing_helper</pre><p>3. Verify the installation:</p><pre>aws_signing_helper --version</pre><h3>3.2 Prepare Configuration Files</h3><ol><li>Save the certificate and private key on the VM:</li></ol><pre>sudo mkdir -p /etc/iam_roles_anywhere sudo mv vm.crt /etc/iam_roles_anywhere/vm.crt sudo mv vm.key /etc/iam_roles_anywhere/vm.key sudo chmod 600 /etc/iam_roles_anywhere/vm.*</pre><p>2. Create a JSON configuration file:</p><pre>{   &quot;certificate&quot;: &quot;/etc/iam_roles_anywhere/vm.crt&quot;,   &quot;private_key&quot;: &quot;/etc/iam_roles_anywhere/vm.key&quot;,   &quot;trust_anchor_arn&quot;: &quot;arn:aws:rolesanywhere:&lt;region&gt;:&lt;account-id&gt;:trust-anchor/&lt;trust-anchor-id&gt;&quot;,   &quot;profile_arn&quot;: &quot;arn:aws:rolesanywhere:&lt;region&gt;:&lt;account-id&gt;:profile/&lt;profile-id&gt;&quot;,   &quot;role_arn&quot;: &quot;arn:aws:iam::&lt;account-id&gt;:role/s3-readonly-role&quot; }{   &quot;certificate&quot;: &quot;/etc/iam_roles_anywhere/vm.crt&quot;,   &quot;private_key&quot;: &quot;/etc/iam_roles_anywhere/vm.key&quot;,   &quot;trust_anchor_arn&quot;: &quot;arn:aws:rolesanywhere:&lt;region&gt;:&lt;account-id&gt;:trust-anchor/&lt;trust-anchor-id&gt;&quot;,   &quot;profile_arn&quot;: &quot;arn:aws:rolesanywhere:&lt;region&gt;:&lt;account-id&gt;:profile/&lt;profile-id&gt;&quot;,   &quot;role_arn&quot;: &quot;arn:aws:iam::&lt;account-id&gt;:role/s3-readonly-role&quot; }</pre><ol><li>Save this to /etc/iam_roles_anywhere/config.json.</li></ol><h3>3.3 Configure AWS CLI</h3><ol><li>Edit the ~/.aws/config file to use the credential helper:</li></ol><pre>[default] credential_process = /usr/local/bin/aws_signing_helper credential-process --certificate /etc/iam_roles_anywhere/vm.crt --private-key /etc/iam_roles_anywhere/vm.key --trust-anchor-arn arn:aws:rolesanywhere:&lt;region&gt;:&lt;account-id&gt;:trust-anchor/&lt;trust-anchor-id&gt; --profile-arn arn:aws:rolesanywhere:&lt;region&gt;:&lt;account-id&gt;:profile/&lt;profile-id&gt; --role-arn arn:aws:iam::&lt;account-id&gt;:role/s3-readonly-role region = &lt;region&gt;</pre><h3>Step 4: Test the Configuration</h3><p>Run the following command to verify access to S3:</p><pre>aws s3 ls</pre><p>If successful, the VM will list all S3 buckets in the account.</p><h3>Conclusion</h3><p>AWS IAM Roles Anywhere simplifies extending IAM-based access control to non-AWS environments. By leveraging trusted certificates and roles, you can securely and temporarily grant access to AWS resources for external workloads, ensuring flexibility and security.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a18797c084f9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/emumba/temporary-access-for-non-aws-virtual-machines-using-aws-iam-roles-anywhere-a18797c084f9">Temporary Access for Non-AWS Virtual Machines Using AWS IAM Roles Anywhere</a> was originally published in <a href="https://medium.com/emumba">Emumba</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>