<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged service</title>
<link>https://coderlegion.com/tag/service</link>
<description>Powered by Question2Answer</description>
<item>
<title>How to Respond to Negative Google Reviews in the Philippines</title>
<link>https://coderlegion.com/25650/how-to-respond-to-negative-google-reviews-in-the-philippines</link>
<description>
&lt;p&gt;&lt;strong&gt;Direct answer:&lt;/strong&gt; acknowledge the review without arguing, confirm only facts you can safely make public, invite the reviewer to a private channel, and record the operational follow-up. If the review appears to violate Google Maps policy, preserve the evidence and report it, but do not report it merely because it is harsh or disputed. Never reveal an order history, medical detail, payment record, phone number, address, or employee file in the public reply.&lt;/p&gt;
      &lt;p&gt;A useful response is written for two audiences. The reviewer needs a clear route to resolution. Future customers need to see that the business listens, protects privacy, and fixes problems without turning the review section into a courtroom. This guide owns that single-incident response. The broader process for requesting, monitoring, assigning, and learning from reviews belongs in the separate review-management guide.&lt;/p&gt;
      &lt;p&gt;You need a verified Google Business Profile before you can reply. Google says an approved reply is posted publicly under the review, the reviewer is notified, and the reviewer may edit the review afterward. That makes a calm first response more useful than a fast emotional one. It does not guarantee a changed rating or removal.&lt;/p&gt;

      &lt;h2 id=&quot;classify-the-review-before-choosing-the-response&quot;&gt;Classify the review before choosing the response&lt;/h2&gt;
      &lt;div class=&quot;article-table-wrap&quot;&gt;
        &lt;table class=&quot;article-table&quot;&gt;
          &lt;thead&gt;&lt;tr&gt;&lt;th&gt;What you see&lt;/th&gt;&lt;th&gt;Primary action&lt;/th&gt;&lt;th&gt;Public response&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
          &lt;tbody&gt;
            &lt;tr&gt;&lt;td&gt;A recognizable service failure&lt;/td&gt;&lt;td&gt;Verify the event, assign an owner, and offer a specific private route&lt;/td&gt;&lt;td&gt;Acknowledge the experience and state the next step without exposing the record&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;A complaint you cannot match&lt;/td&gt;&lt;td&gt;Search by date, branch, service, and limited reference data&lt;/td&gt;&lt;td&gt;Say you could not identify the case from the public details and invite direct contact&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Off-topic, fake engagement, impersonation, harassment, or exposed personal information&lt;/td&gt;&lt;td&gt;Capture evidence and report the policy category that actually applies&lt;/td&gt;&lt;td&gt;Reply only if a short privacy-safe clarification helps customers while the report is reviewed&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;A threat, extortion attempt, safety issue, or legal claim&lt;/td&gt;&lt;td&gt;Preserve evidence and escalate internally to the appropriate adviser or authority&lt;/td&gt;&lt;td&gt;Usually pause. Do not negotiate, accuse, or publish evidence in the review thread&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;A genuine opinion you strongly disagree with&lt;/td&gt;&lt;td&gt;Check whether a process or expectation failed&lt;/td&gt;&lt;td&gt;Respond to the experience. Do not demand removal or describe opinion as a policy violation&lt;/td&gt;&lt;/tr&gt;
          &lt;/tbody&gt;
        &lt;/table&gt;
      &lt;/div&gt;
      &lt;p&gt;Google's removal standard is policy-based. Its Business Profile guidance says only reviews that violate policy are eligible for removal, and that a business should not report a review just because it dislikes or disagrees with it. A negative account can remain even when your internal record tells a different story.&lt;/p&gt;

      &lt;h2 id=&quot;1-preserve-the-evidence-and-slow-the-response-down&quot;&gt;1. Preserve the evidence and slow the response down&lt;/h2&gt;
      &lt;p&gt;Save the review URL if available, reviewer name as displayed, rating, text, images, publication time, profile location, and a screenshot. Record who discovered it and when. If the text is later edited or removed, you still need an internal record of the original incident and the action taken.&lt;/p&gt;
      &lt;p&gt;Assign one response owner. A restaurant shift lead, clinic coordinator, or branch manager can gather facts, but only the designated person should publish the reply. This prevents parallel answers and makes the tone consistent. For an ordinary complaint, responding later the same business day or the next day is usually better than answering before the relevant staff can be heard.&lt;/p&gt;
      &lt;div class=&quot;article-callout&quot;&gt;
        &lt;p&gt;&lt;strong&gt;Pause immediately when the review contains a threat, extortion demand, doxxing, or sensitive personal information.&lt;/strong&gt; Limit internal access, preserve the evidence, and use the appropriate policy, safety, legal, or privacy escalation. Do not quote the harmful details in your reply.&lt;/p&gt;
      &lt;/div&gt;

      &lt;h2 id=&quot;2-investigate-with-the-minimum-necessary-data&quot;&gt;2. Investigate with the minimum necessary data&lt;/h2&gt;
      &lt;p&gt;Start with the smallest useful search: branch, service type, approximate date, staff on duty, and a non-sensitive reference the reviewer can provide privately. Ask the staff member what happened before deciding that the review is false. Separate facts from assumptions in the case note.&lt;/p&gt;
      &lt;pre class=&quot;article-code&quot;&gt;&lt;code&gt;Review URL:
Profile / branch:
Received at:
Assigned owner:
Classification:
Verified facts:
Facts not yet verified:
Customer data consulted:
Public reply approved by:
Private follow-up channel:
Policy report / appeal status:
Operational correction:
Closed at:&lt;/code&gt;&lt;/pre&gt;
      &lt;p&gt;In the Philippines, the National Privacy Commission's implementing rules require personal-data processing to follow transparency, legitimate purpose, and proportionality. The rules also say data should be adequate, relevant, and limited to what is necessary. Applied here, a public review does not authorize the business to publish everything it knows about the reviewer. Use private records to resolve the case, not to win a public argument.&lt;/p&gt;

      &lt;h2 id=&quot;3-write-a-short-public-response&quot;&gt;3. Write a short public response&lt;/h2&gt;
      &lt;p&gt;A strong first reply normally has four parts:&lt;/p&gt;
      &lt;ol&gt;
        &lt;li&gt;&lt;strong&gt;Acknowledge the experience.&lt;/strong&gt; Thank the person for raising it or state that you are sorry the visit did not meet expectations.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;State the standard or concern.&lt;/strong&gt; Name the relevant service expectation without making an unverified admission.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Protect privacy.&lt;/strong&gt; Explain that the team will not discuss customer details in a public thread.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Offer one owned route.&lt;/strong&gt; Give a monitored email, phone line, or contact form and say what reference will help privately.&lt;/li&gt;
      &lt;/ol&gt;
      &lt;p&gt;Do not paste the same generic paragraph under every complaint. Keep the structure consistent, but refer to the actual service category, branch, or issue when doing so is safe. The reply should be complete enough for an observer to understand the next step without exposing the investigation.&lt;/p&gt;

      &lt;h2 id=&quot;response-templates-for-common-cases&quot;&gt;Response templates for common cases&lt;/h2&gt;
      &lt;p&gt;&lt;strong&gt;Recognizable service problem&lt;/strong&gt;&lt;/p&gt;
      &lt;pre class=&quot;article-code&quot;&gt;&lt;code&gt;Thank you for raising this. I am sorry the visit did not meet the service standard we aim for. We are reviewing what happened with the team. To protect your privacy, please contact [monitored channel] with your visit date and reference number so [owner or role] can follow up directly.&lt;/code&gt;&lt;/pre&gt;

      &lt;p&gt;&lt;strong&gt;Complaint you cannot match from the public details&lt;/strong&gt;&lt;/p&gt;
      &lt;pre class=&quot;article-code&quot;&gt;&lt;code&gt;We take this feedback seriously, but we have not been able to identify the visit from the details posted here. Please contact [monitored channel] with the date, branch, and reference number. We will review it privately and respond through that channel.&lt;/code&gt;&lt;/pre&gt;

      &lt;p&gt;&lt;strong&gt;Privacy-sensitive business&lt;/strong&gt;&lt;/p&gt;
      &lt;pre class=&quot;article-code&quot;&gt;&lt;code&gt;Thank you for bringing this to our attention. We cannot discuss client records or service details in a public review. Please contact [privacy-safe channel] and ask for [role] so we can verify the matter and address it directly.&lt;/code&gt;&lt;/pre&gt;

      &lt;p&gt;&lt;strong&gt;Review appears to describe another branch or business&lt;/strong&gt;&lt;/p&gt;
      &lt;pre class=&quot;article-code&quot;&gt;&lt;code&gt;We would like to check this carefully. The service described does not appear to match the records available to this location, but we will not make assumptions in public. Please contact [channel] with the date and branch so we can confirm where the issue belongs.&lt;/code&gt;&lt;/pre&gt;
      &lt;p&gt;Replace the brackets with a channel that is actually monitored. Do not ask the reviewer to post an order number, phone number, full name, medical detail, or other personal data in the review thread.&lt;/p&gt;

      &lt;h2 id=&quot;4-decide-whether-to-report-the-review&quot;&gt;4. Decide whether to report the review&lt;/h2&gt;
      &lt;p&gt;Use the &lt;a href=&quot;https://support.google.com/contributionpolicy/answer/7400114?hl=en&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Google Maps prohibited and restricted content policy&lt;/a&gt; as the decision source. Relevant categories can include fake engagement, impersonation, off-topic content, harassment, doxxing, personal information, profanity, and unsubstantiated allegations of criminal or unethical conduct. Select the category supported by the content. Do not invent a privacy or spam reason simply because the business cannot find the customer.&lt;/p&gt;
      &lt;p&gt;Google provides reporting from the Business Profile and through its Reviews Management Tool. Its current help page says review evaluation typically takes several days. If the result is &quot;no policy violation,&quot; the tool can offer a one-time appeal. The appeal is for a policy decision, not a second attempt to settle a factual disagreement with the reviewer.&lt;/p&gt;
      &lt;ol&gt;
        &lt;li&gt;Capture the review and the exact policy clause you believe applies.&lt;/li&gt;
        &lt;li&gt;Report the review from the profile or Reviews Management Tool.&lt;/li&gt;
        &lt;li&gt;Record the submission date and status in the incident note.&lt;/li&gt;
        &lt;li&gt;If eligible, use the one-time appeal with a concise policy explanation.&lt;/li&gt;
        &lt;li&gt;Continue the service-recovery process separately when a real customer issue may still exist.&lt;/li&gt;
      &lt;/ol&gt;
      &lt;p&gt;If the review contains an extortion demand tied to removal or threatened reviews, use Google's dedicated extortion-reporting route linked from the inappropriate-review help page. Preserve messages and payment demands. Do not pay, bargain in public, or coordinate retaliatory reviews.&lt;/p&gt;

      &lt;h2 id=&quot;5-move-the-resolution-off-the-public-thread&quot;&gt;5. Move the resolution off the public thread&lt;/h2&gt;
      &lt;p&gt;The private conversation should have an owner, a deadline, and a remedy boundary. Confirm the issue, explain what can and cannot be changed, and document the agreed action. A refund, replacement, correction, apology, or staff follow-up may be appropriate depending on the facts and the business's policy. Do not make compensation conditional on deleting or improving the review.&lt;/p&gt;
      &lt;p&gt;If the customer confirms the matter is resolved, you may politely say that they are free to update the review if they believe the new outcome changes their experience. Do not script the rating, offer an incentive, or pressure them. Google treats reviews influenced by payment, discounts, free goods, services, or conflicts of interest as incentivized or biased content.&lt;/p&gt;

      &lt;h2 id=&quot;6-close-the-internal-action-not-just-the-conversation&quot;&gt;6. Close the internal action, not just the conversation&lt;/h2&gt;
      &lt;p&gt;A response without an operational correction is reputation theatre. Tag the root cause so recurring failures become visible: wait time, staff communication, billing, stock, handoff, cleanliness, scheduling, product quality, or expectation setting. Record the fix owner and the date it will be checked.&lt;/p&gt;
      &lt;p&gt;For one incident, a small case log is enough. When reviews arrive regularly, move from ad hoc replies to the full &lt;a rel=&quot;nofollow&quot; href=&quot;https://floxolab.com/seo/guides/google-review-management-small-business&quot;&gt;Google review management process&lt;/a&gt; for fair requests, monitoring, assignment, service recovery, and trend review. Build the workflow before buying software for it.&lt;/p&gt;

      &lt;h2 id=&quot;what-not-to-do&quot;&gt;What not to do&lt;/h2&gt;
      &lt;ul&gt;
        &lt;li&gt;&lt;strong&gt;Do not argue line by line.&lt;/strong&gt; A long rebuttal gives private evidence a public audience and makes the business look defensive.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Do not identify the customer from internal records.&lt;/strong&gt; Matching a username to an order does not give permission to publish the connection.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Do not promise removal.&lt;/strong&gt; Google decides policy enforcement, and a compliant negative opinion may remain.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Do not accuse the reviewer of lying.&lt;/strong&gt; Say what you could or could not verify, then provide a private route.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Do not threaten legal action in the reply.&lt;/strong&gt; Preserve evidence and obtain appropriate advice away from the public thread.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Do not offer money, discounts, or free service for a changed rating.&lt;/strong&gt; Resolve the service issue without buying the review outcome.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Do not outsource replies without access controls.&lt;/strong&gt; An agency should not receive more customer data or profile permissions than the task requires.&lt;/li&gt;
      &lt;/ul&gt;

      &lt;h2 id=&quot;verify-the-response-and-follow-up&quot;&gt;Verify the response and follow-up&lt;/h2&gt;
      &lt;ul&gt;
        &lt;li&gt;The reply appears under the correct profile and review.&lt;/li&gt;
        &lt;li&gt;No personal, medical, payment, employment, or order details are public.&lt;/li&gt;
        &lt;li&gt;The contact channel works and reaches the named owner.&lt;/li&gt;
        &lt;li&gt;The internal note separates verified facts from claims and assumptions.&lt;/li&gt;
        &lt;li&gt;Any Google report cites a real policy category and has a recorded status.&lt;/li&gt;
        &lt;li&gt;The service correction has an owner and review date.&lt;/li&gt;
        &lt;li&gt;The team checks whether the reviewer edited the text after resolution, without chasing or pressuring them.&lt;/li&gt;
      &lt;/ul&gt;
      &lt;p&gt;A calm reply cannot erase a poor experience, and it should not try to. Its job is to protect the customer, show future readers how the business handles problems, and create a traceable route from complaint to correction. For the wider visibility baseline, use the &lt;a rel=&quot;nofollow&quot; href=&quot;https://floxolab.com/seo/guides/local-seo-for-small-business&quot;&gt;local SEO guide for small businesses&lt;/a&gt;. To measure the profile and local search results without treating rank as the only outcome, see the &lt;a rel=&quot;nofollow&quot; href=&quot;https://floxolab.com/seo/tools/best-seo-tools-local-seo-philippines&quot;&gt;local SEO tools guide&lt;/a&gt;.&lt;/p&gt;

      &lt;h2 id=&quot;sources-checked&quot;&gt;Sources checked&lt;/h2&gt;
      &lt;p&gt;Google Business Profile reply behavior, review reporting and appeals, Maps content policies, and the Philippine data privacy principles were verified against official sources on August 6, 2026.&lt;/p&gt;
      &lt;ul&gt;
        &lt;li&gt;&lt;a href=&quot;https://support.google.com/business/answer/3474050?hl=en&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Google Business Profile Help: manage customer reviews and replies&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;https://support.google.com/business/answer/4596773?hl=en&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Google Business Profile Help: report inappropriate reviews and submit an appeal&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;https://support.google.com/contributionpolicy/answer/7400114?hl=en&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Google Maps User Generated Content Policy: prohibited and restricted content&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;https://support.google.com/contributionpolicy/answer/16597558?hl=en&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Google Maps policy: incentivized or biased reviews&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;https://privacy.gov.ph/implementing-rules-regulations-data-privacy-act-2012/&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Philippine National Privacy Commission: implementing rules of the Data Privacy Act&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;

      &lt;nav class=&quot;article-related&quot; aria-label=&quot;Related reading&quot;&gt;
        &lt;p class=&quot;article-related-h mono&quot;&gt;Keep reading&lt;/p&gt;
        &lt;ul&gt;
          &lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://floxolab.com/seo/guides/local-seo-for-small-business&quot;&gt;Build the Single-Location Local SEO Baseline&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://floxolab.com/seo/tools/best-seo-tools-local-seo-philippines&quot;&gt;Choose Tools for Local Visibility and Review Work&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://floxolab.com/seo/guides/what-access-an-seo-audit-needs&quot;&gt;Limit Profile and SEO Access to What the Work Requires&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/nav&gt;

      &lt;div class=&quot;article-cta&quot;&gt;
        &lt;p class=&quot;cta-h&quot;&gt;Need a steadier local reputation process?&lt;/p&gt;
        &lt;p&gt;FloxoLab can review the profile, response ownership, local pages, and measurement path, then turn the gaps into a practical plan without ranking promises or invasive tracking.&lt;/p&gt;
        &lt;a rel=&quot;nofollow&quot; href=&quot;https://floxolab.com/seo/local-seo-philippines&quot; class=&quot;btn btn-primary article-cta-button&quot;&gt;Explore local SEO support&lt;/a&gt;
      &lt;/div&gt;
&lt;p&gt;&lt;em&gt;Originally published on &lt;a rel=&quot;nofollow&quot; href=&quot;https://floxolab.com/seo/guides/respond-negative-google-reviews-philippines&quot;&gt;FloxoLab&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
</description>
<category>Other</category>
<guid isPermaLink="true">https://coderlegion.com/25650/how-to-respond-to-negative-google-reviews-in-the-philippines</guid>
<pubDate>Sat, 19 Sep 2026 15:50:00 +0000</pubDate>
</item>
<item>
<title>Google Review Management for Small Business</title>
<link>https://coderlegion.com/25648/google-review-management-for-small-business</link>
<description>
&lt;p&gt;&lt;strong&gt;Direct answer:&lt;/strong&gt; start with Google Business Profile's own review link, customer-activity notifications, named profile access, and a simple weekly log. Ask every eligible customer with neutral wording after a completed service. Do not offer incentives, screen for happy customers, ask for a particular rating, or impose review quotas on staff. Assign each new review to an owner, move private details off the public thread, and review recurring themes monthly.&lt;/p&gt;
      &lt;p&gt;A small business usually does not need reputation software on day one. The native profile plus a spreadsheet or task board is enough when one person can review the queue regularly. Add automation only when requests come from several systems, multiple people need routing, or branches need shared reporting. The workflow should exist before software scales it.&lt;/p&gt;
      &lt;p&gt;This guide covers the full operating process. If one difficult review has already arrived, use the separate &lt;a rel=&quot;nofollow&quot; href=&quot;https://floxolab.com/seo/guides/respond-negative-google-reviews-philippines&quot;&gt;negative Google review response guide&lt;/a&gt; for incident classification, privacy boundaries, response templates, reporting, and appeal steps.&lt;/p&gt;

      &lt;h2 id=&quot;use-one-policy-safe-operating-loop&quot;&gt;Use one policy-safe operating loop&lt;/h2&gt;
      &lt;div class=&quot;article-table-wrap&quot;&gt;
        &lt;table class=&quot;article-table&quot;&gt;
          &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Stage&lt;/th&gt;&lt;th&gt;Minimum process&lt;/th&gt;&lt;th&gt;Control&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
          &lt;tbody&gt;
            &lt;tr&gt;&lt;td&gt;Eligibility&lt;/td&gt;&lt;td&gt;A real service, visit, order, or completed customer interaction&lt;/td&gt;&lt;td&gt;Use the same rule regardless of whether the customer appears happy&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Request&lt;/td&gt;&lt;td&gt;One neutral message with the official review link or QR code&lt;/td&gt;&lt;td&gt;No incentive, rating instruction, staff script pressure, or required wording&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Monitor&lt;/td&gt;&lt;td&gt;Customer-activity alerts plus a scheduled profile check&lt;/td&gt;&lt;td&gt;One accountable queue owner and a backup&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Assign&lt;/td&gt;&lt;td&gt;Classify praise, question, service issue, privacy risk, or policy concern&lt;/td&gt;&lt;td&gt;Route sensitive incidents before publishing&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Respond&lt;/td&gt;&lt;td&gt;Thank, clarify, or move resolution to a private channel&lt;/td&gt;&lt;td&gt;Do not expose customer or staff records&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Learn&lt;/td&gt;&lt;td&gt;Group themes and record operational corrections&lt;/td&gt;&lt;td&gt;Measure process coverage, not a forced star target&lt;/td&gt;&lt;/tr&gt;
          &lt;/tbody&gt;
        &lt;/table&gt;
      &lt;/div&gt;

      &lt;h2 id=&quot;1-define-who-receives-a-review-request&quot;&gt;1. Define who receives a review request&lt;/h2&gt;
      &lt;p&gt;Write the eligibility rule before choosing the message. A practical rule might be: send one request after a completed appointment, delivered order, closed support case, finished job, or paid visit when the customer has not already been asked for that transaction. Exclude cancelled, fraudulent, duplicate, test, employee, supplier, and internal transactions.&lt;/p&gt;
      &lt;p&gt;Do not turn a satisfaction survey into a gate. Sending the public review link only to people who select a high satisfaction score is selective solicitation. Google Maps policy says merchants must not discourage negative reviews or selectively solicit positive reviews. Offer the same public review path to all customers who meet the neutral eligibility rule.&lt;/p&gt;
      &lt;pre class=&quot;article-code&quot;&gt;&lt;code&gt;Eligible when:
- a real customer interaction is complete
- the business can identify the branch or service internally
- no review request was sent for the same transaction

Not eligible when:
- the interaction was cancelled, duplicated, fraudulent, or internal
- the person is an employee, contractor, supplier, family member, or competitor
- consent or channel rules do not allow the follow-up message&lt;/code&gt;&lt;/pre&gt;

      &lt;h2 id=&quot;2-create-the-official-review-link-and-qr-code&quot;&gt;2. Create the official review link and QR code&lt;/h2&gt;
      &lt;p&gt;Google now provides a direct review link and QR code inside Business Profile. On a computer, open the profile, select &lt;strong&gt;Read reviews&lt;/strong&gt;, then &lt;strong&gt;Get more reviews&lt;/strong&gt;. Copy the link or save the QR code. Google documents receipts, thank-you emails, the end of a chat, and an in-store display as possible placements. The QR code is currently generated in a computer browser, not on mobile.&lt;/p&gt;
      &lt;p&gt;Use the link that belongs to the exact location. Test it while signed out or in a private browser window, confirm that it opens the intended profile, and store the approved link where staff cannot accidentally substitute a Maps search or a different branch. For several locations, keep one row per profile with its own owner and link, then connect that inventory to the wider &lt;a rel=&quot;nofollow&quot; href=&quot;https://floxolab.com/seo/guides/local-seo-multi-location&quot;&gt;multi-location local SEO operating model&lt;/a&gt;.&lt;/p&gt;
      &lt;div class=&quot;article-callout&quot;&gt;
        &lt;p&gt;&lt;strong&gt;Never offer a discount, free item, loyalty point, competition entry, or other benefit for posting, changing, or removing a review.&lt;/strong&gt; Google treats incentivized reviews as fake engagement and can remove the content or restrict the Business Profile.&lt;/p&gt;
      &lt;/div&gt;

      &lt;h2 id=&quot;3-ask-neutrally-after-the-service-is-complete&quot;&gt;3. Ask neutrally after the service is complete&lt;/h2&gt;
      &lt;p&gt;The request should identify the business, connect to the genuine interaction, make honest feedback optional, and contain one direct link. Do not ask for five stars, mention a desired rating, require the review while the customer is still at the counter, or ask them to name a staff member. Google's policy specifically disallows pressure, requested content, and staff review quotas.&lt;/p&gt;
      &lt;p&gt;&lt;strong&gt;Email or message template&lt;/strong&gt;&lt;/p&gt;
      &lt;pre class=&quot;article-code&quot;&gt;&lt;code&gt;Thank you for choosing [Business] for [service]. If you would like to share your honest experience, you can leave a Google review here: [official review link]. Feedback is optional, and we read it to improve the service.&lt;/code&gt;&lt;/pre&gt;
      &lt;p&gt;&lt;strong&gt;Receipt or printed card&lt;/strong&gt;&lt;/p&gt;
      &lt;pre class=&quot;article-code&quot;&gt;&lt;code&gt;How was your experience with [Business]? Share an honest Google review using this QR code. Feedback is optional.&lt;/code&gt;&lt;/pre&gt;
      &lt;p&gt;A private support channel can appear beside the review link, but it should not replace the link for dissatisfied customers. For example: &quot;For help with an unresolved order, contact support@example.com.&quot; Both routes remain visible to everyone.&lt;/p&gt;

      &lt;h2 id=&quot;4-keep-a-minimal-request-log&quot;&gt;4. Keep a minimal request log&lt;/h2&gt;
      &lt;p&gt;The log prevents duplicate requests and shows whether the process runs consistently. It does not need the text of every customer conversation. Use an internal transaction reference rather than copying sensitive personal data into a new sheet.&lt;/p&gt;
      &lt;pre class=&quot;article-code&quot;&gt;&lt;code&gt;completed_at
location
service_category
internal_reference
eligible: yes / no
request_sent_at
request_channel
request_owner
duplicate_check
follow_up_needed: yes / no
retention_delete_after&lt;/code&gt;&lt;/pre&gt;
      &lt;p&gt;Do not try to match every public reviewer to a customer record for attribution. Track request volume and resulting public review volume at an aggregate level. Link an individual review to a private case only when service recovery, fraud, safety, or another legitimate operational purpose requires it.&lt;/p&gt;
      &lt;p&gt;For Philippine businesses, the National Privacy Commission's implementing rules require transparency, legitimate purpose, proportionality, appropriate safeguards, and retention only as long as necessary. Define why each field exists, who can access it, and when the row is deleted. A permanent marketing database is not the default purpose of a review request log.&lt;/p&gt;

      &lt;h2 id=&quot;5-monitor-with-native-alerts-and-an-owned-schedule&quot;&gt;5. Monitor with native alerts and an owned schedule&lt;/h2&gt;
      &lt;p&gt;Google Business Profile can notify users about customer activity, including new reviews and photos. In the profile, open &lt;strong&gt;More&lt;/strong&gt;, &lt;strong&gt;Notifications&lt;/strong&gt;, then configure customer-activity alerts. Notifications are a signal, not the entire control. The queue owner should also open &lt;strong&gt;Read reviews&lt;/strong&gt; on a defined schedule so a missed email does not become a missed complaint.&lt;/p&gt;
      &lt;p&gt;A workable starting rhythm is a quick check every business day and a weekly reconciliation of new reviews, replies, open service cases, and policy reports. Use a faster check for businesses where a complaint may involve health, safety, travel, regulated service, or a time-sensitive booking.&lt;/p&gt;
      &lt;p&gt;Give each person their own Google Account. Google supports Business Profile owners and managers so the primary owner does not need to share a password. Managers can handle daily profile work and replies, while owners retain user-management and removal controls. Review &lt;a rel=&quot;nofollow&quot; href=&quot;https://floxolab.com/seo/guides/what-access-an-seo-audit-needs&quot;&gt;the access guide&lt;/a&gt; before adding an agency or contractor.&lt;/p&gt;

      &lt;h2 id=&quot;6-assign-the-review-before-answering&quot;&gt;6. Assign the review before answering&lt;/h2&gt;
      &lt;div class=&quot;article-table-wrap&quot;&gt;
        &lt;table class=&quot;article-table&quot;&gt;
          &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Review type&lt;/th&gt;&lt;th&gt;Owner&lt;/th&gt;&lt;th&gt;Next action&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
          &lt;tbody&gt;
            &lt;tr&gt;&lt;td&gt;Specific praise&lt;/td&gt;&lt;td&gt;Queue owner&lt;/td&gt;&lt;td&gt;Thank the reviewer without copying a generic sales pitch&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Neutral comment or question&lt;/td&gt;&lt;td&gt;Queue owner or service lead&lt;/td&gt;&lt;td&gt;Answer the useful point and correct any public business information&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Recognizable service failure&lt;/td&gt;&lt;td&gt;Service lead&lt;/td&gt;&lt;td&gt;Investigate, publish a privacy-safe acknowledgment, and open a private case&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Privacy, safety, legal, or extortion concern&lt;/td&gt;&lt;td&gt;Designated escalation owner&lt;/td&gt;&lt;td&gt;Preserve evidence and pause the public reply until the risk is classified&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Possible Google policy violation&lt;/td&gt;&lt;td&gt;Profile owner&lt;/td&gt;&lt;td&gt;Compare the exact content with policy before reporting it&lt;/td&gt;&lt;/tr&gt;
          &lt;/tbody&gt;
        &lt;/table&gt;
      &lt;/div&gt;
      &lt;p&gt;Set internal service targets based on operational risk, not public promises. For example, acknowledge an ordinary new review within two business days, investigate a service complaint by the next business day, and escalate a privacy or safety issue immediately. The target is a management choice, not a Google ranking factor.&lt;/p&gt;

      &lt;h2 id=&quot;7-use-response-patterns-not-identical-scripts&quot;&gt;7. Use response patterns, not identical scripts&lt;/h2&gt;
      &lt;p&gt;&lt;strong&gt;Positive review:&lt;/strong&gt; thank the person and refer briefly to the service when safe. Avoid keyword stuffing, promotional offers, or revealing what they bought if the review does not already make it public.&lt;/p&gt;
      &lt;pre class=&quot;article-code&quot;&gt;&lt;code&gt;Thank you for sharing your experience. We are glad the team could help, and we appreciate you taking the time to leave feedback.&lt;/code&gt;&lt;/pre&gt;
      &lt;p&gt;&lt;strong&gt;Neutral review:&lt;/strong&gt; acknowledge the useful observation and explain the next improvement or clarification.&lt;/p&gt;
      &lt;pre class=&quot;article-code&quot;&gt;&lt;code&gt;Thank you for the specific feedback about the wait. We are reviewing the handoff between booking and arrival so the timing is clearer.&lt;/code&gt;&lt;/pre&gt;
      &lt;p&gt;&lt;strong&gt;Negative review:&lt;/strong&gt; do not improvise from a short template library. Classify the incident, protect personal data, and use the full &lt;a rel=&quot;nofollow&quot; href=&quot;https://floxolab.com/seo/guides/respond-negative-google-reviews-philippines&quot;&gt;negative review response workflow&lt;/a&gt;.&lt;/p&gt;
      &lt;p&gt;Google reviews business replies before publication. When approved, the reply appears publicly as the business and the reviewer receives a notification. Replies can take time to appear, so record the submission before publishing a duplicate.&lt;/p&gt;

      &lt;h2 id=&quot;8-turn-themes-into-operational-corrections&quot;&gt;8. Turn themes into operational corrections&lt;/h2&gt;
      &lt;p&gt;Once a month, group reviews into a small stable taxonomy such as wait time, communication, billing, product quality, cleanliness, availability, scheduling, staff helpfulness, and expectation setting. Separate praise from problems, then count recurring themes by location or service without treating one loud review as a statistically complete survey.&lt;/p&gt;
      &lt;p&gt;For each repeated issue, record the evidence, owner, corrective action, due date, and validation method. A response closes the public communication. A process change closes the operational loop.&lt;/p&gt;
      &lt;pre class=&quot;article-code&quot;&gt;&lt;code&gt;Theme: appointment wait time
Evidence period: July 2026
Reviews mentioning theme: 4
Locations affected: 1
Operational check: booking intervals vs actual service duration
Owner: clinic coordinator
Change: add a 10-minute buffer after long appointments
Validate: compare August wait-time mentions and front-desk log
Decision: keep / revise / revert&lt;/code&gt;&lt;/pre&gt;

      &lt;h2 id=&quot;measure-the-process-without-manipulating-the-rating&quot;&gt;Measure the process without manipulating the rating&lt;/h2&gt;
      &lt;ul&gt;
        &lt;li&gt;&lt;strong&gt;Request coverage:&lt;/strong&gt; eligible completed interactions that received one request.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Duplicate rate:&lt;/strong&gt; transactions or customers incorrectly asked twice.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Review volume:&lt;/strong&gt; new public reviews by week or month, shown separately from requests.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Response coverage:&lt;/strong&gt; reviews with a published business reply.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Response time:&lt;/strong&gt; median time from review detection to published reply.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Open recovery cases:&lt;/strong&gt; unresolved complaints with an accountable owner.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Theme recurrence:&lt;/strong&gt; repeated operational issues by service or location.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Corrections validated:&lt;/strong&gt; completed changes with evidence of whether they helped.&lt;/li&gt;
      &lt;/ul&gt;
      &lt;p&gt;Keep rating and total review count in the report because customers see them, but do not turn a five-star target into pressure on staff or customers. Google policy prohibits quotas that require staff to solicit a certain number of reviews and prohibits attempts to influence the rating or review content.&lt;/p&gt;

      &lt;h2 id=&quot;when-software-or-automation-becomes-useful&quot;&gt;When software or automation becomes useful&lt;/h2&gt;
      &lt;p&gt;Stay with the native setup when one location has modest volume, one person owns the queue, and review requests can be triggered from an existing receipt or thank-you message. Add a shared tool or automation when any of these become true:&lt;/p&gt;
      &lt;ul&gt;
        &lt;li&gt;completed services originate in several booking, POS, CRM, or support systems;&lt;/li&gt;
        &lt;li&gt;duplicate suppression cannot be handled reliably by the existing system;&lt;/li&gt;
        &lt;li&gt;several branches need location-specific links and owners;&lt;/li&gt;
        &lt;li&gt;privacy or safety keywords need an escalation path before a draft is approved;&lt;/li&gt;
        &lt;li&gt;the team needs one audit trail across requests, replies, cases, and corrections;&lt;/li&gt;
        &lt;li&gt;manual monthly theme reporting takes more time than the resulting decisions justify.&lt;/li&gt;
      &lt;/ul&gt;
      &lt;p&gt;Automation may prepare a request after a verified completion event, deduplicate it, select the correct branch link, and create an internal task when a review needs attention. Keep human approval for sensitive public replies. Do not use automation to generate fake reviews, identify only happy customers, publish unverified claims, or pressure staff toward rating targets.&lt;/p&gt;

      &lt;h2&gt;What not to do&lt;/h2&gt;
      &lt;ul&gt;
        &lt;li&gt;&lt;strong&gt;Do not review-gate.&lt;/strong&gt; A satisfaction score must not decide who receives the Google link.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Do not buy, trade, or reward reviews.&lt;/strong&gt; Discounts, gifts, free services, and contest entries are incentives.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Do not ask for five stars or named wording.&lt;/strong&gt; Ask for an honest experience without influencing the rating or text.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Do not set staff review quotas.&lt;/strong&gt; Measure whether the approved process runs, not how many reviews one employee extracts.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Do not share the primary owner's password.&lt;/strong&gt; Add named owners or managers and remove access when responsibilities change.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Do not copy customer records into an unlimited spreadsheet.&lt;/strong&gt; Keep only the fields, access, and retention the process needs.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Do not report every negative review.&lt;/strong&gt; Policy reporting is for policy violations, not ordinary disagreement.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Do not auto-publish sensitive replies.&lt;/strong&gt; Privacy, safety, legal, and extortion cases need human classification.&lt;/li&gt;
      &lt;/ul&gt;

      &lt;h2 id=&quot;verification-checklist&quot;&gt;Verification checklist&lt;/h2&gt;
      &lt;ul&gt;
        &lt;li&gt;The official review link opens the correct profile and location.&lt;/li&gt;
        &lt;li&gt;The same neutral eligibility rule covers positive and negative experiences.&lt;/li&gt;
        &lt;li&gt;No request offers an incentive, desired rating, required wording, or staff quota.&lt;/li&gt;
        &lt;li&gt;Customer-activity notifications reach the queue owner and backup.&lt;/li&gt;
        &lt;li&gt;Each profile user has an individual Google Account and appropriate role.&lt;/li&gt;
        &lt;li&gt;The request log has a declared purpose, minimal fields, restricted access, and deletion date.&lt;/li&gt;
        &lt;li&gt;Negative, privacy-sensitive, and policy cases have separate escalation paths.&lt;/li&gt;
        &lt;li&gt;Monthly review identifies recurring themes, owners, corrections, and validation.&lt;/li&gt;
      &lt;/ul&gt;
      &lt;p&gt;Review management is not the same as maximizing a score. The useful system gives every eligible customer a fair opportunity to speak, protects private information, and turns feedback into accountable changes. Pair it with the broader &lt;a rel=&quot;nofollow&quot; href=&quot;https://floxolab.com/seo/guides/local-seo-for-small-business&quot;&gt;local SEO baseline&lt;/a&gt; and use the &lt;a rel=&quot;nofollow&quot; href=&quot;https://floxolab.com/seo/tools/best-seo-tools-local-seo-philippines&quot;&gt;local SEO tools guide&lt;/a&gt; only when native profile management no longer covers the job.&lt;/p&gt;

      &lt;h2&gt;Sources checked&lt;/h2&gt;
      &lt;p&gt;Google review-link, request, reply, notification, access, fake-engagement, and Business Profile restriction guidance, plus Philippine data privacy principles, were verified against official sources on August 6, 2026.&lt;/p&gt;
      &lt;ul&gt;
        &lt;li&gt;&lt;a href=&quot;https://support.google.com/business/answer/16816815?hl=en&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Google Business Profile Help: create a review link or QR code&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;https://support.google.com/business/answer/3474050?hl=en&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Google Business Profile Help: manage customer reviews and replies&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;https://support.google.com/business/answer/7198436?hl=en&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Google Business Profile Help:&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
</description>
<category>Other</category>
<guid isPermaLink="true">https://coderlegion.com/25648/google-review-management-for-small-business</guid>
<pubDate>Thu, 17 Sep 2026 15:50:00 +0000</pubDate>
</item>
<item>
<title>The Benefits of Security and Governance in the Cloud</title>
<link>https://coderlegion.com/24090/the-benefits-of-security-and-governance-in-the-cloud</link>
<description>
&lt;p&gt;Hello, I'm Ganesh. I'm building &lt;em&gt;git-lrc&lt;/em&gt;, an AI code reviewer that runs on every commit. It is free, unlimited, and source-available on Github. &lt;a href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;Star git-lrc on GitHub&lt;/a&gt; to help more developers discover the project. Do give it a try and share your feedback for improving the product.&lt;/p&gt;

&lt;p&gt;Cloud providers offer built-in security capabilities that help organizations protect their applications and infrastructure. Depending on the cloud service model you choose, the level of security management changes.&lt;/p&gt;

&lt;p&gt;For example, with Infrastructure as a Service (IaaS), the cloud provider secures the physical infrastructure, while you are responsible for managing the operating system, software, and security updates. In Platform as a Service (PaaS) and Software as a Service (SaaS), the cloud provider handles more of these maintenance tasks, reducing the operational burden on customers.&lt;/p&gt;

