<?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 Furkan Gungor on Medium]]></title>
        <description><![CDATA[Stories by Furkan Gungor on Medium]]></description>
        <link>https://medium.com/@furkangungor?source=rss-4a98bde93894------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*SYzsczpNCCcn_j1jSnotsA.jpeg</url>
            <title>Stories by Furkan Gungor on Medium</title>
            <link>https://medium.com/@furkangungor?source=rss-4a98bde93894------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 00:11:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@furkangungor/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[Pulling Dynatrace Host Metrics into Prometheus]]></title>
            <link>https://furkangungor.medium.com/pulling-dynatrace-host-metrics-into-prometheus-0d0b645ffc9d?source=rss-4a98bde93894------2</link>
            <guid isPermaLink="false">https://medium.com/p/0d0b645ffc9d</guid>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[prometheus]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Furkan Gungor]]></dc:creator>
            <pubDate>Tue, 17 Nov 2026 14:54:09 GMT</pubDate>
            <atom:updated>2026-11-17T14:54:09.110Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E6bpR02WzlvkQLquZIGDFA.png" /></figure><p>One of our clusters was monitored by Dynatrace while everything else was already running on Prometheus and Grafana. It worked, but it meant checking two different places whenever something happened. Over time, people naturally looked at the dashboards they already had open.</p><p>Instead of changing the monitoring stack or maintaining two sets of dashboards, I wrote a small exporter. It polls the Dynatrace Metrics v2 API, converts the response into Prometheus exposition format, and exposes everything on `/metrics`. Prometheus scrapes it like any other target, so the Dynatrace-monitored cluster appears alongside everything else.</p><h3>What it scrapes</h3><p>By default, the exporter collects seven host-level Dynatrace metrics:</p><ul><li>CPU usage</li><li>CPU idle</li><li>Memory usage</li><li>Disk available</li><li>Disk used percentage</li><li>Network bytes received</li><li>Network bytes sent</li></ul><p>Each metric becomes a Prometheus gauge with a host label, and disk metrics also include a disk label.</p><p>A scrape looks like this:</p><pre># HELP dynatrace_host_cpu_usage Host CPU usage percent<br># TYPE dynatrace_host_cpu_usage gauge<br>dynatrace_host_cpu_usage{host=&quot;ip-10-0-3-14&quot;} 23.7<br>dynatrace_host_memory_usage{host=&quot;ip-10-0-3-14&quot;} 61.2<br>dynatrace_host_disk_used_percent{host=&quot;ip-10-0-3-14&quot;,disk=&quot;/&quot;} 44.8<br># exporter self-metrics<br>dynatrace_exporter_scrape_errors_total{reason=&quot;rate_limit&quot;} 0<br>dynatrace_exporter_last_successful_scrape_timestamp_seconds 1.7213e+09</pre><p>Swap usage is mapped as well, but it is deliberately kept out of the default selector. Not every Dynatrace tenant exposes it, and the v2 API rejects the entire request when a single metric in the selector is unknown. One missing builtin would take the other seven down with it, so it is opt-in.</p><p>These seven are only a starting point. You can replace them entirely through the METRIC_SELECTOR environment variable: if the Dynatrace Metrics v2 API accepts the selector, the exporter accepts it too.</p><h3>Configuration and scraping</h3><p>Everything is configured through environment variables, and only two of them are required:</p><pre>DYNATRACE_API_URL=https://YOUR_ENV.live.dynatrace.com/api/v2/metrics/query<br>DYNATRACE_API_TOKEN=dt0c01.YOUR_TOKEN     # the token needs metrics.read</pre><p>The rest have defaults that are fine to leave alone: PORT (8000), SCRAPE_INTERVAL_SEC (60), HTTP_TIMEOUT_SEC (10), METRIC_SELECTOR, ENTITY_SELECTOR if you want to narrow the query to something like type(HOST),tag(env:prod), and HEALTHY_AFTER_SEC (180). If the URL or the token is missing, the exporter refuses to start instead of coming up and scraping nothing.</p><p>On the Prometheus side there is nothing special about it:</p><pre>scrape_configs:<br>  - job_name: dynatrace<br>    scrape_interval: 60s<br>    static_configs:<br>      - targets: [&quot;dynatrace-exporter:8000&quot;]</pre><p>Keep that interval at or above SCRAPE_INTERVAL_SEC. The exporter polls Dynatrace on its own timer and serves whatever it collected last, so scraping it more often does not give you fresher data.</p><h3>Supporting custom metrics</h3><p>One thing I wanted to avoid was requiring a code change every time someone wanted another metric.</p><p>If you point METRIC_SELECTOR at something the exporter has never seen before, it registers the metric during the first scrape. The Dynatrace metric ID is sanitized into a valid Prometheus metric name, the METRIC_PREFIX is added in front of it, and the dimensions become labels. A log line records what happened:</p><pre>{&quot;msg&quot;:&quot;registered dynamic metric&quot;,&quot;dynatrace_id&quot;:&quot;builtin:service.response.time&quot;,&quot;prometheus_name&quot;:&quot;dynatrace_service_response_time&quot;,&quot;labels&quot;:[&quot;dim_0&quot;,&quot;dim_1&quot;]}</pre><p>The labels are exposed as dim_0, dim_1, and so on, in the same order Dynatrace returns them. That behaviour is intentional. Resolving friendly label names would mean a metadata request per metric every time the exporter starts, which is more cost and more to break than the trade is worth. If you want more descriptive labels, Prometheus already provides metric_relabel_configs for that.</p><h3>The exporter also watches itself</h3><p>The exporter publishes its own metrics under the dynatrace_exporter_ prefix: scrape duration, scrape errors grouped by reason, last successful scrape time, API response codes, and build info.</p><p>The scrape error counter is usually the one you’ll want to alert on. A growing reason=&quot;auth&quot; counter normally means the API token is invalid. A growing reason=&quot;rate_limit&quot; counter means the exporter is polling faster than the Dynatrace API quota allows, so either ask for a higher quota or raise SCRAPE_INTERVAL_SEC.</p><p>The /healthz endpoint uses the same information. If the exporter has not completed a successful scrape within HEALTHY_AFTER_SEC, it returns HTTP 503 instead of reporting itself as healthy while it is unable to collect metrics.</p><p>Temporary failures such as network issues, HTTP 429 responses, or server-side errors are retried with exponential backoff, 1s through 8s with jitter. HTTP 401 and 403 are not retried, because they indicate a configuration problem rather than a temporary failure.</p><h3>Running it</h3><p>It runs under Docker, Kubernetes, or systemd, depending on where it fits best.</p><p>The container image is multi-stage and based on distroless, so it comes out around 15 MB with no shell and no package manager in it, running as a non-root user:</p><pre>docker build -t dynatrace-exporter:1.0.0 .<br>docker run -d --name dynatrace-exporter --restart unless-stopped \<br>  -p 8000:8000 --env-file ./exporter.env \<br>  dynatrace-exporter:1.0.0</pre><p>The Kubernetes manifest ships a Secret, a Deployment, and a ClusterIP Service. It requests 10m CPU and 32 MiB of memory, with a read-only root filesystem and dropped capabilities. If you run prometheus-operator, a ServiceMonitor selecting app=dynatrace-exporter on the metrics port is the entire integration.</p><p>For Linux servers without a container runtime, there is an installer for the systemd unit:</p><pre>sudo ./deploy/systemd/install-systemd.sh<br>sudo $EDITOR /etc/dynatrace-exporter/.env      # URL and token<br>sudo systemctl enable --now dynatrace-exporter</pre><p>It builds the binary, creates a system user, writes the env file as 0640 root:dynatrace-exporter, and installs a hardened unit (ProtectSystem=strict, NoNewPrivileges, capabilities dropped, syscalls filtered). Running it again upgrades the binary and the unit without touching your env file. No prebuilt image is published anywhere, so you build your own and push it to a registry you control.</p><p>The core of the exporter is intentionally small. Everything lives in a single Go file, so you can read exactly what happens during a scrape before you run it.</p><h3>Current limitations</h3><p>The metric set is host-focused. Service-level metrics only appear if you change the selector yourself.</p><p>The exporter also focuses on a single Dynatrace tenant per process. If you monitor multiple tenants, you simply run multiple exporter instances. Each exposes its own /metrics endpoint and can fail or restart independently without affecting the others.</p><p>The /metrics endpoint itself does not include authentication, so it should only be reachable by your Prometheus server, typically through firewall rules or a Kubernetes NetworkPolicy.</p><p>One detail matters if you extend the selector. The exporter queries from=now-10m at 1-minute resolution and takes the latest value in each series, which is correct for the gauges and percentages the defaults cover. If you pull a counter and want a rate out of it, calculate that downstream in PromQL.</p><p>One thing worth checking before deploying it widely is your Dynatrace licensing. Depending on your plan, the Metrics v2 API may charge per returned data point. Polling a large number of metrics across hundreds of hosts every minute can become surprisingly expensive.</p><h3>Final thoughts</h3><p>This was never meant to replace Dynatrace. It only removes the need to switch between two monitoring systems during an incident, so the dashboards and alert rules you already have keep working without modification.</p><p>I’ve been running it against a Dynatrace-monitored cluster while everything else continues to live in Prometheus. From the team’s perspective, nothing changes. The same dashboards, the same alerts, and one less place to remember to check.</p><p>Repo, MIT licensed: <a href="https://github.com/Bungic/dynatrace-to-prometheus-exporter">https://github.com/Bungic/dynatrace-to-prometheus-exporter</a></p><p>More of what I open source: <a href="https://frkangungor.com/">https://frkangungor.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0d0b645ffc9d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Stop AWS Non-Prod Resources on a Schedule, Karpenter Included]]></title>
            <link>https://furkangungor.medium.com/how-to-stop-aws-non-prod-resources-on-a-schedule-karpenter-included-961aee6c732c?source=rss-4a98bde93894------2</link>
            <guid isPermaLink="false">https://medium.com/p/961aee6c732c</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Furkan Gungor]]></dc:creator>
            <pubDate>Wed, 29 Jul 2026 15:18:55 GMT</pubDate>
            <atom:updated>2026-07-29T15:18:55.981Z</atom:updated>
            <content:encoded><![CDATA[<p>Most development environments do not need to run 24 hours a day. Stopping them is not the hard part. Keeping them stopped is.</p><p>The idea is simple. Run a Lambda every evening to stop everything tagged for scheduling, then run another one in the morning to start it back up. Nobody is using the dev cluster at 3am on a Sunday, but the EC2 instances, RDS databases, and EKS nodes are still running and still costing money.</p><p>Then there’s Karpenter. Delete one of its nodes and, a few seconds later, it provisions a new one. From Karpenter’s point of view, that’s exactly what it’s supposed to do. That one detail is why this project took more than an afternoon.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-R_0hjUUwhrylxy78ddzvg.png" /></figure><h3>Scheduling AWS resources with tags</h3><p>The scheduler itself is quite simple. Two Lambda functions, one that starts and one that stops, each on its own EventBridge schedule in whatever timezone you configure.</p><p>Instead of maintaining allow lists, resources opt in with a tag (Stopper=yes by default). A second tag is the safeguard: DoNotStop=true always wins, even on a resource the scheduler otherwise manages.</p><pre># managed by the scheduler<br>aws ec2 create-tags --resources i-0123 --tags Key=Stopper,Value=yes<br># never stop this one, even if it has the schedule tag<br>aws ec2 create-tags --resources i-0456 --tags Key=DoNotStop,Value=true</pre><p>Put the brake on the shared bastion, or on a database somebody is mid-migration on. A stop job with no brake is how you find out which things people quietly depend on. Each resource type is also handled on its own, so if stopping RDS fails, EC2 still stops and the run reports a partial result instead of discarding the batch.</p><h3>Every service stops differently</h3><p>EC2 is straightforward. ECS is not, because an ECS service has no stop operation at all, only a desired task count.</p><p>Rather than keeping that number somewhere else, the scheduler writes the current desired count onto the service as a tag and then scales it to zero. The morning run reads the tag back and restores it. No DynamoDB table, no S3 bucket to keep in sync. The state lives on the resource it describes.</p><h3>Scaling Karpenter to zero, in the right order</h3><p>Everything above is ordinary AWS API work. Karpenter is different, because it is a controller whose entire purpose is to notice missing capacity and replace it. Terminate nodes before you stop Karpenter and it starts building new ones immediately.</p><p>This order is fixing the problem:</p><pre># 1. stop the controller first, or it re-provisions everything you remove<br>kubectl scale deploy/karpenter -n karpenter --replicas=0<br># 2. delete Karpenter&#39;s node objects (async: the finalizer can&#39;t run with the<br>#    controller down, so --wait would just block until timeout)<br>kubectl delete nodeclaims --all --wait=false<br># 3. scale the managed node group down<br>aws eks update-nodegroup-config --cluster-name CLUSTER --nodegroup-name NG \<br>  --scaling-config minSize=0,maxSize=1,desiredSize=0<br># 4. terminate leftover Karpenter nodes by the tag it stamps on every one<br>aws ec2 describe-instances \<br>  --filters &quot;Name=tag-key,Values=karpenter.k8s.aws/ec2nodeclass&quot; \<br>            &quot;Name=instance-state-name,Values=running&quot; \<br>  --query &#39;Reservations[].Instances[].InstanceId&#39; --output text \<br>  | xargs -r aws ec2 terminate-instances --instance-ids</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G5nzLR1yQvuLvQbOx1GNDQ.png" /></figure><p>Step 4 is the one that is easy to miss, and here is why it has to be there. A NodeClaim carries a finalizer, a cleanup hook that only the Karpenter controller runs. Step 1 scaled that controller to zero, so nothing processes the finalizer anymore. The NodeClaim sits in Terminating while the real EC2 instance keeps running and keeps billing. Deleting the NodeClaim expresses the intent. Terminating the instance by tag is what actually saves money.</p><p>You could reverse the order and let Karpenter drain everything gracefully. You would also open a window where it can provision replacement nodes. This project prefers predictable behaviour over graceful shutdown.</p><p>One assumption worth stating: this expects Karpenter to run on a managed node group, which is the node group step 3 scales down. If your controller lives somewhere else, that step needs to point at wherever it actually runs.</p><h3>Deploying it</h3><p>The terraform/ directory provisions the whole thing in one apply: both Lambdas, their IAM role, the SNS topic, the EventBridge schedules, the Function URLs, and the optional Slack forwarder.</p><pre>cd terraform<br>cp terraform.tfvars.example terraform.tfvars<br># region, the two crons, and which resource types to enable</pre><pre>tofu init<br>tofu plan<br>tofu apply</pre><p>EC2 and RDS are on by default and everything else is opt-in (ENABLE_AURORA, ENABLE_ECS, ENABLE_EKS_NODEGROUP, ENABLE_KARPENTER), so a minimal deploy stays minimal. Karpenter is the only feature that pulls the kubernetes package into the bundle, so leaving it off keeps the deployment small.</p><p>It is also the only feature with a prerequisite outside AWS, and it is the one people may miss. The Lambda has to talk to the Kubernetes API, and IAM permissions alone will not get it in. The execution role has to be mapped to a Kubernetes identity as well, through the aws-auth ConfigMap on older clusters or an EKS access entry on newer ones, with RBAC to patch the Karpenter deployment and to list and delete nodeclaims. Without that mapping the cluster returns 401 or 403 no matter how correct the IAM policy is.</p><h3>Safe by default</h3><p>The example config ships with dry_run = true. Nothing gets stopped. The Lambdas log and report exactly what they would have done. Watch a few scheduled cycles, confirm the right resources are being selected, then turn dry-run off.</p><p>There is also an optional verification stage that waits for resources to reach their expected state, retries transient AWS failures with exponential backoff, and fails immediately on permanent errors like a missing permission.</p><p>The Lambda Function URLs use IAM auth rather than an API key in a query string. A key on a public URL leaks into request logs and hands whoever finds it the ability to shut your environment down. In normal use nobody calls those URLs anyway, EventBridge invokes the functions directly, and the execution role is scoped with tag-based conditions so anything untagged is out of reach.</p><h3>Where it stops</h3><p>One global start time and one global stop time, not per-resource hours in a tag. Per-resource schedules would be useful and would also make this a considerably bigger project.</p><p>There are no built-in cost estimates either. A number that ignores EBS storage still billing, reserved-instance coverage, Aurora pricing and Spot versus On-Demand would be confidently wrong. Cost Explorer answers that question properly.</p><p>Two AWS behaviours to know before you lean on this. A stopped Aurora cluster starts itself again after seven days, so a long holiday will not keep it down on its own. And stopping RDS does not stop storage charges, you are saving compute, not storage.</p><p>For most non-prod, shutting everything down outside working hours is one of the simplest FinOps wins available, a weekend of work against a recurring bill. The automation is not the difficult part. The shutdown order is, especially with Karpenter in the cluster, and that is the part I would read twice before trusting any tool that claims to stop your environment.</p><p>Repo, MIT licensed: <a href="https://github.com/Bungic/aws-start-stop-scheduler">https://github.com/Bungic/aws-start-stop-scheduler</a></p><p>More of what I open-source: <a href="https://frkangungor.com/">https://frkangungor.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=961aee6c732c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Amazon Bedrock Inference Profiles]]></title>
            <link>https://furkangungor.medium.com/mastering-aws-bedrock-inference-profiles-bf862932ce64?source=rss-4a98bde93894------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf862932ce64</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Furkan Gungor]]></dc:creator>
            <pubDate>Mon, 06 Apr 2026 19:23:46 GMT</pubDate>
            <atom:updated>2026-04-07T08:54:00.539Z</atom:updated>
            <content:encoded><![CDATA[<h4>A Practical Guide to Project-Based Cost Tracking and Management on Amazon Bedrock</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lEcIGIKLfRTv8x0D2ebdRQ.png" /></figure><p>Amazon Bedrock has changed the way teams deploy and operate generative AI workloads on AWS. You can experiment faster, integrate powerful foundation models easily, and scale without worrying about the underlying infrastructure.</p><p>But once AI usage spreads across <strong>multiple projects, teams, and environments</strong>, a familiar problem appears:</p><blockquote><em>“Who is actually spending how much on Bedrock?”</em></blockquote><p>This is exactly where <strong>Amazon Bedrock Inference Profiles</strong> become useful. They provide a way to <strong>separate usage, track costs per project, and apply operational controls.</strong></p><p>In this article, we’ll walk through what inference profiles are, why they matter, and how to use them effectively in real-world AWS environments.</p><h3>What Are Amazon Bedrock Inference Profiles?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*SrQlR1q-7tI3uvlc.jpeg" /><figcaption><a href="https://aws.amazon.com/tr/blogs/machine-learning/manage-multi-tenant-amazon-bedrock-costs-using-application-inference-profiles/">Source</a></figcaption></figure><p>Amazon Bedrock Inference Profiles are <strong>custom, logical endpoints</strong> that sit in front of foundation models. Instead of calling a model directly, your application calls an inference profile.</p><p>You can think of them as <strong>dedicated access channels</strong> to Bedrock models, each one representing a project, customer, environment, or use case.</p><p>With inference profiles, you gain:</p><ul><li>Clear cost attribution</li><li>Isolated monitoring and metrics</li><li>Better governance and access control</li><li>Cleaner multi-project architecture</li></ul><h3>Types of Inference Profiles</h3><p>There are two main types:</p><ol><li><strong>System-defined inference profiles</strong><br> Pre-created by AWS, mainly used for cross-region routing and internal load balancing.</li><li><strong>Application inference profiles</strong><br> Created and managed by you. These are the profiles you’ll use for:</li></ol><ul><li>Project-based cost tracking</li><li>Team or customer isolation</li><li>Environment separation (dev / staging / prod)</li></ul><p>This guide focuses primarily on <strong>application inference profiles</strong>.</p><h3>Why Use Application Inference Profiles?</h3><h4>1. Granular Cost Tracking</h4><p>By default, all Bedrock usage is grouped under a single service line item. That makes it difficult to answer simple questions like:</p><ul><li>Which project is driving costs?</li><li>Which environment is the most expensive?</li><li>Can we charge this usage back to a specific team or customer?</li></ul><p>Inference profiles solve this by allowing:</p><ul><li>Tag-based cost allocation</li><li>Project-level visibility in AWS Cost Explorer</li><li>Chargeback and showback models</li><li>Clean financial reporting without guesswork</li></ul><h4>2. Better Operational Control</h4><p>Each inference profile behaves like an independent endpoint. This means you can:</p><ul><li>Monitor usage patterns per project</li><li>Set budgets and alerts per profile</li><li>Apply IAM permissions at a finer level</li><li>Track latency and token usage independently</li></ul><p>This is especially useful when multiple teams share the same AWS account.</p><h4>3. Scalable Multi-Project Management</h4><p>For organizations running multiple AI initiatives, inference profiles provide:</p><ul><li>Logical isolation without separate accounts</li><li>Independent scaling</li><li>Cleaner compliance and audit trails</li><li>Easier governance as AI adoption grows</li></ul><h3>Setting Up Application Inference Profiles</h3><h4>Prerequisites</h4><p>Before getting started, make sure you have:</p><ul><li>AWS CLI or SDK configured</li><li>Access to Amazon Bedrock in the target region</li><li>Model access enabled in Bedrock</li><li>IAM permissions for Bedrock and tagging operations</li></ul><h3>Creating Your First Inference Profile</h3><p>The exact setup differs slightly by region because <strong>model availability and routing rules vary</strong>.</p><h4>Example: US East (us-east-1)</h4><p>In us-east-1, you can create a profile directly from a foundation model ARN.</p><pre>import boto3<br>bedrock = boto3.client(&quot;bedrock&quot;, region_name=&quot;us-east-1&quot;)<br>response = bedrock.create_inference_profile(<br>    inferenceProfileName=&quot;ProjectA-USEast&quot;,<br>    description=&quot;ProjectA cost tracking profile (US East)&quot;,<br>    modelSource={<br>        &quot;copyFrom&quot;: &quot;arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-3-sonnet-20240229-v1:0&quot;<br>    },<br>    tags=[<br>        {&quot;key&quot;: &quot;Project&quot;, &quot;value&quot;: &quot;ProjectA&quot;},<br>        {&quot;key&quot;: &quot;Environment&quot;, &quot;value&quot;: &quot;production&quot;},<br>        {&quot;key&quot;: &quot;CostCenter&quot;, &quot;value&quot;: &quot;AI-Team&quot;},<br>        {&quot;key&quot;: &quot;Department&quot;, &quot;value&quot;: &quot;Engineering&quot;}<br>    ]<br>)<br>profile_arn = response[&quot;inferenceProfileArn&quot;]<br>print(f&quot;Profile ARN: {profile_arn}&quot;)</pre><h4>Example: EU Central (eu-central-1)</h4><p>In eu-central-1, profiles must be created from <strong>system-defined inference profiles</strong>, not directly from foundation models.</p><pre>import boto3<br>bedrock = boto3.client(&quot;bedrock&quot;, region_name=&quot;eu-central-1&quot;)<br>response = bedrock.create_inference_profile(<br>    inferenceProfileName=&quot;ProjectA-EUCentral&quot;,<br>    description=&quot;ProjectA cost tracking profile (EU Central)&quot;,<br>    modelSource={<br>        &quot;copyFrom&quot;: &quot;arn:aws:bedrock:eu-central-1:&lt;...&gt;:inference-profile/eu.anthropic.claude-sonnet-4-20250514-v1:0&quot;<br>    },<br>    tags=[<br>        {&quot;key&quot;: &quot;Project&quot;, &quot;value&quot;: &quot;ProjectA&quot;},<br>        {&quot;key&quot;: &quot;Environment&quot;, &quot;value&quot;: &quot;production&quot;},<br>        {&quot;key&quot;: &quot;Region&quot;, &quot;value&quot;: &quot;eu-central-1&quot;},<br>        {&quot;key&quot;: &quot;Model&quot;, &quot;value&quot;: &quot;claude-sonnet-4&quot;}<br>    ]<br>)</pre><h4>Regional Differences (Important)</h4><ul><li><strong>us-east-1</strong> → You can copy directly from foundation model ARNs</li><li><strong>eu-central-1</strong> → You must use system-defined inference profile ARNs</li></ul><p>This is expected behavior and depends on how AWS deploys Bedrock models region by region.</p><h3>Implementing Cost Tracking</h3><h4>Tagging Strategy (This Really Matters)</h4><p>Your cost visibility is only as good as your tagging discipline.</p><p>A recommended baseline:</p><pre>recommended_tags = [<br>    {&quot;key&quot;: &quot;Project&quot;, &quot;value&quot;: &quot;ProjectA&quot;},<br>    {&quot;key&quot;: &quot;Environment&quot;, &quot;value&quot;: &quot;production&quot;},<br>    {&quot;key&quot;: &quot;CostCenter&quot;, &quot;value&quot;: &quot;AI-Team&quot;},<br>    {&quot;key&quot;: &quot;Department&quot;, &quot;value&quot;: &quot;Engineering&quot;},<br>    {&quot;key&quot;: &quot;Owner&quot;, &quot;value&quot;: &quot;TeamAlpha&quot;},<br>    {&quot;key&quot;: &quot;Region&quot;, &quot;value&quot;: &quot;eu-central-1&quot;},<br>    {&quot;key&quot;: &quot;Model&quot;, &quot;value&quot;: &quot;claude-sonnet-4&quot;}<br>]</pre><p>If you do only one thing after reading this article: <strong>standardize your tags early</strong>.</p><h4>Using an Inference Profile in Your Application</h4><p>Once created, inference profiles can be used <strong>exactly like a model ID</strong>.</p><pre>import boto3<br>import json<br>def invoke_with_profile(profile_arn, message, region=&quot;eu-central-1&quot;):<br>    bedrock_runtime = boto3.client(&quot;bedrock-runtime&quot;, region_name=region)<br>    body = {<br>        &quot;messages&quot;: [{&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: message}],<br>        &quot;max_tokens&quot;: 100,<br>        &quot;anthropic_version&quot;: &quot;bedrock-2023-05-31&quot;<br>    }<br>    response = bedrock_runtime.invoke_model(<br>        modelId=profile_arn,<br>        body=json.dumps(body)<br>    )<br>    result = json.loads(response[&quot;body&quot;].read())<br>    return result<br><br># Example usage<br>profile_arn = &quot;arn:aws:bedrock:eu-central-1:&lt;...&gt;:application-inference-profile/abc123&quot;<br>result = invoke_with_profile(profile_arn, &quot;Hello from ProjectA!&quot;)</pre><p>No application refactor required. Just swap the model ID.</p><h4>Monitoring Costs with AWS Cost Explorer</h4><p>After usage starts, costs will appear in Cost Explorer (usually within 24–48 hours).</p><pre>import boto3<br>from datetime import datetime, timedelta<br>def get_project_costs(projects, days=30):<br>    ce = boto3.client(&quot;ce&quot;, region_name=&quot;us-east-1&quot;)<br>    end_date = datetime.now().strftime(&quot;%Y-%m-%d&quot;)<br>    start_date = (datetime.now() - timedelta(days=days)).strftime(&quot;%Y-%m-%d&quot;)<br>    response = ce.get_cost_and_usage(<br>        TimePeriod={&quot;Start&quot;: start_date, &quot;End&quot;: end_date},<br>        Granularity=&quot;MONTHLY&quot;,<br>        Metrics=[&quot;BlendedCost&quot;],<br>        GroupBy=[{&quot;Type&quot;: &quot;TAG&quot;, &quot;Key&quot;: &quot;Project&quot;}],<br>        Filter={<br>            &quot;And&quot;: [<br>                {&quot;Dimensions&quot;: {&quot;Key&quot;: &quot;SERVICE&quot;, &quot;Values&quot;: [&quot;Amazon Bedrock&quot;]}},<br>                {&quot;Tags&quot;: {&quot;Key&quot;: &quot;Project&quot;, &quot;Values&quot;: projects}}<br>            ]<br>        }<br>    )<br>    project_costs = {}<br>    for result in response[&quot;ResultsByTime&quot;]:<br>        for group in result[&quot;Groups&quot;]:<br>            project = group[&quot;Keys&quot;][0] if group[&quot;Keys&quot;] else &quot;Untagged&quot;<br>            cost = float(group[&quot;Metrics&quot;][&quot;BlendedCost&quot;][&quot;Amount&quot;])<br>            project_costs[project] = cost<br>    return project_costs</pre><h3>Real-World Use Cases</h3><ol><li><strong>Multi-Tenant SaaS</strong></li></ol><p>Create one inference profile per customer and track usage cleanly.</p><p><strong>2. Department-Based Cost Allocation</strong></p><p>Marketing, Engineering, Support, and Research can all share Bedrock while keeping costs separate.</p><p><strong>3. Environment Separation</strong></p><p>Different profiles for:</p><ul><li>Development (smaller, cheaper models)</li><li>Staging</li><li>Production (full-capability models)</li></ul><h3>Advanced Cost Management</h3><h4>Budget Alerts</h4><pre>import boto3<br>def setup_project_budget(project_name, monthly_limit=100):<br>    budgets = boto3.client(&quot;budgets&quot;, region_name=&quot;us-east-1&quot;)<br>    account_id = boto3.client(&quot;sts&quot;).get_caller_identity()[&quot;Account&quot;]<br>    budgets.create_budget(<br>        AccountId=account_id,<br>        Budget={<br>            &quot;BudgetName&quot;: f&quot;{project_name}-Bedrock-Monthly-Budget&quot;,<br>            &quot;BudgetLimit&quot;: {&quot;Amount&quot;: str(monthly_limit), &quot;Unit&quot;: &quot;USD&quot;},<br>            &quot;TimeUnit&quot;: &quot;MONTHLY&quot;,<br>            &quot;BudgetType&quot;: &quot;COST&quot;,<br>            &quot;CostFilters&quot;: {<br>                &quot;Service&quot;: [&quot;Amazon Bedrock&quot;],<br>                &quot;TagKey&quot;: [&quot;Project&quot;],<br>                &quot;TagValue&quot;: [project_name]<br>            }<br>        }<br>    )</pre><h4>CloudWatch Metrics</h4><p>Inference profiles automatically emit metrics such as:</p><ul><li>InvocationCount</li><li>InputTokenCount</li><li>OutputTokenCount</li><li>Latency</li></ul><p>These are perfect for dashboards and alarms.</p><h4>Best Practices</h4><ul><li>Use <strong>consistent naming conventions</strong></li><li>Never skip tagging</li><li>Review costs weekly</li><li>Clean up unused profiles regularly</li><li>Treat inference profiles as long-lived infrastructure</li></ul><h3>Conclusion</h3><p>AWS Bedrock Inference Profiles are one of those features that seem optional at first, until your AI usage grows. Then they become essential.</p><p>With proper use, they allow you to:</p><ul><li>Understand exactly where AI spend is going</li><li>Enforce accountability across teams</li><li>Scale AI workloads without losing control</li><li>Make better decisions based on real cost data</li></ul><p>Start with a single project, get the tagging right, and build from there. Your future self (and finance team) will thank you.</p><p><em>For more information please check:</em> <a href="https://aws.amazon.com/tr/blogs/machine-learning/manage-multi-tenant-amazon-bedrock-costs-using-application-inference-profiles/"><em>https://aws.amazon.com/tr/blogs/machine-learning/manage-multi-tenant-amazon-bedrock-costs-using-application-inference-profiles/</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf862932ce64" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Is CloudFront Static Anycast IP and Why Is It Used?]]></title>
            <link>https://furkangungor.medium.com/what-is-cloudfront-static-anycast-ip-and-why-is-it-used-751e3e2aeb00?source=rss-4a98bde93894------2</link>
            <guid isPermaLink="false">https://medium.com/p/751e3e2aeb00</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Furkan Gungor]]></dc:creator>
            <pubDate>Mon, 16 Feb 2026 07:33:36 GMT</pubDate>
            <atom:updated>2026-02-16T07:33:36.076Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q2Kn9_mEkLE73yzF11v1nw.png" /></figure><p>Amazon CloudFront does <strong>not</strong> provide static IP addresses by default. Instead, it operates behind a dynamic IP pool and is typically accessed via a <strong>CNAME record</strong> at the DNS level.</p><p>However, in certain scenarios:</p><ul><li>You need a <strong>fixed (static) IP address</strong></li><li>You cannot use a <strong>CNAME record</strong> on the DNS side</li></ul><p>This is where <strong>CloudFront Static Anycast IP</strong> becomes relevant.</p><p>A Static Anycast IP is a set of <strong>AWS-managed, fixed IPv4 addresses</strong> that are anycasted across CloudFront edge locations globally and mapped directly to a specific CloudFront distribution.</p><h3>Why Do We Use Static Anycast IP?</h3><h4>1. Allow Listing / Firewall Scenarios</h4><p>In many enterprise or restricted environments, CloudFront traffic must originate from <strong>known and fixed IP addresses</strong>, such as:</p><ul><li>Firewalls</li><li>WAF rules</li><li>Partner systems</li><li>Corporate networks</li></ul><p>Since standard CloudFront IP ranges change frequently, allowlisting them is impractical. Static Anycast IP solves this problem by providing <strong>stable IP addresses</strong> for CloudFront traffic.</p><h4>2. Third-Party Integrations</h4><p>Some third-party services:</p><ul><li>Do not accept DNS hostnames</li><li>Require IP-based configuration only</li></ul><p>In such cases, CloudFront must appear as a <strong>single IP endpoint</strong>. Static Anycast IP enables CloudFront to integrate cleanly with IP-only systems.</p><h4>3. Apex Domain (Root Domain) Limitation</h4><p>Many domain providers do <strong>not support CNAME records for apex (root) domains</strong>, such as:</p><pre>example.com</pre><p>This means you cannot configure:</p><pre>example.com -&gt; CNAME d123456abcdef.cloudfront.net</pre><p>However, you may still want to serve your apex domain through CloudFront. This requires a <strong>static IP address</strong>, which is exactly what Static Anycast IP provides.</p><h3>Our Use Case</h3><p>In our case:</p><ul><li>We want example.com to be served via a CloudFront distribution</li><li>The domain provider does <strong>not</strong> allow CNAME records at the apex level</li></ul><p>The solution is to use <strong>CloudFront Static Anycast IP combined with an A record</strong>.</p><h3>How Does It Work?</h3><p>AWS assigns you a set of <strong>static anycast IPv4 addresses</strong>.<br> On the DNS side, you configure an A record like this:</p><pre>example.com -&gt; A 3.4.5.6</pre><p>This IP address:</p><ul><li>Is fully managed by AWS</li><li>Is anycasted across CloudFront edge locations</li><li>Is mapped internally to your CloudFront distribution</li></ul><p>So when a user:</p><ol><li>Connects to the IP address</li><li>AWS identifies which CloudFront distribution it belongs to</li><li>The request is routed to the correct distribution</li></ol><p>All traffic is transparently served through CloudFront.</p><h3>How to Obtain Static Anycast IPs</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0dYkqmb42pG1zftAymW8Pg.png" /></figure><p>Static Anycast IPs are <strong>not enabled by default</strong>.</p><p>You must open an <strong>AWS Support case</strong> and request a quota increase. In the support request, you need to provide:</p><ul><li>Number of IPs required (between <strong>3 and 24</strong>)</li><li>Expected traffic volume</li><li>Requests per second</li><li>Upload bandwidth</li><li>Business justification</li></ul><p>In our case, we needed apex domain routing, we requested <strong>3 IP addresses</strong>. Once approved, AWS assigns the IPs to your account.</p><h3>CloudFront Distribution Requirements</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-7FLvCRlY29MKUVuZ0ZYVQ.png" /></figure><p>Static Anycast IPs cannot be associated with every CloudFront distribution. AWS enforces the following requirements:</p><h4>1. IPv4 Only</h4><ul><li>The distribution must be <strong>IPv4-only</strong></li><li>IPv6 must be disabled</li></ul><p>If IPv6 is enabled, association is not allowed.</p><h4>2. All Edge Locations Must Be Enabled</h4><ul><li>No price class restrictions</li><li><strong>All edge locations</strong> must be enabled</li></ul><p>Limited price classes are not supported.</p><h3>Associating Static Anycast IPs with a Distribution</h3><p>Once the requirements are met, you can associate the Static Anycast IPs with your CloudFront distribution. AWS then establishes the following mapping internally:</p><pre>Static Anycast IP → CloudFront Distribution</pre><h3>DNS Configuration</h3><p>After receiving the Static Anycast IPs, you are <strong>not required</strong> to assign all IPs to a single apex domain. In fact, distributing them across different domains is often a cleaner approach.</p><p>For example, with three Static Anycast IPs:</p><pre>3.4.5.6<br>3.4.5.7<br>3.4.5.8</pre><p>A recommended setup would be:</p><pre>example.com  -&gt; A 3.4.5.6<br>example1.com  -&gt; A 3.4.5.7<br>example2.com   -&gt; A 3.4.5.8</pre><p>Since Static Anycast IPs can be associated with <strong>multiple CloudFront distributions</strong>, this configuration is fully supported.</p><h3>Final Result</h3><p>After configuration:</p><ul><li>A user accesses example.com</li><li>Traffic reaches the Static Anycast IP</li><li>AWS routes the request directly to CloudFront</li><li>The site is served reliably through CloudFront</li></ul><h3>Summary</h3><ul><li>CloudFront does not provide static IPs by default</li><li>Static Anycast IP solves this limitation</li><li>Useful for firewall allowlisting, third-party integrations, and apex domain routing</li><li>Enables CloudFront usage even when CNAME records are not supported at the root domain level</li></ul><p>This approach allowed us to successfully serve our <strong>apex domain through CloudFront</strong>, despite DNS provider limitations.</p><p><em>For more information on how Anycast Static IPs works, you can check this blog: </em><a href="https://aws.amazon.com/blogs/networking-and-content-delivery/zero-rating-and-ip-address-management-made-easy-cloudfronts-new-anycast-static-ips-explained/"><em>https://aws.amazon.com/blogs/networking-and-content-delivery/zero-rating-and-ip-address-management-made-easy-cloudfronts-new-anycast-static-ips-explained/</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=751e3e2aeb00" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automatically Creating CloudWatch Alarms for Dynamically Created Resources]]></title>
            <link>https://furkangungor.medium.com/automatically-creating-cloudwatch-alarms-for-dynamically-created-resources-90430006edfb?source=rss-4a98bde93894------2</link>
            <guid isPermaLink="false">https://medium.com/p/90430006edfb</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Furkan Gungor]]></dc:creator>
            <pubDate>Mon, 19 Jan 2026 06:14:23 GMT</pubDate>
            <atom:updated>2026-01-19T08:25:53.507Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LEt4nmJj8JX-dOaUPr-GVQ.png" /></figure><p>In fast-moving environments, especially SaaS platforms, infrastructure is often created <strong>dynamically</strong>. New S3 buckets and CloudFront distributions may be provisioned on demand, driven by customer onboarding flows, automation pipelines, or application logic.</p><p>The operational problem usually appears later:</p><blockquote><em>“How do we make sure every newly created resource is properly monitored?”</em></blockquote><p>Manually creating CloudWatch alarms does not scale when resources are created dynamically. Missing alarms mean blind spots, and blind spots eventually turn into incidents.</p><p>In this article, I’ll walk through a practical solution that automatically creates CloudWatch alarms whenever a new <strong>S3 bucket or CloudFront distribution</strong> is created, using:</p><ul><li>AWS CloudTrail</li><li>Amazon EventBridge</li><li>AWS Lambda</li><li>Amazon SNS</li><li>Amazon CloudWatch</li></ul><p>While the example focuses on S3 and CloudFront, <strong>the same approach can be easily adjusted and expanded to cover any AWS resource type</strong> by changing the CloudTrail event filters and alarm logic.</p><h3>The Core Idea</h3><p>The idea is simple:</p><ol><li><strong>CloudTrail</strong> records API calls such as CreateBucket and CreateDistribution</li><li><strong>EventBridge</strong> listens for those events</li><li><strong>Lambda</strong> reacts to resource creation events</li><li><strong>CloudWatch alarms</strong> are created automatically for the new resource</li></ol><p>From that point on, every resource is monitored consistently, without manual effort.</p><h3>Architecture Overview</h3><p>There is an important regional nuance in this setup.</p><ul><li>The Lambda function runs in <strong>eu-central-1 (Frankfurt)</strong></li><li>S3 bucket creation events are regional, so S3 buckets created in Frankfurt can <strong>directly invoke the Lambda via EventBridge</strong></li><li>CloudFront is a <strong>global service</strong>, and its CloudTrail events are delivered in <strong>us-east-1 (N. Virginia)</strong></li></ul><p>Because of this, CloudFront creation events cannot directly trigger a Lambda in Frankfurt. To bridge this gap, <strong>SNS</strong> is used as a cross-region delivery mechanism.</p><p>High-level flow:</p><pre>S3 (eu-central-1)<br>  → CloudTrail<br>  → EventBridge (eu-central-1)<br>  → Lambda (eu-central-1)</pre><pre>CloudFront (global / us-east-1)<br>  → CloudTrail<br>  → EventBridge (us-east-1)<br>  → SNS (us-east-1)<br>  → Lambda (eu-central-1)</pre><h3>Event Sources and Routing</h3><p>This setup relies on <strong>CloudTrail events routed through EventBridge</strong>, with different handling for S3 and CloudFront due to regional behavior.</p><h3>EventBridge Rule (Shared Logic)</h3><p>The core EventBridge rule listens for <strong>resource creation API calls</strong> coming from CloudTrail:</p><pre>{<br>  &quot;source&quot;: [<br>    &quot;aws.cloudfront&quot;,<br>    &quot;aws.s3&quot;<br>  ],<br>  &quot;detail-type&quot;: [<br>    &quot;AWS API Call via CloudTrail&quot;<br>  ],<br>  &quot;detail&quot;: {<br>    &quot;eventName&quot;: [<br>      &quot;CreateDistribution&quot;,<br>      &quot;CreateDistributionWithTags&quot;,<br>      &quot;CreateBucket&quot;,<br>      &quot;DeleteBucket&quot;,<br>      &quot;DeleteDistribution&quot;<br>    ]<br>  }<br>}</pre><p>Rule details:</p><ul><li>Event bus: default</li><li>Description: &lt;YOUR_DESCRIPTION&gt;</li><li>Service principal: events.amazonaws.com</li></ul><p>This single pattern allows us to detect <strong>both S3 bucket and CloudFront distribution creation</strong> events using CloudTrail as the source of truth.</p><h3>S3 Bucket Creation (eu-central-1)</h3><ul><li>Source: aws.s3</li><li>Event name: CreateBucket</li><li>EventBridge rule is created in <strong>eu-central-1 (Frankfurt)</strong></li><li>Target: Lambda function</li></ul><p>Since S3 bucket creation is regional, buckets created in Frankfurt can <strong>directly invoke the Lambda</strong> through EventBridge.</p><h3>CloudFront Distribution Creation (Global / us-east-1)</h3><p>Source: aws.cloudfront</p><p>Event names:</p><ul><li>CreateDistribution</li><li>CreateDistributionWithTags</li></ul><p>CloudTrail events are delivered in <strong>us-east-1 (N. Virginia)</strong></p><p>Because the Lambda runs in eu-central-1, CloudFront creation events <strong>cannot directly invoke it</strong>. To handle this cross-region case:</p><ol><li>An EventBridge rule with the following pattern is created in <strong>us-east-1</strong>:</li></ol><pre>{<br>  &quot;source&quot;: [&quot;aws.cloudfront&quot;],<br>  &quot;detail-type&quot;: [&quot;AWS API Call via CloudTrail&quot;],<br>  &quot;detail&quot;: {<br>    &quot;eventName&quot;: [&quot;CreateDistribution&quot;, &quot;CreateDistributionWithTags&quot;, &quot;DeleteDistribution&quot;]<br>  }<br>}</pre><ol><li>The EventBridge rule targets an <strong>SNS topic</strong> in us-east-1</li><li>The SNS topic invokes the Lambda in eu-central-1</li></ol><p>This SNS hop acts as a reliable <strong>cross-region event bridge</strong>, keeping the alarm creation logic centralized.</p><h3>Lambda Function</h3><p>The Lambda function handles <strong>both direct EventBridge events and SNS-wrapped events</strong>. It detects the source, extracts the CloudTrail detail, and creates the appropriate alarms.</p><pre>import boto3<br>import os<br>import json<br>import logging<br><br>logger = logging.getLogger()<br>logger.setLevel(logging.INFO)<br><br>cloudwatch = boto3.client(&#39;cloudwatch&#39;)<br><br>SNS_TOPIC_ARN = os.environ.get(&#39;SNS_TOPIC_ARN&#39;, &#39;&lt;YOUR ARN TOPIC&gt;&#39;)<br><br>def lambda_handler(event, context):<br>    logger.info(f&quot;Received event: {json.dumps(event)}&quot;)<br>    <br>    try:<br>        if &#39;Records&#39; in event and event[&#39;Records&#39;][0][&#39;EventSource&#39;] == &#39;aws:sns&#39;:<br>            logger.info(&quot;Event received from SNS, parsing message&quot;)<br>            sns_message = json.loads(event[&#39;Records&#39;][0][&#39;Sns&#39;][&#39;Message&#39;])<br>            detail = sns_message[&#39;detail&#39;]<br>            logger.info(f&quot;Parsed SNS message, detail: {json.dumps(detail)}&quot;)<br>        else:<br>            logger.info(&quot;Event received directly from EventBridge&quot;)<br>            detail = event[&#39;detail&#39;]<br>        <br>        event_source = detail[&#39;eventSource&#39;]<br>        event_name = detail[&#39;eventName&#39;]<br>        <br>        logger.info(f&quot;Event source: {event_source}, Event name: {event_name}&quot;)<br>        <br>        # S3 Bucket Creation<br>        if event_source == &#39;s3.amazonaws.com&#39; and event_name == &#39;CreateBucket&#39;:<br>            bucket_name = detail[&#39;requestParameters&#39;][&#39;bucketName&#39;]<br>            logger.info(f&quot;S3 bucket creation detected: {bucket_name}&quot;)<br>            create_s3_alarms(bucket_name)<br>            logger.info(f&quot;Successfully created alarms for S3 bucket: {bucket_name}&quot;)<br>        <br>        # S3 Bucket Deletion<br>        elif event_source == &#39;s3.amazonaws.com&#39; and event_name == &#39;DeleteBucket&#39;:<br>            bucket_name = detail[&#39;requestParameters&#39;][&#39;bucketName&#39;]<br>            logger.info(f&quot;S3 bucket deletion detected: {bucket_name}&quot;)<br>            delete_s3_alarms(bucket_name)<br>            logger.info(f&quot;Successfully deleted alarms for S3 bucket: {bucket_name}&quot;)<br>        <br>        # CloudFront Distribution Creation<br>        elif event_source == &#39;cloudfront.amazonaws.com&#39; and event_name in [&#39;CreateDistribution&#39;, &#39;CreateDistributionWithTags&#39;]:<br>            distribution_id = detail[&#39;responseElements&#39;][&#39;distribution&#39;][&#39;id&#39;]<br>            logger.info(f&quot;CloudFront distribution creation detected: {distribution_id}&quot;)<br>            create_cloudfront_alarms(distribution_id)<br>            logger.info(f&quot;Successfully created alarms for CloudFront distribution: {distribution_id}&quot;)<br>        <br>        # CloudFront Distribution Deletion<br>        elif event_source == &#39;cloudfront.amazonaws.com&#39; and event_name == &#39;DeleteDistribution&#39;:<br>            distribution_id = detail[&#39;requestParameters&#39;][&#39;id&#39;]<br>            logger.info(f&quot;CloudFront distribution deletion detected: {distribution_id}&quot;)<br>            delete_cloudfront_alarms(distribution_id)<br>            logger.info(f&quot;Successfully deleted alarms for CloudFront distribution: {distribution_id}&quot;)<br>        <br>        else:<br>            logger.warning(f&quot;Unhandled event - Source: {event_source}, Name: {event_name}&quot;)<br>        <br>        return {&#39;statusCode&#39;: 200}<br>    <br>    except Exception as e:<br>        logger.error(f&quot;Error processing event: {str(e)}&quot;, exc_info=True)<br>        raise<br><br>def create_s3_alarms(bucket_name):<br>    try:<br>        logger.info(f&quot;Creating storage alarm for bucket: {bucket_name}&quot;)<br>        cloudwatch.put_metric_alarm(<br>            AlarmName=f&#39;{bucket_name}-storage-alarm&#39;,<br>            AlarmDescription=f&#39;S3 bucket {bucket_name} storage exceeded 1GB threshold&#39;,<br>            MetricName=&#39;BucketSizeBytes&#39;,<br>            Namespace=&#39;AWS/S3&#39;,<br>            Statistic=&#39;Average&#39;,<br>            Period=86400,<br>            EvaluationPeriods=1,<br>            Threshold=1 * 1024 * 1024 * 1024,<br>            ComparisonOperator=&#39;GreaterThanThreshold&#39;,<br>            Dimensions=[<br>                {&#39;Name&#39;: &#39;BucketName&#39;, &#39;Value&#39;: bucket_name},<br>                {&#39;Name&#39;: &#39;StorageType&#39;, &#39;Value&#39;: &#39;StandardStorage&#39;}<br>            ],<br>            AlarmActions=[SNS_TOPIC_ARN],<br>            TreatMissingData=&#39;notBreaching&#39;<br>        )<br>        logger.info(f&quot;Storage alarm created: {bucket_name}-storage-alarm&quot;)<br>    except Exception as e:<br>        logger.error(f&quot;Failed to create S3 alarm for {bucket_name}: {str(e)}&quot;)<br>        raise<br><br>def delete_s3_alarms(bucket_name):<br>    try:<br>        alarm_name = f&#39;{bucket_name}-storage-alarm&#39;<br>        logger.info(f&quot;Deleting storage alarm: {alarm_name}&quot;)<br>        <br>        cloudwatch.delete_alarms(AlarmNames=[alarm_name])<br>        logger.info(f&quot;Successfully deleted alarm: {alarm_name}&quot;)<br>    except Exception as e:<br>        logger.error(f&quot;Failed to delete S3 alarm for {bucket_name}: {str(e)}&quot;)<br>        raise<br><br>def create_cloudfront_alarms(distribution_id):<br>    try:<br>        logger.info(f&quot;Creating high-requests alarm for distribution: {distribution_id}&quot;)<br>        cloudwatch.put_metric_alarm(<br>            AlarmName=f&#39;high-requests-{distribution_id}&#39;,<br>            AlarmDescription=f&#39;CloudFront distribution {distribution_id} exceeded 1000 requests/second&#39;,<br>            MetricName=&#39;Requests&#39;,<br>            Namespace=&#39;AWS/CloudFront&#39;,<br>            Statistic=&#39;Sum&#39;,<br>            Period=60,<br>            EvaluationPeriods=1,<br>            Threshold=1000,<br>            ComparisonOperator=&#39;GreaterThanThreshold&#39;,<br>            Dimensions=[{&#39;Name&#39;: &#39;DistributionId&#39;, &#39;Value&#39;: distribution_id}, {&#39;Name&#39;: &#39;Region&#39;, &#39;Value&#39;: &#39;Global&#39;}],<br>            AlarmActions=[SNS_TOPIC_ARN],<br>            TreatMissingData=&#39;notBreaching&#39;<br>        )<br>        logger.info(f&quot;High-requests alarm created: high-requests-{distribution_id}&quot;)<br>        <br>        logger.info(f&quot;Creating 5xx-error-rate alarm for distribution: {distribution_id}&quot;)<br>        cloudwatch.put_metric_alarm(<br>            AlarmName=f&#39;5xx-error-rate-{distribution_id}&#39;,<br>            AlarmDescription=f&#39;CloudFront distribution {distribution_id} 5xx error rate exceeded 5%&#39;,<br>            MetricName=&#39;5xxErrorRate&#39;,<br>            Namespace=&#39;AWS/CloudFront&#39;,<br>            Statistic=&#39;Average&#39;,<br>            Period=300,<br>            EvaluationPeriods=1,<br>            Threshold=5,<br>            ComparisonOperator=&#39;GreaterThanThreshold&#39;,<br>            Dimensions=[{&#39;Name&#39;: &#39;DistributionId&#39;, &#39;Value&#39;: distribution_id}, {&#39;Name&#39;: &#39;Region&#39;, &#39;Value&#39;: &#39;Global&#39;}],<br>            AlarmActions=[SNS_TOPIC_ARN],<br>            TreatMissingData=&#39;notBreaching&#39;<br>        )<br>        logger.info(f&quot;5xx-error-rate alarm created: 5xx-error-rate-{distribution_id}&quot;)<br>    except Exception as e:<br>        logger.error(f&quot;Failed to create CloudFront alarms for {distribution_id}: {str(e)}&quot;)<br>        raise<br><br>def delete_cloudfront_alarms(distribution_id):<br>    try:<br>        alarm_names = [<br>            f&#39;high-requests-{distribution_id}&#39;,<br>            f&#39;5xx-error-rate-{distribution_id}&#39;<br>        ]<br>        <br>        logger.info(f&quot;Deleting CloudFront alarms: {alarm_names}&quot;)<br>        cloudwatch.delete_alarms(AlarmNames=alarm_names)<br>        logger.info(f&quot;Successfully deleted alarms for distribution: {distribution_id}&quot;)<br>    except Exception as e:<br>        logger.error(f&quot;Failed to delete CloudFront alarms for {distribution_id}: {str(e)}&quot;)<br>        raise</pre><h3>Alarm Creation Logic</h3><h3>S3 Storage Alarm</h3><p>For each newly created S3 bucket, a storage alarm is created:</p><ul><li>Metric: BucketSizeBytes</li><li>Threshold: 1 GB</li><li>Period: 1 day</li></ul><pre>cloudwatch.put_metric_alarm(<br>    AlarmName=f&#39;{bucket_name}-storage-alarm&#39;,<br>    MetricName=&#39;BucketSizeBytes&#39;,<br>    Namespace=&#39;AWS/S3&#39;,<br>    Period=86400,<br>    Threshold=1 * 1024 * 1024 * 1024,<br>    ComparisonOperator=&#39;GreaterThanThreshold&#39;,<br>    Dimensions=[<br>        {&#39;Name&#39;: &#39;BucketName&#39;, &#39;Value&#39;: bucket_name},<br>        {&#39;Name&#39;: &#39;StorageType&#39;, &#39;Value&#39;: &#39;StandardStorage&#39;}<br>    ],<br>    AlarmActions=[SNS_TOPIC_ARN]<br>)</pre><h3>CloudFront Alarms</h3><p>For each new distribution, two alarms are created:</p><p><strong>High request rate</strong></p><ul><li>Metric: Requests</li><li>Threshold: 1000 requests per minute</li></ul><p><strong>5xx error rate</strong></p><ul><li>Metric: 5xxErrorRate</li><li>Threshold: 5%</li></ul><p>These alarms provide early signals for traffic spikes and origin failures.</p><h3>Why This Approach Works Well</h3><ul><li>Monitoring is <strong>automatically enforced</strong> for every resource</li><li>No reliance on naming conventions or manual steps</li><li>Centralized alarm logic</li><li>Scales naturally with dynamic infrastructure</li></ul><p>This pattern is especially effective in multi-tenant or self-service platforms.</p><h3>Limitations and Considerations</h3><ul><li>CloudTrail delivery is not real-time; alarms may be created a few minutes after resource creation</li><li>Thresholds are static and may need tuning per workload</li></ul><p>These trade-offs are usually acceptable compared to the operational risk of missing alarms entirely.</p><h3>Final Thoughts</h3><p>Automated alarm creation is one of those things that feels unnecessary, until the first incident caused by an unmonitored resource.</p><p>By combining CloudTrail, EventBridge, Lambda, and SNS, you can enforce monitoring standards across dynamically created infrastructure with minimal ongoing effort.</p><p>If your platform creates AWS resources dynamically, this pattern is a strong foundation for keeping observability consistent and reliable.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=90430006edfb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automatically Backing Up AWS Cognito User Pools]]></title>
            <link>https://furkangungor.medium.com/automatically-backing-up-aws-cognito-user-pools-8d62bfa4091a?source=rss-4a98bde93894------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d62bfa4091a</guid>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[event-driven-architecture]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Furkan Gungor]]></dc:creator>
            <pubDate>Mon, 22 Dec 2025 08:39:25 GMT</pubDate>
            <atom:updated>2025-12-22T08:39:25.769Z</atom:updated>
            <content:encoded><![CDATA[<h3>Automatically Backing Up AWS Cognito User Pools (Lambda + EventBridge)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*COabrWXbOLXtZ-N_sMJqLw.gif" /></figure><p>In almost every real-world project that uses AWS Cognito, this question eventually comes up:</p><blockquote><em>“Do we have a backup of our User Pools?”</em></blockquote><p>In a production authentication system, <strong>users, groups, and user pool configuration</strong> are among the most critical pieces of data. However, AWS Cognito does not provide a built-in, one-click export or backup feature.</p><p>In this article, I’ll walk through a simple yet effective solution to <strong>automatically back up all Cognito User Pools on a daily basis</strong> using:</p><ul><li>AWS Lambda</li><li>Amazon EventBridge (scheduled trigger)</li><li>Amazon S3</li></ul><h3>Goal</h3><p>The purpose of this automation is to:</p><p>Automatically discover <strong>all Cognito User Pools</strong> in an AWS account</p><p>For each user pool, back up:</p><ul><li>User pool configuration</li><li>All users</li><li>All groups</li><li>Store the data in <strong>JSON format</strong></li><li>Organize backups in <strong>date-based folders</strong> in S3</li><li>Run <strong>daily without manual intervention</strong></li></ul><h3>Architecture Overview</h3><p>The flow is straightforward:</p><p><strong>EventBridge</strong> triggers the Lambda function on a daily schedule</p><p><strong>Lambda</strong>:</p><ul><li>Lists all Cognito User Pools</li><li>Collects users, groups, and pool metadata for each pool</li><li>Generates a JSON backup file</li></ul><p><strong>S3</strong> stores the backups in a structured, date-based layout</p><h3>Lambda Function Code</h3><p>Below is the complete Lambda function that implements the entire flow:</p><pre>import json<br>import boto3<br>from datetime import datetime, timedelta<br><br>s3 = boto3.client(&#39;s3&#39;)<br>cognito = boto3.client(&#39;cognito-idp&#39;, region_name=&#39;eu-central-1&#39;)<br><br>def lambda_handler(event, context):<br>    now = datetime.utcnow() + timedelta(hours=3)<br>    date_path = f&quot;{now.year}/{now.month:02d}/{now.day:02d}&quot;<br>    <br>    # Get all user pools<br>    user_pools = []<br>    paginator = cognito.get_paginator(&#39;list_user_pools&#39;)<br>    for page in paginator.paginate(MaxResults=60):<br>        user_pools.extend(page[&#39;UserPools&#39;])<br>    <br>    for pool in user_pools:<br>        pool_id = pool[&#39;Id&#39;]<br>        pool_name = pool[&#39;Name&#39;]<br>        timestamp = now.strftime(&#39;%Y%m%d&#39;)<br>        <br>        # Collect all data<br>        backup_data = {<br>            &#39;UserPool&#39;: cognito.describe_user_pool(UserPoolId=pool_id)[&#39;UserPool&#39;],<br>            &#39;Users&#39;: [],<br>            &#39;Groups&#39;: []<br>        }<br>        <br>        # Get all users<br>        user_paginator = cognito.get_paginator(&#39;list_users&#39;)<br>        for page in user_paginator.paginate(UserPoolId=pool_id):<br>            backup_data[&#39;Users&#39;].extend(page[&#39;Users&#39;])<br>        <br>        # Get all groups<br>        try:<br>            group_paginator = cognito.get_paginator(&#39;list_groups&#39;)<br>            for page in group_paginator.paginate(UserPoolId=pool_id):<br>                backup_data[&#39;Groups&#39;].extend(page[&#39;Groups&#39;])<br>        except:<br>            pass<br>        <br>        # Upload to S3<br>        s3_key = f&quot;{date_path}/{pool_name}_{timestamp}.json&quot;<br>        s3.put_object(<br>            Bucket=&#39;&lt;YOUR_BUCKET_NAME&gt;&#39;,<br>            Key=s3_key,<br>            Body=json.dumps(backup_data, default=str, indent=2),<br>            ContentType=&#39;application/json&#39;<br>        )<br>    <br>    return {&#39;statusCode&#39;: 200, &#39;body&#39;: f&#39;Backed up {len(user_pools)} user pools&#39;}</pre><h3>S3 Folder Structure</h3><p>Backups are automatically organized by date, which makes them easy to browse and restore if needed:</p><pre>2025/<br> └── 03/<br>     └── 08/<br>         ├── prod-user-pool_20250308.json<br>         ├── staging-user-pool_20250308.json</pre><h3>EventBridge Schedule</h3><p>The Lambda function is triggered by an <strong>EventBridge rule</strong> configured with a daily schedule, for example:</p><pre>cron(0 1 * * ? *)</pre><p>This ensures that backups are created automatically every day without any operational overhead.</p><h3>IAM Permissions</h3><p>The Lambda execution role requires the following minimum permissions:</p><pre>{<br>  &quot;Effect&quot;: &quot;Allow&quot;,<br>  &quot;Action&quot;: [<br>    &quot;cognito-idp:ListUserPools&quot;,<br>    &quot;cognito-idp:DescribeUserPool&quot;,<br>    &quot;cognito-idp:ListUsers&quot;,<br>    &quot;cognito-idp:ListGroups&quot;,<br>    &quot;s3:PutObject&quot;<br>  ],<br>  &quot;Resource&quot;: &quot;*&quot;<br>}</pre><p>In a production setup, these permissions should be scoped down as much as possible.</p><h3>Limitations and What This Backup Is (and Is Not)</h3><p>It is important to clearly understand what this backup provides and where its limitations are, especially when dealing with authentication systems.</p><h4>What Is Included</h4><p>This backup captures <strong>readable configuration and metadata</strong>, including:</p><ul><li>User Pool configuration (policies, attributes, settings)</li><li>Users and their attributes (email, username, status, timestamps, custom attributes)</li><li>Groups and group metadata</li></ul><p>This makes it suitable for:</p><ul><li>Auditing and inspection</li><li>Disaster investigation</li><li>Comparing configuration changes over time</li><li>Partial rebuilds or migrations where user data must be referenced</li></ul><h4>What Is NOT Included</h4><p>Due to AWS Cognito security constraints, this backup <strong>does not and cannot include</strong>:</p><ul><li>User passwords (hashed or plaintext)</li><li>Secret keys</li><li>MFA secrets (TOTP seeds, SMS secrets)</li><li>OAuth client secrets</li><li>Any credential material that could be used to authenticate a user</li></ul><p>These omissions are <strong>by design</strong> and enforced by AWS. Cognito never exposes this information through its APIs.</p><h4>What This Means in Practice</h4><ul><li>This backup <strong>cannot be used to fully restore a User Pool and allow users to log in with their existing passwords</strong>.</li><li>In a recovery scenario, users would need to reset their passwords.</li><li>MFA would need to be reconfigured by users.</li></ul><p>This approach should therefore be seen as a <strong>configuration and user-state backup</strong>, not a full authentication snapshot.</p><h3>Security Considerations</h3><p>Even without passwords, this backup still contains sensitive data such as:</p><ul><li>Email addresses</li><li>User identifiers</li><li>Custom attributes</li></ul><p>For production usage, you should strongly consider:</p><ul><li>Encrypting the S3 bucket with SSE-KMS</li><li>Restricting bucket access to a minimal set of IAM principals</li><li>Applying lifecycle policies for automatic expiration</li></ul><h3>Final Thoughts</h3><p>This approach provides a lightweight and fully automated way to back up AWS Cognito User Pools using native AWS services only. It is simple to maintain, inexpensive to run, and can be extended further to support encryption, cross-region replication, or restore workflows.</p><p>If you are running Cognito in production, having a daily backup like this is one of those things you hopefully never need — but will be very glad to have when you do.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d62bfa4091a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mapping the Invisible: How Parny InfraMap Brings Clarity to Complex Systems]]></title>
            <link>https://furkangungor.medium.com/mapping-the-invisible-how-parny-inframap-brings-clarity-to-complex-systems-1767e30f4118?source=rss-4a98bde93894------2</link>
            <guid isPermaLink="false">https://medium.com/p/1767e30f4118</guid>
            <category><![CDATA[infrastructure]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[parny]]></category>
            <category><![CDATA[monitoring]]></category>
            <dc:creator><![CDATA[Furkan Gungor]]></dc:creator>
            <pubDate>Thu, 09 Oct 2025 11:43:42 GMT</pubDate>
            <atom:updated>2025-10-09T11:43:42.275Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction: The Challenge of Understanding Infrastructure</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2hYcKU4Sb8iC3QiJKAerLw.gif" /></figure><p>In today’s cloud-native world, systems communicate with each other more than ever, across regions, services, and networks. Yet when something goes wrong, the question always remains: “<em>Where exactly did it fail?</em>”</p><p>Even with logs, APMs, and dashboards, understanding how everything is actually connected, which service depends on which, or which port suddenly stopped responding, often stays hidden. That’s the gap Parny InfraMap aims to close.</p><h3>What Is Parny InfraMap? (Features &amp; Architecture)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HNTAn5r9ZffYvfBMdERrew.jpeg" /></figure><p>Parny InfraMap is a real-time network visualization and dependency mapping tool that helps teams see every connection inside their infrastructure, not just the ones they manually configured.</p><p>At its core, InfraMap runs lightweight agents across your environments, including Linux, Windows, and macOS, to capture and analyze live network traffic over TCP, UDP, and ICMP.</p><p>Each agent detects source and destination IPs, ports, hostnames, and protocols, then securely streams that data (using API key authentication) to the Parny Portal.</p><p>Inside the portal, you get a dynamic graph where each node represents a device or endpoint, and each edge shows the relationship between them.<br> You can filter by protocol, isolate services, and identify anomalies in real time.</p><h3>How InfraMap Works: Discovery, Mapping, and Live Updates</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h303H1GuAusooSslY2mgnA.gif" /></figure><p>InfraMap’s engine works in three key stages:</p><ol><li><strong>Discovery: </strong>The agent inspects live packets, identifying which hosts and services are communicating.</li><li><strong>Mapping: </strong>It builds a <strong>dependency map</strong>, connecting the dots between services, databases, load balancers, and clients.</li><li><strong>Live Updates: </strong>As the system evolves, InfraMap automatically updates the topology, adding or removing nodes as network behavior changes.</li></ol><p>Because this happens in real time, InfraMap isn’t just a “snapshot.” It’s a <strong>living, breathing view</strong> of your network.</p><h3>Use Cases &amp; Scenarios</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z4vpSTq3znQamgL9girxxw.jpeg" /></figure><p>InfraMap is more than a visualization layer, it provides <strong>real-time operational intelligence</strong>. It reveals how components interact, where failures may propagate, and which services are critical to system stability. Below are key scenarios demonstrating its practical applications.</p><h4>Bottleneck Detection / Over-Connected Services</h4><p>In distributed systems, bottlenecks often appear where you least expect them. A single service can become a “traffic magnet” receiving requests from many upstream components. When it slows down, the performance of the entire system can degrade.</p><p>InfraMap continuously monitors traffic over <strong>TCP, UDP and ICMP,</strong> building a real-time connection graph. Nodes with unusually high inbound or outbound connections are immediately visible, helping teams identify over-connected hubs or potential chokepoints.</p><p>With this insight, teams can proactively:</p><ul><li>Redistribute load between replicas</li><li>Add caching layers or throttling mechanisms</li><li>Prevent single points of failure before they cause incidents</li></ul><h4>Incident Triage &amp; Root Cause Hints</h4><p>During outages, InfraMap acts as an interactive incident map, showing <strong>precisely where communication breaks</strong>. It tracks packet-level activity to highlight:</p><ul><li>Failed TCP handshakes</li><li>Repeated retries or timeouts</li><li>Hosts or services that have become unreachable</li></ul><p>For example, during a slowdown, InfraMap may show that API servers are healthy but a downstream cache is unreachable. The dependency graph highlights the failing connection, providing impact analysis by showing which upstream and downstream services are affected, allowing teams to reduce MTTR by pinpointing the exact source of failure.</p><p>InfraMap also visualizes <strong>service tiering</strong>, showing which services are foundational (tier 0), which depend on them (tier 1, tier 2, etc.), and how issues cascade through the hierarchy. This “service tree” perspective helps teams instantly understand both the <strong>root cause</strong> and <strong>blast radius</strong> of any incident.</p><h4>Cloud Migration / Dependency Planning</h4><p>Migrating workloads requires a clear understanding of service dependencies to avoid broken communication or missing connections post-migration.</p><p>InfraMap provides a <strong>complete dependency map</strong>:</p><ul><li>Identify inter-service communication patterns</li><li>Detect cross-region or cross-zone dependencies</li><li>Discover legacy systems still in use</li></ul><p>Teams can export the dependency map to plan migrations, verify sequences, and ensure no critical services are overlooked. Post-migration, InfraMap enables comparison of pre- and post-move topologies, ensuring all connections are intact.</p><h4>Configuration Drift / Environment Comparison</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ucALZXISqZWWW7IEKuhBHQ.jpeg" /></figure><p>Even with infrastructure as code, environments can drift. Ports may be closed, routes misconfigured, or services disconnected.</p><p>InfraMap detects these differences by comparing <strong>live network maps</strong> between environments, such as staging versus production. Teams can see:</p><ul><li>Missing or extra routes</li><li>Disconnected services</li><li>Unexpected open ports</li></ul><p>This allows verification of network parity, detection of misconfigurations, and audits of deployments before major releases. InfraMap acts as a <strong>real-time diff tool for actual network behavior</strong>.</p><h4>Spotting Unmonitored Services / Blind Spots</h4><p>Large networks often contain forgotten or unmonitored endpoints, such as legacy daemons or temporary test servers. These components don’t appear in dashboards or alerting systems.</p><p>InfraMap automatically discovers them by monitoring all active traffic, identifying:</p><ul><li>Hosts or endpoints missed by existing monitoring</li><li>Services communicating over unmonitored protocols</li><li>Shadow IT components or forgotten processes</li></ul><p>This provides teams with improved operational visibility and allows proactive remediation of untracked infrastructure.</p><h4>Security &amp; Compliance (Unexpected Ports, Protocols)</h4><p>InfraMap monitors <strong>network-level activity</strong> to identify unexpected or unauthorized behavior. By analyzing traffic, teams can detect:</p><ul><li>New TCP or UDP ports becoming active</li><li>ICMP traffic between unauthorized hosts</li><li>Unusual protocols appearing in production</li></ul><p>Security and compliance teams can overlay InfraMap data with policy rules. Deviations trigger alerts, making it easier to detect policy violations and maintain regulatory compliance.</p><h4>Dependency Map Creation &amp; Automated Alert Generation</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fvcJvGoncvc9_yFKTHjDMA.jpeg" /></figure><p>InfraMap can <strong>automatically generate a complete dependency map</strong> of active services and trigger alerts when changes or anomalies are detected.</p><p>These alerts are behavior-driven rather than manually configured:</p><ul><li>A previously healthy connection fails</li><li>A new, unknown protocol starts communicating</li><li>A service dependency disappears suddenly</li></ul><p>This functionality transforms InfraMap from a visualization tool into a <strong>real-time infrastructure sentinel</strong>, continuously monitoring and alerting on changes across your network.</p><h3>Example Walkthrough: Visualizing a Multi-Service Environment</h3><p>Imagine a microservices-based application:<br>a frontend, several APIs, a database, and a cache layer.</p><p>After deploying the InfraMap Agent across nodes, the portal starts lighting up. Each service appears as a node, with lines showing live connections.</p><p>Suddenly, a user reports slow API responses.<br>You check InfraMap and see one line glowing red — the API → DB connection shows packet drops.</p><p>Moments later, an alert triggers automatically: <em>“Increased TCP failures detected on port 5432 between api-server-3 and db-cluster-1.”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6aCm9NZ8QC0S5DW1kcDfOw.jpeg" /></figure><p>No more guesswork , the map itself tells you what broke and where.</p><h3>Benefits, Trade-Offs &amp; Challenges</h3><p><strong>Benefits:</strong></p><ul><li>Real-time visualization of every network relationship</li><li>Faster RCA during incidents</li><li>Automated alerts tied to dependency changes</li><li>Increased visibility across hybrid or multi-cloud setups</li></ul><p><strong>Trade-Offs:</strong></p><ul><li>Requires packet capture permissions (network-level access)</li><li>Generates detailed traffic data, may need filtering to reduce noise</li><li>Agent management at scale (but mitigated by centralized control)</li></ul><h3>Best Practices &amp; Tips</h3><ul><li><strong>Deploy strategically:</strong> Start with critical nodes and expand gradually.</li><li><strong>Use filters:</strong> Limit visualization to relevant protocols (TCP/UDP/ICMP) for clarity.</li><li><strong>Integrate:</strong> Connect InfraMap alerts to existing monitoring or SIEM pipelines.</li><li><strong>Review dependency maps regularly:</strong> They evolve as your systems do.</li></ul><h3>Summary</h3><p>When everything depends on everything else, visibility isn’t optional. It’s vital.<br><strong>Parny InfraMap</strong> helps teams make sense of complexity by mapping what’s truly happening in their systems. Automatically, in real time.</p><p>Whether you’re hunting bottlenecks, preventing incidents, or planning a migration, InfraMap turns invisible dependencies into actionable insight.</p><p><strong>Explore it yourself:</strong> <a href="https://parny.io/inframap">parny.io/inframap</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1767e30f4118" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Is On-Call Management? A Complete Guide With Parny (parny.io)]]></title>
            <link>https://furkangungor.medium.com/what-is-on-call-management-a-complete-guide-with-parny-parny-io-dc32248abc49?source=rss-4a98bde93894------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc32248abc49</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[parny]]></category>
            <dc:creator><![CDATA[Furkan Gungor]]></dc:creator>
            <pubDate>Thu, 18 Sep 2025 13:13:06 GMT</pubDate>
            <atom:updated>2025-09-18T13:13:06.580Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1a872lR9R_HZaoSfp3bZGQ.png" /></figure><h3>Introduction: The Pain of 2 A.M. Alerts</h3><p>If you’ve ever been responsible for keeping a system running, you know the feeling: your phone rings at 2 a.m., and suddenly you’re the only thing standing between uptime and a major outage. On-call duty is a reality for modern engineering teams but without the right system, it quickly becomes stressful, chaotic, and error-prone.</p><p>That’s where <strong>on-call management</strong> comes in. A good on-call process ensures that incidents are routed to the right people, handled quickly, and documented clearly. So teams stay reliable without burning out.</p><p>In this guide, we’ll break down what on-call management is, why it matters, the challenges teams face, and how modern tools like <a href="https://parny.io/"><strong>Parny</strong></a> can make it easier. We’ll also walk through how to use Parny in real life and how to benefit from its full stack of features.</p><h3>What Is On-Call Management?</h3><p>On-call management is the structured process of handling alerts and incidents when systems go down or show signs of trouble.</p><p>In modern engineering teams, systems can fail at any hour; servers crash, APIs go unresponsive, databases become slow, or critical services suddenly stop working. On-call management ensures that when these issues occur, <strong>someone is immediately aware and can respond</strong>, rather than letting the problem escalate unnoticed.</p><p>At its core, it ensures that:</p><ul><li><strong>Alerts reach the right person at the right time: </strong>Notifications can be sent via multiple channels; phone calls, SMS, push notifications, email, or chat tools like Slack and Teams. In critical cases, tools can literally wake up the on-call engineer in the middle of the night to ensure no downtime goes unnoticed.</li><li><strong>Duty rotations are fair: </strong>On-call schedules distribute responsibility across the team so that no single engineer is overburdened with nights, weekends, or holidays.</li><li><strong>Escalations are automatic: </strong>If the first responder doesn’t acknowledge an alert within a set time, it escalates to the next person or team, preventing delays in critical response.</li><li><strong>Incidents are tracked and documented transparently: </strong>Alerts can be grouped into incidents, roles and responsibilities are clear, and postmortem reports capture actions and decisions for future learning.</li></ul><p>Typical features of on-call management include:</p><ul><li><strong>Duty Rotations (Schedules): </strong>defining who is on call, when, with fair rotation logic.</li><li><strong>Escalation Policies: </strong>if one person doesn’t respond, escalate to the next person or team.</li><li><strong>Multi-Channel Notifications: </strong>Slack, Teams, email, push, SMS etc.</li><li><strong>Incident Tracking &amp; Postmortems: </strong>grouping alerts, tracking start/end, roles, decision logs.</li></ul><h3>Why Do Teams Need On-Call Management?</h3><p>Without a clear process, incidents turn into chaos:</p><ul><li>Alerts get lost or ignored.</li><li>Multiple engineers scramble on the same problem.</li><li>Nobody is accountable.</li><li>Huge stress, burnout, low morale.</li></ul><p>With on-call management, teams gain:</p><ul><li><strong>Reliability; </strong>better uptime, faster response.</li><li><strong>Accountability &amp; clarity: </strong>everyone knows who does what.</li><li><strong>Efficiency; </strong>fewer duplicated efforts, less noise.</li><li><strong>Continuous learning; </strong>postmortems, trend analysis.</li></ul><h3>Common Challenges in On-Call Management</h3><p>Even there is a big progress when you use on-call management tools, you still might struggle with:</p><ul><li><strong>Alert Fatigue, </strong>too many irrelevant or duplicate alerts.</li><li><strong>Poor Filtering / Prioritization, </strong>low threshold alerts drown out the critical ones.</li><li><strong>Difficulty with Dependencies / Root Cause, </strong>not seeing how services connect makes debugging slow.</li><li><strong>Lack of visibility</strong> into SLA status, metrics, past incidents.</li><li><strong>Onboarding &amp; Handoff Issues, </strong>incoming on-call engineers often lack full context on ongoing incidents.</li></ul><h3>Key Features of Parny (parny.io) That Solve On-Call Challenges</h3><p>Modern engineering teams face constant pressure: alerts coming from multiple monitoring tools, unclear responsibilities, and the stress of midnight wake-up calls. <strong>Parny</strong> is built to tackle these challenges head-on, providing a full suite of on-call management features. Here’s a deep dive into its core capabilities and how they help your team stay reliable.</p><h4>1. AI-Powered Anomaly Detection</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*szTbOGC3adUixWNzXH0xyQ.gif" /></figure><p>Parny continuously scans all incoming alerts in real time from your various monitoring tools. Its AI analyzes patterns, detects unusual spikes, rare events, and correlations across multiple sources. It also reduces noise by grouping similar alerts and filtering duplicates.</p><p><strong>Benefits / Use Cases:</strong></p><ul><li>Detect issues before they escalate into outages.</li><li>Reduce “false alarms” and avoid alert fatigue.</li><li>Prevent duplicated alerts from multiple tools, giving engineers a clearer picture of what actually matters.</li></ul><h4>2. On-Call Management</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e95h9AepMBSPWUkdPRzeVw.png" /></figure><p>Parny offers robust on-call management capabilities, including:</p><ul><li><strong>Shift Scheduling</strong>: Easily create and manage on-call schedules.</li><li><strong>Escalation Policies</strong>: Define custom escalation paths to ensure timely response.</li></ul><h4>3. InfraMap (Real-Time Infrastructure &amp; Dependency Mapping)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hmgs_R1omA5xciJTjo9zzA.gif" /></figure><p>Parny provides a live, visual map of all your services and their dependencies. This makes it easy to see how an upstream failure might affect downstream systems.</p><p><strong>Benefits / Use Cases:</strong></p><ul><li>Quickly identify the root cause of incidents.</li><li>Triaging becomes faster and more accurate.</li><li>Team members gain a better understanding of system impact during outages.</li></ul><h4>4. Uptime Pulse (“Parny Pulse”)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rCsLWRLdUlYoHY1qwgj59Q.avif" /></figure><p>Parny Pulse monitors critical services with real-time heartbeat checks, usually every minute. If a service goes down silently -without triggering an alert- Parny sends an immediate notification.</p><p><strong>Benefits / Use Cases:</strong></p><ul><li>Catch silent failures before users notice.</li><li>Maintain higher SLAs and improve user experience.</li><li>Track uptime trends over time to proactively improve reliability.</li></ul><h4>5. Alert Rules, Filtering &amp; Prioritization</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EjrMn22Vdiwgm3BHxoDWWA.jpeg" /></figure><p>Parny allows you to define complex alert rules: filter by severity, source, or message patterns, and tag alerts for easier handling. Rules are processed in order, ensuring the first match triggers the right action.</p><p><strong>Benefits / Use Cases:</strong></p><ul><li>Reduce alert fatigue by filtering out low-impact alerts.</li><li>Ensure only urgent, relevant notifications reach engineers.</li><li>Customize per team or service, making alerts actionable.</li></ul><h4>6. Incident Management</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s-eUQZfj5pzTQ9dmIK_VAQ.jpeg" /></figure><p>When multiple alerts are related, Parny groups them into a single incident. Teams can assign a commander, set assignees, and define automatic escalation rules. Postmortem reports are generated automatically.</p><p><strong>Benefits / Use Cases:</strong></p><ul><li>Clear ownership and accountability during incidents.</li><li>Reduce duplicated efforts across the team.</li><li>Learn from incidents with actionable reports and metrics.</li></ul><h4>7. Integrations With Your Existing Stack</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*FbqDDgYjqeLKhsG_Y4WpYg.gif" /></figure><p>Parny connects to over 40 popular monitoring tools, cloud services, and communication platforms like Slack, Teams, Prometheus, and AWS. You can also configure custom webhooks.</p><p><strong>Benefits / Use Cases:</strong></p><ul><li>Easily integrate without reworking your current monitoring setup.</li><li>Maintain continuity across multiple alert sources.</li><li>Notifications and escalations flow directly into tools your team already uses.</li></ul><h4>8. SLA Tracking</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*52-F8k0WB1HtgEhT" /></figure><p>Parny allows teams to monitor Service Level Agreements (SLAs) in real-time. This feature provides alerts before SLA breaches occur, helping teams maintain service reliability and meet their commitments.</p><h4>9. AI Assistant</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WeO7LQsg8fb4YhnxY99uDQ.png" /></figure><p>Parny’s AI assistant helps investigate alerts, suggests actions, and accelerates resolution times. By leveraging AI, teams can respond to incidents more efficiently and effectively.</p><h4>10. Parny Heartbeats</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bJnVM6EeOEF5eosN" /></figure><p>Parny Heartbeats provides a simple push-based mechanism for monitoring service health. Each system or component periodically sends heartbeat signals to Parny, confirming it is alive and functioning. If a heartbeat is missed or delayed, Parny immediately detects the anomaly and alerts the relevant teams. This proactive approach helps identify outages faster, minimizes downtime, and ensures reliable visibility into critical services.</p><h3>How to Use Parny in Practice: Step-by-Step Guide</h3><p>Here’s a practical workflow to get your team running on Parny:</p><h4>Step 1: Sign Up &amp; Initial Setup</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nkYQpbxfiy93f2qU" /></figure><ul><li>Go to <a href="https://parny.io/">parny.io</a> and create an account (free plan available).</li><li>Invite your team and define user roles.</li><li>Identify and define core services to monitor (e.g., database, API gateway, web server).</li></ul><h4>Step 2: Connect Monitoring Tools</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m4L1sKYjX9Q2dZ7H06B3aQ.jpeg" /></figure><ul><li>Use <strong>webhooks</strong> or built-in integrations (Prometheus, AWS, etc.) to send alerts to Parny.</li><li>Ensure metadata (severity, service, instance, description) is included for better categorization.</li></ul><h4>Step 3: Define On-Call Schedules &amp; Escalations</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MFShoaL6cRmPiGSM" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9GR6Vu2aW00HxJvNreutZw.png" /></figure><p>Configure duty rotations so coverage is fair.</p><ul><li>Set escalation policies: if the primary engineer doesn’t respond, escalate automatically.</li><li>Define notification channels (Slack, email, SMS).</li></ul><h4>Step 4: Configure Alert Rules &amp; Anomaly Detection</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/0*42yFdAD9AKKrF17y" /></figure><ul><li>Set rules to filter or group alerts, tagging critical ones.</li><li>Enable AI anomaly detection to highlight unusual events across your alert streams.</li></ul><h4>Step 5: InfraMap &amp; Dependency Mapping</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vOFZclNB0lLkdNSA" /></figure><ul><li>Map all services and dependencies with Parny agent.</li><li>Ensure that upstream/downstream relationships are visible during incidents for faster root-cause analysis.</li></ul><h4>Step 6: Uptime Monitoring with Pulse</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yUyh8WXVD4T7OkeT" /></figure><ul><li>Configure heartbeat checks for key services/sites.</li><li>Set alert notifications for silent failures to catch outages early.</li></ul><h4>Step 7: Run Test Alerts &amp; Incident Simulations</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/0*gEBOHUFpV193A7JW" /></figure><ul><li>Trigger test alerts to verify rules, notifications, and escalation flows.</li><li>Simulate incidents to practice war-room collaboration and response workflows.</li></ul><h4>Step 8: Reports, Postmortems &amp; Analytics</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VQD6oi8sydptG6yU" /></figure><ul><li>After incidents, review postmortem reports and metrics.</li><li>Identify recurring alert types, bottlenecks, and opportunities for process improvement.</li><li>Adjust alert rules and thresholds over time to keep your system tuned.</li></ul><h3>Conclusion</h3><p>On-call management isn’t just about 2 a.m. panic calls. It’s about <strong>structured, scalable, and stress-free incident response</strong>.</p><p>With <strong>Parny (parny.io)</strong>, teams get AI-powered anomaly detection, real-time infrastructure mapping, robust incident workflows, alert filtering, uptime monitoring, and integrations. All in one platform.</p><p><strong>Next Step:</strong> Open a free account, start with your core service, define an on-call schedule, connect one monitoring tool, and enable one alert rule. Iterate from there to make your incident management process smarter and faster.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc32248abc49" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automated Installation of OpenSearch and OpenSearch Dashboards on Ubuntu Linux]]></title>
            <link>https://furkangungor.medium.com/automated-installation-of-opensearch-and-opensearch-dashboards-on-ubuntu-linux-a1999f4c04db?source=rss-4a98bde93894------2</link>
            <guid isPermaLink="false">https://medium.com/p/a1999f4c04db</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[opensearch]]></category>
            <category><![CDATA[script]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Furkan Gungor]]></dc:creator>
            <pubDate>Mon, 01 Sep 2025 08:01:40 GMT</pubDate>
            <atom:updated>2025-09-01T08:01:40.893Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5myCWDm1JosBx_weYy0bhQ.png" /></figure><h3>Introduction</h3><p>In this guide, we explore an automated installation and configuration of OpenSearch and OpenSearch Dashboards on Ubuntu Linux using a comprehensive Bash script. This script streamlines the deployment process for a standalone OpenSearch instance with its accompanying Dashboards interface, handling everything from system prerequisites to security configuration and service management.</p><h3>Problem Statement</h3><p>Setting up OpenSearch and OpenSearch Dashboards manually involves numerous steps that can be complex and error-prone. These include configuring Java environment, managing system settings like swap memory, installing the correct package versions, setting up security credentials, configuring services, and ensuring proper communication between components. Without automation, this process requires significant time and expertise, increasing the risk of misconfiguration or incomplete setup that could affect performance and security.</p><h3>Solution</h3><p>opensearch-setup.sh</p><pre>#!/bin/bash<br><br># ==============================================================================<br># OpenSearch and OpenSearch Dashboards Installation Script for Ubuntu Linux<br># ==============================================================================<br>#<br># IMPORTANT:<br># - Run the script with &#39;root&#39; privileges (sudo ./script_name.sh).<br># - Script may affect existing installations, clean system recommended.<br># - Optimize JVM Heap (-Xms/-Xmx) settings according to your system.<br># - Demo TLS certificates are used, use your own certificates for Production.<br># - Check firewall settings (Port 9200, 5601).<br># ==============================================================================<br><br><br># ------------------------------------------------------------------------------<br>set -e<br>set -u<br>set -o pipefail<br><br>JAVA_MAJOR_VERSION=&quot;17&quot; <br>OPENSEARCH_REPO_VERSION=&quot;2.x&quot;<br>JVM_HEAP=&quot;1g&quot;<br>INTERVAL=5<br><br>log_info() { <br>    echo &quot;[INFO] $(date &#39;+%Y-%m-%d %H:%M:%S&#39;) - $1&quot; <br>}<br>log_warn() { <br>    echo &quot;[WARN] $(date &#39;+%Y-%m-%d %H:%M:%S&#39;) - $1&quot; <br>}<br>log_error() { <br>    echo &quot;[ERROR] $(date &#39;+%Y-%m-%d %H:%M:%S&#39;) - $1&quot; &gt;&amp;2 <br>    exit 1 <br>}<br>check_root() { <br>    if [[ &quot;$EUID&quot; -ne 0 ]]; then <br>        log_error &quot;This script must be run with root privileges. Use &#39;sudo $0&#39;.&quot; <br>    fi <br>}<br><br>check_root<br>log_info &quot;Starting OpenSearch (Standalone, APT) and Dashboards (DEB Download) installation...&quot;<br><br>log_info &quot;Setting initial password for &#39;admin&#39; user for OpenSearch installation.&quot;<br>NEW_ADMIN_PASSWORD=&quot;&quot; <br>CONFIRM_PASSWORD=&quot;&quot;<br>while true; do<br>    IFS= read -rs -p &quot;Enter the &#39;admin&#39; password for OpenSearch: &quot; NEW_ADMIN_PASSWORD<br>    echo<br>    IFS= read -rs -p &quot;Re-enter the new password: &quot; CONFIRM_PASSWORD<br>    echo<br>    if [ &quot;$NEW_ADMIN_PASSWORD&quot; == &quot;$CONFIRM_PASSWORD&quot; ]; then<br>        if [ -z &quot;$NEW_ADMIN_PASSWORD&quot; ]; then<br>            log_warn &quot;Password cannot be empty. Please try again.&quot;<br>        else<br>            if [[ ${#NEW_ADMIN_PASSWORD} -lt 12 ]]; then<br>                log_warn &quot;Password must be at least 12 characters long. Please try again.&quot;<br>            elif [[ ! &quot;$NEW_ADMIN_PASSWORD&quot; =~ [a-z] ]]; then<br>                log_warn &quot;Password must contain at least one lowercase letter. Please try again.&quot;<br>            elif [[ ! &quot;$NEW_ADMIN_PASSWORD&quot; =~ [A-Z] ]]; then<br>                log_warn &quot;Password must contain at least one uppercase letter. Please try again.&quot;<br>            elif [[ ! &quot;$NEW_ADMIN_PASSWORD&quot; =~ [0-9] ]]; then<br>                log_warn &quot;Password must contain at least one digit. Please try again.&quot;<br>            else<br>                log_info &quot;Passwords match and meet policy requirements. Continuing installation.&quot;<br>                export NEW_ADMIN_PASSWORD<br>                break<br>            fi<br>        fi<br>    else<br>        log_warn &quot;Passwords do not match. Please try again.&quot;<br>    fi<br>done<br><br># ------------------------------------------------------------------------------<br>log_info &quot;Step 1: Disabling SWAP...&quot;<br>if free | awk &#39;/^Swap:/ {exit $3==0}&#39;; then <br>    log_info &quot;SWAP is already disabled or not present.&quot;<br>else<br>    swapoff -a<br>    log_info &quot;Active SWAP disabled.&quot;<br>    if grep -q &#39;swap&#39; /etc/fstab; then <br>        sed -i.bak &#39;/ swap / s/^\(.*\)$/#\1/g&#39; /etc/fstab<br>        log_info &quot;/etc/fstab updated (backup: /etc/fstab.bak).&quot;<br>    else <br>        log_info &quot;No active swap entries found in /etc/fstab.&quot;<br>    fi<br>    log_info &quot;SWAP permanently disabled.&quot;<br>fi<br><br># ------------------------------------------------------------------------------<br>log_info &quot;Step 2: Updating system and installing required packages...&quot;<br>apt-get update -y<br>apt-get install -y \<br>    wget \<br>    gnupg \<br>    apt-transport-https \<br>    ca-certificates \<br>    lsof \<br>    curl \<br>    software-properties-common \<br>    net-tools<br>log_info &quot;Required packages installed.&quot;<br><br># ------------------------------------------------------------------------------<br>log_info &quot;Step 3: Installing OpenJDK ${JAVA_MAJOR_VERSION}...&quot;<br>apt-get install -y &quot;openjdk-${JAVA_MAJOR_VERSION}-jdk&quot;<br><br>JAVA_HOME_PATH=$(update-java-alternatives -l | grep &quot;java-1.${JAVA_MAJOR_VERSION}.0-openjdk&quot; | awk &#39;{print $3}&#39;) || \<br>JAVA_HOME_PATH=$(find /usr/lib/jvm -maxdepth 1 -type d -name &quot;java-${JAVA_MAJOR_VERSION}-openjdk-*&quot; | head -n 1)<br><br>if [ -z &quot;$JAVA_HOME_PATH&quot; ] || [ ! -d &quot;$JAVA_HOME_PATH&quot; ]; then <br>    log_error &quot;OpenJDK ${JAVA_MAJOR_VERSION} installation path not found.&quot;<br>fi<br>log_info &quot;Setting JAVA_HOME to: ${JAVA_HOME_PATH}&quot;<br><br>JAVA_PROFILE_SCRIPT=&quot;/etc/profile.d/java_home.sh&quot;<br>echo &quot;export JAVA_HOME=${JAVA_HOME_PATH}&quot; &gt; &quot;$JAVA_PROFILE_SCRIPT&quot;<br>echo &#39;export PATH=$JAVA_HOME/bin:$PATH&#39; &gt;&gt; &quot;$JAVA_PROFILE_SCRIPT&quot;<br>chmod +x &quot;$JAVA_PROFILE_SCRIPT&quot;<br><br>export JAVA_HOME=${JAVA_HOME_PATH}<br>export PATH=$JAVA_HOME/bin:$PATH<br><br>log_info &quot;Java settings configured. Checking:&quot;<br>java -version<br><br># ------------------------------------------------------------------------------<br>log_info &quot;Step 4: Adding OpenSearch APT repository...&quot;<br>wget -qO - https://artifacts.opensearch.org/publickeys/opensearch.pgp | gpg --dearmor --batch --yes -o /usr/share/keyrings/opensearch-keyring.gpg<br>OPENSEARCH_REPO_FILE=&quot;/etc/apt/sources.list.d/opensearch-${OPENSEARCH_REPO_VERSION}.list&quot;<br>echo &quot;deb [signed-by=/usr/share/keyrings/opensearch-keyring.gpg] https://artifacts.opensearch.org/releases/bundle/opensearch/${OPENSEARCH_REPO_VERSION}/apt stable main&quot; | tee &quot;$OPENSEARCH_REPO_FILE&quot; &gt; /dev/null<br>chmod 644 /usr/share/keyrings/opensearch-keyring.gpg<br>chmod 644 &quot;$OPENSEARCH_REPO_FILE&quot;<br><br>log_info &quot;Installing OpenSearch (via APT)...&quot;<br>apt-get update -y<br><br>log_info &quot;Providing initial admin password via OPENSEARCH_INITIAL_ADMIN_PASSWORD.&quot;<br>OPENSEARCH_INITIAL_ADMIN_PASSWORD=&quot;$NEW_ADMIN_PASSWORD&quot; \<br>DEBIAN_FRONTEND=noninteractive \<br>apt-get install -y opensearch \<br>    -o Dpkg::Options::=&quot;--force-confdef&quot; \<br>    -o Dpkg::Options::=&quot;--force-confold&quot;<br><br>log_info &quot;OpenSearch successfully installed.&quot;<br><br># ------------------------------------------------------------------------------<br>log_info &quot;Step 5: Configuring OpenSearch in standalone mode...&quot;<br>OPENSEARCH_CONF_DIR=&quot;/etc/opensearch&quot;<br>OPENSEARCH_YML=&quot;${OPENSEARCH_CONF_DIR}/opensearch.yml&quot;<br>JVM_OPTIONS=&quot;${OPENSEARCH_CONF_DIR}/jvm.options&quot;<br><br>if grep -q &#39;^#cluster.name:&#39; &quot;$OPENSEARCH_YML&quot;; then <br>    sed -i &#39;s/^#cluster.name: .*/cluster.name: my-opensearch-standalone/&#39; &quot;$OPENSEARCH_YML&quot;<br>fi<br><br>if grep -q &#39;^#network.host:&#39; &quot;$OPENSEARCH_YML&quot;; then <br>    sed -i &#39;s/^#network.host: .*/network.host: 0.0.0.0/&#39; &quot;$OPENSEARCH_YML&quot;<br>fi<br><br>log_info &quot;Setting discovery.type: single-node.&quot;<br>sed -i &#39;/^[# ]*discovery.type:/d&#39; &quot;$OPENSEARCH_YML&quot; <br>echo &quot;discovery.type: single-node&quot; &gt;&gt; &quot;$OPENSEARCH_YML&quot;<br><br>log_info &quot;Setting JVM Heap size (${JVM_HEAP})...&quot;<br>log_warn &quot;Attention: JVM Heap (${JVM_HEAP}) MUST be optimized for production!&quot;<br>sed -i &quot;s/^-Xms.*/-Xms${JVM_HEAP}/&quot; &quot;$JVM_OPTIONS&quot;<br>sed -i &quot;s/^-Xmx.*/-Xmx${JVM_HEAP}/&quot; &quot;$JVM_OPTIONS&quot;<br><br>log_info &quot;Standalone OpenSearch configuration completed.&quot;<br><br># ------------------------------------------------------------------------------<br>log_info &quot;Step 6: Enabling and starting OpenSearch service with systemd...&quot;<br>systemctl daemon-reload<br>systemctl enable opensearch.service<br><br>log_info &quot;Stopping current OpenSearch service (if running)...&quot;<br>systemctl stop opensearch.service || true<br><br>log_info &quot;Starting OpenSearch service...&quot;<br>systemctl start opensearch.service<br><br>log_info &quot;Waiting for OpenSearch to start (maximum 2 minutes)...&quot;<br>MAX_WAIT=120 <br>ELAPSED=0<br>while ! curl -k -u &quot;admin:${NEW_ADMIN_PASSWORD}&quot; --fail --silent https://localhost:9200 &gt; /dev/null 2&gt;&amp;1; do<br>    sleep $INTERVAL<br>    ELAPSED=$((ELAPSED + INTERVAL))<br>    log_info &quot;OpenSearch not ready yet... (${ELAPSED}s/${MAX_WAIT}s)&quot;<br>    if [ $ELAPSED -ge $MAX_WAIT ]; then <br>        log_error &quot;OpenSearch did not start within ${MAX_WAIT} seconds. Check logs: journalctl -u opensearch or /var/log/opensearch/&quot;<br>    fi<br>done<br>log_info &quot;OpenSearch started successfully!&quot;<br><br># ------------------------------------------------------------------------------<br>log_info &quot;Step 7: Installing OpenSearch Dashboards (DEB Download Method)...&quot;<br><br>log_info &quot;Detecting installed OpenSearch version...&quot;<br>INSTALLED_OPENSEARCH_VERSION=$(dpkg-query -W -f=&#39;${Version}&#39; opensearch 2&gt;/dev/null | sed -e &#39;s/^[^0-9]*//&#39; -e &#39;s/[^0-9.]*$//&#39; -e &#39;s/-.*$//&#39;)<br>if [ -z &quot;$INSTALLED_OPENSEARCH_VERSION&quot; ]; then <br>    log_error &quot;Could not get installed OpenSearch version using dpkg-query. Cannot determine Dashboards version.&quot;<br>fi<br>log_info &quot;Detected OpenSearch version: ${INSTALLED_OPENSEARCH_VERSION}&quot;<br>DASHBOARDS_VERSION=$INSTALLED_OPENSEARCH_VERSION<br><br>DASHBOARDS_DEB_FILENAME=&quot;opensearch-dashboards-${DASHBOARDS_VERSION}-linux-x64.deb&quot;<br>DASHBOARDS_DOWNLOAD_URL=&quot;https://artifacts.opensearch.org/releases/bundle/opensearch-dashboards/${DASHBOARDS_VERSION}/${DASHBOARDS_DEB_FILENAME}&quot;<br><br>log_info &quot;Downloading OpenSearch Dashboards DEB package: ${DASHBOARDS_DOWNLOAD_URL}&quot;<br>TEMP_DIR=$(mktemp -d)<br>log_info &quot;Download temporary directory: ${TEMP_DIR}&quot;<br>wget -q --show-progress -O &quot;${TEMP_DIR}/${DASHBOARDS_DEB_FILENAME}&quot; &quot;${DASHBOARDS_DOWNLOAD_URL}&quot; <br>if [ $? -ne 0 ]; then<br>    log_error &quot;Failed to download Dashboards DEB package (${DASHBOARDS_DOWNLOAD_URL}). Check URL or network connection.&quot;<br>    rm -rf &quot;$TEMP_DIR&quot;<br>    exit 1<br>fi<br>log_info &quot;DEB package successfully downloaded: ${TEMP_DIR}/${DASHBOARDS_DEB_FILENAME}&quot; <br><br>log_info &quot;Installing downloaded DEB package (with apt)...&quot;<br>DEBIAN_FRONTEND=noninteractive apt-get install -y &quot;${TEMP_DIR}/${DASHBOARDS_DEB_FILENAME}&quot; \<br>    -o Dpkg::Options::=&quot;--force-confdef&quot; \<br>    -o Dpkg::Options::=&quot;--force-confold&quot; \<br>    --allow-downgrades<br>log_info &quot;OpenSearch Dashboards installed successfully.&quot;<br><br>log_info &quot;Cleaning up downloaded DEB file and temporary directory...&quot;<br>rm -f &quot;${TEMP_DIR}/${DASHBOARDS_DEB_FILENAME}&quot;<br>rmdir &quot;$TEMP_DIR&quot; <br>log_info &quot;Cleanup completed.&quot;<br><br># ------------------------------------------------------------------------------<br>log_info &quot;Step 8: Configuring OpenSearch Dashboards...&quot;<br>DASH_CONF_DIR=&quot;/etc/opensearch-dashboards&quot;<br>DASH_YML=&quot;${DASH_CONF_DIR}/opensearch_dashboards.yml&quot;<br><br>if [ ! -f &quot;$DASH_YML&quot; ]; then<br>    log_error &quot;${DASH_YML} file not found. Dashboards installation may have failed.&quot;<br>fi<br><br>set_config() {<br>    local key=&quot;$1&quot;<br>    local value=&quot;$2&quot;<br>    local file=&quot;$3&quot;<br>    log_info &quot;Setting ${key}: ${value}&quot;<br>    sed -i &quot;/^[# ]*${key}:/d&quot; &quot;${file}&quot;<br>    echo &quot;${key}: ${value}&quot; &gt;&gt; &quot;${file}&quot;<br>}<br><br>set_config_quoted() {<br>    local key=&quot;$1&quot;<br>    local value=&quot;$2&quot;<br>    local file=&quot;$3&quot;<br>    log_info &quot;Setting ${key}: (value hidden)&quot;<br>    sed -i &quot;/^[# ]*${key}:/d&quot; &quot;${file}&quot;<br>    echo &quot;${key}: \&quot;${value}\&quot;&quot; &gt;&gt; &quot;${file}&quot;<br>}<br><br>set_config &quot;server.host&quot; &#39;&quot;0.0.0.0&quot;&#39; &quot;$DASH_YML&quot;<br>set_config &quot;opensearch.hosts&quot; &#39;[&quot;https://localhost:9200&quot;]&#39; &quot;$DASH_YML&quot;<br><br>log_warn &quot;Dashboards will use &#39;admin&#39; user to connect to OpenSearch. A dedicated user is recommended for production.&quot;<br>set_config &quot;opensearch.username&quot; &#39;&quot;admin&quot;&#39; &quot;$DASH_YML&quot; <br>set_config_quoted &quot;opensearch.password&quot; &quot;${NEW_ADMIN_PASSWORD}&quot; &quot;$DASH_YML&quot;<br><br>log_warn &quot;Disabling Dashboards SSL verification (opensearch.ssl.verificationMode: none). Use VALID CERTIFICATES for production!&quot;<br>set_config &quot;opensearch.ssl.verificationMode&quot; &quot;none&quot; &quot;$DASH_YML&quot; <br><br>log_info &quot;OpenSearch Dashboards configuration completed.&quot;<br><br># ------------------------------------------------------------------------------<br>log_info &quot;Step 9: Enabling and starting OpenSearch Dashboards service with systemd...&quot;<br>systemctl daemon-reload<br>systemctl enable opensearch-dashboards.service<br><br>log_info &quot;Stopping current OpenSearch Dashboards service (if running)...&quot;<br>systemctl stop opensearch-dashboards.service || true<br><br>log_info &quot;Starting OpenSearch Dashboards service...&quot;<br>systemctl start opensearch-dashboards.service<br><br>log_info &quot;Waiting for OpenSearch Dashboards to start (maximum 1 minute)...&quot;<br>MAX_WAIT_DASH=60 <br>ELAPSED_DASH=0 <br>DASHBOARDS_URL=&quot;http://localhost:5601&quot; <br><br>while ! curl --output /dev/null --silent --head --fail &quot;${DASHBOARDS_URL}/app/login&quot; &gt; /dev/null 2&gt;&amp;1; do<br>    sleep $INTERVAL<br>    ELAPSED_DASH=$((ELAPSED_DASH + INTERVAL))<br>    log_info &quot;Dashboards not ready yet... (${ELAPSED_DASH}s/${MAX_WAIT_DASH}s)&quot;<br>    if [ $ELAPSED_DASH -ge $MAX_WAIT_DASH ]; then <br>        log_error &quot;OpenSearch Dashboards did not start within ${MAX_WAIT_DASH} seconds. Check logs: journalctl -u opensearch-dashboards&quot;<br>    fi<br>done<br>log_info &quot;OpenSearch Dashboards started successfully!&quot;<br><br># ------------------------------------------------------------------------------<br>SERVER_IP=$(hostname -I | awk &#39;{print $1}&#39;) <br>log_info &quot;============================================================&quot;<br>log_info &quot; OpenSearch (Standalone) and Dashboards Installation Complete! &quot;<br>log_info &quot;============================================================&quot;<br>log_info &quot;OpenSearch Access          : https://localhost:9200 (or https://${SERVER_IP}:9200)&quot;<br>log_info &quot;OpenSearch Dashboards Access: ${DASHBOARDS_URL} (or http://${SERVER_IP}:5601)&quot;<br>log_info &quot;Admin Username             : admin&quot;<br>log_info &quot;Admin Password             : The password you set during installation.&quot;<br>log_info &quot;------------------------------------------------------------&quot;<br>log_warn &quot;IMPORTANT REMINDERS:&quot;<br>log_warn &quot;1. JVM Heap Size           : Optimize &#39;/etc/opensearch/jvm.options&#39; file (currently: ${JVM_HEAP}).&quot;<br>log_warn &quot;2. Security                : Use your own certificates instead of demo certificates.&quot;<br>log_warn &quot;3. Firewall                : Allow ports 9200 and 5601 if necessary.&quot;<br>log_warn &quot;4. Dashboards User         : Create a dedicated user instead of using &#39;admin&#39;.&quot;<br>log_info &quot;For installation logs       : journalctl -u opensearch and journalctl -u opensearch-dashboards&quot;<br>log_info &quot;============================================================&quot;<br><br>exit 0</pre><p>The provided Bash script automates the end-to-end process of installing OpenSearch and OpenSearch Dashboards. It offers the following capabilities:</p><ul><li><strong>Secure configuration:</strong> Prompts for and enforces strong password policies for the admin user</li><li><strong>System optimization:</strong> Automatically disables swap memory to improve performance</li><li><strong>Java environment setup:</strong> Installs and configures the required OpenJDK version</li><li><strong>Version compatibility:</strong> Ensures matching versions between OpenSearch and Dashboards</li><li><strong>Service management:</strong> Creates and configures systemd services for both components</li><li><strong>Security integration:</strong> Sets up secure communication between Dashboards and OpenSearch</li><li><strong>Installation verification:</strong> Validates successful installation with health checks</li></ul><h3>Key Features</h3><ol><li><strong>Interactive Password Setup:</strong> Enforces strong password policies with minimum length, complexity requirements, and confirmation validation.</li><li><strong>System Preparation:</strong> Disables swap memory, updates the system, and installs necessary dependencies.</li><li><strong>Java Configuration:</strong> Installs the specified OpenJDK version and properly configures the JAVA_HOME environment.</li><li><strong>OpenSearch Installation:</strong> Uses APT repositories for a clean, manageable installation with proper versioning.</li><li><strong>Standalone Configuration:</strong> Configures OpenSearch for single-node deployment with customizable JVM heap settings.</li><li><strong>OpenSearch Dashboards Integration:</strong> Installs matching Dashboards version via DEB package and configures secure communication.</li><li><strong>Service Configuration:</strong> Sets up, enables and starts systemd services with proper health checks.</li><li><strong>User-Friendly Output:</strong> Provides clear installation summary with access information and important reminders.</li></ol><h3>Notes About Solution</h3><ul><li><strong>Prerequisites:</strong> The script requires root privileges and an internet connection to download packages.</li><li><strong>Password Security:</strong> The script enforces minimum password complexity requirements (12+ characters, mixed case, numbers).</li><li><strong>JVM Configuration:</strong> Default heap size is set to 1GB but includes warnings to customize this for production.</li><li><strong>Security Certificates:</strong> Uses demo certificates by default with clear warnings to replace them for production use.</li><li><strong>Health Verification:</strong> Includes timeouts and health checks to verify successful component startup.</li><li><strong>Error Handling:</strong> Comprehensive error handling with descriptive messages and logging.</li></ul><h3>Limitations</h3><ul><li>The script is designed specifically for Ubuntu Linux and may require modifications for other distributions.</li><li>Demo TLS certificates are used which are not suitable for production environments.</li><li>The default JVM heap size (1GB) is suitable for testing but needs adjustment for production loads.</li><li>The script uses admin credentials for Dashboards-to-OpenSearch communication, which should be replaced with dedicated service accounts in production.</li><li>SSL verification is disabled for Dashboard-to-OpenSearch communication, which should be properly configured for production.</li></ul><h3>Installation Steps</h3><p>To run the installation script, follow these steps:</p><p><strong>Switch to root user:</strong> Run the command</p><pre>sudo su</pre><p>to switch to the root user.</p><p><strong>Create or open the script file:</strong> Run</p><pre>vi install_opensearch.sh</pre><p>to create and open the file in the vi editor.</p><p><strong>Paste the script content:</strong> Once inside the vi editor, press i to enter insert mode, and paste the script content into the file. After pasting the script, press Esc and type “ :wq! “ and press enter to save and exit the editor.</p><p><strong>Make the script executable:</strong> Run the command</p><pre>chmod +x install_opensearch.sh</pre><p><strong>Run the script:</strong> To start the installation process, execute the script by running</p><pre>./install_opensearch.sh</pre><ol><li><strong>Follow the on-screen prompts:</strong> The script will ask you to create an admin password, meeting the specified complexity requirements. It will then handle the installation process automatically, including system configuration, package installation, service setup, and health checks.</li><li><strong>Access your installation:</strong> Once complete, the script displays connection information for both OpenSearch (<a href="https://localhost:9200/">https://localhost:9200</a>) and OpenSearch Dashboards (<a href="http://localhost:5601/">http://localhost:5601</a>) interfaces.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jI_W961V1PaxGfMDrngrow.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ubsNZMhhDD7Fwa9TUfyuBg.png" /></figure><p>By leveraging this automated installation approach, teams can quickly deploy OpenSearch and OpenSearch Dashboards with consistent configurations and proper security settings. The script’s comprehensive logging and verification steps help ensure a successful deployment while highlighting important considerations for production environments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a1999f4c04db" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Zero Trust Architecture]]></title>
            <link>https://furkangungor.medium.com/building-a-zero-trust-architecture-6e24953e9d96?source=rss-4a98bde93894------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e24953e9d96</guid>
            <category><![CDATA[practice]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Furkan Gungor]]></dc:creator>
            <pubDate>Tue, 01 Jul 2025 14:09:02 GMT</pubDate>
            <atom:updated>2025-07-01T14:09:02.684Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Introduction: From Theory to Practice</strong></h3><p>In one of my previous article, we explored what Zero Trust is and why it’s a critical security model for modern environments. Now, it’s time to take that understanding and turn it into action. Implementing Zero Trust may seem like a huge undertaking, but breaking it down into clear, manageable steps makes the process much more approachable. In this article, we’ll walk through how to implement Zero Trust effectively using AWS tools, from assessing your environment to securing identities and protecting data.</p><p>By the end, you’ll have a practical roadmap for applying Zero Trust in your cloud infrastructure, with real-world examples to guide you. Whether you’re just getting started or refining your security posture, these actionable steps will help you build a robust and secure environment. Let’s dive in!</p><h3>Zero Trust Implementation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/0*tu1pScIMyRoy-pb1.png" /></figure><p>Implementing Zero Trust can feel overwhelming, but breaking it down into clear, actionable steps makes the process manageable and effective. Here’s how to do it:</p><p><strong>Step 1: Assess Your Environment</strong></p><p>The first step is to <strong>get a comprehensive view of what you’re working with</strong> — mapping your resources, understanding your risks, and knowing where your critical assets are. This sets the stage for applying Zero Trust in the right areas.</p><ol><li><strong>Map Your Assets</strong></li></ol><ul><li>Identify the <strong>critical data</strong> you’re protecting: customer information, sensitive financial records, internal databases, etc.</li><li><strong>Applications and Services</strong>: Are your applications running on EC2 instances, Lambda functions, or containers? These need proper access management.</li><li><strong>Users and Devices</strong>: Who’s accessing your systems, and from what devices? Are employees using personal devices? What about contractors or third-party vendors?</li><li><strong>Tools to Help</strong>: Use <strong>AWS Resource Groups</strong> to organize resources by business function or risk level. This will help you keep track of what you’re protecting and where the highest risks are located.</li></ul><ol><li><strong>Identify High-Risk Areas</strong></li></ol><ul><li>Look for <strong>public-facing applications</strong> — especially web services or APIs that may be targeted by attackers.</li><li>Understand where sensitive data is stored (e.g., <strong>S3 buckets</strong>, <strong>RDS instances</strong>, or <strong>EFS</strong>). <strong>Classify your data</strong> into different sensitivity levels and ensure high-risk assets are locked down.</li><li>Tools like <strong>AWS Trusted Advisor</strong> can help you identify configuration weaknesses or security gaps in your environment.</li></ul><p><strong>Step 2: Secure Identities</strong></p><p>In Zero Trust, the <strong>identity</strong> of every user and application must be authenticated and authorized continuously. This is where IAM (Identity and Access Management) comes into play.</p><ol><li><strong>Implement Robust IAM Practices</strong></li></ol><ul><li>Set up specific <strong>IAM roles</strong> for different access levels, from admins to developers to read-only users. For instance, use <strong>IAM policies</strong> to define access to different services (like EC2, S3, DynamoDB) and make sure they follow the principle of least privilege.</li><li>Don’t forget to audit IAM roles regularly — use <strong>AWS IAM Access Analyzer</strong> to ensure policies are in line with best practices and avoid overly permissive access.</li></ul><ol><li><strong>Require MFA for All Users</strong></li></ol><ul><li><strong>Multi-factor Authentication (MFA)</strong> adds an essential layer of security. Ensure MFA is enabled for all users accessing sensitive resources, especially for IAM users with elevated privileges.</li><li>Use <strong>AWS MFA</strong> or even <strong>hardware MFA devices</strong> for high-risk environments (like privileged admin roles). This ensures an attacker can’t access your AWS environment just by compromising a password.</li></ul><ol><li><strong>Centralized Identity Management</strong></li></ol><ul><li>Use <strong>AWS Identity Center</strong> for managing user access across multiple AWS accounts. This service makes it easier to manage permissions centrally and enforce consistent identity policies across your organization.</li><li><strong>Federated identity management</strong> via AWS <strong>Cognito</strong> can also be a great option for applications that require user authentication.</li></ul><p><strong>Step 3: Protect Data</strong></p><p>Data is always a prime target for attackers, so Zero Trust requires strong controls around data access and encryption.</p><ol><li><strong>Encrypt All Data at Rest and in Transit</strong></li></ol><ul><li>Encrypt your data with <strong>AWS KMS (Key Management Service)</strong> for encryption at rest. For example, use KMS to manage encryption keys for your S3 buckets or RDS databases.</li><li>For encryption in transit, make sure all communication between services is secured with <strong>SSL/TLS</strong>. When deploying microservices or APIs, use <strong>AWS API Gateway</strong> with TLS to ensure encrypted connections.</li></ul><ol><li><strong>Classify Data Based on Sensitivity</strong></li></ol><ul><li>Classify your data by sensitivity — <strong>high, medium, or low</strong>. For high-sensitivity data like PII (personally identifiable information), enforce stricter access controls and encryption policies.</li><li><strong>S3 Bucket Policies</strong>: Use S3’s built-in policies to control access. Restrict access to sensitive data using IAM policies that allow only authorized users and services to access certain buckets.</li><li>Additionally, consider <strong>data masking</strong> or <strong>tokenization</strong> for sensitive data, especially when you have non-production environments or third parties accessing it.</li></ul><p><strong>Step 4: Secure the Network</strong></p><p>Network security in Zero Trust is about <strong>limiting access</strong> to only the resources that are needed and continuously monitoring for suspicious activity.</p><ol><li><strong>Use Network Segmentation</strong></li></ol><ul><li><strong>AWS VPC</strong> (Virtual Private Cloud) allows you to logically isolate your resources. For example, you can segment your database layer into its own private subnet, limiting access from only authorized services.</li><li>Use <strong>AWS Transit Gateway</strong> for cross-account networking and centralizing your VPC communications securely. This helps ensure that your network is segmented appropriately without letting traffic cross unnecessarily.</li></ul><ol><li><strong>Enable Firewalls and DDoS Protection</strong></li></ol><ul><li>Protect your web apps and APIs with <strong>AWS WAF (Web Application Firewall)</strong>. It allows you to create custom rules to block malicious traffic, like SQL injections or cross-site scripting.</li><li>For <strong>DDoS protection</strong>, enable <strong>AWS Shield</strong> to mitigate attacks against your applications. AWS Shield Standard is included with all AWS services, but <strong>Shield Advanced</strong> offers additional features like real-time attack visibility and 24/7 DDoS cost protection.</li></ul><p><strong>Step 5: Continuous Monitoring and Response</strong></p><p>Zero Trust requires constant vigilance. Your cloud environment should be continuously monitored to detect unusual behavior and automatically respond to potential threats.</p><ol><li><strong>Set Up Monitoring Tools</strong></li></ol><ul><li>Use <strong>AWS CloudTrail</strong> to log and track all API calls and activity within your AWS environment. CloudTrail records every action taken in your AWS account, making it a critical part of your security posture.</li><li>Enable <strong>AWS GuardDuty</strong> for threat detection. GuardDuty uses machine learning to identify unusual patterns and threats like unauthorized access or compromised instances.</li><li>Use <strong>AWS Security Hub</strong> to centralize security findings and streamline the process of investigating and responding to incidents.</li></ul><ol><li><strong>Automate Responses to Threats</strong></li></ol><ul><li>When an anomaly is detected, don’t wait — <strong>automate responses</strong>. With <strong>AWS Lambda</strong>, you can trigger automated actions, like isolating a compromised instance or alerting an admin when suspicious activity is detected.</li><li>Set up <strong>AWS CloudWatch</strong> alarms to get notified about potential security issues, like excessive failed login attempts or unusual traffic spikes, and configure automatic remediation actions.</li></ul><p><strong>Step 6: Enforce Policies with Automation</strong></p><p>Consistency is key in Zero Trust. Automation ensures that your security policies are enforced without manual intervention.</p><ol><li><strong>Leverage Tools for Automation</strong></li></ol><ul><li>Use <strong>AWS Config</strong> to continuously assess your environment for compliance with your Zero Trust policies. For instance, ensure that all S3 buckets are encrypted and that IAM roles are correctly defined.</li><li>With <strong>AWS Systems Manager</strong>, you can automate the process of patching EC2 instances, ensuring that your instances are always up to date and secure.</li><li>Use <strong>AWS Organizations</strong> for managing multiple accounts and applying <strong>Service Control Policies (SCPs)</strong> across all your accounts to enforce organization-wide security standards.</li></ul><p><strong>In Conclusion</strong>, implementing Zero Trust in the cloud is a journey that involves protecting identities, securing data, segmenting networks, continuously monitoring activity, and automating policy enforcement. With AWS-native tools like <strong>IAM</strong>, <strong>GuardDuty</strong>, <strong>CloudTrail</strong>, and <strong>KMS</strong>, you can build a comprehensive Zero Trust architecture that scales with your business needs.</p><h3>Common Challenges of Zero Trust</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*75vifcC_KOcUKimS.png" /></figure><p>Implementing Zero Trust comes with a few challenges:</p><ol><li><strong>Complexity and Integration</strong><br> Transitioning from traditional security models to Zero Trust requires reconfiguring systems, access controls, and network boundaries.<br> <em>Tip: Start small with IAM and sensitive data, then expand gradually.</em></li><li><strong>Performance Overheads</strong><br> Continuous validation and authentication can add latency, affecting user experience, especially in high-traffic environments.<br> <em>Tip: Use load balancing and auto-scaling to minimize impact.</em></li><li><strong>Cultural Resistance</strong><br> Shifting to Zero Trust can face internal pushback from users used to open access.<br> <em>Tip: Educate teams on the security benefits and necessity of this shift.</em></li><li><strong>Cost of Implementation</strong><br> The tools, technologies, and expertise required can make Zero Trust seem costly.<br> <em>Tip: Leverage cloud-native services like AWS IAM and GuardDuty to manage costs.</em></li><li><strong>Managing Distributed Environments</strong><br> In hybrid or multi-cloud environments, managing users and workloads can become complex.<br> <em>Tip: Automate and use orchestration tools to streamline management.</em></li></ol><p>While the challenges are real, the long-term security benefits make it well worth the effort.</p><h3><strong>Conclusion</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wvmGeUwRBXffKUpS.png" /></figure><p>Implementing Zero Trust is undeniably complex and may require a significant shift in how your environment operates. It’s not a quick fix but a process that involves carefully assessing your infrastructure and making strategic changes to how access, data, and networks are managed.</p><p>While the journey can feel daunting, taking it step by step makes it more manageable. Start by focusing on the most critical areas, and as you build momentum, you’ll gradually create a more secure environment. Though it may take time and effort, the security benefits of adopting Zero Trust make the investment worthwhile in the long run.</p><p>CREDITS</p><ul><li><a href="https://www.fortinet.com/resources/cyberglossary/how-to-implement-zero-trust">https://www.fortinet.com/resources/cyberglossary/how-to-implement-zero-trust</a></li><li><a href="https://www.nccoe.nist.gov/projects/implementing-zero-trust-architecture">https://www.nccoe.nist.gov/projects/implementing-zero-trust-architecture</a></li><li><a href="https://www.catonetworks.com/zero-trust-network-access/how-to-implement-zero-trust/">https://www.catonetworks.com/zero-trust-network-access/how-to-implement-zero-trust/</a></li><li><a href="https://www.microsoft.com/insidetrack/blog/implementing-a-zero-trust-security-model-at-microsoft/">https://www.microsoft.com/insidetrack/blog/implementing-a-zero-trust-security-model-at-microsoft/</a></li><li><a href="https://www.zscaler.com/zpedia/how-to-implement-zero-trust">https://www.zscaler.com/zpedia/how-to-implement-zero-trust</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e24953e9d96" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>