<?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 Krzysztof Szyper on Medium]]></title>
        <description><![CDATA[Stories by Krzysztof Szyper on Medium]]></description>
        <link>https://medium.com/@krzysztof.szyper?source=rss-5e3a1ecd9ab1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Vl1LcnpcTuZSU7GA</url>
            <title>Stories by Krzysztof Szyper on Medium</title>
            <link>https://medium.com/@krzysztof.szyper?source=rss-5e3a1ecd9ab1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 21:58:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@krzysztof.szyper/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[Getting started with AWS the proper way — Part 2: AWS Identity Center]]></title>
            <link>https://medium.com/@krzysztof.szyper/getting-started-with-aws-the-proper-way-part-2-aws-identity-center-fd8cd90c951d?source=rss-5e3a1ecd9ab1------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd8cd90c951d</guid>
            <category><![CDATA[identity]]></category>
            <category><![CDATA[aws-sso]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[identity-management]]></category>
            <dc:creator><![CDATA[Krzysztof Szyper]]></dc:creator>
            <pubDate>Tue, 20 Jan 2026 22:27:24 GMT</pubDate>
            <atom:updated>2026-01-22T17:02:50.548Z</atom:updated>
            <content:encoded><![CDATA[<h3>Getting started with AWS the proper way — no more IAM users: Part 2 — AWS Identity Center</h3><p><strong>While my previous article focused on using an external Identity Provider (IdP) like Okta to eliminate IAM Users, there is an even simpler, cloud-native way to achieve the same goal. Meet AWS IAM Identity Center (formerly AWS SSO — Single Sign-On).</strong></p><p>You can also watch YouTube recordings of my presentation about this subject given by myself on meetups:</p><ul><li><a href="https://www.youtube.com/watch?v=C2729nhbzp8">AWS User Group Silesia</a>, May 22nd 2025, in Polish🇵🇱.</li><li><a href="https://youtu.be/ZXv7JN5ki_0">SysOps/DevOps Polska</a>, June 5th 2025, in Polish🇵🇱.</li></ul><p>In the first part of this series, we explored why IAM Users are outdated and dangerous — long-lived credentials, management hell, security risks, etc. We discussed how to replace them with a robust setup using a 3rd party IdP (like Okta<strong> </strong>or other) with <strong>SAML</strong> federation.</p><p>That approach is excellent for organizations that already use an external IdP for their corporate identities. But what if you are<strong> starting a private project, a small startup, or just learning AWS</strong>? Setting up Okta might feel like killing a fly with a sledgehammer.</p><p>Fortunately, AWS has evolved. You can now achieve the same “<strong>proper</strong>” setup — centralized access, short-lived credentials, and MFA — without leaving the AWS console and without spending a dime.</p><p>Here is how to get started with <strong>AWS IAM Identity Center</strong> as your own Identity Provider.</p><h3>The Evolution: From IAM to Identity Center</h3><p>To recap the journey:</p><ul><li><strong>The Old Way (IAM Users):</strong> Manual creation of users per account. Access keys stored on laptops. A security nightmare.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*rm9TFZsxI5qmvxGhvAU4Ww.png" /></figure><ul><li><strong>“The Old” Enterprise Way (External IdP):</strong> Federating Google Workspace, Okta, or Active Directory via SAML. Great for scale, but requires complex setup (SCIM, SAML assertions).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W-wwzTPbMfL7OAxqhuKdyg.png" /></figure><ul><li><strong>The Modern “Built-in” Way (Identity Center):</strong> Using AWS’s native service not just to manage access, but <em>as</em> the directory of users itself.<br>That’s the most simple and most secure solution for private projects or small organization — <strong>we’ll explore it further</strong> in the next paragraph.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j_1UYQC5gRR3MqTMwvXgOQ.png" /></figure><p>AWS Identity Center allows you to create users directly within AWS, but crucially, it manages their access via <strong>SSO</strong> and <strong>Roles</strong>, not IAM Users.</p><ul><li><strong>“The best” way combining all benefits</strong>: Using central, external IdP for identity management and provisioning (ideal approach if using many other services besides AWS), while using Identity Center for AWS access.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jxM-oJaJ-rEIVFTo8dBIeA.png" /></figure><h3>Why Identity Center?</h3><p>If you are hesitating between the Okta approach and Identity Center, consider this:</p><ul><li><strong>It’s Free:</strong> Just like the basic Okta plan, but without the external dependency.</li><li><strong>Enforced MFA:</strong> Identity Center <strong>forces</strong> you to set up MFA immediately. No complex policies required.</li><li><strong>Multi-Account by Design:</strong> It integrates natively with AWS Organizations. You manage access to 2, 10, or 100 accounts from one dashboard.</li><li><strong>CLI 2.0:</strong> The aws sso login experience is superior to the old access key methods and eliminates the need for third-party tools (like gimme-aws-creds) to hack together a CLI experience. The AWS CLI now supports SSO natively.</li><li><strong>Native integration</strong> with AWS application/services. The simplest solution for role based access control (RBAC) natively</li><li>Integration with <strong>3rd party services</strong> — Identity Center can be used as IdP for other services, just like Okta.</li></ul><h3>Step-by-Step Guide</h3><h4>1. Start with an Organization</h4><p>Even for a personal “sandbox” do not work in a single account. Create an <strong>AWS Organization</strong>. It’s free and separates your billing and management from your actual workloads.</p><ul><li>Go to <strong>AWS Organizations</strong> and click <strong>Create organization</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*7enuZkzzj2OmDO5FHsnuGw.png" /></figure><ul><li><em>Tip:</em> The account you create the organization in becomes the Management Account. Do not run resources (EC2, Lambda) here. Keep it for billing and maybe identity management only.</li></ul><h4>2. Enable Identity Center</h4><p>Navigate to the <strong>IAM Identity Center</strong> service.</p><ul><li><strong>Enable</strong> the service.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XHTodRmcniik24_5NktZHQ.png" /></figure><ul><li><em>Critical Note:</em> Unlike IAM, <strong>Identity Center is Regional</strong>. Choose your region wisely (e.g., eu-west-1), as your SSO portal URL and configuration will live there.</li><li>Take a note of Identity Center details or know how to find them easily — will be used for configuring CLI later on.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S7AFEAyz_7eTI2RgyRDRhw.png" /></figure><h4>3. Create Users (Your Directory)</h4><p>Since we aren’t using Okta here, we need to populate the directory.</p><ul><li>Go to <strong>Users</strong> -&gt; <strong>Add user</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AdO5rGCP4OJ2ANMrmkdXZw.png" /></figure><ul><li>Fill in the details and confirm creation.</li><li>From this moment user is created and login is possible, but there’s not access defined yet. You will receive an email invitation to set a password.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/456/1*0bK2ZgTnI66kNHxmonxd_w.png" /></figure><ul><li><em>Tip: </em>Upon first login, you will be also forced to register an <strong>MFA device</strong>. This is a huge security win out of the box.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/1*yAJ6Qm0SELIRnyVChGzQxQ.png" /></figure><h4>4. Define Permission Sets</h4><p>In Identity Center, we don’t manually create Roles in every child account. We create <strong>Permission Sets</strong>.</p><ul><li>A Permission Set is a template. It defines <em>“What permissions should this role have”</em> (e.g., ReadOnlyAccess or even a custom set of IAM policies — but they need to be created in the target account(s) beforehand) — effectively mapping to an IAM role in a provisioned account.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-rc0VnPmXx_uFzVwcxLHUQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pHb17H2JYYcwR6CzipoqqA.png" /></figure><p>Identity Center effectively deploys these as IAM Roles into the target accounts for you.</p><h4>5. Provision Permission Set and assign access</h4><p>The magic happens here. You don’t copy keys or create roles. You map: <strong>User/Group</strong> + <strong>Permission Set</strong> -&gt; <strong>Target AWS Account(s)</strong></p><ul><li>Go to <strong>AWS accounts</strong> and select accounts or organizational units.</li><li>Click <strong>Assign users or groups</strong>.</li><li>Select your user (e.g., yourself).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gHuF7dGscsXauZu-5Vy_hw.png" /></figure><ul><li>Select the existing Permission Set (e.g., ReadOnlyAccess).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y_rIffVVLNzT1vvoyVD7YQ.png" /></figure><ul><li>Now, on <strong>AWS accounts</strong> choose one or more accounts for provisioning.</li><li>Choose username or group created before.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XTYxrS04Bhnr-yFM4dVeXw.png" /></figure><ul><li>Done. The user now has access and can log into the selected accounts.</li></ul><h3>The Developer Experience (CLI)</h3><p>This is where the “No IAM Users” philosophy shines. You never touch a long-lived Access Keys (AKIA...) anymore.</p><p>Upon first login in terminal you can configure your CLI:</p><pre>aws configure sso</pre><p>You will be asked for your <strong>SSO Start URL</strong> (found in the Identity Center console) and the Region.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PlZ9qQ-7Pg1JzsObyCSN5A.png" /></figure><p>To start your day, you simply run:</p><pre>aws sso login # to choose account and permission set<br><br>aws sso login --profile my-profile # to select predefined credentials profile</pre><p>This opens your browser, asks for your MFA, and grants your terminal a temporary session (valid for 1–12 hours, configurable). If you are working in a <strong>headless</strong> environment (e.g., SSH), it provides a URL and code to authenticate via a browser on a different device.</p><p>Caveats:</p><ul><li>One limitation to note: If you reference a <strong>Customer Managed Policy</strong> in your Permission Set, that policy must already exist in the target account with the exact same name. Identity Center will not create the policy for you; it only references it. This creates a dependency that is best managed with Infrastructure-as-Code (e.g., Terraform).</li></ul><h3>Summary</h3><p>By using AWS Identity Center as your IdP, you gain the security of the &quot;Enterprise&quot; approach with the simplicity of a &quot;Personal&quot; setup.</p><ul><li><strong>No more long-lived access keys</strong> stored on your disk.</li><li><strong>No more IAM users</strong> to rotate.</li><li><strong>Centralized view</strong> of who has access to what.</li><li><strong>Free and scalable</strong>.</li><li><strong>Audit-friendly</strong> with CloudTrail.</li></ul><p>Whether you are a freelancer, building personal projects, or building a startup, this is the proper baseline for 2026. Stop creating IAM Users today!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd8cd90c951d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting started with AWS — the proper way — no more IAM users]]></title>
            <link>https://medium.com/brainly/getting-started-with-aws-the-proper-way-no-more-iam-users-32e94f1d52b6?source=rss-5e3a1ecd9ab1------2</link>
            <guid isPermaLink="false">https://medium.com/p/32e94f1d52b6</guid>
            <category><![CDATA[aml]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[iam-roles]]></category>
            <category><![CDATA[okta]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Krzysztof Szyper]]></dc:creator>
            <pubDate>Wed, 15 May 2024 11:03:43 GMT</pubDate>
            <atom:updated>2026-01-22T17:02:19.789Z</atom:updated>
            <content:encoded><![CDATA[<h3>Getting started with AWS the proper way — no more IAM users: Part 1 — SAML</h3><p>While many <a href="https://aws.amazon.com/"><strong>Amazon Web Services (AWS)</strong></a> tutorials still introduce <a href="https://aws.amazon.com/iam/"><strong>IAM</strong></a> users for accessing APIs and resources, this method is outdated and often inadequate for real-world applications due to hidden complexities that can arise as you scale, and security weaknesses.</p><p>Instead of using <strong>IAM Users</strong>, it’s better to use <strong>IAM Roles</strong>, even for training purposes on your personal accounts and projects, to get used to the concept that will accompany you in your professional career as well. Even third-party services have begun to use IAM roles from their accounts instead of creating IAM users in yours to access your infrastructure. Here, we’ll explore how to set up <a href="https://wiki.oasis-open.org/security"><strong>Single Sign-On (SSO)</strong></a> for AWS using <a href="https://wiki.oasis-open.org/security"><strong>Security Assertion Markup Language (SAML)</strong></a> with an <a href="https://en.wikipedia.org/wiki/Identity_provider"><strong>Identity Provider (IdP)</strong></a>, emphasizing why this is the essential skill you’ll need everywhere now.</p><p>IAM role delegation through SSO provides a more streamlined, secure, and efficient way to grant access to resources. It eliminates the need to manage individual IAM users’ credentials, reducing administrative overhead and enhancing overall security. With SSO, users authenticate through a single set of credentials, simplifying their access to various services without needing multiple passwords. This approach also enables organizations to enforce stronger security practices like <a href="https://en.wikipedia.org/wiki/Multi-factor_authentication"><strong>Multi-factor authentication (MFA)</strong></a> consistently across all services. Additionally, it offers better compliance management by centralizing identity and access controls. And it’s the most common way of accessing AWS APIs in the real world.</p><p>Therefore, you should start with a proper way of accessing AWS — with IAM roles delegation via SSO. This article will provide step-by-step instructions on how to set it all up for the first time. There are multiple ways of using SSO, but some of them generate costs or are too complicated to start with, e.g. <a href="https://aws.amazon.com/iam/identity-center/"><strong>AWS IAM Identity Center</strong></a> with <a href="https://simplecloud.info/"><strong>System for Cross-domain Identity Management (SCIM)</strong></a>. This example will concentrate on a free solution using <a href="https://www.okta.com/"><strong>Okta</strong></a>, as IdP with SAML, being a leading standard in many companies. A robust free offering from Okta facilitates broader application across various services and systems.</p><p>It is also beneficial to start early with AWS Organizations and to use multiple accounts, even for training purposes. As you get ready to discover essential skills about splitting workloads, cross-account access and permissions, etc.</p><h3>The old-school way</h3><p>AWS access can be managed by creating IAM users with specific permissions and distributing access keys to team members.</p><p>This method has several drawbacks:</p><ul><li><strong>Credential Management</strong>: Managing multiple IAM users and their credentials is cumbersome, prone to errors, and not scalable.</li><li><strong>Security Risks</strong>: IAM users with long-lived access keys pose security risks if compromised.</li><li><strong>Limited Visibility</strong>: Tracking user access and permissions across multiple accounts is challenging.</li><li><strong>Compliance Challenges</strong>: Meeting compliance requirements for access control is complex and time-consuming.</li><li><strong>Lack of Centralized Control</strong>: Each AWS account has its own user management, leading to siloed access control.</li><li><strong>Complicated Multi-Factor Authentication (MFA)</strong>: Enforcing MFA for all users is not straightforward with IAM users.</li><li><strong>No Single Sign-On (SSO)</strong>: Users have to manage multiple credentials for different services.</li><li><strong>No Federated Access</strong>: Integrating with external identity providers is not seamless.</li><li><strong>No Role-Based Access Control</strong>: Defining granular permissions based on roles is limited.</li><li><strong>No Automated User Provisioning</strong>: Onboarding and off-boarding users is manual and error-prone.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/0*aywm3Hx-wMjtGunf.png" /></figure><h3>How it’s done now</h3><p>To address the limitations of traditional IAM user management, modern cloud environments are adopting <strong>SSO</strong> solutions with <strong>IdPs</strong> like Okta.</p><p>Here’s how SSO access improves the security and efficiency of your cloud environment:</p><ul><li><strong>Centralized User Management</strong>: Manage user access to AWS centrally from the IdP system, eliminating the need for individual IAM users.</li><li><strong>Enhanced Security</strong>: Secure access to AWS resources with SAML-based authentication and MFA through IdP reduces the risk of compromised credentials.</li><li><strong>Compliance and Auditing</strong>: Easily track user access to AWS resources and their authentication methods through IdP’s comprehensive logs.</li><li><strong>Role-Based Access Control (RBAC)</strong>: Define granular permissions based on roles in AWS.</li><li><strong>Session Management</strong>: Control session duration so that even leaked credentials are invalidated quickly.</li><li><strong>Automated User Provisioning</strong>: Automate user onboarding and off-boarding with IdP’s user lifecycle management.</li><li><strong>Centralized Audit Trail</strong>: Track user activities and changes across AWS accounts through audit logs.</li><li><strong>Cross-Account Access</strong>: Enable access across multiple AWS accounts with federated access.</li><li><strong>User Self-Service</strong>: Allow users to manage their access, reset passwords, or MFA settings through the IdP portal.</li><li><strong>Simplified Access</strong>: Users can access multiple services with a single set of credentials through SSO.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UPkLgXa_undK4gFj.png" /></figure><h3>How the login process looks like</h3><p>The login process with AWS SSO using SAML involves the following steps:</p><ol><li><strong>User Authentication</strong>: Users log in to the IdP (e.g., Okta) portal with their credentials.</li><li><strong>SSO Authentication</strong>: The IdP authenticates the user and generates a SAML assertion.</li><li><strong>SAML Assertion</strong>: The IdP sends the SAML assertion to AWS SSO, requesting temporary credentials.</li><li><strong>Role-Based Access</strong>: AWS validates trust policy of requested IAM role for IdP’s IAM user and SAML assertion by providing temporary credentials.</li><li><strong>Access to AWS Resources</strong>: Users can access AWS resources using those credentials provided by AWS.</li><li><strong>Session Management</strong>: AWS manages the session duration and automatically invalidates the temporary credentials after the session expires.</li></ol><h3>Step-by-step guide to setting up AWS SAML access with Okta</h3><h3>Prerequisites</h3><ul><li>Running a Unix-like operating system (e.g. macOS or Linux).</li><li>Basic understanding of AWS, especially <strong>IAM</strong> and <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html"><strong>Organizations</strong></a>.</li><li>Some understanding of <a href="https://www.terraform.io/"><strong>Terraform</strong></a> and using modules.</li><li>At least one <a href="https://aws.amazon.com/"><strong>AWS</strong></a> account.</li><li>An <a href="https://www.okta.com/"><strong>Okta</strong></a> account.</li></ul><p>This example solution will require the creation of an initial IAM user for Terraform to provision all the necessary resources. It can be deleted later when the SSO is fully set up.</p><h3>Guide</h3><p><strong>Set up your Okta account</strong><br>A free account is enough for this purpose.</p><ul><li>Create an <strong>Okta</strong> account if you don’t have one.</li><li>Go to the Okta <strong>Admin</strong> dashboard.</li><li>Take note of the page URL, it should be similar to https://dev-123456-admin.okta.com/admin/getting-started, where dev-123456 will be your organization name, and okta.com will be Okta’s base URL.</li></ul><p><strong>Create an API token in Okta</strong> — see a <a href="https://www.youtube.com/watch?v=PNmFd45F-Kg"><strong>video recap</strong></a><br>Those credentials will be used by Terraform to interact with Okta, i.e. create groups, assign users to the groups, etc.</p><ul><li>In the Okta <strong>Admin</strong> dashboard.</li><li>Navigate to <strong>Security</strong> &gt; <strong>API</strong> and select the <strong>Tokens</strong> tab.</li><li>Click on <strong>Create Token</strong>.</li><li>Give the token a name and click <strong>Create Token</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/499/0*KkSnBwGDJeehDgVO.png" /></figure><ul><li>Copy the token value and store it securely.</li></ul><p><strong>Create an IAM user in the AWS account </strong>— see a <a href="https://www.youtube.com/watch?v=iydmmiI_Zug"><strong>video recap</strong></a><br>This will be a temporary user for Terraform before you can switch to using roles. You may already have one created before if you’ve used Terraform or tried using AWS CLI. It may be reused for that purpose as well, just double-check permissions to IAM and Organizations.</p><ul><li>Log in to your organization’s master account, using for example root credentials.</li><li>Go to the <strong>IAM</strong> service.</li><li>Navigate to <strong>Users</strong> and click on <strong>Create user</strong>.</li><li>Enter a username, e.g. terraform, and click <strong>Next</strong>.</li><li>Select <strong>Attach policies directly</strong> and search for <strong>IAMFullAccess</strong> and <strong>AWSOrganizationsReadOnlyAccess</strong> in <strong>Permissions policies</strong>, select them, and click <strong>Next</strong>.</li><li>Confirm the next page by clicking <strong>Create user</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XWu-4yB5dYarA2TO.png" /></figure><ul><li>When the list of users shows up click on the name you’ve provided to get user details.</li><li>Click on the <strong>Security credentials</strong> tab and find the <strong>Create access key</strong> button.</li><li>Select <strong>Command Line Interface (CLI)</strong>, check the box on the bottom, and click <strong>Next</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*y4ZkcNffKoK_nzMi.png" /></figure><ul><li>Confirm by clicking the <strong>Create access key</strong>.</li><li>Store securely Access key and Secret access key (click on <strong>Show</strong>) values.</li><li>Take note of the account ID in the upper right corner.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/0*32tGfYVyusVl25sW.png" /></figure><p><strong>Set up AWS CLI</strong> — see a <a href="https://www.youtube.com/watch?v=QeY9GbUvOG0"><strong>video recap</strong></a><br>Command Line Interface credentials are necessary for Terraform to interact with AWS.</p><ul><li>Install <a href="https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html"><strong>AWS CLI</strong></a> if you haven’t already.</li><li>Create a configuration file in your home directory ~/.aws/config with the following content:</li></ul><pre>[default]<br>region = eu-west-1<br>output = json</pre><ul><li>Create a credentials file in your home directory ~/.aws/credentials with the following content:</li></ul><pre>[okta-master]<br>aws_access_key_id = MyRaNdOmAcCeSsKeY<br>aws_secret_access_key = MyRaNdOmSeCrEtKeY</pre><ul><li>Enter the values from the IAM user you’ve created. That will become okta-master profile used later by Terraform.</li><li>Run aws sts get-caller-identity --profile okta-master | cat, to make sure there are no errors and the account ID and username match the expected values.<br>It should give something like:</li></ul><pre>{<br>  &quot;UserId&quot;: &quot;SOMEOTHERVALUE&quot;,<br>  &quot;Account&quot;: &quot;123456789012&quot;,<br>  &quot;Arn&quot;: &quot;arn:aws:iam::123456789012:user/terraform&quot;<br>}</pre><p><strong>Set up Terraform</strong> — see a <a href="https://www.youtube.com/watch?v=2-ArlogiH7Y"><strong>video recap</strong></a><br>Terraform will be used to provision all the necessary resources in AWS and Okta.</p><ul><li>Download the provided module source code in a subdirectory of Terraform sources.<br>Keep in mind this module is only provided as-is for the demonstration of an idea, not as a full-proof production-ready solution.</li><li>AWS credentials will be taken by the provider from ~/.aws/credentials file, so make sure they are set up correctly and profiles names match the ones used in the code.</li><li>Okta provider needs to have OKTA_API_TOKEN environment variable set with the token you’ve created before.<br>The same value is also needed to passed as okta_api_token variable in Terraform code, to do it safely use TF_VAR_okta_api_token environment variable.<br>This variable is used by Terraform http provider to download IdP metadata from Okta on the fly, without the need of saving the file locally.</li><li>Create a new file, e.g. terraform.tf and add the following content to define providers:</li></ul><pre>terraform {<br>  required_version = &quot;&gt;= 1.7.0&quot;<br><br>  required_providers {<br>    aws = {<br>      source  = &quot;hashicorp/aws&quot;<br>      version = &quot;~&gt; 5.0&quot;<br>    }<br><br>    http = {<br>      source  = &quot;hashicorp/http&quot;<br>      version = &quot;~&gt; 3.0&quot;<br>    }<br><br>    okta = {<br>      source  = &quot;okta/okta&quot;<br>      version = &quot;~&gt; 4.0&quot;<br>    }<br>  }<br>}<br><br># https://registry.terraform.io/providers/hashicorp/aws/latest/docs<br>provider &quot;aws&quot; {<br>  alias   = &quot;master&quot;<br>  profile = &quot;okta-master&quot;<br>  region  = &quot;eu-west-1&quot;<br>}<br><br># https://registry.terraform.io/providers/okta/okta/latest/docs<br>provider &quot;okta&quot; {<br>  org_name = &quot;dev-123456&quot;<br>  base_url = &quot;okta.com&quot;<br>}</pre><ul><li>Replace the values with your own, e.g. dev-123456 with your organization name, define aws providers for master account.</li><li>Create a new file, e.g. okta.tf and add the following content to define access mapping for your AWS organization:</li></ul><pre>locals {<br>  assignment = jsonencode({<br>    &quot;first.user@example.com&quot; = {<br>      &quot;123456789012&quot; = [<br>        &quot;AdminAccess&quot;,<br>        &quot;ReadOnlyAccess&quot;<br>      ],<br>      &quot;987654321098&quot; = [<br>        &quot;AdminAccess&quot;,<br>        &quot;ReadOnlyAccess&quot;<br>      ]<br>    },<br>    &quot;second.user@example.com&quot; = {<br>      &quot;123456789012&quot; = [<br>        &quot;ReadOnlyAccess&quot;<br>      ],<br>      &quot;987654321098&quot; = [<br>        &quot;ReadOnlyAccess&quot;<br>      ]<br>    }<br>  })<br>}<br><br>variable &quot;okta_api_token&quot; {<br>  description = &quot;The Okta API token for downloading the IdP metadata&quot;<br>  type        = string<br>  sensitive   = true<br>}</pre><ul><li>Replace the values with your own, e.g. emails and account IDs, and roles’ names.<br>For every account and role defined, there will be a corresponding group created in Okta, and users assigned to those groups will have access to the roles.<br>Group names will be in the format aws_&lt;account_id&gt;_&lt;role_name&gt;.</li><li>To the same file add the following content to define the first module copy for the master account:</li></ul><pre>module &quot;master_account&quot; {<br>  source = &quot;../module-okta-saml-aws&quot;<br><br>  providers = {<br>    aws  = aws.master<br>    okta = okta<br>    http = http<br>  }<br><br>  assignment     = local.assignment<br>  okta_api_token = var.okta_api_token<br>}</pre><ul><li>You can further adjust module configuration, e.g. by changing role names, changing session duration, etc. Only the master account is defined here, child accounts can be defined in the next steps.</li><li>Run terraform init and terraform plan in the main Terraform directory. Review the plan and compare it with the code to understand dependencies.</li></ul><p><strong>Create resources for Okta</strong> — see a <a href="https://www.youtube.com/watch?v=kHh9hZe9k-o"><strong>video recap 1</strong></a><strong> and </strong><a href="https://www.youtube.com/watch?v=rnRPKtHZoGg"><strong>vide recap 2</strong></a><br>Terraform will create a preconfigured SAML application in Okta, together with groups used for assigning access and the IAM user for Okta to federate the access.</p><ul><li>Run terraform apply to create AWS SAML application in Okta and required IAM resources in AWS by confirming with yes.</li><li>Go to the <strong>Users</strong> page in the <strong>IAM</strong> console page in <strong>AWS</strong>, and find the user created by Terraform. The default name, if not changed, is OktaUserSSO.</li><li>Open it and create a set of access keys as in one of the previous steps. Those credentials will be used by Okta.</li></ul><p><strong>Configure SAML application in Okta</strong> — see a <a href="https://www.youtube.com/watch?v=gu_oJEhDJkc"><strong>video recap</strong></a><br>Now Okta needs to get configuration to access your AWS organization.</p><ul><li>To connect Okta with AWS go to <strong>Admin</strong> page in <strong>Okta</strong>.</li><li>Open <strong>Applications</strong> and search for <strong>Amazon Web Services</strong>, which was created by Terraform.</li><li>When opened go to the <strong>Provisioning</strong> tab and click on <strong>Configure API Integration</strong>.</li><li>Mark the checkbox that appeared, and enter access keys created previously for OktaUserSSO, and click <strong>Test API Credentials</strong>. And <strong>Save</strong> if there were no errors.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/0*gStF5hVUKin9MOZr.png" /></figure><ul><li>Go back to the list of applications expand <strong>More</strong> on the right and click <strong>Refresh Application Data</strong>. This will let Okta access your AWS account(s) and read IAM roles in them.<br>It should be done every time an account(s) or role(s) are added or removed from provisioning.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/0*hLrL3glUFxWXn7bY.png" /></figure><ul><li>Now the defined users can access the AWS Console through Okta. They need to log in to Okta and select the <strong>Amazon Web Services</strong> application to be redirected to the AWS Console.<br>If user has more than one role assigned they will be asked to choose which one to use.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/0*qboOAzuqtUaKPF_z.png" /></figure><p><strong>Set up non-master AWS accounts</strong> — see a <a href="https://www.youtube.com/watch?v=yYJip4jyPoc"><strong>video recap</strong></a><br>Okta will now need to have its cross-account IAM role in the child accounts to read the roles and federate the login process.<br>Repeat <strong>steps 3–6</strong> for every child account you want to have access to.</p><ul><li>In the ~/.aws/credentials enter a new profile for the child account, e.g. okta-child with access keys for the user created in the child account.</li><li>In the terraform.tf file add a new provider for the child account, e.g. child.</li></ul><pre>provider &quot;aws&quot; {<br>  alias   = &quot;child&quot;<br>  profile = &quot;okta-child&quot;<br>  region  = &quot;eu-west-1&quot;<br>}</pre><ul><li>In the okta.tf file add a new module copy for the child account, e.g. module &quot;child_account&quot;, and set the same provider alias as just created in the terraform.tf file.</li></ul><pre>module &quot;child_account&quot; {<br>  source = &quot;../module-okta-saml-aws&quot;<br><br>  providers = {<br>    aws  = aws.child<br>    okta = okta<br>    http = http<br>  }<br><br>  assignment     = local.assignment<br>  okta_api_token = var.okta_api_token<br>}</pre><ul><li>Adjust the local.assignment variable to include the new account and roles if it&#39;s not already there.</li><li>Run terraform apply to create the required IAM resources in AWS for the child account.<br>Note that the SAML application in Okta is shared between all accounts, so it will not be created again.</li><li>Open again the <strong>Provisioning</strong> tab in the <strong>Amazon Web Services</strong> application in Okta and add the new account ID to the list of accounts in the <strong>Connected Accounts IDs (optional)</strong> field.<br>Remember to add ID of the master account as well, if it’s not there already. Divide them with a comma, e.g. 123456789012,987654321098.<br>This will let Okta access the child accounts and read IAM roles in it.</li><li>Refresh application data in Okta to read the roles in the child account.</li><li>Now the defined users can access the AWS Console in the child account through Okta.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/0*Rvzp9zSwkRlKhFYK.png" /></figure><p><strong>Set up CLI for AWS</strong> — see a <a href="https://www.youtube.com/watch?v=YK1p5GbNtj8"><strong>video recap</strong></a><br>To fully migrate from IAM users to IAM roles you need to switch IAM credentials for your terminal and CLI tools. It can be done with various tools. For example Okta’s <a href="https://github.com/okta/okta-aws-cli"><strong>okta-aws-cli</strong></a>, but the author personally suggests Nike’s <a href="https://github.com/Nike-Inc/gimme-aws-creds"><strong>gimme-aws-creds</strong></a>, as the one being actively updated and improved, and can use hardware MFA in a headless mode. It can, for example, create a separate AWS credentials profile for every account and every IAM role your user has been assigned with. Which will help with running this example Terraform code, by just renaming credentials profiles names in AWS provider configuration.</p><ul><li>Install <strong>gimme-aws-creds</strong>.</li><li>From <strong>Amazon Web Services</strong> application configuration in <strong>Okta </strong>admin dashboard open <strong>General</strong> tab and copy the URL under <strong>App Embed Link</strong>. It will be used as <strong>app_url</strong> next.</li><li>Create ~/.okta_aws_login_config file with the following content, adjusted with your Okta organization details.</li></ul><pre>[DEFAULT]<br>okta_username = user.name@example.com<br>cred_profile = acc-role<br>aws_default_duration = 28800<br>okta_org_url = https://dev-123456.okta.com<br>app_url = https://dev-123456.okta.com/home/amazon_aws/0oaSoMeRanDoMh8/137<br>preferred_mfa_type = token:software:totp<br>gimme_creds_server = appurl<br>write_aws_creds = True<br>resolve_aws_alias = True<br>remember_device = True<br>output_format = json<br>aws_rolename = all</pre><ul><li>Run gimme-aws-creds, it will update ~/.aws/credentials creating needed profiles. The output of the command will tell which credentials profiles have been updated.</li><li>Use those profile names to configure AWS providers in your terraform.tf code replacing the previous ones.</li></ul><pre>provider &quot;aws&quot; {<br>  alias   = &quot;master&quot;<br>  profile = &quot;my-org-master-AdminAccess&quot;<br>  region  = &quot;eu-west-1&quot;<br>}<br><br>provider &quot;aws&quot; {<br>  alias   = &quot;child&quot;<br>  profile = &quot;my-org-child-AdminAccess&quot;<br>  region  = &quot;eu-west-1&quot;<br>}</pre><ul><li>Run terraform plan to make sure no changes are needed and the new credentials work properly.</li><li>IAM users created for Terraform can now be deleted. Remember to deactivate access keys before deleting the user.</li></ul><h3>Useful tips</h3><ul><li>Consider using a more scalable approach to <a href="https://en.wikipedia.org/wiki/Infrastructure_as_code"><strong>Infrastructure as Code (IaC)</strong></a>, different tools can make your life easier. Like <a href="https://terragrunt.gruntwork.io/"><strong>Terragrunt</strong></a>, which will automatically create cross-account access roles when creating new AWS accounts. This will eliminate the need to create IAM users in the child accounts within your organization.</li><li>Instead of access mapping in code you could use a more agile approach, for example with <strong>Okta push groups</strong>, which will allow you to build fully automated provisioning or self-service tools.</li><li>Consider <a href="https://en.wikipedia.org/wiki/CI/CD"><strong>CI/CD</strong></a> tools for running Terraform. Like <a href="https://aws.amazon.com/codebuild/"><strong>AWS CodeBuild</strong></a> and <a href="https://aws.amazon.com/codepipeline/"><strong>AWS CodePipeline</strong></a>, which will use IAM roles instead of IAM users for provisioning resources.</li><li>Consider using <a href="https://en.wikipedia.org/wiki/Role-based_access_control"><strong>Role-Based Access Control (RBAC)</strong></a> in services that support it. For example, <a href="https://aws.amazon.com/rds/"><strong>Amazon Relational Database Services (RDS)</strong></a> databases can make use of those new roles you use to log into AWS.</li><li>Logging into the Console page of AWS while having a lot of accounts may be cumbersome, so consider our Brainly colleague’s Chrome plugin<strong> </strong><a href="https://github.com/winglot/saml-searchbox"><strong>saml-searchbox</strong></a> to quickly search through accounts and roles.</li><li>Using Okta groups for assigning access is also similar to what <a href="https://aws.amazon.com/iam/identity-center/"><strong>AWS Identity Center</strong></a> would require, so you’ll be familiar with the concept when you need to use it in the future.</li></ul><h3>Moving Forward</h3><ul><li>By following these steps, you’ve modernized how access is managed to your AWS resources, aligning with best practices for security and efficiency.<br>It’s essential to learn and adapt to these modern approaches, as this knowledge directly translates to real-world applications in cloud security and management.</li><li>If you’re a beginner in AWS, understanding IAM and the power of SSO integrations with services like Okta will set a strong foundation for your cloud computing journey.<br>Keep exploring, learning, and applying these practices to ensure your cloud environments are secure, compliant, and efficiently managed.</li><li>As you progress in your cloud career, you’ll encounter more advanced scenarios and tools that build upon these foundational concepts.<br>Stay curious, keep learning, and adapt to the evolving cloud landscape to become a proficient cloud practitioner.<br>Embrace the challenges, seek out new knowledge, and apply best practices to build secure, scalable, and efficient cloud environments, even for training purposes.</li></ul><h3>More information and meetup presentation</h3><p>The source code for the module used in this article together with a meetup presentation with a demo run can be found on GitHub: <a href="https://github.com/ChristophShyper/presentation-okta-saml-aws"><strong>presentation-okta-saml-aws</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=32e94f1d52b6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/brainly/getting-started-with-aws-the-proper-way-no-more-iam-users-32e94f1d52b6">Getting started with AWS — the proper way — no more IAM users</a> was originally published in <a href="https://medium.com/brainly">Brainly Technology Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Separating cloud environments with routing domains]]></title>
            <link>https://medium.com/brainly/separating-cloud-environments-with-routing-domains-bd3287ee6ebe?source=rss-5e3a1ecd9ab1------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd3287ee6ebe</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[routing]]></category>
            <category><![CDATA[transit-gateway]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Krzysztof Szyper]]></dc:creator>
            <pubDate>Thu, 10 Aug 2023 18:41:40 GMT</pubDate>
            <atom:updated>2023-08-10T18:41:40.237Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Challenge</strong></p><p>In modern cloud computing, securing and separating workloads and data is of paramount importance. Having many <a href="https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html"><strong>Virtual Private Clouds</strong></a> (VPCs) created and terminated even daily is unmanageable manually or using standard solutions. There are commercial products that can help with it, but at a high price. Fortunately, <a href="https://aws.amazon.com/"><strong>Amazon Web Services</strong></a><strong> </strong>(AWS) has a few services that, with the help of cloud architects, can make it very simple to manage at scale using modern abstracts.</p><p>One effective way to enhance the security posture of cloud environments is by using routing domains. They enable organizations to segregate and control the flow of network traffic between various segments of their infrastructure. This article explores the concept of routing domains and demonstrates their use in enhancing security by separating development and production environments in AWS.</p><p><strong>Understanding routing domains</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fhTZGpDG1erOOFe0" /></figure><p>Routing domains are logical groupings of network route tables within <a href="https://aws.amazon.com/transit-gateway/"><strong>AWS Transit Gateway</strong></a> (TGW). Which acts as a central hub within a <a href="https://aws.amazon.com/about-aws/global-infrastructure/regions_az/"><strong>region</strong></a>, simplifying the network connectivity between multiple VPCs and on-premises networks. As it doesn’t require creating each-to-each peerings or any other hectic method to work with. Instead, a simple TGW VPC attachment for each VPC that can use even a single Transit Gateway is enough to implement many routing domains.</p><p>Worth empathizing that Transit Gateway acts as a router in a single AWS region. If an organization also uses VPCs in other regions it requires a Transit Gateway for each region to be peered with each other.</p><p>To further secure environments a set of <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps.html"><strong>Service Control Policies</strong></a><strong> </strong>should also be in place to restrict AWS API operations between environments as well as restricting who can modify route tables and other networking settings, so they don’t get compromised.</p><p><strong>Key benefits of routing domains</strong></p><p><em>Enhanced Security</em>: Routing domains offer a robust approach to enforcing network segmentation. By separating different parts of the infrastructure into isolated domains, one can control the flow of traffic between them. This isolation limits the attack surface and reduces the risk of unauthorized access or lateral movement within the network.</p><p><em>Simplified Network Management</em>: Routing domains simplify network management by providing logical containers for route tables. This makes it easier to organize and maintain complex network topologies, especially in large-scale cloud environments.</p><p><em>Improved Compliance</em>: Many compliance regulations mandate strict segregation of development and production environments. Routing domains provide a straightforward way to achieve this segregation while adhering to compliance requirements.</p><p><strong>Using routing domains to separate development and production environments</strong></p><p>Let’s explore how routing domains can be utilized to improve the security of cloud environments by isolating development and production workloads.</p><p><em>Segregation of network traffic</em>: Assume an organization has four distinct VPCs — two for development and two for production. By attaching them in pairs to separate routing domains within the Transit Gateway, the organization ensures that the two environments remain isolated, and network traffic is not directly exchanged between them.</p><p><em>Controlled communication</em>: In the development environment, there might be less restrictive security measures to facilitate agile development and testing. However, in the production environment, stringent access controls are essential to protect sensitive data and applications. With routing domains, the production environment can enforce tighter security policies while still allowing necessary communication. For example, allowing traffic only between selected VPCs from the same domain, not all of them.</p><p><em>Implementation of security layers</em>: By using routing domains, an organization can implement security layers, such as firewalls, intrusion detection systems, or <a href="https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html"><strong>Network Access Control Lists</strong></a> (NACLs). Each routing domain can have its own set of security policies tailored to the specific needs of its environment.</p><p><em>Secure cross-account communication</em>: In some scenarios, organizations may have multiple AWS accounts for different business units or departments. Routing domains enable secure communication between these accounts by using AWS Transit Gateway inter-region peering. Each account can even have multiple VPCs attached to separate routing domains, ensuring that traffic is isolated and controlled. The routing domain doesn’t have to correspond to the SDLC environment but can rely on the business domain or any other logical separation.</p><p><em>VPN</em>: Routing domains can also utilize VPN connections. A separate <a href="https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/what-is.html"><strong>VPN Client Endpoint</strong></a><strong> </strong>for each domain can assure there is complete separation between engineers and environments. It’s also very easy to restrict access to each VPC for every engineer.</p><p><em>Exceptions</em>: There might be a need of having a VPC with some common services for all routing domains (e.g. central logging, security audit, etc.). In such cases, VPC attachment can be used in several instances of routing domains allowing traffic between them.</p><p><strong>Example route tables</strong></p><p>Development routing domain</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*Glk24Xu4PYBI27aGqHADrA.png" /></figure><p>Production routing domain</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/1*0IbVWuFobEArJYM65mnG8g.png" /></figure><p><strong>Automation</strong></p><p>Managing routing domains at scale manually is not possible. But it’s very easy to create, e.g. a Terraform module that can control them. It can be a part of <a href="https://docs.aws.amazon.com/controltower/latest/userguide/account-factory.html"><strong>Account Factory</strong></a> implementation. Automatically creating all needed route tables, NACLs, and VPC attachments in Transit Gateway for defined routing domains.</p><p>In this example setting the environment name as an input variable for an account can define what type of ingress and egress network traffic will be possible for it via the routing domain.</p><p><strong>Conclusion</strong></p><p>Routing domains play a crucial role in securing modern cloud environments by providing isolation and control over network traffic between different segments of the infrastructure. By separating development and production environments using routing domains, organizations can significantly reduce the risk of security breaches and maintain compliance with industry regulations. Implementing routing domains within AWS Transit Gateway or similar networking solutions empowers organizations to design robust and secure network architectures that align with their business requirements and security policies. As cloud adoption continues to grow, leveraging routing domains will remain a valuable strategy for enhancing the security posture of cloud environments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd3287ee6ebe" width="1" height="1" alt=""><hr><p><a href="https://medium.com/brainly/separating-cloud-environments-with-routing-domains-bd3287ee6ebe">Separating cloud environments with routing domains</a> was originally published in <a href="https://medium.com/brainly">Brainly Technology Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>