&lt;p&gt;Cloud providers also offer protection against common threats such as Distributed Denial of Service (DDoS) attacks, helping applications remain available even during large-scale attacks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cloud Governance
&lt;/h2&gt;

&lt;p&gt;Cloud governance is the process of managing cloud resources so they comply with organizational policies and regulatory requirements. Cloud platforms provide built-in tools that make governance easier throughout the lifecycle of your resources.&lt;/p&gt;

&lt;h3&gt;
  
  
  Resource Templates
&lt;/h3&gt;

&lt;p&gt;Templates allow organizations to deploy resources using predefined configurations. This ensures that every deployment follows the same technical standards and reduces the chances of configuration errors.&lt;/p&gt;

&lt;h3&gt;
  
  
  Compliance Auditing
&lt;/h3&gt;

&lt;p&gt;Cloud platforms continuously monitor deployed resources to check whether they meet your organization's compliance requirements. If a resource doesn't comply with established policies, auditing tools can identify the issue and suggest remediation steps.&lt;/p&gt;

&lt;h3&gt;
  
  
  Automatic Updates
&lt;/h3&gt;

&lt;p&gt;Many cloud services automatically apply software patches and platform updates. Keeping systems up to date improves both security and governance while reducing the administrative effort required to maintain infrastructure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Governance Matters
&lt;/h2&gt;

&lt;p&gt;Establishing governance early helps organizations maintain a secure, compliant, and well-managed cloud environment as it grows. By using templates, compliance checks, and automated updates, teams can ensure resources remain consistent and aligned with organizational standards.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Security and governance are foundational pillars of a well-run cloud environment. Cloud providers shoulder a significant portion of security responsibilities &amp;mdash; from protecting physical infrastructure to defending against DDoS attacks &amp;mdash; but the extent of that coverage depends on the service model you adopt (IaaS, PaaS, or SaaS).&lt;/p&gt;

&lt;p&gt;Cloud governance tools such as resource templates, compliance auditing, and automatic updates give organizations the controls they need to enforce consistent policies, reduce human error, and stay aligned with regulatory requirements &amp;mdash; all without heavy manual overhead.&lt;/p&gt;

&lt;p&gt;The key takeaway is simple: &lt;strong&gt;start governance early&lt;/strong&gt;. Organizations that establish clear policies and leverage built-in cloud tooling from day one are far better positioned to scale securely and confidently as their infrastructure grows.&lt;/p&gt;

&lt;p&gt;Any feedback or contributors are welcome! It's online, source-available, and ready for anyone to use.&lt;/p&gt;

&lt;p&gt;&amp;#11088; &lt;a href=&quot;https://github.com/HexmosTech/git-lrc?utm_source=chatgpt.com&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;Star git-lrc on GitHub&lt;/a&gt;&lt;/p&gt;
</description>
<category>Other</category>
<guid isPermaLink="true">https://coderlegion.com/24090/the-benefits-of-security-and-governance-in-the-cloud</guid>
<pubDate>Fri, 14 Aug 2026 08:44:28 +0000</pubDate>
</item>
<item>
<title>Stop Implementing Authentication Inside Containers on Kubernetes</title>
<link>https://coderlegion.com/23251/stop-implementing-authentication-inside-containers-on-kubernetes</link>
<description>
&lt;a href=&quot;https://alexandre-vazquez.com/auth-inside-container-antipattern-kubernetes/&quot; title=&quot;Stop Implementing Authentication Inside Containers on Kubernetes&quot; rel=&quot;nofollow&quot;&gt;&lt;img width=&quot;1536&quot; height=&quot;1024&quot; src=&quot;https://mlk5tkvgfeoa.i.optimole.com/cb:s8WW.68/w:1536/h:1024/q:mauto/f:best/https://alexandre-vazquez.com/wp-content/uploads/2026/07/auth.avif&quot; class=&quot;webfeedsFeaturedVisual wp-post-image&quot; alt=&quot;Stop Implementing Authentication Inside Containers on Kubernetes&quot; style=&quot;display: block; margin: auto; margin-bottom: 5px;max-width: 100%;&quot; title=&quot;Stop Implementing Authentication Inside Containers on Kubernetes 6&quot;&gt;&lt;/a&gt;
&lt;p&gt;You have ten microservices running in Kubernetes. Each one validates JWTs, checks scopes, maintains sessions, and implements its own RBAC rules. One team uses &lt;code&gt;jsonwebtoken&lt;/code&gt; v8, another uses a custom Go library, a third rolled their own HMAC check because &amp;ldquo;it was simple.&amp;rdquo; They all accept &lt;code&gt;alg: none&lt;/code&gt;. Three accept RS256 and HS256 simultaneously.&lt;/p&gt;



&lt;p&gt;This is not a security posture. This is a distributed security liability &amp;mdash; and Kubernetes makes the problem worse, because the cluster creates an illusion of isolation that encourages teams to treat each Pod as a security boundary it was never designed to be.&lt;/p&gt;



&lt;p&gt;The pattern of embedding authentication and authorization logic inside individual containers is one of the most pervasive anti-patterns in Kubernetes-based microservices. It feels like ownership and simplicity. It is, in practice, inconsistency at scale &amp;mdash; and the blast radius of a single misconfiguration is your entire service portfolio.&lt;/p&gt;



&lt;p&gt;Kubernetes provides the primitives to fix this at the infrastructure layer: Ingress controllers, the Gateway API, service mesh sidecars, admission webhooks, and workload identity via SPIFFE. None of these require a line of auth code inside your application containers.&lt;/p&gt;



&lt;p&gt;This article explains why the anti-pattern exists, what&amp;rsquo;s wrong with it technically, and what the correct Kubernetes-native alternatives are &amp;mdash; with concrete implementation guidance and references to the standards and incidents that validate the argument.&lt;/p&gt;



&lt;hr class=&quot;wp-block-separator has-alpha-channel-opacity&quot;&gt;



&lt;h2 class=&quot;wp-block-heading&quot;&gt;The Anti-Pattern: What It Looks Like&lt;/h2&gt;



&lt;h3 class=&quot;wp-block-heading&quot;&gt;In-Application JWT Validation&lt;/h3&gt;



&lt;p&gt;Every service imports an auth library and validates tokens independently:&lt;/p&gt;



&lt;pre class=&quot;wp-block-code&quot;&gt;&lt;code&gt;# Pattern seen in thousands of microservices
from jose import jwt

def authenticate(token: str):
    payload = jwt.decode(token, SECRET_KEY, algorithms=[&quot;HS256&quot;])
    return payload[&quot;sub&quot;]&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;Variations include:&lt;/p&gt;



&lt;ul class=&quot;wp-block-list&quot;&gt;

&lt;li&gt;&lt;strong&gt;Algorithm confusion&lt;/strong&gt;: accepting both &lt;code&gt;HS256&lt;/code&gt; and &lt;code&gt;RS256&lt;/code&gt;, or letting the token header drive verification behavior instead of pinning acceptable algorithms server-side. This is a distinct JWT implementation failure class, documented extensively by &lt;a href=&quot;https://portswigger.net/web-security/jwt&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;PortSwigger on JWT attacks&lt;/a&gt; and &lt;a href=&quot;https://www.rfc-editor.org/rfc/rfc8725&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;RFC 8725&lt;/a&gt;&lt;/li&gt;


&lt;li&gt;&lt;strong&gt;&lt;code&gt;alg: none&lt;/code&gt; bypass&lt;/strong&gt;: libraries that accept unsigned tokens when &lt;code&gt;alg&lt;/code&gt; is set to &lt;code&gt;none&lt;/code&gt;. This is a documented attack vector in &lt;a href=&quot;https://auth0.com/blog/critical-vulnerabilities-in-json-web-token-libraries/&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Auth0&amp;rsquo;s JWT security analysis&lt;/a&gt;&lt;/li&gt;


&lt;li&gt;&lt;strong&gt;Missing &lt;code&gt;exp&lt;/code&gt; / &lt;code&gt;iss&lt;/code&gt; / &lt;code&gt;aud&lt;/code&gt; validation&lt;/strong&gt;: trusting a valid signature without checking whether the token is expired, for the right audience, or from the right issuer&lt;/li&gt;


&lt;li&gt;&lt;strong&gt;Key confusion attacks&lt;/strong&gt;: accepting a public RS256 key as an HS256 symmetric secret&lt;/li&gt;

&lt;/ul&gt;



&lt;h3 class=&quot;wp-block-heading&quot;&gt;Session State in Every Service&lt;/h3&gt;



&lt;p&gt;When services maintain session state directly, they duplicate logic that has no business being duplicated &amp;mdash; cookie validation, refresh token flows, PKCE verification &amp;mdash; and each implementation diverges over time.&lt;/p&gt;



&lt;h3 class=&quot;wp-block-heading&quot;&gt;RBAC Reimplemented Per Service&lt;/h3&gt;



&lt;p&gt;Authorization rules (&amp;ldquo;can this user access this resource?&amp;rdquo;) end up embedded in service logic, mixed with business logic, tested inconsistently, and impossible to audit across the portfolio.&lt;/p&gt;



&lt;hr class=&quot;wp-block-separator has-alpha-channel-opacity&quot;&gt;



&lt;h2 class=&quot;wp-block-heading&quot;&gt;Why This Is a Structural Problem&lt;/h2&gt;



&lt;h3 class=&quot;wp-block-heading&quot;&gt;1. The Vulnerability Surface Scales With Your Service Count&lt;/h3&gt;



&lt;p&gt;Each new microservice is a new JWT validation surface. A single incorrect library configuration &amp;mdash; an unvalidated &lt;code&gt;alg&lt;/code&gt;, a missing &lt;code&gt;aud&lt;/code&gt; check &amp;mdash; is an authentication bypass affecting that entire service. With ten services, you have ten potential misconfigurations. With a hundred services, the probability that at least one is misconfigured approaches certainty.&lt;/p&gt;



&lt;p&gt;The &lt;a href=&quot;https://cheatsheetseries.owasp.org/cheatsheets/Kubernetes_Security_Cheat_Sheet.html&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;OWASP Kubernetes Security Cheat Sheet&lt;/a&gt; and &lt;a href=&quot;https://cheatsheetseries.owasp.org/cheatsheets/Microservices_Security_Cheat_Sheet.html&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;OWASP Microservices Security Cheat Sheet&lt;/a&gt; both identify in-service auth as a primary attack surface in microservices environments. &lt;a href=&quot;https://doi.org/10.6028/NIST.SP.800-204&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;NIST SP 800-204&lt;/a&gt; and its companion &lt;a href=&quot;https://doi.org/10.6028/NIST.SP.800-204A&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;NIST SP 800-204A&lt;/a&gt; on DevSecOps make the same argument: &lt;a rel=&quot;nofollow&quot; href=&quot;https://alexandre-vazquez.com/kubernetes-security-best-practices/&quot;&gt;security controls belong at infrastructure boundaries&lt;/a&gt;, not inside application code.&lt;/p&gt;



&lt;h3 class=&quot;wp-block-heading&quot;&gt;2. Maintenance Cost Is Multiplicative&lt;/h3&gt;



&lt;p&gt;When a JWT vulnerability is disclosed &amp;mdash; and they are disclosed regularly &amp;mdash; you update one library in one service. Then another. Then you discover service C is pinned to an old version because it has a transitive dependency conflict. Meanwhile the vulnerability is exploitable in production.&lt;/p&gt;



&lt;p&gt;The &lt;a href=&quot;https://github.com/cncf/tag-security/blob/main/security-whitepaper/v2/cloud-native-security-whitepaper.md&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;CNCF Cloud Native Security Whitepaper&lt;/a&gt; frames this directly: security controls implemented redundantly across services create maintenance overhead that teams cannot sustain, leading to version drift and policy divergence.&lt;/p&gt;



&lt;h3 class=&quot;wp-block-heading&quot;&gt;3. Centralized Policy Is Impossible to Enforce&lt;/h3&gt;



&lt;p&gt;When policy is in code &amp;mdash; even well-factored library code &amp;mdash; it cannot be changed atomically across services. A policy update requires a coordinated deployment across every affected service. In practice, services deploy on different schedules, managed by different teams, with different testing cycles. The result is that at any given moment, some fraction of your services are running different authorization rules.&lt;/p&gt;



&lt;p&gt;This is the core argument in Google&amp;rsquo;s &lt;a href=&quot;https://cloud.google.com/beyondcorp&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;BeyondCorp&lt;/a&gt; model and the &lt;a href=&quot;https://doi.org/10.6028/NIST.SP.800-207&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Zero Trust Architecture guidance from NIST SP 800-207&lt;/a&gt;: authentication and authorization decisions should be made by a centralized, auditable policy enforcement point &amp;mdash; not distributed across workloads.&lt;/p&gt;



&lt;h3 class=&quot;wp-block-heading&quot;&gt;4. Secrets Distribution Is a Problem You Don&amp;rsquo;t Need&lt;/h3&gt;



&lt;p&gt;If every service validates JWTs, every service needs the signing key (for symmetric algorithms) or the public key (for asymmetric). Distributing and rotating signing keys across a fleet of microservices is an operational burden with meaningful blast radius: a leaked symmetric key compromises every service holding it.&lt;/p&gt;



&lt;p&gt;The &lt;a href=&quot;https://spiffe.io/docs/latest/spiffe-about/overview/&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;CNCF SPIFFE/SPIRE project&lt;/a&gt; was built specifically to solve this class of problem: workload identity should be cryptographically attested, not rely on secrets distributed to application code.&lt;/p&gt;



&lt;hr class=&quot;wp-block-separator has-alpha-channel-opacity&quot;&gt;



&lt;h2 class=&quot;wp-block-heading&quot;&gt;The Real-World Incidents&lt;/h2&gt;



&lt;h3 class=&quot;wp-block-heading&quot;&gt;The &lt;code&gt;alg: none&lt;/code&gt; Class&lt;/h3&gt;



&lt;p&gt;In 2015, critical vulnerabilities in JWT libraries from &lt;a href=&quot;https://auth0.com/blog/critical-vulnerabilities-in-json-web-token-libraries/&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Auth0&lt;/a&gt; affecting Python, PHP, Node.js, Ruby, Java, and .NET allowed attackers to forge tokens by setting &lt;code&gt;alg: none&lt;/code&gt;. The signature was not verified. The vulnerability was present in applications that had copied JWT validation code from tutorials or used unpatched libraries &amp;mdash; exactly the pattern that in-service auth produces at scale.&lt;/p&gt;



&lt;h3 class=&quot;wp-block-heading&quot;&gt;Java&amp;rsquo;s Psychic Signatures (CVE-2022-21449)&lt;/h3&gt;



&lt;p&gt;&lt;a href=&quot;https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21449&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;CVE-2022-21449&lt;/a&gt; affected ECDSA signature verification in Oracle Java SE and GraalVM, including &lt;code&gt;java.security.Signature&lt;/code&gt; paths used by higher-level libraries. The bug allowed certain malformed ECDSA signatures to verify when they should not. JWT validation was in scope only when the deployment used an affected Java runtime and ECDSA-signed tokens, for example ES256. A gateway would help only if verification happened on a patched or unaffected runtime at the gateway instead of inside every Java service.&lt;/p&gt;



&lt;h3 class=&quot;wp-block-heading&quot;&gt;CVE-2023-2728 (Kubernetes Mountable Secrets Bypass)&lt;/h3&gt;



&lt;p&gt;&lt;a href=&quot;https://www.cve.org/CVERecord?id=CVE-2023-2728&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;CVE-2023-2728&lt;/a&gt; was not an ImagePolicyWebhook outage behavior. It was a Kubernetes API server issue where users could use ephemeral containers to bypass the mountable secrets policy enforced by the ServiceAccount admission plugin. Clusters were affected only when the ServiceAccount admission plugin, the &lt;code&gt;kubernetes.io/enforce-mountable-secrets&lt;/code&gt; annotation, and ephemeral containers were used together. The adjacent ImagePolicyWebhook issue was &lt;a href=&quot;https://github.com/kubernetes/kubernetes/issues/118640&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;CVE-2023-2727&lt;/a&gt;, also involving ephemeral containers, but it is a separate CVE.&lt;/p&gt;



&lt;h3 class=&quot;wp-block-heading&quot;&gt;The Uber API Gateway Evolution&lt;/h3&gt;



&lt;p&gt;Uber&amp;rsquo;s engineering blog describes its API gateway as a centralized layer for routing, protocol conversion, rate limiting, load shedding, header propagation, security auditing, and user access blocking. That supports the architectural point here: high-volume platforms move cross-cutting controls into shared infrastructure. The public source does not prove that Uber migrated specifically from per-service authentication to gateway authentication, so that stronger claim should not be made.&lt;/p&gt;



&lt;h3 class=&quot;wp-block-heading&quot;&gt;Netflix Zuul&lt;/h3&gt;



&lt;p&gt;Netflix&amp;rsquo;s &lt;a href=&quot;https://github.com/Netflix/zuul&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Zuul&lt;/a&gt; is an L7 gateway for dynamic routing, monitoring, resiliency, security, and related edge concerns. Netflix&amp;rsquo;s own Zuul posts list authentication among common edge-service uses, but they do not frame Zuul primarily as a case study in eliminating per-service auth. Treat it as evidence that authentication is a natural edge concern at scale, not as proof of a specific migration story.&lt;/p&gt;



&lt;hr class=&quot;wp-block-separator has-alpha-channel-opacity&quot;&gt;



&lt;h2 class=&quot;wp-block-heading&quot;&gt;The Alternatives&lt;/h2&gt;



&lt;p&gt;Use these as complementary controls, not as a single replacement for all authentication and authorization logic:&lt;/p&gt;



&lt;figure class=&quot;wp-block-table&quot;&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Alternative&lt;/th&gt;&lt;th&gt;When to use it&lt;/th&gt;&lt;th&gt;What it solves&lt;/th&gt;&lt;th&gt;Principal trade-off&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;API Gateway / Edge Auth&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;External API clients, public ingress, partner integrations, mixed auth mechanisms at the boundary&lt;/td&gt;&lt;td&gt;Central JWT/API-key/OAuth2 validation, rate limiting, request shaping, and identity header propagation before traffic reaches services&lt;/td&gt;&lt;td&gt;Does not secure east-west service calls by itself; trusted headers require strict network boundaries&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Service Mesh mTLS&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Service-to-service traffic inside the cluster, especially across teams or sensitive domains&lt;/td&gt;&lt;td&gt;Workload identity, automatic mTLS, peer authentication, and proxy-level authorization policy&lt;/td&gt;&lt;td&gt;Adds data-plane/control-plane complexity and operational coupling to sidecars or ambient mesh components&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;OAuth2 Proxy&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Browser-facing internal apps that need OIDC login, redirects, cookies, and session handling&lt;/td&gt;&lt;td&gt;Delegates login/session management to a reverse proxy and forwards authenticated identity headers&lt;/td&gt;&lt;td&gt;Best for HTTP/browser flows; not a general machine-to-machine authorization system&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;OPA&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Complex, auditable, frequently changing authorization rules&lt;/td&gt;&lt;td&gt;Separates policy decisions from application releases and can run as sidecar, service, ext_authz backend, or admission control via Gatekeeper&lt;/td&gt;&lt;td&gt;Policy/data distribution and failure behavior must be designed deliberately&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;SPIFFE/SPIRE&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Multi-cluster, multi-cloud, or meshless environments that need portable workload identity&lt;/td&gt;&lt;td&gt;Issues short-lived workload identities without application-managed shared secrets&lt;/td&gt;&lt;td&gt;Provides identity, not business authorization; needs registration and attestation lifecycle management&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/figure&gt;



