DEV Community

Cover image for Env Shield: Your Secret Guardian in VS Code
Crhistopher Suriel
Crhistopher Suriel

Posted on

3 1 1 1 1

Env Shield: Your Secret Guardian in VS Code

Introduction

As developers, we know how crucial it is to protect sensitive information during collaborative work. That's why I created Env Shield, a small VS Code extension designed to protect sensitive information from accidental exposure. Whether you're sharing your screen during pair programming sessions, recording tutorials, or taking screenshots, Env Shield ensures your secrets stay secret by automatically blurring sensitive content in your configuration files.

Key Features

1. Automatic Secret Detection

  • Hide sensitive content in .env files and other configuration files by blurring the value of your secret keys.
    Secret Detection

  • Recognizes common patterns for API keys, passwords, tokens, and other credentials from given configuration files.
    Common patterns

2. Smart File Recognition

  • Built-in support for .env files and their variants (.env.local, .env.development, etc.)
  • It is configured to protect additional file types (JSON, YAML, etc.).
  • Customizable file patterns to match your project's structure

3. Dynamic Blur Control

  • Toggle blur on/off with a simple click
  • Status bar indicator shows current protection status
  • Automatic reactivation when switching files or windows

Getting Started

Installation

From the editor:

  1. Open VS Code
  2. Access the Extensions Marketplace
  3. Search for "Env Shield"
  4. Click Install

From the marketplace:

  1. Visit the Visual Studio Code Marketplace
  2. Click the "Install" button

Basic Configuration

The extension works out of the box with default settings, but you can customize it through VS Code settings:

{
  "env-shield.additionalFiles": ["config.json", "secrets.yaml"],
  "env-shield.sensitiveFiles": ["**/credentials/*"],
}
Enter fullscreen mode Exit fullscreen mode

Usage Scenarios

Pair Programming

Env Shield automatically blurs sensitive values in your .env files while keeping the key names visible when sharing your screen during pair programming sessions. This allows you to discuss configuration without exposing actual credentials.

Documentation and Tutorials

Creating documentation or tutorials? Env Shield helps you capture clean screenshots without accidentally including sensitive information. The blur toggle feature lets you quickly switch between protected and visible states.

Tips

  1. Quick Toggle: Use the status bar indicator to toggle blur protection on/off when needed quickly.

  2. File Patterns: Configure additional file patterns to protect sensitive files across your project:

{
  "env-shield.additionalFiles": [
    "config/*.json",
    "**/secrets/*",
    "deployment/credentials.yaml"
  ]
}
Enter fullscreen mode Exit fullscreen mode

Conclusion

Env Shield is an essential tool for modern development workflows where security and privacy are paramount. It automatically protects sensitive information while maintaining productivity, providing peace of mind during collaborative development activities.

Remember: The best security breach is the one that never happens. With Env Shield, you're one step closer to ensuring your secrets remain secret.

Image of Timescale

PostgreSQL for Agentic AI — Build Autonomous Apps on One Stack

pgai turns PostgreSQL into an AI-native database for building RAG pipelines and intelligent agents. Run vector search, embeddings, and LLMs—all in SQL

Build Today

Top comments (1)

Collapse
 
josemanuelnunez profile image
JoseManuelNunez

Great!!! I find Env Shield very interesting and how it helps protect sensitive information automatically. One case where I would definitely use it is when making presentations or recordings explaining project configurations. Sometimes, it's easy to forget that there are credentials in open files, and this extension would help prevent accidental exposure. Great work!

Sentry image

Make it make sense

Only get the information you need to fix your code that’s broken with Sentry.

Start debugging →

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay