Skip to main content
bagel
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Environment Probe

The env probe scans environment variables, shell configuration files, and .env files for exposed secrets.

What It Checks

SourceDescription
Environment VariablesAll currently set environment variables
Shell Config Files.bashrc, .zshrc, .bash_profile, etc.
.env FilesProject and home directory .env files

Files Scanned

Shell Configuration

  • ~/.bashrc
  • ~/.bash_profile
  • ~/.zshrc
  • ~/.zprofile
  • ~/.profile

Environment Files

  • ~/.env
  • .env in project directories
  • .env.local, .env.development, etc.

Finding Types

The env probe runs all registered detectors on the scanned content. Common findings include:

Finding IDSourceDescription
github-token-*Environment variableGitHub tokens in env vars
ai-service-*Shell configAI API keys in exports
cloud-credential-*.env fileCloud credentials
generic-api-keyAnyHigh-entropy secrets

Example Findings

Secret in Environment Variable

{
  "id": "github-token-classic-pat",
  "probe": "env",
  "severity": "critical",
  "title": "GitHub Token Detected (Classic Personal Access Token)",
  "message": "A GitHub Classic Personal Access Token was detected in environment variable GITHUB_TOKEN.",
  "path": "env:GITHUB_TOKEN"
}

Secret in Shell Config

{
  "id": "ai-service-openai-api-key",
  "probe": "env",
  "severity": "critical",
  "title": "AI Service API Key Detected (OpenAI API Key)",
  "message": "An OpenAI API Key was detected in file:/Users/dev/.zshrc.",
  "path": "file:/Users/dev/.zshrc"
}

Best Practices

Use secret managers and only load secrets when needed.

For Shell History

If secrets appear in your shell config, they may also be in your history. See the Shell History Probe for remediation.