&lt;h3 class=&quot;wp-block-heading&quot;&gt;Option 1: API Gateway (Edge Auth)&lt;/h3&gt;



&lt;p&gt;An API Gateway sits at the perimeter and handles authentication before a request reaches any downstream service. Services receive pre-validated identity in a trusted header.&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;What it does:&lt;/strong&gt; &amp;ndash; Validates JWTs, API keys, OAuth2 tokens &amp;ndash; Enforces rate limiting per identity &amp;ndash; Strips and re-adds Authorization headers as needed &amp;ndash; Routes to upstream services with verified identity headers&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;When to use it:&lt;/strong&gt; &amp;ndash; North-south traffic (external clients &amp;rarr; cluster) &amp;ndash; Mixed authentication mechanisms (JWT + API key + mTLS) at the Ingress layer &amp;ndash; Teams that want to centralize auth policy without rolling out a full service mesh&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;Tools:&lt;/strong&gt;&lt;/p&gt;



&lt;p&gt;&lt;a href=&quot;https://documentation.gravitee.io/&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Gravitee.io API Gateway&lt;/a&gt; can be deployed on Kubernetes via its &lt;a href=&quot;https://documentation.gravitee.io/apim/getting-started/install-on-kubernetes&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Helm chart&lt;/a&gt; and integrates with the &lt;a href=&quot;https://documentation.gravitee.io/apim/getting-started/configuration/configure-the-kubernetes-gateway-api&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Kubernetes Gateway API&lt;/a&gt;:&lt;/p&gt;



&lt;pre class=&quot;wp-block-code&quot;&gt;&lt;code&gt;helm repo add graviteeio &lt;a href=&quot;https://helm.gravitee.io&quot; rel=&quot;nofollow&quot;&gt;https://helm.gravitee.io&lt;/a&gt;
helm install gravitee-apim graviteeio/apim \
  --namespace gravitee \
  --create-namespace \
  --set gateway.replicaCount=2 \
  --set gateway.ingress.enabled=true \
  --set gateway.ingress.hosts[0]=api.example.com&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;Once deployed, authentication policies are declared on the &lt;code&gt;ApiV4&lt;/code&gt; CRD &amp;mdash; no application code involved:&lt;/p&gt;



&lt;pre class=&quot;wp-block-code&quot;&gt;&lt;code&gt;apiVersion: gravitee.io/v1alpha1
kind: ApiV4
metadata:
  name: payment-api
  namespace: gravitee
spec:
  name: &quot;Payment API&quot;
  type: PROXY
  listeners:
    - type: HTTP
      paths:
        - path: /v1/payments
      entrypoints:
        - type: http-proxy
  endpointGroups:
    - name: default
      type: http-proxy
      endpoints:
        - name: upstream
          type: http-proxy
          configuration:
            target: &lt;a href=&quot;http://payment-service.production.svc.cluster.local:8080&quot; rel=&quot;nofollow&quot;&gt;http://payment-service.production.svc.cluster.local:8080&lt;/a&gt;
  flows:
    - name: JWT validation
      enabled: true
      request:
        - policy: jwt
          enabled: true
          configuration:
            signature: RSA_RS256
            publicKeyResolver: JWKS_URL
            jwksUrl: &lt;a href=&quot;https://idp.example.com/.well-known/jwks.json&quot; rel=&quot;nofollow&quot;&gt;https://idp.example.com/.well-known/jwks.json&lt;/a&gt;
            checkTokenRevocation: true
            requiredClaims:
              - name: aud
                value: payment-api
        - policy: rate-limit
          enabled: true
          configuration:
            rate:
              limit: 100
              periodTime: 1
              periodTimeUnit: MINUTES&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;Gravitee&amp;rsquo;s &lt;a href=&quot;https://documentation.gravitee.io/apim/getting-started/configuration/configure-the-kubernetes-operator&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Kubernetes operator&lt;/a&gt; reconciles &lt;code&gt;ApiV4&lt;/code&gt; resources against the gateway, making API policy a first-class GitOps object &amp;mdash; versioned, reviewed, and deployed the same way as any other Kubernetes manifest.&lt;/p&gt;



&lt;p&gt;Other Kubernetes-native options: &lt;a href=&quot;https://www.getambassador.io/docs/emissary&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Emissary-Ingress&lt;/a&gt; (formerly Ambassador) with its &lt;code&gt;AuthService&lt;/code&gt; CRD; &lt;a href=&quot;https://doc.traefik.io/traefik/middlewares/http/forwardauth/&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Traefik&lt;/a&gt; with &lt;code&gt;ForwardAuth&lt;/code&gt; middleware on &lt;code&gt;IngressRoute&lt;/code&gt; resources.&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;Limitations:&lt;/strong&gt; API Gateways handle north-south traffic. They don&amp;rsquo;t address east-west (service-to-service) authentication inside the cluster.&lt;/p&gt;



&lt;hr class=&quot;wp-block-separator has-alpha-channel-opacity&quot;&gt;



&lt;h3 class=&quot;wp-block-heading&quot;&gt;Option 2: Service Mesh (East-West mTLS + Auth)&lt;/h3&gt;



&lt;p&gt;A service mesh provides mutual TLS between every service pair and enforces authorization policy at the sidecar proxy, without any application code changes.&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;What it does:&lt;/strong&gt; &amp;ndash; Automatic mTLS between all service-to-service calls &amp;ndash; Workload identity via X.509 certificates (SPIFFE SVIDs) &amp;ndash; Fine-grained AuthorizationPolicy at the Envoy sidecar &amp;ndash; JWT validation at the proxy, not the application&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;Istio Implementation:&lt;/strong&gt;&lt;/p&gt;



&lt;p&gt;Istio uses &lt;a href=&quot;https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/ext_authz_filter&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Envoy&amp;rsquo;s ext_authz filter&lt;/a&gt; and native &lt;a rel=&quot;nofollow&quot; href=&quot;https://alexandre-vazquez.com/istio-serviceentry-explained/&quot;&gt;&lt;code&gt;RequestAuthentication&lt;/code&gt; + &lt;code&gt;AuthorizationPolicy&lt;/code&gt; CRDs&lt;/a&gt;:&lt;/p&gt;



