<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Erick Cruz</title>
    <description>The latest articles on DEV Community by Erick Cruz (@leganux).</description>
    <link>https://dev.to/leganux</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4085876%2F59ec7363-8b1f-4124-8376-41f83b71d135.png</url>
      <title>DEV Community: Erick Cruz</title>
      <link>https://dev.to/leganux</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/leganux"/>
    <language>en</language>
    <item>
      <title>Why I Built a Secret-Injecting Proxy in Node.js After an API Key Leak Spent All Our Cloud Credits</title>
      <dc:creator>Erick Cruz</dc:creator>
      <pubDate>Thu, 20 Aug 2026 03:38:58 +0000</pubDate>
      <link>https://dev.to/leganux/why-i-built-a-secret-injecting-proxy-in-nodejs-after-an-api-key-leak-spent-all-our-cloud-credits-11eh</link>
      <guid>https://dev.to/leganux/why-i-built-a-secret-injecting-proxy-in-nodejs-after-an-api-key-leak-spent-all-our-cloud-credits-11eh</guid>
      <description>&lt;p&gt;The Incident&lt;br&gt;
It’s the classic startup nightmare: a .env file gets committed by accident, a scraper bot picks it up in under 30 seconds, and you wake up to depleted API credits and surprise cloud bills.&lt;/p&gt;

&lt;p&gt;After a credential leak burned our DeepSeek credits and threatened our AWS account, I realized that telling developers to "be more careful" is a broken security model. The real architectural fix is simple: Developers and client apps should never possess real production secrets in the first place.&lt;/p&gt;

&lt;p&gt;Introducing Llavero 🔑&lt;br&gt;
To solve this, I built Llavero (Keyring in Spanish), an open-source Credential-Aware Reverse Proxy / Secret Injection Gateway built with Node.js 24, TypeScript, Fastify, and SQLite.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Application&lt;br&gt;
    │  Authorization: Bearer llv_dev_xxx&lt;br&gt;
    ▼&lt;br&gt;
Llavero ── validate token ── policy (deny-by-default) &lt;br&gt;
    │── decrypt credential in-memory (AES-256-GCM) ── apply auth driver&lt;br&gt;
    ▼&lt;br&gt;
External API (OpenAI, Stripe, AWS...)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="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%2F9z37bf5sad4s4gyxye60.png" class="article-body-image-wrapper"&gt;&lt;img src="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%2F9z37bf5sad4s4gyxye60.png" alt="Architecture of llavero" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Architecture Highlights&lt;br&gt;
In-Memory Decryption: Secrets are encrypted at rest using AES-256-GCM. The master key lives strictly in memory (LLAVERO_MASTER_KEY).&lt;/p&gt;

&lt;p&gt;Deny-by-Default Policies: Clients must be explicitly granted permission for specific services, paths, and HTTP methods.&lt;/p&gt;

&lt;p&gt;Pluggable Auth Drivers: Handles complex authentication mechanisms like OAuth2 refresh token caching and AWS SigV4 request signing automatically.&lt;/p&gt;

&lt;p&gt;Streaming &amp;amp; WebSocket Support: Native proxying for SSE (Server-Sent Events) and WS handshakes without buffering payload.&lt;/p&gt;

&lt;p&gt;Log Redaction &amp;amp; SSRF Guard: Strict origin validation and automatic redaction of sensitive headers in Pino logs.&lt;/p&gt;

&lt;p&gt;Join the Project!&lt;br&gt;
Llavero is fully open-source under the MIT license. I’m actively looking for feedback, security reviews, and contributions:&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/leganux/llavero-keychain" rel="noopener noreferrer"&gt;Go to REPO &lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Needs: Security auditing, additional auth drivers, and HA storage adapters.&lt;/p&gt;

&lt;p&gt;Let me know what you think in the comments below!&lt;/p&gt;

&lt;p&gt;&lt;a href="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%2Fk1vyhpy67dmt76nmk80y.png" class="article-body-image-wrapper"&gt;&lt;img src="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%2Fk1vyhpy67dmt76nmk80y.png" alt="A storytime about it" width="800" height="1200"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>selfhosted</category>
      <category>node</category>
      <category>security</category>
      <category>passwords</category>
    </item>
  </channel>
</rss>
