<?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 Vahaggn on Medium]]></title>
        <description><![CDATA[Stories by Vahaggn on Medium]]></description>
        <link>https://medium.com/@vahaggn?source=rss-bd3b544897b5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*OpiUUcGsGGZFEtW7</url>
            <title>Stories by Vahaggn on Medium</title>
            <link>https://medium.com/@vahaggn?source=rss-bd3b544897b5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 02:33:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vahaggn/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[Amazon Linux 2 ECS-optimized AMIs officially reach end of life on June 30, 2026.]]></title>
            <link>https://awstip.com/amazon-linux-2-ecs-optimized-amis-officially-reach-end-of-life-on-june-30-2026-852d4039892c?source=rss-bd3b544897b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/852d4039892c</guid>
            <category><![CDATA[aws-ec2]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Vahaggn]]></dc:creator>
            <pubDate>Tue, 19 May 2026 21:23:57 GMT</pubDate>
            <atom:updated>2026-05-21T08:07:16.713Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*kzccyuFS7QJhGMrnCmNizQ.jpeg" /></figure><p>On paper, migrating ECS clusters to Amazon Linux 2023 sounds straightforward:<br>Replace the AMI, refresh the capacity, and move on.</p><p>“no more Amazon ECS-optimized Amazon Linux 2 AMIs are published” after June 30, 2026.</p><p>In reality, this is one of those infrastructure upgrades that exposes years of hidden assumptions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/321/1*QeKHeGcS2pIVp-uRO1Yv3w.png" /></figure><p>A lot changed underneath the hood with AL2023:</p><p><strong>→ cgroups v2 changes memory accounting behavior <br></strong>Page cache is now counted toward container memory usage. Workloads that looked healthy on AL2 can suddenly start flirting with OOM kills.</p><p><strong>→ IMDSv2 is enforced by default <br></strong>Older SDKs, bootstrap scripts, and sidecars that still rely on IMDSv1 often fail quietly — usually during credential refresh, not during deployment.</p><p><strong>→ yum, amazon-linux-extras, and EPEL are gone <br></strong>A surprising number of user-data scripts still assume those repositories exist.</p><p><strong>→ systemd-networkd replaces older networking behavior <br></strong>Anything depending on legacy ifcfg-* configurations or dhclient hooks may stop behaving the way teams expect.</p><p><strong>→ /tmp is now tmpfs (RAM-backed) <br></strong>That harmless temporary file usage? It now competes directly with workload memory.</p><p><strong>→ cloud-init is stricter <br></strong>Remote includes that were “usually available” can now fail bootstrapping entirely if unreachable.</p><p>None of these changes are bad. <br>Most are actually improvements.</p><p>But together, they turn a routine AMI refresh into a platform migration.</p><p>The risky part isn’t deploying AL2023. <br>The risky part is discovering all the operational dependencies nobody realized existed until rollout day.</p><p>The teams navigating this well aren’t treating it like <strong>patch management</strong>.</p><p>They’re:<br>• benchmarking real workload memory usage on AL2023 <br>• running weighted capacity-provider rollouts <br>• validating bootstrap compatibility ahead of time <br>• canarying stateful and temp-heavy workloads first <br>• testing rollback paths before touching production</p><p>Because the failure modes here are subtle:<br>credential refreshes failing hours later, memory pressure increasing slowly over time, bootstrap scripts partially succeeding, or nodes joining clusters in broken states.</p><p>This is one of those migrations that looks tiny in the CDK change.</p><p>To have more info, check AWS docs:</p><p><a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/al2-to-al2023-ami-transition.html">https://docs.aws.amazon.com/AmazonECS/latest/developerguide/al2-to-al2023-ami-transition.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=852d4039892c" width="1" height="1" alt=""><hr><p><a href="https://awstip.com/amazon-linux-2-ecs-optimized-amis-officially-reach-end-of-life-on-june-30-2026-852d4039892c">Amazon Linux 2 ECS-optimized AMIs officially reach end of life on June 30, 2026.</a> was originally published in <a href="https://awstip.com/">AWS Tip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Managing Root Access in AWS Organizations: More Than Just Locking It Down]]></title>
            <link>https://awstip.com/managing-root-access-in-aws-organizations-more-than-just-locking-it-down-c4ddbabdcf6b?source=rss-bd3b544897b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4ddbabdcf6b</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-iam]]></category>
            <dc:creator><![CDATA[Vahaggn]]></dc:creator>
            <pubDate>Sat, 25 Apr 2026 11:22:56 GMT</pubDate>
            <atom:updated>2026-05-21T08:07:12.644Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K-9NHNuP8xxaR2yUebsPKw.jpeg" /></figure><p>Managing root access in AWS has always been a “handle with extreme care” topic. Every best practice says the same thing: lock it down, don’t use it, and protect it at all costs.</p><blockquote><strong>&quot;Root access in AWS has always been something you lock away and hope you never need. But what if you could eliminate it — without losing control?&quot;</strong></blockquote><p>Since November 2024, AWS has made the new feature Root Access Management into something far more powerful than simply “don’t touch the root user.”</p><p>In this article, I’ll walk through:</p><ul><li>What AWS root access management in Organizations actually is</li><li>Why it matters more than ever</li><li>And the less obvious superpower: controlling resource-level policies like S3 and SQS</li></ul><p>Traditionally, every AWS account has its own root user. That root user:</p><ul><li>Has unrestricted access</li><li>Cannot be restricted by identity-based IAM policies; only SCPs can fence it, and only in member accounts.</li><li>Can override almost everything in the account</li></ul><p>Even if you:</p><ul><li>Enable MFA or hardware MFA</li><li>Avoid using root credentials</li><li>Store them securely</li></ul><blockquote>Even if root credentials are secured, they still exist — and that alone increases your attack surface.</blockquote><p>…you still end up with a <strong>distributed risk model</strong> across every account in your organization.</p><p>Yes, access becomes harder — but not impossible.</p><p>In large environments, this leads to:</p><ul><li>Hard-to-audit setups</li><li>Inconsistent security practices</li><li>Operational complexity</li><li>Increased risk during incident response</li></ul><blockquote>This is not just a security improvement — it fundamentally changes how root access should be handled in AWS environments.</blockquote><h3>AWS Organizations Root Access Management</h3><p>AWS Organizations now provides a centralized way to <strong>manage and restrict root user capabilities across member accounts</strong>.</p><p>At a high level, this approach allows you to:</p><ul><li>Remove or restrict root credentials in member accounts</li><li>Enforce centralized governance</li><li>Reduce reliance on account-level root users</li></ul><p>This shifts your security model from:</p><p>“Every account is a potential risk.” to “Root access is centrally governed and controlled.”</p><h3>Why This Matters</h3><p>At first glance, securing root access might seem like a solved problem — enable MFA, store credentials safely, and never use them.</p><p>But in reality, the risk still exists.</p><p>Every AWS account with root credentials increases your <strong>attack surface</strong>, even if those credentials are well-protected. In multi-account environments, this also becomes an <strong>operational challenge</strong> — managing, storing, and accessing root credentials during incidents is slow and complex.</p><p>And when something goes wrong — like a misconfigured S3 bucket policy — recovery often depends on root access, turning a simple fix into a high-risk process.</p><p>This is exactly the gap AWS Organizations is designed to close. This feature is also changing the goal from <strong>protecting root</strong> access to <strong>eliminating it</strong>.</p><h3>The Hidden Superpower: Policy Control at the Root Level</h3><p>Here’s the part that’s often overlooked — and arguably the most powerful.</p><p>This model is <strong>not just about removing root credentials</strong>.</p><p>It also gives you the ability to <strong>delete resource-based policies </strong>only for the following services:</p><ul><li>S3 bucket policies</li><li>SQS queue policies</li></ul><h3>Real-World Scenario</h3><p>But what happens when something actually goes wrong?</p><p>Imagine this:</p><ul><li>An S3 bucket policy is misconfigured</li><li>It accidentally denies access to all principals (including administrators)</li><li>The account team is completely locked out — and unable to fix it.</li><li>Account wants to leave the AWS Organization</li></ul><p>Without centralized control:</p><ul><li>You may need to retrieve and use root credentials</li><li>Recovery becomes slow, manual, and risky</li></ul><p>With AWS Organizations root access management:</p><ul><li>You can intervene at the organization level</li><li>Remove or fix the problematic policy</li><li>Restore access quickly — without escalation chaos</li></ul><h3>Technical Walkthrough</h3><h3>Step 1: Prerequisites</h3><p>Before enabling this feature:</p><ul><li>Your accounts must be part of <strong>AWS Organizations</strong></li><li>You must operate from the <strong>management account</strong></li><li>Enable <strong>trusted access for IAM in Organizations</strong></li></ul><h3>Step 2: Enable Root Access Management</h3><ol><li>Go to the <strong>IAM Console</strong></li><li>In the left menu, select:</li></ol><ul><li><strong>Root access management</strong></li></ul><p>3. Click <strong>Enable</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*t0V5TYFWFfpiGIwP9wq2kw.png" /></figure><p>Then enable these two capabilities:</p><ul><li>✅ <strong>Root credentials management</strong></li><li>✅ <strong>Privileged root actions in member accounts</strong></li></ul><p>This allows you to:</p><ul><li>Delete root credentials</li><li>Perform root-level actions centrally</li></ul><h3>Step 3: Remove Root Credentials from Member Accounts</h3><p>Once enabled:</p><ol><li>Go to the <strong>Root access management dashboard</strong></li><li>Review all accounts and their root credential status</li><li>Select accounts that still have:</li></ol><ul><li>Passwords / Access keys / MFA devices</li></ul><p>4. Click: <strong>“Take privileged action” → Delete root credentials</strong></p><p>This removes:</p><ul><li>Root password / Access keys /MFA devices</li></ul><p>After this:</p><ul><li>The root user <strong>cannot log in</strong></li><li>Password recovery is <strong>disabled by default</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3x-hbovJUcNDcmabJ_yQUQ.png" /></figure><h3>Step 4: What Happens After Removal</h3><p>Once root credentials are deleted:</p><ul><li>No one can sign in as root</li><li>Password reset is not possible unless explicitly re-enabled</li><li>Accounts effectively operate <strong>without standing root access</strong></li></ul><h3>Step 5: Break-Glass Access (When You Really Need Root)</h3><p>If root access is required:</p><ol><li>Select the account</li><li>Click <strong>Take privileged action</strong></li><li>Choose: <strong>Allow password recovery</strong></li></ol><p>Then:</p><ul><li>Reset the password via email via normal AWS Conosle Login</li><li>Perform the required action</li><li>Remove credentials again afterward ( Go to Step 3)</li></ul><p>This creates a <strong>controlled, temporary root access model</strong>.</p><h3>Step 6: Perform Root-Level Fixes (S3 / SQS Policies)</h3><p>Using this centralized capability, you can perform critical recovery actions such as:</p><ul><li>Fixing broken <strong>S3 bucket policies</strong></li><li>Correcting restrictive <strong>SQS queue policies</strong></li><li>Restoring access in locked-out scenarios</li></ul><p>These actions are:</p><ul><li>Centrally executed</li><li>Controlled and auditable</li><li>Designed for recovery without relying on stored root credentials</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kt1usqo7Kg7UpJAEshm_gQ.png" /><figcaption>S3 Bucket Policy</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GoYytkBL7ZZVQSbFLnGSFA.png" /><figcaption>SQS Policy</figcaption></figure><p>Final Point</p><p>If you’re running a multi-account AWS + Organization environment and not using this yet, you’re likely carrying unnecessary risk, which is not just a security improvement — it’s an operational safety net.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4ddbabdcf6b" width="1" height="1" alt=""><hr><p><a href="https://awstip.com/managing-root-access-in-aws-organizations-more-than-just-locking-it-down-c4ddbabdcf6b">Managing Root Access in AWS Organizations: More Than Just Locking It Down</a> was originally published in <a href="https://awstip.com/">AWS Tip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Ingest AWS Logs into ELK Without Access Keys Using IAM Roles Anywhere]]></title>
            <link>https://awstip.com/how-to-ingest-aws-logs-into-elk-without-access-keys-using-iam-roles-anywhere-3d72cc353199?source=rss-bd3b544897b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d72cc353199</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-iam]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <dc:creator><![CDATA[Vahaggn]]></dc:creator>
            <pubDate>Fri, 03 Apr 2026 07:23:40 GMT</pubDate>
            <atom:updated>2026-04-07T12:12:06.005Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>If you’re running ELK outside AWS and need to ingest logs from S3 or CloudWatch, you’ve probably ended up storing AWS access keys somewhere in your configuration.</em></blockquote><blockquote><em>It works — but it’s painful, hard to scale, and a security risk, especially in multi-account environments.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L6ul8EX-pRiwbop707xNKg.png" /></figure><p>Many organizations run their <strong>ELK stack outside AWS</strong>. This is common in environments with:</p><ul><li>on-premise infrastructure</li><li>hybrid cloud deployments</li><li>centralised security platforms</li><li>compliance-driven log aggregation</li></ul><p>At the same time, application logs often live inside AWS services such as:</p><ul><li>S3 (CloudTrail, ALB logs, VPC Flow Logs, etc.)</li><li>CloudWatch Logs</li></ul><p>One of the typical ingestion pipeline looks like this:</p><pre>AWS Logs (S3 / CloudWatch)<br>        │<br>        ▼<br>     Filebeat<br>        │<br>        ▼<br>     Logstash<br>        │<br>        ▼<br>    Elasticsearch<br>        │<br>        ▼<br>      Kibana</pre><p>The challenge begins when Filebeat or any other service runs <strong>outside AWS</strong>.</p><p>Most teams solve this by configuring Filebeat with AWS access keys. While this works, it introduces several security and operational problems.</p><p>One of them it is not recommended by AWS to have access keys.</p><h3>The Problem with Static AWS Credentials</h3><p>The traditional approach relies on long-lived AWS credentials:</p><pre>Filebeat Server<br>     │<br>     │ Access Key + Secret Key<br>     ▼<br>AWS APIs (S3 / CloudWatch)</pre><p>This creates multiple risks:</p><ul><li>long-lived credentials stored in configuration files</li><li>difficult key rotation</li><li>risk of credential leakage</li><li>duplication across multiple AWS accounts</li><li>operational complexity in multi-account environments</li><li>forget to rotate the keys</li></ul><p>This becomes especially painful when you have multiple AWS accounts and need to manage credentials across all of them.</p><blockquote><em>In this article, I’ll show how to securely ingest logs from multiple AWS accounts into a self-hosted ELK stack — without storing any AWS credentials.</em></blockquote><h4>One of the Approaches: IAM Roles Anywhere</h4><p>IAM Roles Anywhere allows workloads outside AWS to obtain temporary AWS credentials using X.509 certificates.</p><p>Instead of storing access keys, your external workload authenticates with:</p><ul><li>an X.509 certificate</li><li>a trust anchor</li><li>an IAM role</li></ul><p>AWS then issues temporary credentials.</p><pre>Filebeat<br>   │<br>   │ X.509 Certificate<br>   ▼<br>IAM Roles Anywhere<br>   │<br>   │ Temporary Credentials<br>   ▼<br>AWS APIs (S3 / CloudWatch)</pre><p>This completely removes the need for static credentials.</p><h3>The Multi-Account Challenge:</h3><p>IAM Roles Anywhere works great in a single AWS account.</p><p>But most organizations use multiple AWS accounts:</p><ul><li>production</li><li>development</li><li>networking</li><li>security</li><li>sandbox</li><li>code</li></ul><p>Deploying IAM Roles Anywhere in every account is possible — but not scalable.</p><blockquote>SIMPLE ANSWER👉 <strong>Deploy IAM Roles Anywhere in one central account and use AssumeRole to access other accounts</strong></blockquote><pre>+----------------------+<br>|   External Server    |<br>|                      |<br>|      Filebeat        |<br>+----------+-----------+<br>           |<br>           | X.509 certificate<br>           v<br>+----------------------+<br>| IAM Roles Anywhere   |<br>|  Central AWS Account |<br>+----------+-----------+<br>           |<br>           | Temporary credentials<br>           v<br>+----------------------+<br>| Central IAM Role     |<br>|  (Base role)         |<br>+----------+-----------+<br>           |<br>           | sts:AssumeRole<br>           +-------------------+-------------------+<br>                               |                   |<br>                               v                   v<br>                   +-------------------+   +-------------------+<br>                   | Target AWS Acc 1  |   | Target AWS Acc 2  |<br>                   | Role for logs     |   | Role for logs     |<br>                   +-------------------+   +-------------------+<br>                               |                   |<br>                               +---------+---------+<br>                                         |<br>                                         v<br>                              S3 / CloudWatch Logs</pre><p>This architecture cleanly separates responsibilities:</p><ul><li>IAM Roles Anywhere → authentication</li><li>AssumeRole → authorization</li></ul><p>ok up to now, we found how to fix this problem but lets do it now, together.</p><h3>Step 1 — Create a Base Role (Central Account)</h3><p>This role is assumed via IAM Roles Anywhere and allows cross-account access.</p><pre>{<br>  &quot;Version&quot;: &quot;2012-10-17&quot;,<br>  &quot;Statement&quot;: [<br>    {<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Action&quot;: &quot;sts:AssumeRole&quot;,<br>      &quot;Resource&quot;: [<br>        &quot;arn:aws:iam::111111111111:role/FilebeatReadLogsRole&quot;,<br>        &quot;arn:aws:iam::222222222222:role/FilebeatReadLogsRole&quot;<br>      ]<br>    }<br>  ]<br>}</pre><h3>Step 2 — Create Roles in Target Accounts</h3><p>Each account needs a role for Filebeat access.</p><p>Trust policy</p><pre>{<br>  &quot;Effect&quot;: &quot;Allow&quot;,<br>  &quot;Principal&quot;: {<br>    &quot;AWS&quot;: &quot;arn:aws:iam::&lt;CENTRAL_ACCOUNT_ID&gt;:role/ExternalFilebeatBaseRole&quot;<br>  },<br>  &quot;Action&quot;: &quot;sts:AssumeRole&quot;<br>}</pre><p>Permissions:</p><ul><li>s3:GetObject</li><li>s3:ListBucket</li><li>sqs:ReceiveMessage</li><li>logs:GetLogEvents</li></ul><p>this is just a sample permissions and it can be anything or it can be limited to a single or multiple resources</p><h3>Step 3 — Configure IAM Roles Anywhere</h3><p>Trust Anchor</p><ul><li>Your certificate authority</li></ul><p>Profile</p><ul><li>Defines roles and session settings</li></ul><p>Role Mapping</p><ul><li>Links IAM role to the profile</li></ul><h3>Step 4 — Generate Certificates</h3><pre>openssl genrsa -out filebeat-key.pem 2048<br><br>openssl req -new -key filebeat-key.pem -out filebeat.csr<br><br>openssl x509 -req \<br>  -in filebeat.csr \<br>  -CA rootCA.pem \<br>  -CAkey rootCA.key \<br>  -out filebeat-cert.pem \<br>  -days 365</pre><h3>Step 5 — Install aws_signing_helper</h3><p>This is a command line which you need to install and then can run use it</p><pre>aws_signing_helper credential-process \<br>  --certificate filebeat-cert.pem \<br>  --private-key filebeat-key.pem \<br>  --trust-anchor-arn ... \<br>  --profile-arn ... \<br>  --role-arn arn:aws:iam::central-account-id:role/ExternalFilebeatBaseRole</pre><h3>Step 6 — Deliver Credentials to Filebeat</h3><p>we have couple of different ways that we can handle this but the way which i like is using good old CRON</p><h3>Cron + Dynamic Config Reload</h3><p>In this improved approach:<br> 1. a cron job runs periodically<br> 2. it uses IAM Roles Anywhere to generate temporary credentials for the central (base) role<br> 3. it writes these credentials into a Filebeat configuration file<br> 4. Filebeat automatically reloads the configuration using its config loader<br> 5. Filebeat then uses its native AssumeRole support to access target AWS accounts</p><pre>Cron Job<br>   │<br>   ▼<br>aws_signing_helper (IAM Roles Anywhere)<br>   │<br>   ▼<br>Temporary credentials (central account)<br>   │<br>   ▼<br>Write Filebeat config (base credentials only)<br>   │<br>   ▼<br>Filebeat config loader reloads inputs<br>   │<br>   ▼<br>Filebeat AssumeRole → Target Accounts<br>   │<br>   ▼<br>S3 / CloudWatch Logs</pre><p>this is example of script that can generate the keys</p><blockquote>limit the access to the certificate and private key only to the cronjob. DO NOT USE 777</blockquote><pre>#!/bin/bash<br>DATE=$(date &#39;+%F_%H:%M:%S&#39;)<br>CERTIFICATE=${CERTIFICATE:-/iamRoleAnyWhere/filebeat-cert.pem}<br>PRIVATE_KEY=${PRIVATE_KEY:-/iamRoleAnyWhere/filebeat-key.pem}<br>TRUST_ANCHOR_ARN=${TRUST_ANCHOR_ARN:-arn:aws:rolesanywhere:REGION:ACCOUNTID:trust-anchor/ID}<br>PROFILE_ARN=${PROFILE_ARN:-arn:aws:rolesanywhere:REGION:ACCOUNTID:profile/ID}<br>ROLE_ARN=${ROLE_ARN:-arn:aws:iam::REGION:role/ROLE}<br>CREDENTIALS_FILE=${CREDENTIALS_FILE:-/etc/filebeat/conf.d/config.yml}<br><br># Check if aws_signing_helper is installed<br>if ! command -v aws_signing_helper &amp;&gt; /dev/null; then<br>  echo &quot;Error: aws_signing_helper is not installed. Start installing.&quot;<br>  apt update -y<br>  apt install wget -y<br>  wget https://rolesanywhere.amazonaws.com/releases/1.4.0/X86_64/Linux/aws_signing_helper -O /usr/local/bin/aws_signing_helper<br>  chmod +x /usr/local/bin/aws_signing_helper<br>  echo &quot;aws_signing_helper installed successfully&quot;<br>fi<br><br>if ! command -v jq &amp;&gt; /dev/null; then<br>  echo &quot;Error: jq is not installed. Start installing.&quot;<br>  apt update -y<br>  apt install jq -y<br>  echo &quot;jq installed successfully&quot;<br>fi<br><br># Run the aws_signing_helper command and capture the output<br>output=$(aws_signing_helper credential-process \<br>  --certificate &quot;$CERTIFICATE&quot; \<br>  --private-key &quot;$PRIVATE_KEY&quot; \<br>  --trust-anchor-arn &quot;$TRUST_ANCHOR_ARN&quot; \<br>  --profile-arn &quot;$PROFILE_ARN&quot; \<br>  --role-arn &quot;$ROLE_ARN&quot; \<br>  --session-duration 43200 | jq .)<br><br># Extract the credentials from the JSON output<br>access_key_id=$(echo &quot;$output&quot; | jq -r &#39;.AccessKeyId&#39;)<br>secret_access_key=$(echo &quot;$output&quot; | jq -r &#39;.SecretAccessKey&#39;)<br>session_token=$(echo &quot;$output&quot; | jq -r &#39;.SessionToken&#39;)<br>expiration=$(echo &quot;$output&quot; | jq -r &#39;.Expiration&#39;)<br><br># Replace the credentials<br>sed -i &quot;s|access_key_id:.*|access_key_id: $access_key_id|&quot; &quot;$CREDENTIALS_FILE&quot;<br>sed -i &quot;s|secret_access_key:.*|secret_access_key: $secret_access_key|&quot; &quot;$CREDENTIALS_FILE&quot;<br>sed -i &quot;s|session_token:.*|session_token: $session_token|&quot; &quot;$CREDENTIALS_FILE&quot;<br>echo &quot;At $DATE Credentials saved to $CREDENTIALS_FILE and token is valid up to $expiration UTC Time&quot;<br><br>echo &quot;Done $DATE ---------------------&quot;</pre><p>this is example of filebeat.yml file</p><pre>filebeat.config.inputs:<br>  enabled: true<br>  path: /etc/filebeat/conf.d/config.yml<br>  reload.enabled: true<br>  reload.period: 1m</pre><p>this is example of /etc/filebeat/conf.d/config.yml file</p><pre>- type: aws-s3<br>  id: aws-s3-iam-role-anywhere<br>  enabled: true<br>  access_key_id: XXXXX<br>  secret_access_key: XXXXX<br>  session_token: XXXXX<br>  queue_url: https://sqs.YOURREGION.amazonaws.com/ACCOUNTID/SQSQUEUENAME<br>  region: YOUR REGION<br>  role_arn: arn:aws:iam::ACCOUNTID:role/ROLENAME<br>  assume_role.duration: 1h<br>  assume_role.expiry_window: 5m</pre><blockquote><em>This approach lets you eliminate static credentials entirely while scaling securely across AWS accounts — which is exactly what modern AWS architectures should aim for.</em></blockquote><p>If you have better options please share so we can learn together</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d72cc353199" width="1" height="1" alt=""><hr><p><a href="https://awstip.com/how-to-ingest-aws-logs-into-elk-without-access-keys-using-iam-roles-anywhere-3d72cc353199">How to Ingest AWS Logs into ELK Without Access Keys Using IAM Roles Anywhere</a> was originally published in <a href="https://awstip.com/">AWS Tip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>