&amp;lt;pre class=&quot;wp-block-c
</description>
<category>Other</category>
<guid isPermaLink="true">https://coderlegion.com/23251/stop-implementing-authentication-inside-containers-on-kubernetes</guid>
<pubDate>Sat, 25 Jul 2026 10:00:00 +0000</pubDate>
</item>
<item>
<title>You Don't Own Your Phone. You Don't Own Your Data. You Barely Own Your Opinions.</title>
<link>https://coderlegion.com/23413/you-dont-own-your-phone-you-dont-own-your-data-you-barely-own-your-opinions</link>
<description>&lt;p&gt;&lt;em&gt;Fair warning before the disclaimers even start: this one's a little long, a little uncomfortable, and not really written for someone who's going to bounce after the first two paragraphs. If you're still here by the end, you'll know things about your own phone that most people never bother to check.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;A disclaimer before we start, because apparently that's how it works now: this is one person's opinion, built on public facts and the collective paranoia of people who still bother reading terms of service. I'm not trying to cancel Google — please, Google, I'm a competent engineer, hire me, I'm kidding, I'm not kidding. I just think somebody should say the quiet part out loud before saying it becomes a compliance violation.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;A bigger, more boring disclaimer, because this one actually matters: everything below is built on real, checkable sources — court verdicts, regulator fines, academic research, and independent audit tools like Exodus Privacy. Where a specific claim couldn't be independently verified, I've labeled it explicitly as a theory or an unverified report, not a fact, and I'd rather under-claim than dress up a rumor as a courtroom finding. I also touch on identity-verification laws and proposals from a few different countries — Vietnam, the EU, Russia — purely as a technical and factual comparison of what each is doing and when. That's not a scorecard, and it's not me passing judgment on any government, political system, or policy choice. I'm not qualified to rule on sovereign lawmaking and I'm not trying to. This is a breakdown of mechanisms, not a verdict on the people who built them.&lt;/em&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;the-myth-everyone-gets-wrong-so-let-s-kill-it-properly-&quot;&gt;The myth everyone gets wrong (so let's kill it properly)&lt;/h3&gt;
&lt;p&gt;Let's start with the thing you &lt;em&gt;think&lt;/em&gt; you know: &quot;my phone is listening to me.&quot; You said &quot;air fryer&quot; out loud once and an ad for an air fryer showed up. Spooky, right?&lt;/p&gt;
&lt;p&gt;It's not spooky. It's worse.&lt;/p&gt;
&lt;p&gt;Every major platform — Meta, Google, Apple — has said on record, repeatedly, under oath in Meta's case, that they don't use your microphone to target ads. Independent security researchers have tested this claim for years, tearing apart thousands of apps looking for secret always-on listening, and they keep finding basically nothing. No hidden audio pipeline running in the background of TikTok. No microphone spyware baked into Instagram.&lt;/p&gt;
&lt;p&gt;Why? Because they don't need it. They already know you searched for kitchen gadgets three times last week, follow four cooking accounts, paused two seconds longer on a fryer ad last month, and that your friend with identical shopping habits just bought one. That's not surveillance through a microphone. That's a statistical ghost of you, built from years of clicks and dwell time, predicting your next move before you've made it. Ad tech doesn't need your voice. It has something better.&lt;/p&gt;
&lt;p&gt;That said — the myth isn't &lt;em&gt;entirely&lt;/em&gt; fantasy. A marketing outfit branded &quot;Active Listening&quot; got dragged in front of the FTC for claiming it could target ads via smart-device microphones in real time; the &quot;service&quot; turned out to be repackaged data-broker email lists sold at a markup, but the pitch decks named Google as a partner. Apple paid $95 million in a class-action settlement over Siri recordings potentially reaching third parties. Amazon is currently defending a federal class action in Seattle over Alexa recordings allegedly retained and used to train its AI models.&lt;/p&gt;
&lt;p&gt;So no, your phone probably isn't listening to your dinner plans. The industry built entirely around &lt;em&gt;not needing to&lt;/em&gt; listen is more unsettling, because there's no toggle for &quot;please stop knowing me.&quot;&lt;/p&gt;
&lt;h3 id=&quot;the-receipts-because-trust-me-isn-t-a-source&quot;&gt;The receipts, because &quot;trust me&quot; isn't a source&lt;/h3&gt;
&lt;p&gt;If this sounds like tinfoil-hat energy, here's what regulators and juries have actually done about it in the last few years — not allegations, verdicts and settled fact:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Meta / Cambridge Analytica.&lt;/strong&gt; A UK firm harvested the data of roughly 87 million Facebook users through a single quiz app, built psychological profiles from it, and sold political targeting off the back of it. The FTC fined Meta $5 billion — still one of the largest privacy penalties ever issued against a single company.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Meta / Flo period-tracking app.&lt;/strong&gt; In August 2025, a federal jury found Meta liable under a 1967 California wiretapping law for secretly collecting menstrual and pregnancy data from the Flo app — cycle dates, whether users were trying to conceive — through an embedded software kit, then using it for ad targeting. The jury needed three hours to decide Meta had eavesdropped without consent. Damages could run into the billions once the full class is counted.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Google / &quot;Web &amp;amp; App Activity.&quot;&lt;/strong&gt; In September 2025, a San Francisco jury ordered Google to pay $425.7 million after finding it kept collecting data from about 98 million users across an eight-year stretch — even after those users had explicitly flipped the privacy switch meant to stop it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Amazon / Alexa Voice ID.&lt;/strong&gt; A federal judge in Chicago certified a class of roughly 1.18 million Illinois Alexa users in November 2025, over allegations that Amazon built biometric &quot;voiceprints&quot; from their voices without the written consent Illinois law requires.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Meta and Yandex / the localhost trick.&lt;/strong&gt; In 2025, researchers caught Meta's Facebook and Instagram apps — and Yandex's apps, reportedly since 2017 — quietly listening on local network ports on Android phones. Any website with a Meta Pixel or Yandex Metrica tracker could use this to silently hand your anonymous browsing session to the app sitting on your phone and stitch it to your actual identity. It worked straight through incognito mode, cookie clearing, and ad-ID resets — the three things privacy-conscious people are told will protect them. Meta paused it within days of the research going public, calling it a &quot;miscommunication&quot; about Google's policies.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;GDPR, cumulatively.&lt;/strong&gt; European regulators have now handed out more than €7 billion in fines since 2018, including a €1.2 billion penalty against Meta for unlawful US data transfers and €530 million against TikTok for sending EU user data to China. Enforcement isn't slowing down — more fines have hit small and mid-sized companies in the last three years than in GDPR's entire first five.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;None of this required a conspiracy theory. It required a courtroom, a jury, and people willing to read the fine print out loud.&lt;/p&gt;
&lt;h3 id=&quot;vk-the-eastern-giant-nobody-in-the-west-is-watching&quot;&gt;VK: the eastern giant nobody in the West is watching&lt;/h3&gt;
&lt;p&gt;Everything above is Western Big Tech getting dragged into courtrooms, mostly because Western courtrooms exist for that purpose and Western journalists chase that beat. But swap hemispheres and you find a mirror image: VKontakte (VK), the dominant social network across Russia and much of the CIS, running the same playbook with a different flag on it.&lt;/p&gt;
&lt;p&gt;Independent app-auditing tools like Exodus Privacy — which do static analysis on Android APKs to catalogue embedded tracking SDKs and requested permissions rather than take a developer's word for it — put VK's official Android app at &lt;strong&gt;16 separate tracker SDKs&lt;/strong&gt; and &lt;strong&gt;99 requested permissions&lt;/strong&gt; in its most recent scanned build (&lt;a rel=&quot;nofollow&quot; href=&quot;https://reports.exodus-privacy.eu.org/en/reports/com.vkontakte.android/latest/&quot;&gt;full report here&lt;/a&gt; — go look yourself, don't take my word for it). The tracker list alone reads like a cross-section of the entire ad industry: Google AdMob and Firebase Analytics, Yandex Ad, Huawei's HMS Core (which bundles location, advertising, and analytics in one package), plus ad-mediation networks like ironSource, Mintegral, and Unity3d Ads, alongside VK's own first-party identification SDK. The permissions list goes well past what a messaging-and-newsfeed app needs to function: precise GPS location, reading your call log, reading and writing your contacts and calendar (including a permission that explicitly lets the app &quot;send email to guests without owners' knowledge&quot; when it modifies calendar events), reading your phone number and device identity, recording audio, using the camera, and reading fitness data like step count and calories burned. Not all 99 are sinister on their own — plenty are mundane plumbing every app needs — but stacked together with 16 separate third-party trackers quietly reporting home, it's a genuinely large surface area for a platform whose stated job is &quot;let people message their friends.&quot; Worth being precise about what VK actually is here, because it matters for how you read the rest of this: VK isn't just a private company that happens to be popular in Russia, it's a platform with formal ties to the Russian state and legal obligations to cooperate with its authorities on request, and unlike Meta or WhatsApp, VK's messages carry no end-to-end encryption at all — meaning that data, once collected, isn't just sitting in a corporate server somewhere abstract, it's structurally reachable by a government. That's a documented, publicly reported fact about how the platform is built and regulated, not a political opinion about Russia, and I'd say the exact same thing about any platform, in any country, built the same way. So if you're weighing which regional giant to worry about, the honest answer is: don't pick a side. East and West both built the same machine — they just answer to different governments when the machine gets audited.&lt;/p&gt;
&lt;h3 id=&quot;a-theory-worth-reading-not-a-verified-fact&quot;&gt;A theory worth reading, not a verified fact&lt;/h3&gt;
&lt;p&gt;While we're here — a claim that's been floating around tech circles that I want to flag &lt;em&gt;as&lt;/em&gt; a claim, not smuggle in as fact: reports have circulated alleging that in 2026, Meta ran an internal program collecting employee activity — keystrokes, screen content, even messages — from company laptops, ostensibly to train AI systems, and that some of those records ended up visible to a far larger internal audience than intended, triggering an employee petition. I haven't been able to independently verify the specifics — the numbers attached to it move depending on which forum you read — so take it exactly as advertised: an interesting, plausible-sounding story making the rounds, not a courtroom fact like the ones above. If true, it's the same surveillance logic Big Tech applies to its users, just pointed inward at the people building the tools. If it's exaggerated, it's still a useful thought experiment: what happens when the company that profiles you for a living starts applying the same instincts to its own staff?&lt;/p&gt;
&lt;h3 id=&quot;the-data-doesn-t-have-to-be-sold-to-end-up-in-the-wrong-hands&quot;&gt;The data doesn't have to be sold to end up in the wrong hands&lt;/h3&gt;
&lt;p&gt;Right now, while you're reading this sentence, a screenshot of somebody's desktop is sitting on a server they never explicitly agreed to. Somewhere, a password nobody's changed in five years is sitting in a database that already leaked once. Statistically, given how many billions of records are already circulating, the odds that none of it is yours are getting worse every year, not better.&lt;/p&gt;
&lt;p&gt;Here's the part that ties everything above together, and it's arguably the most important one: none of this requires a company to be evil on purpose. Every dataset described in this post — location history, voiceprints, screenshots, browsing profiles, passport scans — sits somewhere on a server. And servers get breached. Constantly. At a scale that's honestly hard to hold in your head.&lt;/p&gt;
&lt;p&gt;2025 alone produced the largest credential leak ever recorded: roughly 16 billion login records — usernames, passwords, session tokens — pulled together from infostealer malware infections across services including Apple, Google, Facebook, and Telegram, surfacing on criminal marketplaces in June 2025. Separately, a data broker called National Public Data lost roughly 2.9 billion records covering an estimated 170 million people — full names, Social Security numbers, decades of address history (&lt;a rel=&quot;nofollow&quot; href=&quot;https://www.ibm.com/think/news/national-public-data-breach-publishes-private-data-billions-us-citizens&quot;&gt;IBM's writeup of the incident is worth a read&lt;/a&gt;) — and that dataset kept circulating on dark web markets throughout 2025, more than a year after the original breach. Qantas got hit in 2025 too: attackers social-engineered their way into a third-party customer service platform in June, and after the airline refused to pay a ransom, dumped roughly 5.7 million customer records — names, emails, birth dates, frequent-flyer numbers — onto the dark web that October (&lt;a rel=&quot;nofollow&quot; href=&quot;https://www.cyberdaily.au/security/12759-qantas-hackers-dump-more-than-5-million-customer-records-to-clear-and-darkweb-leak-sites&quot;&gt;Qantas's own public breach timeline confirms it&lt;/a&gt;). None of these companies wanted this to happen. It happened anyway, because a large enough pile of valuable data is, by definition, a target worth attacking.&lt;/p&gt;
&lt;p&gt;And this isn't hypothetical for the platform we just spent a whole section on. VK has been breached, leaked, or scraped repeatedly across more than a decade: around 100 million account credentials — plaintext passwords included — were stolen and put up for sale on the dark web for the price of a fast-food meal back in 2016 (&lt;a rel=&quot;nofollow&quot; href=&quot;https://haveibeenpwned.com/Breach/VK&quot;&gt;Have I Been Pwned has the full record&lt;/a&gt;); over 32 million scraped and API-pulled records, including data from supposedly private and closed profiles, surfaced in a 2022 leak; more than 390 million user records were dumped on a hacking forum in September 2024 (&lt;a rel=&quot;nofollow&quot; href=&quot;https://cybernews.com/news/russian-state-owned-social-network-vk-breached/&quot;&gt;Cybernews covered it in detail&lt;/a&gt;); and as recently as February 2026, researchers found malicious Chrome extensions had hijacked over half a million VK accounts to spread malware and manipulate security tokens. Whatever VK collects doesn't just sit in a vault under VK's control forever — history shows it eventually ends up copy-pasted onto a forum where anyone with a few dollars in cryptocurrency can buy it. And once your name, phone number, location history, or password is sitting in a criminal marketplace, it isn't used to sell you sneakers anymore. It's used for account takeovers, SIM-swap fraud, blackmail, and identity theft — by people with considerably worse intentions than an ad network.&lt;/p&gt;
&lt;p&gt;This is the actual argument for minimizing what gets collected in the first place, and it has nothing to do with distrusting any single company's intentions. It's just math: the less data exists about you in any one place, the less there is to steal when — not if — that place eventually gets broken into.&lt;/p&gt;
&lt;h3 id=&quot;windows-would-like-to-remember-everything-you-ve-ever-looked-at&quot;&gt;Windows would like to remember everything you've ever looked at&lt;/h3&gt;
&lt;p&gt;Microsoft shipped a feature that screenshots your desktop every few seconds and uses on-device AI to let you search your own life like a browser history. It's called Recall. The first version stored everything in a folder, unencrypted, extractable by a two-minute script researchers named — I am not making this up — &quot;TotalRecall.&quot; After the backlash, Microsoft rebuilt it: encrypted, tied to Windows Hello, wrapped in a hardware-isolated enclave, off by default.&lt;/p&gt;
&lt;p&gt;Great. Except security researchers have gone back in more than once and found new ways to reach the stored data anyway — most recently in early 2026. The pattern repeats: Microsoft hardens it, someone breaks it again, Microsoft patches it. The core problem was never really the encryption implementation. A running photographic log of everything you've ever typed or clicked is an extraordinarily attractive target no matter how good the lock is. A vault is still a vault worth robbing.&lt;/p&gt;
&lt;h3 id=&quot;plot-twist-your-no-logs-vpn-might-have-a-footnote&quot;&gt;Plot twist: your &quot;no-logs&quot; VPN might have a footnote&lt;/h3&gt;
&lt;p&gt;Quick detour, because you're probably thinking &quot;fine, I'll just get a VPN.&quot; Good instinct. Bad ending, sometimes.&lt;/p&gt;
&lt;p&gt;I actually did this — emailed a mid-market paid VPN provider (Russian-jurisdiction, &quot;no-logs&quot; is literally in their marketing) with one clean question: &lt;em&gt;do you store IP addresses and connection timestamps, and can you confirm no-logs in writing?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Their first reply: &lt;strong&gt;&quot;We don't store or share client data with third parties.&quot;&lt;/strong&gt; Clean. Confident. Case closed, right?&lt;/p&gt;
&lt;p&gt;So I sent back their own privacy policy. Turns out their own terms define &quot;processing&quot; — using the exact wording from Russia's data protection law — as including &lt;em&gt;collection, storage, and retention.&lt;/em&gt; And their own clauses say IP addresses and login timestamps get &quot;processed.&quot; And a separate clause says processing happens on Russian territory. And another says data gets handed over if Russian law requires it.&lt;/p&gt;
&lt;p&gt;Their second reply, paraphrased because their actual answer ran three defensive paragraphs: &lt;em&gt;&quot;technically it's only in RAM, only for the session, destroyed after you disconnect, and we're legally required to use that wording from the law, we can't change it.&quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Here's the part that matters and takes five seconds to understand: &lt;strong&gt;RAM is still storage.&lt;/strong&gt; If your IP and timestamp exist anywhere a system can read them — disk or memory, doesn't matter — while your session is active, and that system sits inside a jurisdiction that can legally compel a live extraction, then &quot;no-logs&quot; was never really a technical guarantee. It was a marketing sentence sitting on top of a legal document that says the opposite in its own words.&lt;/p&gt;
&lt;p&gt;I'm not naming the company, and I'm not telling you every VPN does this — plenty of providers publish real, independently audited no-logs reports and mean it. I'm telling you to do exactly what I did: ask the pointed question, then actually read the policy they hand you afterward, especially the definitions section. If &quot;processing&quot; quietly includes &quot;storage&quot; and the company sits under a jurisdiction with broad data-access laws, you haven't bought anonymity. You've bought a very polite waiting room.&lt;/p&gt;
&lt;h3 id=&quot;your-phone-is-a-rental-and-you-re-the-tenant-who-can-t-change-the-locks&quot;&gt;Your phone is a rental, and you're the tenant who can't change the locks&lt;/h3&gt;
&lt;p&gt;You paid full price — sometimes over a thousand dollars — for a device you don't fully control. Bootloaders are locked. Bloatware is preinstalled and often can't be removed without voiding a warranty or tripping hardware checks that quietly break your banking app. The manufacturer decides what OS you're allowed to run, which repair shops count as &quot;authorized,&quot; and how long the device gets security updates before it's engineered into obsolescence. You're the owner on paper and the guest in practice. The device is the hook; your data and your next upgrade purchase are the actual product.&lt;/p&gt;
&lt;h3 id=&quot;the-passport-paradox&quot;&gt;The passport paradox&lt;/h3&gt;
&lt;p&gt;Here's where it gets genuinely interesting, and where I want to be careful, because this isn't a story with a villain — it's a story with a trade-off, and different countries are answering it completely differently at the same time.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Vietnam&lt;/strong&gt; just did something almost nobody expected: starting January 1, 2026, its new Law on Personal Data Protection bans social platforms operating there — local or foreign — from requiring users to upload a photo of their ID card or passport just to verify an account. It also bans platforms from reading private messages or recording calls without consent. That's a real, enforceable ban with serious financial penalties attached. At the same time, Vietnam is separately rolling out rules requiring accounts to be linked to a verified local phone number or national ID number for anti-fraud purposes. So the picture isn't &quot;more privacy&quot; or &quot;less privacy&quot; — it's &quot;no more handing platforms a photo of your actual passport,&quot; while identity still gets tied to you through a different, arguably less exploitable channel. Genuinely nuanced, genuinely worth watching.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Europe&lt;/strong&gt; took the opposite visual approach for an entirely different reason. In early 2026, a new EU-based platform called W Social launched as a deliberate alternative to X, built specifically to be bot-resistant: to post, you verify your identity by scanning a passport or national ID card and a selfie through a separate companion app. The pitch is that the scan and match happen on your own device, and the company says it doesn't store the document itself centrally — you can also browse anonymously with reduced functionality if you skip verification entirely. Whether &quot;we process it locally and don't store it&quot; survives contact with millions of users and a few years of pressure is exactly the kind of promise worth revisiting in twelve months. It's the same core question as always — how much of &quot;prove you're human&quot; ends up as &quot;here's your permanent identity record&quot; — just answered by a private company instead of a government this time.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Russia's telecom regulator, Roskomnadzor&lt;/strong&gt;, put forward a proposal back in 2021 that would have required new social media and messenger users to submit passport details, home address, and contact information, cross-checked against the state's Gosuslugi portal, as part of consent-management infrastructure for personal data. To be clear about where this actually stands: it was a draft proposal, not a law that took effect, and it hasn't been implemented as originally floated. I'm not going to pretend to have a verdict on whether that specific idea was good policy or bad policy — plenty of countries debate identity requirements for online services, for all kinds of legitimate and illegitimate reasons, and that's a conversation about tradeoffs, not a referendum on any one government. What's actually worth sitting with is the pattern above it: state ID portals, private &quot;trust and safety&quot; platforms, and social networks are all reaching for the same solution — link your face and your legal identity to your online activity — at almost exactly the same moment, for reasons ranging from fighting bots to fighting fraud to fighting disinformation. Some of those reasons are good. The output is still the same: your passport, your biometrics, and your posting history increasingly living in the same place.&lt;/p&gt;
&lt;p&gt;And that's the actual tension, stripped of any single country's politics: identity verification is a genuinely reasonable answer to bots, fraud, and disinformation. It is also, structurally, a new centralized target. So next time something asks you to prove you're human, the interesting question isn't whether they have a good reason today. It's what happens to that proof on the day their reason stops mattering. You don't need me to answer that one for you — but here's a hint: databases don't retire. They just wait.&lt;/p&gt;
&lt;h3 id=&quot;so-what-do-we-actually-do-about-it-&quot;&gt;So what do we actually do about it?&lt;/h3&gt;
&lt;p&gt;Here's the part where I disappoint anyone expecting a manifesto: I'm not telling you to throw your phone in a lake and move to a cabin. I use the apps too. I like fast information and dumb memes as much as anyone. This isn't a call to abandon convenience — it's a call to stop pretending the convenience is free.&lt;/p&gt;
&lt;p&gt;You can also do nothing. Close the tab, keep scrolling, change nothing — that's a real option and nobody's coming to stop you. Or you can spend the next two minutes doing this, right now, before you close this tab:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open your phone's settings.&lt;/li&gt;
&lt;li&gt;Pick one app you use daily — VK, Instagram, whatever's already open in another tab.&lt;/li&gt;
&lt;li&gt;Turn off its access to your microphone, contacts, and location if the app doesn't strictly need them to function.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Done. That's it. You just did more for your own privacy in two minutes than most people will do all year. Not a revolution. Not a lake cabin. Just one small door you closed that used to be wide open.&lt;/p&gt;
&lt;p&gt;A few more things that cost five minutes each and nothing beyond that:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Turn off ad personalization&lt;/strong&gt; in your Google, Meta, and TikTok settings. It doesn't stop collection, but it shrinks the targeting surface.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use a real password manager and 2FA.&lt;/strong&gt; Most &quot;hacks&quot; are just reused passwords from a breach nobody rotated.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Read one privacy policy this year.&lt;/strong&gt; Just one. You'll never look at &quot;free&quot; the same way again.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;If you're a developer, push back inside your own stack.&lt;/strong&gt; You decide what telemetry ships in the product you build. That's more power than most people in this conversation will ever have.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here's the uncomfortable part, though. You probably think of yourself as a person — opinions, habits, a face. Every system described in this post thinks of you as a row. A data point with a name attached purely for convenience. You don't have to agree with that framing. But once you've actually sat with it for a second, it's a little harder to just close the tab and pretend you didn't read this.&lt;/p&gt;
&lt;h3 id=&quot;now-about-why-you-actually-read-this-whole-thing&quot;&gt;Now, about why you actually read this whole thing&lt;/h3&gt;
&lt;p&gt;Since we're being honest with each other: this post used a specific structure on purpose, and it's worth naming, because recognizing the pattern here is the same skill that protects you from the next one.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;It opened with a myth I could confidently debunk&lt;/strong&gt; — trust, earned fast.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It escalated with dollar figures and jury verdicts&lt;/strong&gt; — specificity that reads as credibility, whether or not you checked it yourself (you should).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It made the threat feel like it's happening to you, right now&lt;/strong&gt;, not to some abstract &quot;user out there.&quot;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It gave you a way out that felt like a choice, not an order&lt;/strong&gt; — do nothing, or spend two minutes. Either way, you decided.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It handed you one small, immediate action&lt;/strong&gt; instead of a vague suggestion, because five minutes of resistance beats another lecture you'll forget by tomorrow.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It pulled you into an unresolved debate&lt;/strong&gt; — the passport paradox — with no clean villain, because open loops keep people reading.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It's closing on a moment of &quot;wait, is &lt;em&gt;this&lt;/em&gt; article doing the thing it just described&quot;&lt;/strong&gt; — a little vertigo is what makes people screenshot something and send it to a friend.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;None of that makes the verified parts above less true. The Flo verdict happened. The $425 million happened. The localhost tracking happened. I flagged the one item I couldn't fully verify as exactly that — a claim, not a fact — because the moment you stop distinguishing the two, you've become exactly the kind of unreliable narrator this whole post is warning you about. But the fact that true information can be arranged to hook you exactly like an ad can is, honestly, the whole point of this post. The mechanism doesn't care whether the payload is a sneaker ad or a privacy manifesto. Worth remembering the next time something online makes you feel like you &lt;em&gt;have&lt;/em&gt; to keep scrolling — including this one.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;One last note, plainly stated: everything in this piece is either a matter of public court record, a regulatory decision, published academic research, or the output of an open, independently verifiable auditing tool that anyone can run themselves — sources are linked or named where they exist specifically so you don't have to trust me. The one exception is flagged inline as an unverified claim, not presented as fact. This is a personal, informational write-up, not legal advice, not a security audit of any product named here, and not a statement about the character, intentions, or legitimacy of any company or government mentioned. Company names, product names, and country names appear because they're the ones with public data behind them — not because I'm accusing anyone of anything beyond what's already a matter of public record. If something here is factually wrong, I'd rather be corrected than be right — go check the sources, that's what they're there for.&lt;/em&gt;&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/23413/you-dont-own-your-phone-you-dont-own-your-data-you-barely-own-your-opinions</guid>
<pubDate>Fri, 24 Jul 2026 21:33:29 +0000</pubDate>
</item>
<item>
<title>What is the shared responsibility model in cloud computing?</title>
<link>https://coderlegion.com/22512/what-is-the-shared-responsibility-model-in-cloud-computing</link>
<description>
&lt;p&gt;Hello, I'm Ganesh. I'm building &lt;em&gt;git-lrc&lt;/em&gt;, an AI code reviewer that runs on every commit. It is free, unlimited, and source-available on Github. &lt;a href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;Star git-lrc on GitHub&lt;/a&gt; to help more developers discover the project. Do give it a try and share your feedback for improving the product.&lt;br&gt;
One of the biggest misconceptions about cloud computing is that once you move to the cloud, the cloud provider takes care of everything. &lt;/p&gt;

&lt;p&gt;While cloud providers manage a significant portion of the infrastructure, customers still have important security and operational responsibilities.&lt;/p&gt;

&lt;p&gt;This concept is known as the &lt;strong&gt;Shared Responsibility Model&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The division of responsibilities changes depending on whether you're running workloads &lt;strong&gt;On-Premises&lt;/strong&gt;, using &lt;strong&gt;Infrastructure as a Service (IaaS)&lt;/strong&gt;, &lt;strong&gt;Platform as a Service (PaaS)&lt;/strong&gt;, or &lt;strong&gt;Software as a Service (SaaS)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Let's break it down.&lt;/p&gt;

&lt;h2&gt;
  
  
  On-Premises: You Manage Everything
&lt;/h2&gt;

&lt;p&gt;When your applications run in your own data center, every component is your responsibility.&lt;/p&gt;

&lt;h3&gt;
  
  
  Customer Responsibilities
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Data&lt;/li&gt;
&lt;li&gt;Devices&lt;/li&gt;
&lt;li&gt;Accounts&lt;/li&gt;
&lt;li&gt;Identity and Access Management (IAM)&lt;/li&gt;
&lt;li&gt;Applications&lt;/li&gt;
&lt;li&gt;Network controls&lt;/li&gt;
&lt;li&gt;Operating systems&lt;/li&gt;
&lt;li&gt;Infrastructure&lt;/li&gt;
&lt;li&gt;Physical servers&lt;/li&gt;
&lt;li&gt;Physical networking&lt;/li&gt;
&lt;li&gt;Datacenter facilities&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What the Provider Manages
&lt;/h3&gt;

&lt;p&gt;Nothing.&lt;/p&gt;

&lt;p&gt;Since everything is hosted on your own infrastructure, there is no cloud provider to share operational responsibilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  Infrastructure as a Service (IaaS)
&lt;/h2&gt;

&lt;p&gt;Examples include virtual machines such as &lt;strong&gt;Amazon EC2&lt;/strong&gt;, &lt;strong&gt;Azure Virtual Machines&lt;/strong&gt;, and &lt;strong&gt;Google Compute Engine&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;With IaaS, the provider supplies the infrastructure while you manage everything running on top of it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Customer Responsibilities
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Data&lt;/li&gt;
&lt;li&gt;Devices&lt;/li&gt;
&lt;li&gt;Accounts&lt;/li&gt;
&lt;li&gt;Identity and Access Management&lt;/li&gt;
&lt;li&gt;Applications&lt;/li&gt;
&lt;li&gt;Network controls (firewalls, security groups, etc.)&lt;/li&gt;
&lt;li&gt;Operating systems&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Cloud Provider Responsibilities
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Physical infrastructure&lt;/li&gt;
&lt;li&gt;Physical hosts&lt;/li&gt;
&lt;li&gt;Physical networking&lt;/li&gt;
&lt;li&gt;Datacenters&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;IaaS gives you the most flexibility among cloud service models, but it also requires the most operational management.&lt;/p&gt;

&lt;h2&gt;
  
  
  Platform as a Service (PaaS)
&lt;/h2&gt;

&lt;p&gt;Examples include &lt;strong&gt;Azure App Service&lt;/strong&gt;, &lt;strong&gt;AWS Elastic Beanstalk&lt;/strong&gt;, &lt;strong&gt;Google App Engine&lt;/strong&gt;, and &lt;strong&gt;Heroku&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;PaaS removes the burden of managing operating systems and infrastructure, allowing developers to focus on building applications.&lt;/p&gt;

&lt;h3&gt;
  
  
  Customer Responsibilities
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Data&lt;/li&gt;
&lt;li&gt;Devices&lt;/li&gt;
&lt;li&gt;Accounts&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Shared Responsibilities
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Identity and Access Management&lt;/li&gt;
&lt;li&gt;Applications&lt;/li&gt;
&lt;li&gt;Network controls&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Cloud Provider Responsibilities
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Operating systems&lt;/li&gt;
&lt;li&gt;Infrastructure&lt;/li&gt;
&lt;li&gt;Physical hosts&lt;/li&gt;
&lt;li&gt;Physical networking&lt;/li&gt;
&lt;li&gt;Datacenters&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;PaaS strikes a balance between flexibility and convenience, making it an excellent choice for many modern application deployments.&lt;/p&gt;

&lt;h2&gt;
  
  
  Software as a Service (SaaS)
&lt;/h2&gt;

&lt;p&gt;Examples include &lt;strong&gt;Microsoft 365&lt;/strong&gt;, &lt;strong&gt;Salesforce&lt;/strong&gt;, &lt;strong&gt;Google Workspace&lt;/strong&gt;, and &lt;strong&gt;Dropbox&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;With SaaS, the provider delivers a complete application that users simply access through a web browser or client application.&lt;/p&gt;

&lt;h3&gt;
  
  
  Customer Responsibilities
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Data&lt;/li&gt;
&lt;li&gt;Devices&lt;/li&gt;
&lt;li&gt;Accounts&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Shared Responsibilities
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Identity and Access Management&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Cloud Provider Responsibilities
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Applications&lt;/li&gt;
&lt;li&gt;Network controls&lt;/li&gt;
&lt;li&gt;Operating systems&lt;/li&gt;
&lt;li&gt;Infrastructure&lt;/li&gt;
&lt;li&gt;Physical hosts&lt;/li&gt;
&lt;li&gt;Physical networking&lt;/li&gt;
&lt;li&gt;Datacenters&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;SaaS offers the lowest operational overhead because the provider manages nearly the entire technology stack.&lt;/p&gt;

&lt;h2&gt;
  
  
  Shared Responsibility at a Glance
&lt;/h2&gt;

&lt;div class=&quot;table-wrapper-paragraph&quot;&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Service Model&lt;/th&gt;
&lt;th&gt;Customer Manages&lt;/th&gt;
&lt;th&gt;Shared&lt;/th&gt;
&lt;th&gt;Provider Manages&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;On-Premises&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Everything&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;td&gt;Nothing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;IaaS&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;OS, applications, IAM, network controls, data&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;td&gt;Infrastructure &amp;amp; physical hardware&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;PaaS&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Data, devices, accounts&lt;/td&gt;
&lt;td&gt;IAM, applications, network controls&lt;/td&gt;
&lt;td&gt;OS, infrastructure &amp;amp; physical hardware&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;SaaS&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Data, devices, accounts&lt;/td&gt;
&lt;td&gt;IAM&lt;/td&gt;
&lt;td&gt;Applications, OS, infrastructure &amp;amp; physical hardware&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;No matter which cloud service model you choose, &lt;strong&gt;your data, devices, and user accounts remain your responsibility&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;As you move from &lt;strong&gt;On-Premises &amp;rarr; IaaS &amp;rarr; PaaS &amp;rarr; SaaS&lt;/strong&gt;, the cloud provider takes on progressively more responsibility, reducing your operational burden. However, protecting your users, managing access, and securing your data always remain critical tasks.&lt;/p&gt;

&lt;p&gt;Understanding where your responsibilities begin&amp;mdash;and where the provider's responsibilities end&amp;mdash;is essential for building secure, reliable cloud solutions.&lt;/p&gt;

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

&lt;p&gt;&lt;a href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;&lt;img src=&quot;https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnuphqwcp6bha9ol6pdo3.png&quot; alt=&quot;git-lrc&quot; width=&quot;360&quot; height=&quot;540&quot;&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Any feedback or contributors are welcome! It's online, source-available, and ready for anyone to use.&lt;/p&gt;

&lt;p&gt;&amp;#11088; &lt;a href=&quot;https://github.com/HexmosTech/git-lrc?utm_source=chatgpt.com&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;Star git-lrc on GitHub&lt;/a&gt;&lt;/p&gt;
</description>
<category>Other</category>
<guid isPermaLink="true">https://coderlegion.com/22512/what-is-the-shared-responsibility-model-in-cloud-computing</guid>
<pubDate>Tue, 14 Jul 2026 22:00:08 +0000</pubDate>
</item>
<item>
<title>Understanding Systemd.exec—Part 3: Disabling the COPY TO PROGRAM feature in Postgres.</title>
<link>https://coderlegion.com/16112/understanding-systemd-exec-part-3-disabling-the-copy-to-program-feature-in-postgres</link>
<description>
&lt;p&gt;Hello, I'm Ganesh. I'm building &lt;em&gt;git-lrc&lt;/em&gt;, an AI code reviewer that runs on every commit. It is free, unlimited, and source-available on Github. &lt;a href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;Star Us&lt;/a&gt; to help devs discover the project. Do give it a try and share your feedback for improving the product.&lt;/p&gt;

&lt;p&gt;In previous article we discussed how this feature may be attacker entry point to server.&lt;/p&gt;

&lt;p&gt;So, now let's implment custom systemd configuration to disable this feature.&lt;/p&gt;

&lt;h2&gt;
  
  
  Securing Postgres with systemd.exec options
&lt;/h2&gt;

&lt;p&gt;I found only way for now to disable this feature is to create custom systemd configuration.&lt;/p&gt;

&lt;p&gt;Let's identify the postgres version.&lt;br&gt;
&lt;/p&gt;

&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight shell&quot;&gt;&lt;code&gt;gk@jarvis:~&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;psql &lt;span class=&quot;nt&quot;&gt;--version&lt;/span&gt;
psql &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;PostgreSQL&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; 16.13 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;Ubuntu 16.13-0ubuntu0.24.04.1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
gk@jarvis:~&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Based on postgress version we can use different postgresctl command.&lt;/p&gt;

&lt;p&gt;We can add custom systemd configuration for each postgres version.&lt;/p&gt;

&lt;p&gt;So, How attacker mostly use copy function to get inside the server?&lt;/p&gt;

&lt;p&gt;Here, how simple funtion can be used to get inside the server.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;using shell&lt;/li&gt;
&lt;li&gt;using curl&lt;/li&gt;
&lt;li&gt;using wget&lt;/li&gt;
&lt;li&gt;using bash&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Still goes on Many ways you can use copy function to get inside the server.&lt;/p&gt;

&lt;p&gt;Based on my analysis and continuous retry on disable feature on by one.&lt;br&gt;
I got working configureation  which will disconnect from postgres access.&lt;/p&gt;
&lt;h2&gt;
  
  
  Available options In systemd.exec For postgres
&lt;/h2&gt;

&lt;p&gt;Let's analyze these options and try to disable them using systemd.exec options.&lt;/p&gt;

&lt;p&gt;we can use&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;TemporaryFileSystem&lt;br&gt;
This will create read only filesystem for specific directory.&lt;br&gt;
We can make sure they don't have direct access to system utilities.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;BindReadOnlyPaths&lt;br&gt;
Re-expose only what's needed by postgres. Example postgres binaries, libraries etc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;ProtectSystem&lt;br&gt;
Block /usr, /boot, /etc from write access&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;ProtectHome&lt;br&gt;
This will block access to /home directory.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;PrivateTmp&lt;br&gt;
This will create temporary /tmp and /var/tmp directories for the service.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;ReadWritePaths&lt;br&gt;
This is main thing as we disabled all the feature postgress data should be writable to some directory. Which can be:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;/var/lib/postgresql&lt;/li&gt;
&lt;li&gt;/var/run/postgresql&lt;/li&gt;
&lt;li&gt;/var/log/postgresql&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Just have a look based on your version.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;NoNewPrivileges&lt;br&gt;
If a service process tries to gain more privileges, the kernel will deny it.&lt;br&gt;
This can prevent attackers from escalating privileges even if they compromise the service.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;RestrictNamespaces&lt;br&gt;
This option can be used to restrict the namespaces that a service can access.&lt;br&gt;
This is mainly for if they try to break out from the container/VM. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;RestrictAddressFamilies&lt;br&gt;
This option can be used to restrict the address families that a service can access.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;ProtectKernelTunables&lt;br&gt;
This option can be used to prevent a service from modifying kernel tunables.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;ProtectKernelModules&lt;br&gt;
This option can be used to prevent a service from loading kernel modules.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;ProtectControlGroups&lt;br&gt;
This will prevent the service from accessing the cgroups of other processes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;ProtectProc&lt;br&gt;
This will prevent the service from accessing the process information of other processes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;UMask&lt;br&gt;
This will set the umask of the service.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;CapabilityBoundingSet&lt;br&gt;
This will set the capability bounding set of the service.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;AmbientCapabilities&lt;br&gt;
This will set the ambient capabilities of the service.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SystemCallFilter&lt;br&gt;
This will set the system call filter of the service.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SystemCallErrorNumber&lt;br&gt;
This will set the system call error number of the service.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;MemoryDenyWriteExecute&lt;br&gt;
This will set the memory deny write execute of the service.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;LockPersonality&lt;br&gt;
This will lock the personality of the service.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;RestrictSUIDSGID&lt;br&gt;
This will prevent the service from using SUID and SGID bits.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  Configuring Systemd for postgres
&lt;/h2&gt;

&lt;p&gt;So, Now let's create custom configuration for postgres.&lt;br&gt;
&lt;/p&gt;

&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight shell&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; /etc/systemd/system/postgresql@16-main.service.d
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;vim /etc/systemd/system/postgresql@16-main.service.d/override.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now add these options to the file.&lt;br&gt;
&lt;/p&gt;

&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight shell&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Service]
&lt;span class=&quot;c&quot;&gt;# &amp;#9472;&amp;#9472; BYPASS pg_ctlcluster (it's a perl script &amp;mdash; breaks TemporaryFileSystem) &amp;#9472;&amp;#9472;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;ExecStart&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;ExecStart&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/usr/lib/postgresql/16/bin/postgres &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; /var/lib/postgresql/16/main &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;config_file&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/etc/postgresql/16/main/postgresql.conf &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;hba_file&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/etc/postgresql/16/main/pg_hba.conf &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;ident_file&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/etc/postgresql/16/main/pg_ident.conf &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;external_pid_file&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/run/postgresql/16-main.pid
&lt;span class=&quot;nv&quot;&gt;ExecStop&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;ExecStop&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/usr/lib/postgresql/16/bin/pg_ctl stop &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; /var/lib/postgresql/16/main &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; fast
&lt;span class=&quot;nv&quot;&gt;ExecReload&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;ExecReload&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/usr/lib/postgresql/16/bin/pg_ctl reload &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; /var/lib/postgresql/16/main

&lt;span class=&quot;nv&quot;&gt;User&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;postgres
&lt;span class=&quot;nv&quot;&gt;Group&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;postgres

&lt;span class=&quot;c&quot;&gt;# &amp;#9472;&amp;#9472; BLANK ALL EXECUTABLE DIRS &amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;TemporaryFileSystem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/usr/bin:ro
&lt;span class=&quot;nv&quot;&gt;TemporaryFileSystem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/bin:ro
&lt;span class=&quot;nv&quot;&gt;TemporaryFileSystem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/usr/sbin:ro
&lt;span class=&quot;nv&quot;&gt;TemporaryFileSystem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/sbin:ro
&lt;span class=&quot;nv&quot;&gt;TemporaryFileSystem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/usr/local/bin:ro
&lt;span class=&quot;nv&quot;&gt;TemporaryFileSystem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/usr/local/sbin:ro
&lt;span class=&quot;nv&quot;&gt;TemporaryFileSystem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/snap:ro
&lt;span class=&quot;nv&quot;&gt;TemporaryFileSystem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/opt:ro

&lt;span class=&quot;c&quot;&gt;# &amp;#9472;&amp;#9472; RE-EXPOSE ONLY WHAT'S NEEDED &amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;BindReadOnlyPaths&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/usr/lib/postgresql/16/bin/postgres:/usr/lib/postgresql/16/bin/postgres
&lt;span class=&quot;nv&quot;&gt;BindReadOnlyPaths&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/usr/lib/postgresql/16/bin/pg_ctl:/usr/lib/postgresql/16/bin/pg_ctl
&lt;span class=&quot;nv&quot;&gt;BindReadOnlyPaths&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/usr/lib/postgresql/16/lib:/usr/lib/postgresql/16/lib
&lt;span class=&quot;nv&quot;&gt;BindReadOnlyPaths&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu
&lt;span class=&quot;nv&quot;&gt;BindReadOnlyPaths&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/usr/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu

&lt;span class=&quot;c&quot;&gt;# &amp;#9472;&amp;#9472; FILESYSTEM &amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;ProtectSystem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;strict
&lt;span class=&quot;nv&quot;&gt;ProtectHome&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;yes
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;PrivateTmp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;yes
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;ReadWritePaths&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/var/lib/postgresql /var/run/postgresql /var/log/postgresql

&lt;span class=&quot;c&quot;&gt;# &amp;#9472;&amp;#9472; BEHAVIORAL &amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;NoNewPrivileges&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;yes
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;RestrictNamespaces&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;yes
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;RestrictAddressFamilies&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;AF_UNIX AF_INET AF_INET6
&lt;span class=&quot;nv&quot;&gt;ProtectKernelTunables&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;yes
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;ProtectKernelModules&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;yes
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;ProtectControlGroups&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;yes
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;ProtectProc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;invisible
&lt;span class=&quot;nv&quot;&gt;UMask&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0027
&lt;span class=&quot;nv&quot;&gt;CapabilityBoundingSet&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;AmbientCapabilities&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# &amp;#9472;&amp;#9472; SYSCALL FILTER &amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&amp;#9472;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;SystemCallFilter&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;@system-service @file-system @network-io
&lt;span class=&quot;nv&quot;&gt;SystemCallErrorNumber&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;EPERM
&lt;span class=&quot;nv&quot;&gt;MemoryDenyWriteExecute&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;yes
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;LockPersonality&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;yes
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;RestrictSUIDSGID&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;yes&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Note: There may many issues setting up this configuration. So, make sure this only done on Staging env and test it thoroughly.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight shell&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;systemctl daemon-reload
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;systemctl restart postgresql@16-main.service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, If you check status&lt;br&gt;
&lt;/p&gt;

&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight shell&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;systemctl status postgresql@16-main.service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will see all the options are enabled.&lt;/p&gt;

&lt;p&gt;If there any issues just check logs&lt;br&gt;
&lt;/p&gt;

&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight shell&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;journalctl &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; postgresql@16-main.service &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; 50
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Reverting Configuration
&lt;/h2&gt;

&lt;p&gt;Finaly to remove this configuration just run&lt;/p&gt;

&lt;p&gt;First we have remove the conf file.&lt;/p&gt;

&lt;p&gt;And restart daemon and restart service.&lt;br&gt;
&lt;/p&gt;

&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight shell&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo rm&lt;/span&gt; /etc/systemd/system/postgresql@16-main.service.d/override.conf
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;systemctl daemon-reload
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;systemctl restart postgresql@16-main.service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This is the only way I found to disable copy function in postgres. This may be experimental but still worth for adding this config if you want disable postgress copy to program function.&lt;/p&gt;

&lt;p&gt;Reference Man Page Systemd : &lt;a href=&quot;https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Discussion in HN: &lt;a href=&quot;https://news.ycombinator.com/item?id=37164115&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;https://news.ycombinator.com/item?id=37164115&lt;/a&gt;&lt;br&gt;
PostgreSQL Discussion : &lt;a href=&quot;https://www.postgresql.org/message-id/CAKFQuwZZ0zAMpp2KjBr5bUS7RvBqouD2Kqne6YtbgZn%3DnzL1xA%40mail.gmail.com&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;https://www.postgresql.org/message-id/CAKFQuwZZ0zAMpp2KjBr5bUS7RvBqouD2Kqne6YtbgZn%3DnzL1xA%40mail.gmail.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;&lt;img src=&quot;https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fabn6nl3iehrohehnxgje.png&quot; alt=&quot;git-lrc&quot; width=&quot;800&quot; height=&quot;373&quot;&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Any feedback or contributors are welcome! It&amp;rsquo;s online, source-available, and ready for anyone to use. &lt;br&gt;
&amp;#11088; Star it on GitHub: &lt;a href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;https://github.com/HexmosTech/git-lrc&lt;/a&gt;&lt;/p&gt;


</description>
<category>Other</category>
<guid isPermaLink="true">https://coderlegion.com/16112/understanding-systemd-exec-part-3-disabling-the-copy-to-program-feature-in-postgres</guid>
<pubDate>Sat, 02 May 2026 23:50:26 +0000</pubDate>
</item>
<item>
<title>Understanding Systemd.exec - Part 1: How to Secure Applications Running in Systemd?</title>
<link>https://coderlegion.com/16114/understanding-systemd-exec-part-1-how-to-secure-applications-running-in-systemd</link>
<description>
&lt;p&gt;Hello, I'm Ganesh. I'm building &lt;em&gt;git-lrc&lt;/em&gt;, an AI code reviewer that runs on every commit. It is free, unlimited, and source-available on GitHub. &lt;a href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;Star Us&lt;/a&gt; to help devs discover the project. Do give it a try and share your feedback for improving the product.&lt;/p&gt;

&lt;p&gt;If you are running applications with systemd and want to restrict how they interact with Linux kernel features (like filesystem, processes, and capabilities), you can use the systemd.exec configuration options. &lt;/p&gt;

&lt;p&gt;In this article I will be going to explain how to use these options to secure your application.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are systemd.exec options?
&lt;/h2&gt;

&lt;p&gt;Systemd.exec options are a set of configuration options that are used to configure how a systemd service interacts with the Linux kernel. &lt;/p&gt;

&lt;p&gt;This feature is mainly used to provide security for the applications running in systemd.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why we need this option in first place?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Hardening services (Postgres, Nginx, workers, etc) which are mostly open to the internet&lt;/li&gt;
&lt;li&gt;Reducing blast radius after compromise &lt;/li&gt;
&lt;li&gt;Lightweight (no container overhead)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How is this different from Docker?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Works on a single process/service.&lt;/li&gt;
&lt;li&gt;Applies restrictions on top of the host.&lt;/li&gt;
&lt;li&gt;Uses kernel features (namespaces, cgroups, capabilities)&lt;/li&gt;
&lt;li&gt;Shares the same root filesystem (by default)&lt;/li&gt;
&lt;li&gt;No packaging, no images&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What is the real usecase?
&lt;/h2&gt;

&lt;p&gt;Let's take an example of service.&lt;br&gt;
&lt;/p&gt;

&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight shell&quot;&gt;&lt;code&gt;/etc/systemd/system/myapp.service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside this file, we can control:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Where the app runs&lt;/li&gt;
&lt;li&gt;Which user it runs as&lt;/li&gt;
&lt;li&gt;What it can access&lt;/li&gt;
&lt;li&gt;How secure / isolated it is&lt;/li&gt;
&lt;li&gt;What resources it can use&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Most common options
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Run a service as non-root (security)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Set &lt;code&gt;User=&lt;/code&gt; &lt;code&gt;Group=&lt;/code&gt; to a non-privileged user (e.g. &lt;code&gt;postgres&lt;/code&gt;, &lt;code&gt;www-data&lt;/code&gt;).&lt;br&gt;
This will prevent the service from running as root, which can lead to security vulnerabilities.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight shell&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Service]
&lt;span class=&quot;nv&quot;&gt;User&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;postgres
&lt;span class=&quot;nv&quot;&gt;Group&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;postgres
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Restrict filesystem access&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Set &lt;code&gt;ProtectSystem=&lt;/code&gt; &lt;code&gt;ProtectHome=&lt;/code&gt; &lt;code&gt;ReadWritePaths=&lt;/code&gt; &lt;code&gt;ReadOnlyPaths=&lt;/code&gt; to control filesystem access.&lt;br&gt;
This will make service only read/ write specifed directory.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight shell&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Service]
&lt;span class=&quot;nv&quot;&gt;ProtectSystem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;strict
&lt;span class=&quot;nv&quot;&gt;ProtectHome&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;yes
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;ReadWritePaths&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/var/lib/postgresql
&lt;span class=&quot;nv&quot;&gt;ReadOnlyPaths&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/var/lib/postgresql/16/bin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Isolate runtime environment (like lightweight container)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Set &lt;code&gt;PrivateTmp=yes&lt;/code&gt; &lt;code&gt;NoNewPrivileges=yes&lt;/code&gt; to isolate runtime environment.&lt;br&gt;
As there is no container like docker this will be running in the host but under private tmp and no new privileges.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight shell&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Service]
&lt;span class=&quot;nv&quot;&gt;PrivateTmp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;yes
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;NoNewPrivileges&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;yes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Limit resources (avoid abuse / crashes)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Set &lt;code&gt;CPUQuota=&lt;/code&gt; &lt;code&gt;MemoryMax=&lt;/code&gt; &lt;code&gt;MemoryHigh=&lt;/code&gt; &lt;code&gt;MemoryLimit=&lt;/code&gt; &lt;code&gt;MemoryAccounting=&lt;/code&gt; to limit resources.&lt;br&gt;
If we want specific service to use only limited resources, we can use these options.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight shell&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Service]
&lt;span class=&quot;nv&quot;&gt;CPUQuota&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;50%
&lt;span class=&quot;nv&quot;&gt;MemoryMax&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;512M
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Provide controlled writable directories
Set &lt;code&gt;ReadWritePaths=&lt;/code&gt; &lt;code&gt;ReadOnlyPaths=&lt;/code&gt; to control filesystem access.
This will make service only read/ write specifed directory.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight shell&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Service]
&lt;span class=&quot;nv&quot;&gt;ReadWritePaths&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/var/lib/postgresql
&lt;span class=&quot;nv&quot;&gt;ReadOnlyPaths&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/var/lib/postgresql/16/bin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Drop dangerous privileges&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Set &lt;code&gt;CapabilityBoundingSet=&lt;/code&gt; to drop dangerous privileges.&lt;br&gt;
This will make service only able to run commands with specific privileges.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight shell&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Service]
&lt;span class=&quot;nv&quot;&gt;CapabilityBoundingSet&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;CAP_NET_BIND_SERVICE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Run temporary / ephemeral services
Set &lt;code&gt;RuntimeDirectory=&lt;/code&gt; &lt;code&gt;StateDirectory=&lt;/code&gt; &lt;code&gt;LogsDirectory=&lt;/code&gt; to run temporary / ephemeral services.
This will run the service in a temporary / ephemeral directory.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight shell&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Service]
&lt;span class=&quot;nv&quot;&gt;RuntimeDirectory&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;myapp
&lt;span class=&quot;nv&quot;&gt;StateDirectory&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;myapp
&lt;span class=&quot;nv&quot;&gt;LogsDirectory&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;myapp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Limit process / thread count
Set &lt;code&gt;TasksMax=&lt;/code&gt; to limit process / thread count.
This will make service only able to run with specific process / thread count.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight shell&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Service]
&lt;span class=&quot;nv&quot;&gt;TasksMax&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Restrict access to system calls
Set &lt;code&gt;SystemCallFilter=&lt;/code&gt; &lt;code&gt;SystemCallArchitectures=&lt;/code&gt; to restrict access to system calls.
This will make service only able to use specific system calls.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight shell&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Service]
&lt;span class=&quot;nv&quot;&gt;SystemCallFilter&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;open,read,write,close
&lt;span class=&quot;nv&quot;&gt;SystemCallArchitectures&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;amd64
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Security measures for Docker Engine
Set &lt;code&gt;Delegate=yes&lt;/code&gt; to run Docker Engine with specific privileges.
This will make Docker Engine only able to run with specific privileges.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight shell&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Service]
&lt;span class=&quot;nv&quot;&gt;Delegate&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;yes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;We could able to use systemd.exec options to secure application running in systemd.&lt;/p&gt;

