<?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: Allan Denot</title>
    <description>The latest articles on DEV Community by Allan Denot (@denot).</description>
    <link>https://dev.to/denot</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%2F161775%2F5bcdb8c1-4303-4596-8188-ccf7502a9963.png</url>
      <title>DEV Community: Allan Denot</title>
      <link>https://dev.to/denot</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/denot"/>
    <language>en</language>
    <item>
      <title>How to create a Vultr API token</title>
      <dc:creator>Allan Denot</dc:creator>
      <pubDate>Thu, 06 Jun 2024 12:22:01 +0000</pubDate>
      <link>https://dev.to/ownvpn/how-to-create-a-vultr-api-token-179d</link>
      <guid>https://dev.to/ownvpn/how-to-create-a-vultr-api-token-179d</guid>
      <description>&lt;h2&gt;
  
  
  Step 1: Login to your Vultr Account
&lt;/h2&gt;

&lt;p&gt;Go to &lt;a href="https://my.vultr.com/" rel="noopener noreferrer"&gt;https://my.vultr.com/&lt;/a&gt; and login to your account.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Enable the Vultr API
&lt;/h2&gt;

&lt;p&gt;Click on your name in the top right corner to access a dropdown menu. Select “API” from this menu:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsahkfmzs1nzrikwa5v3e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsahkfmzs1nzrikwa5v3e.png" alt="Vultr menu option API" width="800" height="469"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the Personal Access Token panel, click the large blue “Enable API” button to activate the API:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqg9yxr8v67g5lqjxfcnv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqg9yxr8v67g5lqjxfcnv.png" alt="Vultr activate API" width="800" height="446"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Manage Your IP Addresses
&lt;/h2&gt;

&lt;p&gt;Once you have enabled the Vultr API, go to the Access Control Area (Account → API) to whitelist your IP address. This allows the ownvpn MacOS app to utilize the API on your behalf.&lt;/p&gt;

&lt;p&gt;Vultr automatically whitelists your current IP address when you enable the API. If your IP address changes, remember to update the whitelist.&lt;/p&gt;

&lt;p&gt;To check your current IP address, visit: &lt;a href="https://api.ipify.org/" rel="noopener noreferrer"&gt;https://api.ipify.org/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fajtta3fibis4mnxlwopc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fajtta3fibis4mnxlwopc.png" alt="Vultr API whitelisting" width="800" height="639"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If your IP changes frequently, you may opt to whitelist all IP addresses. Note that this is less secure. If you choose this option, take extra precautions to secure your API Personal Access Token.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxo3z8iv8tplqqipxvgyn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxo3z8iv8tplqqipxvgyn.png" alt="Vultr API whitelist all" width="800" height="211"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The ownvpn MacOS app stores your API token in MacOS’s keychain to ensure security.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Copy Your Personal Access Token
&lt;/h2&gt;

&lt;p&gt;You can find your Personal Access Token on the API page of your Vultr account at any time. Copy this token and enter it into the ownvpn settings, ensuring it is kept secure.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0vte2anq2bn4ozjoacen.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0vte2anq2bn4ozjoacen.png" alt="Vultr API copy token" width="800" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5. Setup ownvpn App
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Open the ownvpn app and select “Settings” from the menu bar.&lt;/li&gt;
&lt;li&gt;Under “Provider,” choose “Vultr” and select your desired Country/Region.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click on “Credentials” and enter the API token you copied from the previous step.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk3h5v69h6g23q1pzyetu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk3h5v69h6g23q1pzyetu.png" alt="ownvpn provider settings" width="800" height="512"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After saving your settings, a green tick will appear next to the “Credentials” button, indicating that your credentials are correctly configured.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You are now ready to create your first VPN instance.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
    <item>
      <title>How to create a DigitalOcean access token</title>
      <dc:creator>Allan Denot</dc:creator>
      <pubDate>Thu, 06 Jun 2024 12:20:30 +0000</pubDate>
      <link>https://dev.to/ownvpn/how-to-create-an-digitalocean-access-token-32hf</link>
      <guid>https://dev.to/ownvpn/how-to-create-an-digitalocean-access-token-32hf</guid>
      <description>&lt;h2&gt;
  
  
  Step 1: Login to your DigitalOcean Account
&lt;/h2&gt;

