<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Muhammed Sajeed</title>
    <description>The latest articles on DEV Community by Muhammed Sajeed (@sajeedmoh).</description>
    <link>https://dev.to/sajeedmoh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F941751%2F862c6a4b-fdeb-4f40-b71c-acef7d8f5168.jpg</url>
      <title>DEV Community: Muhammed Sajeed</title>
      <link>https://dev.to/sajeedmoh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sajeedmoh"/>
    <language>en</language>
    <item>
      <title>How to import server or client certificate on AWS Certificate Manager (ACM)</title>
      <dc:creator>Muhammed Sajeed</dc:creator>
      <pubDate>Thu, 19 Jan 2023 14:48:18 +0000</pubDate>
      <link>https://dev.to/sajeedmoh/how-to-import-server-or-client-certificate-on-aws-certificate-manager-acm-4gmj</link>
      <guid>https://dev.to/sajeedmoh/how-to-import-server-or-client-certificate-on-aws-certificate-manager-acm-4gmj</guid>
      <description>&lt;h2&gt;
  
  
  How to import server or client certificate on AWS Certificate Manager (ACM)
&lt;/h2&gt;

&lt;p&gt;AWS certificate manager (ACM) is certificate store we can either request a public ceritificate or import a certificate into ACM.&lt;/p&gt;

&lt;p&gt;For several reasons we import the certificates into ACM and use it for client server mutual certificate based authentication. one of the example is when we setup AWS client VPN and one of the authentication method is mutual certificate authentication and we need to create and import the server/client certs into AWS.&lt;/p&gt;

&lt;p&gt;Below is the steps how to create and upload a server/client certifiate into AWS ACM. Its using OpenVPN easy-rsa tool to create the cert and the keys.&lt;/p&gt;

&lt;p&gt;Download the easy-rsa tool into your local computer and locate easy-rsa/easyrsa3 folder.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;$ git clone &lt;a href="https://github.com/OpenVPN/easy-rsa.git" rel="noopener noreferrer"&gt;https://github.com/OpenVPN/easy-rsa.git&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;$ cd easy-rsa/easyrsa3&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Initialize new PKI environment. this will cleanup all existing CA, certs or keys inside easy-rsa folder. we would need to backup those before doing this.This will create new ca.crt and ca.key into the easyrsa3 folder.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;$ ./easyrsa init-pki&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Generate server certificate and the key. This will create server.crt and server.key into the easyrsa3 folder.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;$ ./easyrsa build-server-full server nopass&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Generate client certificate and key.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;$ ./easyrsa build-client-full client1.domain.tld nopass&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Copy the .crt and .key files into common folder and intiate aws cli comand to import the certificate into AWS ACM. You can find the .crt files into easy-rsa/easyrsa3/pki/issued folder and .key files into easy-rsa/easyrsa3/pki/private folder.Make sure the user has access to imort ACM certificates.&lt;/p&gt;

&lt;p&gt;To import server certs&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;$ aws acm import-certificate — certificate fileb://server.crt — private-key fileb://server.key — certificate-chain fileb://ca.crt&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To import client certs&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;$aws acm import-certificate — certificate fileb://client1.domain.tld.crt — private-key fileb://client1.domain.tld.key — certificate-chain fileb://ca.crt&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>gratitude</category>
    </item>
    <item>
      <title>How to create a Pre-signed URL in S3</title>
      <dc:creator>Muhammed Sajeed</dc:creator>
      <pubDate>Thu, 19 Jan 2023 14:02:45 +0000</pubDate>
      <link>https://dev.to/sajeedmoh/how-to-create-a-pre-signed-url-in-s3-og1</link>
      <guid>https://dev.to/sajeedmoh/how-to-create-a-pre-signed-url-in-s3-og1</guid>
      <description>&lt;h2&gt;
  
  
  How to create a Pre-signed URL in S3
&lt;/h2&gt;

&lt;p&gt;When you create a S3 bucket by default all the objects in the buckets you upload are privte and only the object owner has permission to access it.&lt;/p&gt;

&lt;p&gt;However, the object owner can optionally share objects with others by creating a presigned URL, using their own security credentials, to grant time-limited permission to download the objects.&lt;/p&gt;

&lt;p&gt;When you create a presigned URL and shared it, Anyone who receive the URL can access the objects even if the objects is private. For example if you upload a file object into the bucket and both the bucket and the file object is private, You can create the presigned URL and share it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To create a Pre-signed URL from AWS console&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Login to AWS console and select the bucket and object you want to create -pre-signed URL.Go to Actions and select share with Presigned URL option.AWS console maximum you can create presigned url with12 hours experation time.For loger time we would need to create the URL from AWS CLI/SDK.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnp4cakmdpbt1bpicur0r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnp4cakmdpbt1bpicur0r.png" width="800" height="678"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To create a Pre-signed URL from AWS CLI&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When you create presigned URL using a temporary token ( eg : from ec2 machine with instance profile attached ) the URL expires when the temporary tocken expires even if the URL was created with more expiration time.&lt;/p&gt;

&lt;p&gt;The credentials you can use to create a presigned url include .&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;AWS Identity and Access Management (IAM) instance profile:&lt;/strong&gt; Valid up to six hours.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;AWS &lt;a href="https://docs.aws.amazon.com/STS/latest/APIReference/API_GetSessionToken.html" rel="noopener noreferrer"&gt;Security Token Service&lt;/a&gt; (STS):&lt;/strong&gt; Valid up to 36 hours when signed by an AWS Identity and Access Management (IAM) user, or valid up to one hour when signed by the root user.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;IAM user:&lt;/strong&gt; Valid up to seven days when using &lt;a href="https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html" rel="noopener noreferrer"&gt;AWS Signature Version 4&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want more expiration time for presigned URL more then 36 hours upto 7 days, i would recommed to use and configure AWS Access Key ID and AWS Secret Access Key into AWS CLI.&lt;/p&gt;

&lt;p&gt;After Access/secret key into aws configure use below AWS CLI command to create presigned URL. Below example will create a presigned URL with max expiration of 7 days.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;aws s3 presign s3://DOC-EXAMPLE-BUCKET/Drawing.zip— expires-in 604800&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>gratitude</category>
    </item>
    <item>
      <title>https://medium.com/@muhammedsajeed/how-to-create-a-pre-signed-url-in-s3-c56b7946b3d</title>
      <dc:creator>Muhammed Sajeed</dc:creator>
      <pubDate>Thu, 19 Jan 2023 13:33:06 +0000</pubDate>
      <link>https://dev.to/sajeedmoh/httpsmediumcommuhammedsajeedhow-to-create-a-pre-signed-url-in-s3-c56b7946b3d-8n8</link>
      <guid>https://dev.to/sajeedmoh/httpsmediumcommuhammedsajeedhow-to-create-a-pre-signed-url-in-s3-c56b7946b3d-8n8</guid>
      <description></description>
      <category>html</category>
      <category>java</category>
      <category>learning</category>
      <category>career</category>
    </item>
  </channel>
</rss>