&lt;p&gt;But Until we integrate with real application and test these options, we can't be sure about the security.&lt;/p&gt;

&lt;p&gt;In the next article we will see how service react with integrations of these options.&lt;/p&gt;

&lt;p&gt;Reference Man Page Systemd : &lt;a href=&quot;https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;&lt;img src=&quot;https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fabn6nl3iehrohehnxgje.png&quot; alt=&quot;git-lrc&quot; width=&quot;800&quot; height=&quot;373&quot;&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Any feedback or contributors are welcome! It&amp;rsquo;s online, source-available, and ready for anyone to use. &lt;br&gt;
&amp;#11088; Star it on GitHub: &lt;a href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;https://github.com/HexmosTech/git-lrc&lt;/a&gt;&lt;/p&gt;


</description>
<category>Other</category>
<guid isPermaLink="true">https://coderlegion.com/16114/understanding-systemd-exec-part-1-how-to-secure-applications-running-in-systemd</guid>
<pubDate>Sat, 02 May 2026 02:27:26 +0000</pubDate>
</item>
<item>
<title>How OTP Authentication Streamlines Service Delivery for HVAC Companies</title>
<link>https://coderlegion.com/15291/how-otp-authentication-streamlines-service-delivery-for-hvac-companies</link>
<description>
&lt;p&gt;&lt;img src=&quot;https://cdn.pseo.one/67b62b766899109fe72fb789/687e6cccf6fe799d28851ea0/69be69575148ee4f7d63bbfe/content-image/aa7b6967-63fc-446d-9374-4879a2d281ca.webp&quot; alt=&quot;aa7b6967-63fc-446d-9374-4879a2d281ca&quot;&gt;&lt;/p&gt;
&lt;p&gt;Photo courtesy of &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.freepik.com/free-photo/male-plumber-working-with-client-fix-kitchen-problems_94957515.htm&quot;&gt;Freepik&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;As HVAC businesses grow and expand into new areas, they need to find ways to manage more customers and staff. One of the biggest challenges is making sure that service delivery and payments are secure and efficient, especially when working with new customers in different locations.&lt;/p&gt;
&lt;p&gt;A simple solution to this problem is one-time password (OTP) authentication. OTP authentication makes it easy to verify customers and payments quickly and securely that helps HVAC companies improve their overall service process.&lt;/p&gt;
&lt;p&gt;In this article, we&amp;rsquo;ll explore how OTP authentication helps HVAC companies streamline service delivery by improving customer verification, appointment scheduling, payments, and service completion, all while keeping things secure and simple.&lt;/p&gt;
&lt;h2&gt;1. Simplified Customer Verification&lt;/h2&gt;
&lt;p&gt;OTP (One-Time Password) authentication replaces &lt;a rel=&quot;nofollow&quot; href=&quot;https://mojoauth.com/ciam-101/authentication-server&quot;&gt;traditional login methods&lt;/a&gt; by sending a unique code to a customer&amp;rsquo;s phone or email, which they use to verify their identity instantly. For HVAC service appointments, customers can receive an OTP to confirm their identity, eliminating the need for passwords or lengthy forms.&lt;/p&gt;
&lt;h2&gt;2. Enhanced Service Appointment Scheduling&lt;/h2&gt;
&lt;p&gt;OTP authentication helps verify and confirm HVAC service appointments, ensuring both the customer and service provider are clear on the timing and details. When a customer schedules a service, they receive an OTP confirmation, which confirms the appointment and reduces the risk of any misunderstandings. &lt;/p&gt;
&lt;p&gt;This process ensures that appointments are tracked accurately, leading to fewer scheduling errors and improved customer satisfaction. As you invest in marketing or &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.wearetg.com/industry/hvac-seo-company/&quot;&gt;HVAC SEO services&lt;/a&gt; to generate more leads, it&amp;rsquo;s essential to have a reliable system for booking appointments to avoid confusion and ensure a smooth customer experience.&lt;/p&gt;
&lt;h2&gt;3. Improved Payment and Transaction Security&lt;/h2&gt;
&lt;p&gt;OTP authentication adds a layer of security to payments and transactions, protecting HVAC businesses and their customers. When a payment is made, an OTP is sent to the customer's phone or email to verify the transaction, ensuring it&amp;rsquo;s legitimate. This reduces the risk of fraud or unauthorized charges. &lt;/p&gt;
&lt;p&gt;Additionally, OTP can prevent fraud from service vendors by confirming that payments are processed correctly and only authorized transactions are completed. This enhances security, builds trust, and ensures a reliable payment system for HVAC companies and their clients.&lt;/p&gt;
&lt;h2&gt;4. Streamlined Service Completion Confirmation&lt;/h2&gt;
&lt;p&gt;OTP authentication simplifies service completion verification. After an HVAC service is completed, an OTP is sent to the customer&amp;rsquo;s phone or email to confirm the work was done. This ensures clear communication and prevents any disputes about the service, making the process quicker and more reliable.&lt;/p&gt;
&lt;h2&gt;5. Seamless Communication for Customer Support&lt;/h2&gt;
&lt;p&gt;OTP authentication streamlines customer support by ensuring secure communication. When a customer contacts the HVAC company for assistance, they can verify their identity through OTP, &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.fraud.com/post/account-verification&quot;&gt;confirming they are the account holder&lt;/a&gt;. This prevents unauthorized access to support channels and ensures that customer queries are handled by the right team.&lt;/p&gt;
&lt;h2&gt;Endnote&lt;/h2&gt;
&lt;p&gt;OTP authentication enhances security and simplifies key processes for HVAC businesses. By streamlining customer verification, service confirmations, and payments, it improves efficiency and builds trust. &lt;/p&gt;
&lt;p&gt;Adopting OTP ensures smoother operations, better customer experience, and strengthens the company's competitive edge in a growing market. It&amp;rsquo;s a valuable investment for long-term success.&lt;/p&gt;