&lt;p&gt;Go to &lt;a href="https://cloud.digitalocean.com/login" rel="noopener noreferrer"&gt;https://cloud.digitalocean.com/login&lt;/a&gt; and login with your credentials.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Generate Your DigitalOcean API Token
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Log into your DigitalOcean dashboard.&lt;/li&gt;
&lt;li&gt;Navigate to “API” in the main menu on the left side.&lt;/li&gt;
&lt;li&gt;In the “Tokens/Keys” section, click on “Generate New Token.”&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Give your token a name, select "Custom Scopes" to define granular permissions for your token&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fbb69w1vglawzs5mvnl4m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fbb69w1vglawzs5mvnl4m.png" alt="DigitalOcean creating token"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select: droplet, regions and sizes&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fw2qaqbqmf7m5v8248sgg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fw2qaqbqmf7m5v8248sgg.png" alt="DigitalOcean token custom scope selection"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click "Generate Token"&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Be sure to copy your new token immediately; you won’t be able to see it again.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fbppbq73652wme8n85fss.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fbppbq73652wme8n85fss.png" alt="DigitalOcean new token generated"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step 3: Configure the ownvpn App
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Launch the ownvpn app and go to “Settings” in the menu bar.&lt;/li&gt;
&lt;li&gt;For the “Provider” option, select “DigitalOcean.”&lt;/li&gt;
&lt;li&gt;Choose your desired data center region from the “Region” dropdown menu.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click on “Credentials” and paste the API token you generated earlier.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fcvx6upvv0042m4y5q2tr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fcvx6upvv0042m4y5q2tr.png" alt="ownvpn provider settings"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Once you save your settings, a green tick will appear next to the “Credentials” button to confirm your API token is successfully integrated.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step 4: Create Your VPN Instance
&lt;/h2&gt;

&lt;p&gt;With the API set up and credentials configured, you are ready to create your first VPN instance using the ownvpn app with DigitalOcean as your cloud provider.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Protecting URLs with AWS ALBs and OIDC in 6 minutes</title>
      <dc:creator>Allan Denot</dc:creator>
      <pubDate>Mon, 15 Nov 2021 23:11:19 +0000</pubDate>
      <link>https://dev.to/dnx/protecting-urls-with-aws-albs-and-oidc-in-6-minutes-32jo</link>
      <guid>https://dev.to/dnx/protecting-urls-with-aws-albs-and-oidc-in-6-minutes-32jo</guid>
      <description>&lt;h2&gt;
  
  
  00:00:00
&lt;/h2&gt;

&lt;p&gt;Problem: You have a web app with an administration page that should be restricted to internal users.&lt;/p&gt;

&lt;p&gt;Here's some of the options that would solve this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Program authentication into your app, which would be different from your main user login as it's targeted to internal users and not your customers.&lt;/li&gt;
&lt;li&gt;Deploy the app privately (like an internal load balancer) and require VPN access&lt;/li&gt;
&lt;li&gt;Use some third-party service like Cloudflare Access.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We would like to propose a solution that could be implemented very quickly if you already using AWS Application Load Balancer (ALB).&lt;/p&gt;

&lt;h2&gt;
  
  
  00:01:00
&lt;/h2&gt;

&lt;p&gt;This example we will authenticate internal users in Google Workspace, but this works with any Identity Provider that supports OIDC/OAuth2.&lt;/p&gt;

&lt;p&gt;Go to your Google Cloud Console (linked to your Google Workspace account) as Admin and under "APIs &amp;amp; Services", create a new OAuth2 Client, as shown below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F73nwi2p9scgoqoz7olwk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F73nwi2p9scgoqoz7olwk.png" alt="Google Cloud creating OAuth client"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;More details here: &lt;a href="https://support.google.com/cloud/answer/6158849?hl=en" rel="noopener noreferrer"&gt;https://support.google.com/cloud/answer/6158849?hl=en&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fl9poqbhda8yg54wx4ltw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fl9poqbhda8yg54wx4ltw.png" alt="Google Cloud Setup OAuth client URLs"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In "Authorized JavaScript origins", enter the main URL of your web application (without the &lt;code&gt;/admin&lt;/code&gt; path). And in "Authorized redirect URIs" enter the same as before, but adding &lt;code&gt;oauth2/idpresponse&lt;/code&gt; to the path.&lt;/p&gt;

&lt;p&gt;After creation, copy the Client ID and Client Secret generated to a secure location.&lt;/p&gt;

&lt;p&gt;Also make sure your Google project's OAuth Consent is set to Internal, if you want to authenticate only internal users. If your goal is to authenticate anyone with a Google Account, you can leave it External.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fg105v6w0g8ury4g2uk6p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fg105v6w0g8ury4g2uk6p.png" alt="Google Cloud OAuth consent screen"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  00:03:00
&lt;/h2&gt;

