Secret Masking Configuration
Atmos automatically masks sensitive data (secrets, API keys, tokens) in all terminal output to prevent accidental exposure in logs, screenshots, or CI/CD pipelines.
Overviewâ
Secret masking operates at the I/O layer, intercepting all output before it reaches stdout/stderr. This ensures secrets are masked regardless of:
- Output format (plain text, JSON, YAML)
- Output destination (terminal, file, pipe)
- Command type (terraform, helmfile, custom commands)
Quick Startâ
Enable Masking (Default)â
Masking is enabled by default with 8 built-in patterns for common secrets:
# atmos.yaml
settings:
terminal:
mask:
enabled: true # Default: true
Disable Masking for Debuggingâ
Use the CLI flag to disable masking temporarily:
atmos terraform plan --mask=false
Configurationâ
Full Configuration Exampleâ
# atmos.yaml
settings:
terminal:
mask:
enabled: true # Enable/disable masking (default: true)
replacement: "***MASKED***" # Custom replacement text (default: ***MASKED***)
Configuration Optionsâ
enabledEnable or disable secret masking globally.
- Type: boolean
- Default:
true - Example:
enabled: false
replacementText to replace masked secrets with.
- Type: string
- Default:
"***MASKED***" - Example:
replacement: "[REDACTED]"
Built-In Patternsâ
Atmos includes 8 built-in patterns for common secret formats:
-
GitHub Personal Access Tokens
- Classic format:
ghp_[A-Za-z0-9]{36} - OAuth format:
gho_[A-Za-z0-9]{36} - New format:
github_pat_[A-Za-z0-9]{22}_[A-Za-z0-9]{59}
- Classic format:
-
GitLab Personal Access Tokens
- Format:
glpat-[A-Za-z0-9\-_]{20}
- Format:
-
OpenAI API Keys
- Format:
sk-[A-Za-z0-9]{48}
- Format:
-
AWS Access Key ID
- Format:
AKIA[0-9A-Z]{16}
- Format:
-
AWS Secret Access Key
- Format: 40-character base64 string
-
Bearer Tokens
- Format:
Bearer [A-Za-z0-9\-._~+/]+=*
- Format:
Auto-Masked Environment Variablesâ
The following environment variables are automatically detected and masked:
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_SESSION_TOKENGITHUB_TOKENGH_TOKENGITLAB_TOKENCI_JOB_TOKENDATADOG_API_KEYDD_API_KEYANTHROPIC_API_KEY
CLI Flagsâ
--maskâ
Enable or disable masking for a single command:
# Disable masking for debugging
atmos terraform plan --mask=false
# Explicitly enable masking (default)
atmos terraform plan --mask=true
How It Worksâ
Masking Flowâ
- Initialization - Atmos loads masking configuration on startup
- Pattern Registration - Built-in patterns and env var values are registered
- Output Interception - All output goes through the masking engine
- Secret Detection - Regex patterns and literal values are matched
- Replacement - Matched secrets are replaced with
***MASKED***
Format-Aware Maskingâ
Secrets are detected in multiple formats:
- Plain text:
sk-abc123def456 - JSON:
{"api_key": "sk-abc123def456"} - YAML:
api_key: sk-abc123def456 - URL-encoded:
key=sk%2Dabc123def456 - Base64:
c2stYWJjMTIzZGVmNDU2 - Hex:
736b2d616263313233646566343536
Performanceâ
Masking has minimal performance impact:
- Initialization: <50ms
- Per-operation: <3Ξs (no secrets), <16Ξs (with secrets)
- Memory: ~100KB for pattern storage
Use Casesâ
Production Deploymentsâ
Prevent secrets from appearing in CI/CD logs:
# atmos.yaml
settings:
terminal:
mask:
enabled: true
# Run deployment - secrets automatically masked
atmos terraform apply
Local Developmentâ
Disable masking for debugging:
# See full output for troubleshooting
atmos terraform plan --mask=false
Screenshot Generationâ
Enable masking when generating documentation screenshots:
settings:
terminal:
mask:
enabled: true
# Generate screenshots with masked secrets
atmos terraform plan | screenshot-tool
Security Considerationsâ
What Gets Maskedâ
- AWS credentials (access keys, secret keys, session tokens)
- GitHub/GitLab tokens and PATs
- OpenAI API keys
- Bearer tokens
- Values from configured environment variables
What Does NOT Get Maskedâ
- Non-secret configuration values
- Resource names and identifiers
- Public URLs and endpoints
- Log messages and status text
False Positivesâ
If legitimate values are incorrectly masked:
-
Disable masking temporarily:
atmos terraform plan --mask=false -
Report pattern issue: Open an issue with the false positive pattern
False Negativesâ
If secrets are NOT being masked:
- Check pattern coverage: Built-in patterns may not cover your secret format
- Custom secret formats: Consider contributing pattern to Atmos
Troubleshootingâ
Secrets Not Being Maskedâ
Problem: Expected secrets appear in output.
Solutions:
-
Verify masking is enabled:
settings:
terminal:
mask:
enabled: true -
Check if secret format matches built-in patterns
-
Check environment variables are set correctly
Legitimate Values Maskedâ
Problem: Non-secret values are being masked.
Solutions:
-
Temporarily disable masking for debugging:
atmos terraform plan --mask=false -
Report false positive pattern
Performance Issuesâ
Problem: Masking slows down output.
Solutions:
- Check for extremely large output (>10MB)
- Disable masking if performance is critical:
atmos terraform plan --mask=false
See Alsoâ
- Terminal Configuration - Terminal settings and options