</description>
<category>Other</category>
<guid isPermaLink="true">https://coderlegion.com/15291/how-otp-authentication-streamlines-service-delivery-for-hvac-companies</guid>
<pubDate>Mon, 20 Apr 2026 11:50:01 +0000</pubDate>
</item>
<item>
<title>Architectural Design for a Ride App such as OLA, UBER, RAPIDO</title>
<link>https://coderlegion.com/14661/architectural-design-for-a-ride-app-such-as-ola-uber-rapido</link>
<description>
&lt;p&gt;&lt;img src=&quot;https://blog.ratnesh-maurya.com/images/blog/Architectural-Design-for-a-Ride-App-such-as-OLA-UBER-RAPIDO.jpg&quot; alt=&quot;Architectural Design for a Ride App such as OLA, UBER, RAPIDO&quot;&gt;&lt;/p&gt;&lt;p&gt;A ride-sharing app needs to match riders with drivers in real-time, track locations, process payments, and handle all of this at scale across a city. This is my take on how to architect such a system using microservices &amp;mdash; and where a simpler approach might actually be better.&lt;/p&gt;
&lt;h2 id=&quot;why-microservices-for-a-ride-app&quot;&gt;Why microservices for a ride app&lt;/h2&gt;
&lt;p&gt;The core challenge is that different parts of the system have very different scaling requirements:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Geo-location tracking&lt;/strong&gt; needs to handle thousands of location updates per second with sub-100ms latency&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Payment processing&lt;/strong&gt; needs strong consistency and idempotency but handles far fewer requests&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Notifications&lt;/strong&gt; are fire-and-forget at high volume&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;User authentication&lt;/strong&gt; is read-heavy with infrequent writes&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A monolith would force all of these to scale together. Microservices let you scale the geo-location service to 50 instances while keeping the payment service at 3.&lt;/p&gt;
&lt;p&gt;That said, if you're building an MVP or serving a single city, start with a monolith. Uber itself started as a monolith. Extract services only when specific components hit scaling bottlenecks.&lt;/p&gt;
&lt;h2 id=&quot;service-boundaries&quot;&gt;Service boundaries&lt;/h2&gt;
&lt;p&gt;Each service owns its data and exposes a clear API:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;User Service&lt;/strong&gt; &amp;mdash; Manages rider and driver accounts, authentication (OAuth2/OIDC), profile data, and session management. Backed by PostgreSQL.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ride Service&lt;/strong&gt; &amp;mdash; The core coordination service. Handles ride requests, matches riders with nearby available drivers, tracks ride state (requested &amp;rarr; matched &amp;rarr; in-progress &amp;rarr; completed), and calculates fares. Backed by PostgreSQL with Redis for active ride state.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Driver Service&lt;/strong&gt; &amp;mdash; Manages driver availability, approval status, vehicle information, and earnings. Tracks which drivers are online, idle, or on a ride. Backed by PostgreSQL.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Geo-Location Service&lt;/strong&gt; &amp;mdash; The highest-throughput service. Receives GPS coordinates from driver and rider apps every 3&amp;ndash;5 seconds, stores them in a spatial index (Redis with geospatial commands or a dedicated service like H3), and answers proximity queries (&quot;find the 5 nearest available drivers within 3km&quot;). This is the service that needs the most aggressive scaling.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Payment Service&lt;/strong&gt; &amp;mdash; Integrates with payment gateways (Razorpay, Stripe). Processes charges after ride completion, handles refunds, and manages driver payouts. Must be idempotent &amp;mdash; a network retry should never charge a rider twice.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Notification Service&lt;/strong&gt; &amp;mdash; Sends push notifications (ride matched, driver arriving, ride completed), SMS fallbacks, and email receipts. Consumes events from a message queue rather than being called directly.&lt;/p&gt;
&lt;h2 id=&quot;how-the-services-communicate&quot;&gt;How the services communicate&lt;/h2&gt;
&lt;p&gt;Not all communication should use the same pattern:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Pattern&lt;/th&gt;
&lt;th&gt;Use case&lt;/th&gt;
&lt;th&gt;Why&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;REST/HTTP&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Client &amp;rarr; API Gateway &amp;rarr; Services&lt;/td&gt;
&lt;td&gt;Simple request/response for CRUD operations&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;gRPC&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Service-to-service (e.g., Ride Service &amp;rarr; Geo-Location Service)&lt;/td&gt;
&lt;td&gt;Low latency, typed contracts, streaming support&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Message queue (Kafka/RabbitMQ)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Ride Service &amp;rarr; Notification Service, Ride Service &amp;rarr; Analytics&lt;/td&gt;
&lt;td&gt;Async, decoupled, no backpressure on the producer&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The &lt;strong&gt;API Gateway&lt;/strong&gt; sits in front of all services and handles routing, rate limiting, and authentication token validation. Clients never talk directly to internal services.&lt;/p&gt;
&lt;p&gt;A critical design decision: the Ride Service publishes a &lt;code&gt;ride.completed&lt;/code&gt; event to Kafka. The Payment Service, Notification Service, and Analytics Service all consume this event independently. This means adding a new consumer (say, a driver-rating prompt) doesn't require changing the Ride Service at all.&lt;/p&gt;
&lt;h2 id=&quot;scaling-and-fault-tolerance&quot;&gt;Scaling and fault tolerance&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Load balancing.&lt;/strong&gt; An L7 load balancer (like AWS ALB or Envoy) distributes requests across service instances. The Geo-Location Service gets its own load balancer with sticky sessions disabled (since requests are stateless).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Auto-scaling.&lt;/strong&gt; Kubernetes Horizontal Pod Autoscaler watches CPU and custom metrics (like queue depth for the Notification Service). The Geo-Location Service might scale from 10 pods at 2 AM to 80 pods at 6 PM during rush hour.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Circuit breakers.&lt;/strong&gt; If the Payment Service is down, the Ride Service shouldn't hang waiting for it. A circuit breaker (e.g., via Istio or a library like resilience4j) fails fast after N consecutive errors and falls back to queuing the payment for later processing.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Health checks.&lt;/strong&gt; Every service exposes &lt;code&gt;/healthz&lt;/code&gt; (liveness) and &lt;code&gt;/readyz&lt;/code&gt; (readiness) endpoints. Kubernetes restarts crashed pods automatically and stops routing traffic to pods that aren't ready.&lt;/p&gt;
&lt;h2 id=&quot;security-considerations&quot;&gt;Security considerations&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Authentication:&lt;/strong&gt; OAuth2 with JWTs for user-facing APIs. Service-to-service calls use mTLS within the Kubernetes cluster.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Data encryption:&lt;/strong&gt; AES-256 at rest, TLS 1.3 in transit. Payment card data never touches your services &amp;mdash; use the payment gateway's tokenization.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Rate limiting:&lt;/strong&gt; Applied at the API Gateway level. Geo-location updates are rate-limited per device to prevent abuse.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Secrets management:&lt;/strong&gt; HashiCorp Vault or AWS Secrets Manager. No secrets in environment variables or config files.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;deployment&quot;&gt;Deployment&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Containerization:&lt;/strong&gt; Each service is a Docker image with a multi-stage build (builder &amp;rarr; runtime). Images are scanned for vulnerabilities in CI.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Orchestration:&lt;/strong&gt; Kubernetes with namespaces per environment (dev, staging, prod). Services declare resource requests and limits.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CI/CD:&lt;/strong&gt; GitHub Actions or GitLab CI runs tests, builds images, pushes to a container registry, and deploys via Helm charts or ArgoCD.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Observability:&lt;/strong&gt; Prometheus + Grafana for metrics, Jaeger for distributed tracing, Fluentd/Loki for centralized logs. Every service emits structured JSON logs with a correlation ID.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;what-id-do-differently-at-different-scales&quot;&gt;What I'd do differently at different scales&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Scale&lt;/th&gt;
&lt;th&gt;Approach&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;MVP (1 city, &amp;lt; 1K rides/day)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Monolith with a single PostgreSQL database. Extract the geo-location queries into a background worker if they slow down the main app.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Growth (5 cities, 10K rides/day)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Extract Geo-Location and Notification as separate services. Keep everything else in the monolith. Add Redis for caching.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Scale (50+ cities, 100K+ rides/day)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Full microservices as described above. Invest in Kafka for event-driven architecture, dedicated SRE team, and per-service databases.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The biggest mistake is building for the third row when you're at the first row. Start simple, measure, and extract when the pain is real.&lt;/p&gt;
</description>
<category>Other</category>
<guid isPermaLink="true">https://coderlegion.com/14661/architectural-design-for-a-ride-app-such-as-ola-uber-rapido</guid>
<pubDate>Sat, 18 Apr 2026 11:02:58 +0000</pubDate>
</item>
<item>
<title>Kubernetes HPA Best Practices: When CPU Works, Why Memory Almost Never Does</title>
<link>https://coderlegion.com/14649/kubernetes-hpa-best-practices-when-cpu-works-why-memory-almost-never-does</link>
<description>
&lt;a href=&quot;https://alexandre-vazquez.com/kubernetes-hpa-best-practices/&quot; title=&quot;Kubernetes HPA Best Practices: When CPU Works, Why Memory Almost Never Does&quot; rel=&quot;nofollow&quot;&gt;&lt;img width=&quot;1536&quot; height=&quot;1024&quot; src=&quot;https://mlk5tkvgfeoa.i.optimole.com/cb:s8WW.68/w:1536/h:1024/q:mauto/f:best/https://alexandre-vazquez.com/wp-content/uploads/2026/04/hpa-featured.avif&quot; class=&quot;webfeedsFeaturedVisual wp-post-image&quot; alt=&quot;Kubernetes HPA best practices diagram showing CPU vs memory autoscaling behavior&quot; style=&quot;display: block; margin: auto; margin-bottom: 5px;max-width: 100%;&quot; title=&quot;Kubernetes HPA Best Practices: When CPU Works, Why Memory Almost Never Does 2&quot;&gt;&lt;/a&gt;&amp;lt;!--
SEO Title: Kubernetes HPA Best Practices: When CPU Works, Why Memory Almost Never Does
Meta Description: Stop blindly setting 70% CPU/memory HPA thresholds. Learn when memory-based HPA breaks, why idle workloads scale up, and what metrics to use instead.
Focus Keywords: kubernetes hpa best practices,kubernetes memory hpa,hpa cpu vs memory kubernetes,horizontal pod autoscaler best practices
Slug: kubernetes-hpa-best-practices
--&amp;gt;


&lt;p&gt;There is a configuration that appears in virtually every Kubernetes cluster: a HorizontalPodAutoscaler targeting 70% CPU utilization and 70% memory utilization. It looks reasonable. It follows the examples in the official documentation. And in many cases, it silently causes more harm than good.&lt;/p&gt;



&lt;p&gt;The problems surface in predictable ways: workloads that do nothing get scaled up because their memory footprint is naturally high. Latency-sensitive APIs scale too slowly because the CPU spike is already over by the time new pods are ready. Batch jobs oscillate between scaling up and down during normal operation. And teams spend hours debugging autoscaling behavior that should have been straightforward.&lt;/p&gt;



&lt;p&gt;This article is about understanding &lt;strong&gt;why the default HPA configuration fails&lt;/strong&gt;, under which exact conditions memory-based HPA is appropriate (and when it is not), and what alternative metrics &amp;mdash; custom metrics, event-driven triggers, and external signals &amp;mdash; produce autoscaling behavior that actually matches workload demand.&lt;/p&gt;



&lt;h2 class=&quot;wp-block-heading&quot;&gt;How HPA Actually Decides to Scale&lt;/h2&gt;



&lt;p&gt;Before diagnosing the problems, it is worth understanding the mechanics precisely. HPA computes a desired replica count using this formula:&lt;/p&gt;