&lt;p&gt;Login to your AWS Console, under EC2 select Load Balancers, choose your load balance and edit the Listener Rules, as shown below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F10vvwpow3yjq49zr3guf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F10vvwpow3yjq49zr3guf.png" alt="AWS Console edit ALBs Listener Rules"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click the "+" icon to add a new rule.&lt;/p&gt;

&lt;p&gt;Click "Insert rule" above the normal URL for your web app (which could be the default action).&lt;/p&gt;

&lt;p&gt;In the left side, enter the conditions for the rule. As this example is for path-based, we will enter all paths we want to protect with an OAuth login screen:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fu89xkrl83y96l60n8ujn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fu89xkrl83y96l60n8ujn.png" alt="AWS ALB rule condition"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enter all paths ending with a &lt;code&gt;*&lt;/code&gt; (remove the trailing slash from the path).&lt;/p&gt;

&lt;p&gt;In the right side, enter Add Action &amp;gt; Authenticate, and select OIDC.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fpigl7s5855qergbnayxg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fpigl7s5855qergbnayxg.png" alt="AWS ALB rule action"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And setup Google Workspace OIDC with the following parameters:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Issuer&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://accounts.google.com&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Authorization endpoint&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://accounts.google.com/o/oauth2/v2/auth&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Token endpoint&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://oauth2.googleapis.com/token&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;User info endpoint&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://openidconnect.googleapis.com/v1/userinfo&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;And under Advanced Settings, set the &lt;strong&gt;Session Timeout&lt;/strong&gt; to a small value, like &lt;code&gt;43200&lt;/code&gt; (12 hours), otherwise the authentication will last for 7 days by default.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fvwmuuuu25i5h7yqsqvap.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fvwmuuuu25i5h7yqsqvap.png" alt="AWS ALB OIDC action"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Just below the OIDC action, you now have to add the Forward action to reach your web app.&lt;/p&gt;

&lt;p&gt;Copy the same action as the rule used at the moment to reach your web app. In this example, we were using a Default Action, Forwarding to a Target Group called "Laravel", so we will mimic this action into our OIDC rule, as shown below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F24png4qjqngnhh2qsati.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F24png4qjqngnhh2qsati.png" alt="AWS ALB rule action"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on the Save button above to save the new rule.&lt;/p&gt;

&lt;h1&gt;
  
  
  00:05:00
&lt;/h1&gt;

&lt;p&gt;That's it, now access your web app under the URL protected and you should be redirected to a Google authentication page.&lt;/p&gt;

&lt;p&gt;After authenticated, ALB will add a cookie that lasts for 12 hours (or the Session Timeout set before).&lt;/p&gt;

&lt;p&gt;If you like this post, you will love our 100+ open source repositories with moslty Terraform modules that help you achieve stuff like this.&lt;/p&gt;

&lt;p&gt;Check out our repos at &lt;a href="https://github.com/DNXLabs" rel="noopener noreferrer"&gt;https://github.com/DNXLabs&lt;/a&gt;, specially &lt;a href="https://github.com/DNXLabs/terraform-aws-ecs-app" rel="noopener noreferrer"&gt;https://github.com/DNXLabs/terraform-aws-ecs-app&lt;/a&gt; that comes with this feature built in.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>oauth2</category>
    </item>
    <item>
      <title>ARM vs Intel - A real-world comparison using EC2</title>
      <dc:creator>Allan Denot</dc:creator>
      <pubDate>Wed, 02 Dec 2020 11:38:32 +0000</pubDate>
      <link>https://dev.to/dnx/arm-vs-intel-a-real-world-comparison-using-ec2-2kme</link>
      <guid>https://dev.to/dnx/arm-vs-intel-a-real-world-comparison-using-ec2-2kme</guid>
      <description>&lt;p&gt;With the recent move from Apple to ARM-based CPUs, everyone seems to be in awe of the performance of the ARM-based Apple M1s. &lt;/p&gt;

&lt;p&gt;As a cloud engineer, I couldn't avoid asking if this performance translates to cloud computing too.&lt;/p&gt;

&lt;p&gt;AWS has their line of ARM CPUs called &lt;a href="https://aws.amazon.com/ec2/graviton/" rel="noopener noreferrer"&gt;Graviton&lt;/a&gt;, available in their second generation as the &lt;code&gt;m6g&lt;/code&gt; family in EC2. Those CPUs are on average 20% cheaper for the same amount of vCPUs and RAM, but how do they compare in terms of real-world performance, against traditional Intel CPUs? That's what we are here to find out.&lt;/p&gt;

&lt;h1&gt;
  
  
  Setup
