SShortSingh.
Back to feed

How to Keep Dev Secrets Off Disk Using Bitwarden and direnv

0
·9 views

Developers commonly store sensitive credentials like API keys and database passwords in plaintext files such as .env or shell profiles, leaving them vulnerable to malware, accidental commits, or stolen hardware. The core risk is that these secrets sit permanently decrypted on disk without requiring any identity verification at the time of use. A more secure alternative involves storing secrets in an encrypted password manager like Bitwarden and using the direnv tool to inject them as environment variables only when inside a specific project directory. This combination means credentials are never written to disk in plaintext — they exist only in memory for the duration of a shell session, unlocked via a master password prompt. The same pattern can be applied to any type of secret by adjusting the Bitwarden item name and the environment variables being exported.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Five Questions to Ask Before Building on a Free AI Platform Trial

Engineering teams often integrate free AI platform tiers into their workflows without fully understanding the trade-offs, only to face compliance and reliability issues later. A decision framework built around five key questions helps teams evaluate whether to use a managed free-tier AI platform or self-host their own stack. The five areas of scrutiny are data boundaries, latency tolerance, load patterns, operational responsibilities, and exit costs. Each gate requires evidence-based answers rather than assumptions, with particular emphasis on testing vendor lock-in risks from day one. The framework uses MonkeyCode, an open-source AI development platform with a free server option and a 10 million token allowance, as a worked example.

0
ProgrammingDEV Community ·

How to Build Real-Time Inventory APIs That Prevent Overselling and Stock Errors

Inventory management systems often return incorrect stock quantities when multiple operations update the same SKU simultaneously, causing overselling or negative stock. A reliable architecture requires explicit concurrency rules, transaction boundaries, idempotency, and a full event audit trail rather than simple CRUD endpoints. One practical approach combines Node.js, PostgreSQL, Redis, and AWS, where PostgreSQL serves as the authoritative source of truth for all stock-changing transactions. Instead of a read-then-write pattern, stock mutations should be validated and applied within a single atomic database transaction to eliminate race conditions. An inventory ledger table recording every quantity change alongside the main inventory table provides both operational accuracy and a complete audit history.

0
ProgrammingDEV Community ·

Cybersecurity Learner Documents Hands-On Nmap Network Reconnaissance Study

A cybersecurity self-learner published a write-up in August 2026 documenting their practical experience with network reconnaissance using Nmap. The study was conducted as part of a structured self-education effort being pursued alongside an active job search. The learner worked through guided rooms covering Nmap's core scanning capabilities, gaining firsthand experience identifying open ports and running services on target systems. The exercise highlighted the difference between theoretical knowledge and practical application of reconnaissance tools. The author indicated plans to build on this foundation in subsequent study sessions.

0
ProgrammingDEV Community ·

Treat AI Models as Dependencies, Not Products, to Avoid Integration Failures

A software team recently lost three days of work after switching LLM providers over a weekend, only to discover a schema mismatch where the new provider returned responses in a different format than the old one. No tests had been written against the response contract, causing every prompt template in the codebase to return empty strings. The author argues that the real product teams ship is the contract between their app and the model, not the model itself, and that it should be defined before a model is even chosen. To enforce this, the author builds a lightweight API gateway that accepts a fixed request shape, calls a configurable provider, and always returns a fixed response shape, with model names stored as environment variables. Running a contract test suite against this gateway in CI can prevent the kind of costly provider-swap failures that stem from undocumented response format assumptions.