&lt;pre class=&quot;wp-block-code&quot;&gt;&lt;code&gt;desiredReplicas = ceil(currentReplicas &amp;times; (currentMetricValue / desiredMetricValue))&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;For a CPU target of 70%, with 2 replicas currently consuming an average of 140% of their CPU request, HPA computes &lt;code&gt;ceil(2 &amp;times; (140 / 70)) = 4&lt;/code&gt; replicas. This is conceptually simple but has a critical dependency that most configurations ignore: &lt;strong&gt;the metric value is expressed relative to the resource &lt;em&gt;request&lt;/em&gt;, not the resource limit&lt;/strong&gt;.&lt;/p&gt;



&lt;p&gt;This distinction is fundamental to understanding every failure mode that follows. If a container has a CPU request of 100m and a limit of 2000m, and it is currently consuming 80m, HPA sees 80% utilization &amp;mdash; even though the container is using only 4% of its allowed ceiling. Set an HPA threshold of 70% on a container with a CPU request of 100m and any nontrivial workload will trigger scaling immediately.&lt;/p&gt;



&lt;p&gt;The HPA controller polls metrics every 15 seconds by default (&lt;code&gt;--horizontal-pod-autoscaler-sync-period&lt;/code&gt;). Scale-up happens quickly &amp;mdash; within one to three polling cycles when the threshold is consistently exceeded. Scale-down is deliberately slow: by default the controller waits 5 minutes (&lt;code&gt;--horizontal-pod-autoscaler-downscale-stabilization&lt;/code&gt;) before reducing replicas, to avoid thrashing. This asymmetry matters when debugging oscillation.&lt;/p&gt;



&lt;h2 class=&quot;wp-block-heading&quot;&gt;CPU-Based HPA: When It Works and When It Doesn&amp;rsquo;t&lt;/h2&gt;



&lt;p&gt;CPU is a &lt;em&gt;compressible&lt;/em&gt; resource. When a container hits its CPU limit, the kernel throttles it &amp;mdash; the process slows down but does not crash or get evicted. This property makes CPU a reasonable proxy for load in many, but not all, scenarios.&lt;/p&gt;



&lt;h3 class=&quot;wp-block-heading&quot;&gt;Where CPU HPA Works Well&lt;/h3&gt;



&lt;p&gt;&lt;strong&gt;Stateless request-processing workloads&lt;/strong&gt; are the sweet spot for CPU-based HPA. If your service does CPU-bound work per request &amp;mdash; REST APIs performing data transformation, compute-heavy business logic, image processing &amp;mdash; then CPU utilization correlates strongly with request volume. More requests means more CPU consumed, which means HPA adds replicas, which distributes the load.&lt;/p&gt;



&lt;p&gt;The key prerequisites for CPU HPA to work correctly are:&lt;/p&gt;



&lt;ul class=&quot;wp-block-list&quot;&gt;
&lt;li&gt;&lt;strong&gt;Accurate CPU requests.&lt;/strong&gt; Set requests to the actual sustained consumption of the workload under normal load, not a low placeholder. Use VPA in recommendation mode or historical Prometheus data to right-size requests before enabling HPA.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reasonable request-to-limit ratio.&lt;/strong&gt; A ratio of 1:4 or less keeps HPA thresholds meaningful. A container with request 100m and limit 4000m makes percentage-based thresholds nearly useless.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CPU consumption that tracks user load linearly.&lt;/strong&gt; If your service does CPU-heavy background work independent of incoming requests, CPU utilization will trigger scaling regardless of actual demand.&lt;/li&gt;
&lt;/ul&gt;



&lt;h3 class=&quot;wp-block-heading&quot;&gt;Where CPU HPA Fails&lt;/h3&gt;



&lt;p&gt;&lt;strong&gt;Latency-sensitive services with sharp traffic spikes.&lt;/strong&gt; HPA reacts to average CPU utilization measured over the polling window. For a service that handles traffic bursts &amp;mdash; a flash sale, a cron-triggered batch of API calls, a notification broadcast &amp;mdash; by the time the HPA controller detects the spike, queues new pods, and those pods pass readiness checks, the burst may already be over. The result is replicas added after the damage is done, with the added cost of a scale-down cycle afterward.&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;I/O-bound workloads.&lt;/strong&gt; A service that spends most of its time waiting on database queries, external API calls, or message queue reads will show low CPU utilization even under heavy load. HPA will not add replicas while the service is degraded &amp;mdash; it sees idle CPUs while goroutines or threads are blocked waiting on I/O.&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;Workloads with cold-start costs.&lt;/strong&gt; If a new replica takes 30-60 seconds to warm up (loading ML models, establishing connection pools, populating caches), scaling decisions need to happen earlier &amp;mdash; before CPU peaks &amp;mdash; not in reaction to it.&lt;/p&gt;



&lt;h2 class=&quot;wp-block-heading&quot;&gt;Memory-Based HPA: Why It Almost Always Breaks&lt;/h2&gt;



&lt;p&gt;Memory is an &lt;em&gt;incompressible&lt;/em&gt; resource. Unlike CPU &amp;mdash; which can be throttled without killing a process &amp;mdash; when a container exhausts its memory limit, the OOM killer terminates it. This single property cascades into a set of fundamental problems with using memory as an HPA trigger.&lt;/p&gt;



&lt;h3 class=&quot;wp-block-heading&quot;&gt;The Core Problem: Memory Doesn&amp;rsquo;t Naturally Correlate With Load&lt;/h3&gt;



&lt;p&gt;For most well-architected services, memory consumption is relatively stable. A Go service allocates memory at startup for its runtime structures, connection pools, and caches &amp;mdash; and then maintains roughly that footprint regardless of traffic. A JVM application allocates a heap at startup and uses garbage collection to manage it. In both cases, memory usage under 10 requests per second and under 10,000 requests per second may be nearly identical.&lt;/p&gt;



&lt;p&gt;This means a memory-based HPA with a 70% threshold will either:&lt;/p&gt;



&lt;ul class=&quot;wp-block-list&quot;&gt;
&lt;li&gt;&lt;strong&gt;Never trigger,&lt;/strong&gt; because the workload&amp;rsquo;s memory is stable and always below the threshold &amp;mdash; rendering the HPA useless.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Always trigger,&lt;/strong&gt; because the workload&amp;rsquo;s baseline memory consumption is naturally above the threshold &amp;mdash; causing the workload to scale out permanently and never scale back in.&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;Neither outcome corresponds to actual scaling need.&lt;/p&gt;



&lt;h3 class=&quot;wp-block-heading&quot;&gt;The Request Misconfiguration Trap&lt;/h3&gt;



&lt;p&gt;This is the failure mode the user mentioned, and it is the most common cause of &amp;ldquo;my workload scales up for no reason.&amp;rdquo; Consider a Java service that needs 512Mi of heap to run normally. The team sets memory request to 256Mi &amp;mdash; too conservative, either to save cost or because the initial estimate was wrong. The service immediately consumes 200% of its memory request just by being alive. An HPA with a 70% memory target will scale this workload to maximum replicas within minutes of deployment, and it will stay there forever.&lt;/p&gt;



&lt;p&gt;The fix is never &amp;ldquo;adjust the HPA threshold.&amp;rdquo; The fix is right-sizing the memory request. But this reveals the deeper issue: &lt;strong&gt;memory-based HPA is extremely sensitive to the accuracy of your resource requests&lt;/strong&gt;, and most teams do not have accurate requests &amp;mdash; especially for newer workloads or after code changes that alter memory footprint.&lt;/p&gt;



&lt;h3 class=&quot;wp-block-heading&quot;&gt;JVM and Go Runtime Memory Behavior&lt;/h3&gt;



&lt;p&gt;&lt;strong&gt;JVM workloads&lt;/strong&gt; are particularly problematic. By default, the JVM allocates heap up to a maximum (-Xmx) and then holds that memory &amp;mdash; it does not release heap back to the OS aggressively, even after garbage collection. A JVM service that handles one request per hour will show nearly the same memory footprint as one handling thousands of requests per minute. Furthermore, the JVM&amp;rsquo;s garbage collector introduces memory spikes during collection cycles that are unrelated to load.&lt;/p&gt;



&lt;p&gt;In containerized JVM environments, you also need to account for the container memory limit aware flag (&lt;code&gt;-XX:+UseContainerSupport&lt;/code&gt;, enabled by default since JDK 11) which affects how the JVM calculates its heap ceiling relative to the container limit. Without proper tuning, the JVM may allocate a heap that fills 80-90% of the container&amp;rsquo;s memory limit &amp;mdash; immediately triggering any memory-based HPA.&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;Go workloads&lt;/strong&gt; behave differently but also poorly with memory HPA. Go&amp;rsquo;s garbage collector is designed to maintain low latency rather than minimal memory use. The runtime may hold memory above what is strictly needed, and the memory footprint can vary based on GC tuning parameters (&lt;code&gt;GOGC&lt;/code&gt;, &lt;code&gt;GOMEMLIMIT&lt;/code&gt;) in ways that are not correlated with incoming request load.&lt;/p&gt;



&lt;h3 class=&quot;wp-block-heading&quot;&gt;When Memory HPA Is Actually Appropriate&lt;/h3&gt;



&lt;p&gt;There are narrow cases where memory-based HPA makes sense:&lt;/p&gt;



&lt;ul class=&quot;wp-block-list&quot;&gt;
&lt;li&gt;&lt;strong&gt;Workloads where memory consumption genuinely tracks with load linearly.&lt;/strong&gt; Some data processing pipelines, in-memory caches that grow with request volume, or streaming applications that buffer data proportionally to throughput. If you can demonstrate from metrics that memory and load have a strong linear correlation, memory HPA is defensible.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;As a safety valve alongside CPU HPA.&lt;/strong&gt; Using memory as a secondary metric (not primary) to protect against memory leaks or runaway allocations in a service that normally scales on CPU. In this case, set the memory threshold high &amp;mdash; 85-90% &amp;mdash; so it only triggers in genuine overconsumption scenarios.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Caching services where eviction is not desirable.&lt;/strong&gt; If a service uses memory as a performance cache and you want to scale out before memory pressure causes cache eviction, memory utilization can be a useful trigger &amp;mdash; provided requests are accurately sized.&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;Outside these specific cases, removing memory from your HPA spec and relying on the signals below will produce better behavior in virtually every scenario.&lt;/p&gt;



&lt;h2 class=&quot;wp-block-heading&quot;&gt;Right-Sizing Requests Before You Add HPA&lt;/h2&gt;



&lt;p&gt;No HPA strategy works correctly without accurate resource requests. Before adding any autoscaler &amp;mdash; CPU, memory, or custom metrics &amp;mdash; run your workload under representative load and measure actual consumption. The easiest way to do this is with VPA in recommendation mode:&lt;/p&gt;



&lt;pre class=&quot;wp-block-code&quot;&gt;&lt;code&gt;apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
  name: my-service-vpa
spec:
  targetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: my-service
  updatePolicy:
    updateMode: &quot;Off&quot;   # Recommendation only &amp;mdash; don't auto-apply&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;After 24-48 hours of traffic, check the VPA recommendations:&lt;/p&gt;



&lt;pre class=&quot;wp-block-code&quot;&gt;&lt;code&gt;kubectl describe vpa my-service-vpa&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;The &lt;code&gt;lowerBound&lt;/code&gt;, &lt;code&gt;target&lt;/code&gt;, and &lt;code&gt;upperBound&lt;/code&gt; values give you a data-driven baseline for setting requests. Set your requests at or near the VPA &lt;code&gt;target&lt;/code&gt; value before configuring HPA. This single step eliminates the most common cause of HPA misbehavior.&lt;/p&gt;



&lt;p&gt;Note that &lt;strong&gt;VPA and HPA cannot both manage the same resource metric simultaneously&lt;/strong&gt;. If VPA is set to auto-update CPU or memory, and HPA is also scaling on those metrics, the two controllers will fight each other. The safe combination is: HPA on CPU/memory + VPA in recommendation-only mode, or HPA on custom metrics + VPA on CPU/memory in auto mode. See the &lt;a rel=&quot;nofollow&quot; href=&quot;https://alexandre-vazquez.com/introduction/&quot;&gt;Kubernetes VPA guide&lt;/a&gt; for the full details.&lt;/p&gt;



&lt;h2 class=&quot;wp-block-heading&quot;&gt;Better Signals: What to Scale On Instead&lt;/h2&gt;



&lt;p&gt;The fundamental shift is moving from &lt;em&gt;resource consumption&lt;/em&gt; metrics (which describe the past) to &lt;em&gt;demand&lt;/em&gt; metrics (which describe what the workload is being asked to do right now or will be asked to do in seconds).&lt;/p&gt;



&lt;h3 class=&quot;wp-block-heading&quot;&gt;Requests Per Second (RPS)&lt;/h3&gt;



&lt;p&gt;For HTTP services, requests per second per replica is usually the most accurate proxy for load. Unlike CPU, it measures demand directly &amp;mdash; not a side-effect of demand. An HPA that maintains 500 RPS per replica will scale predictably as traffic grows, regardless of whether the service is CPU-bound, memory-bound, or I/O-bound.&lt;/p&gt;



&lt;p&gt;RPS is available as a custom metric from your service mesh (Istio exposes it as &lt;code&gt;istio_requests_total&lt;/code&gt;), from your ingress controller (NGINX exposes request rates via Prometheus), or from your application&amp;rsquo;s own Prometheus metrics. Configuring HPA on custom metrics requires the Prometheus Adapter or a compatible custom metrics API implementation.&lt;/p&gt;



&lt;pre class=&quot;wp-block-code&quot;&gt;&lt;code&gt;apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: my-service-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: my-service
  minReplicas: 2
  maxReplicas: 20
  metrics:
  - type: Pods
    pods:
      metric:
        name: http_requests_per_second
      target:
        type: AverageValue
        averageValue: &quot;500&quot;   # 500 RPS per replica&lt;/code&gt;&lt;/pre&gt;



&lt;h3 class=&quot;wp-block-heading&quot;&gt;Queue Depth and Lag&lt;/h3&gt;



&lt;p&gt;For consumer workloads &amp;mdash; services reading from Kafka, RabbitMQ, SQS, or any message queue &amp;mdash; the right scaling signal is &lt;strong&gt;consumer lag&lt;/strong&gt;: how many messages are waiting to be processed. A lag of zero means consumers are keeping up; a growing lag means you need more consumers.&lt;/p&gt;



&lt;p&gt;CPU will not give you this signal reliably. A consumer blocked on a slow database write will show low CPU but growing lag. An idle consumer will show low CPU even if the queue contains millions of unprocessed messages. Scaling on lag directly solves both problems.&lt;/p&gt;



&lt;p&gt;This is precisely the use case that &lt;a rel=&quot;nofollow&quot; href=&quot;https://alexandre-vazquez.com/enhanced-autoscaling-options-for-event-driven-applications/&quot;&gt;KEDA was built for&lt;/a&gt;. KEDA&amp;rsquo;s Kafka scaler, for example, reads consumer group lag directly and scales replicas to maintain a configurable lag threshold &amp;mdash; no custom metrics pipeline required.&lt;/p&gt;



&lt;h3 class=&quot;wp-block-heading&quot;&gt;Latency&lt;/h3&gt;



&lt;p&gt;P99 latency per replica is an excellent scaling signal for latency-sensitive services. If your SLO is a 200ms P99 response time and latency starts climbing toward 400ms, that is a direct signal that the service is overloaded &amp;mdash; regardless of what CPU or memory shows.&lt;/p&gt;



&lt;p&gt;Latency-based autoscaling requires custom metrics from your service mesh or APM tool, but the added complexity is often justified for user-facing APIs where latency directly impacts experience.&lt;/p&gt;



&lt;h3 class=&quot;wp-block-heading&quot;&gt;Scheduled and Predictive Scaling&lt;/h3&gt;



&lt;p&gt;For workloads with predictable traffic patterns &amp;mdash; business-hours services, weekly batch jobs, end-of-month processing peaks &amp;mdash; proactive scaling outperforms reactive scaling by definition. Rather than waiting for CPU to spike and then scrambling to add replicas, you pre-scale before the expected load increase.&lt;/p&gt;



&lt;p&gt;KEDA&amp;rsquo;s Cron scaler enables this pattern declaratively, defining scale rules based on time windows rather than observed metrics.&lt;/p&gt;



&lt;h2 class=&quot;wp-block-heading&quot;&gt;HPA Configuration Best Practices&lt;/h2&gt;



&lt;h3 class=&quot;wp-block-heading&quot;&gt;Always Set minReplicas &amp;ge; 2 for Production&lt;/h3&gt;



&lt;p&gt;A &lt;code&gt;minReplicas: 1&lt;/code&gt; HPA means your service has a single point of failure during scale-in events. When HPA scales down to 1 replica and that pod is evicted for node maintenance, your service has zero available instances for the duration of the new pod&amp;rsquo;s startup time. For any production workload, set &lt;code&gt;minReplicas: 2&lt;/code&gt; as a baseline.&lt;/p&gt;



&lt;h3 class=&quot;wp-block-heading&quot;&gt;Tune Stabilization Windows&lt;/h3&gt;



&lt;p&gt;The default 5-minute scale-down stabilization window is too aggressive for many workloads. A service that processes jobs in 3-minute batches will show a predictable CPU trough between batches &amp;mdash; HPA will attempt to scale down, only to scale back up when the next batch arrives. Increase the stabilization window to match your workload&amp;rsquo;s natural cycle:&lt;/p&gt;



&lt;pre class=&quot;wp-block-code&quot;&gt;&lt;code&gt;apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: my-service-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: my-service
  minReplicas: 2
  maxReplicas: 20
  metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization
        averageUtilization: 60
  behavior:
    scaleDown:
      stabilizationWindowSeconds: 600   # 10 minutes
      policies:
      - type: Percent
        value: 25                        # Scale down max 25% of replicas at once
        periodSeconds: 60
    scaleUp:
      stabilizationWindowSeconds: 0     # Scale up immediately
      policies:
      - type: Percent
        value: 100
        periodSeconds: 30&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;The &lt;code&gt;behavior&lt;/code&gt; block (available in HPA v2, GA since Kubernetes 1.23) gives you independent control over scale-up and scale-down behavior. Aggressive scale-up with conservative scale-down is the right default for most production services.&lt;/p&gt;
</description>
<category>Other</category>
<guid isPermaLink="true">https://coderlegion.com/14649/kubernetes-hpa-best-practices-when-cpu-works-why-memory-almost-never-does</guid>
<pubDate>Mon, 13 Apr 2026 23:51:55 +0000</pubDate>
</item>
<item>
<title>API Gateway vs Service Mesh: Beyond the North–South/East–West Myth</title>
<link>https://coderlegion.com/7852/api-gateway-vs-service-mesh-beyond-the-north-south-east-west-myth</link>
<description>&lt;p&gt;There is a limit of some characters and I could not publish the page here for API Gateway vs Service Mesh.&lt;/p&gt;
&lt;p&gt;Article Link: &lt;a rel=&quot;nofollow&quot; href=&quot;https://dev.to/rajkundalia/api-gateway-vs-service-mesh-beyond-the-north-southeast-west-myth-2mpg&quot;&gt;https://dev.to/rajkundalia/api-gateway-vs-service-mesh-beyond-the-north-southeast-west-myth-2mpg&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Code Link: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/rajkundalia/api-gateway-service-mesh-sample&quot;&gt;https://github.com/rajkundalia/api-gateway-service-mesh-sample&lt;/a&gt;&lt;/p&gt;
</description>
<category>Java</category>
<guid isPermaLink="true">https://coderlegion.com/7852/api-gateway-vs-service-mesh-beyond-the-north-south-east-west-myth</guid>
<pubDate>Wed, 26 Nov 2025 14:38:07 +0000</pubDate>
</item>
</channel>
</rss>