&lt;/h1&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Intel&lt;/th&gt;
&lt;th&gt;ARM&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Instance Count&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Instance Type&lt;/td&gt;
&lt;td&gt;m5.large&lt;/td&gt;
&lt;td&gt;m6g.large&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CPU Tested&lt;/td&gt;
&lt;td&gt;Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz&lt;/td&gt;
&lt;td&gt;Custom built AWS Graviton2 Processor with 64-bit Arm Neoverse cores&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CPU Count&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Clock (MHz)&lt;/td&gt;
&lt;td&gt;3397.426&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Region/AZ&lt;/td&gt;
&lt;td&gt;ap-southeast-2c&lt;/td&gt;
&lt;td&gt;ap-southeast-2c&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Price (Sydney)&lt;/td&gt;
&lt;td&gt;$0.120 per Hour&lt;/td&gt;
&lt;td&gt;$0.096 per Hour&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;cat /proc/cpuinfo&lt;/code&gt; didn't show much information for the Graviton CPUs, I guess AWS wants to be secretive about it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Platform
&lt;/h2&gt;

&lt;p&gt;The goal is to simulate a workload close to a real-world scenario, so we chose to use a Laravel API connecting to a MySQL database, which is a popular stack today.&lt;/p&gt;

&lt;p&gt;The infrastructure used:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AWS ECS running in EC2&lt;/li&gt;
&lt;li&gt;2 Docker containers (ECS tasks) running the same App in one instance&lt;/li&gt;
&lt;li&gt;Containers limited to 1GB RAM (soft and hard limit), but no limit on CPU usage&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Application
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/gothinkster/laravel-realworld-example-app" rel="noopener noreferrer"&gt;RealWorld Example API, Laravel&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;PHP 7.1&lt;/li&gt;
&lt;li&gt;Apache/2.4.38 (Debian)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Container
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Intel: &lt;code&gt;FROM php:7.1-apache&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;ARM: &lt;code&gt;FROM arm64v8/php:7.1-apache&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Test Tool
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ab -n 1000 -c 20 https://${HOST}/api/articles/test-post
^      ^      ^
⎮      |      ⎩ 20 concurrency
⎮      ⎩ 1000 requests
⎩ Apache Benchmark
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Results
&lt;/h1&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;Graviton2 processors (m6g.large) are on average 25% faster than Intel on an m5.large instance. &lt;/p&gt;

&lt;p&gt;Given that m6g.large is 20% cheaper, we get a total of 40% gain in price/performance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data (higher is better)
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmql0qitqnzlaugmcunk8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmql0qitqnzlaugmcunk8.png" alt="single container, same database"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Graviton2 is almost 29% faster when shooting requests to a single container and the database behind is exactly the same.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F6dmvbbgc2xz5j4dkp011.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F6dmvbbgc2xz5j4dkp011.png" alt="2 containers, same database"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When adding a second container to answer requests, interestingly Gravitons didn't see any improvement, while Intel did. The difference fell to 8% only&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjw16q9490x0zhxx9lut3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjw16q9490x0zhxx9lut3.png" alt="2 containers, no database access"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Testing with requests that do not require database access, the number of requests per second were higher for both, and Graviton kept a good margin against Intel of 26%.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fv1ikjz1nafvtjy5x6e25.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fv1ikjz1nafvtjy5x6e25.png" alt="2 containers, database with the same instance type"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As a bonus, we decided to match the same instance type in the database. That means that now the &lt;code&gt;m5.large&lt;/code&gt; EC2 instance is connected to a &lt;code&gt;db.m5.large&lt;/code&gt; RDS instance and the &lt;code&gt;m6g.large&lt;/code&gt; to a &lt;code&gt;db.m6g.large&lt;/code&gt; RDS instance.&lt;/p&gt;

&lt;p&gt;Results were pretty similar to before, with a 22% advantage to Gravitons, meaning that for this specific test, the database was not a bottleneck.&lt;/p&gt;

&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;A simple change in your Dockerfile could mean a 40% cost reduction in your compute costs.&lt;/p&gt;

&lt;p&gt;As M1 Macs become more popular, dev teams will be multi-platform, requiring environments (both local and cloud) to support different architectures. &lt;/p&gt;

&lt;p&gt;Docker also is working on better support for multi-platform images with &lt;a href="https://docs.docker.com/buildx/working-with-buildx/" rel="noopener noreferrer"&gt;docker buildx&lt;/a&gt;, making it more portable and easier to use the most cost-effective computing platform, independent of architecture.&lt;/p&gt;

</description>
      <category>ec2</category>
      <category>aws</category>
      <category>performance</category>
      <category>cloud</category>
    </item>
  </channel>
</rss>
