Vault Radar extension for VS Code
This Visual Studio Code extension uses Vault Radar CLI to highlight secrets detected and help with the remediation.
Features
Real-time Secret Detection: Get immediate feedback on hardcoded secrets.
Intelligent Highlighting: Easily identify secrets with clear severity indicators for quick assessment.
Detailed Secret Information: Hover or click on detected secrets to view crucial details like secret type, severity, and activeness.
Actionable Remediation: Connect to a Hashicorp Vault instance to correlate known risks or copy discovered secrets.
AI-Powered Remediation: Use GitHub Copilot to automatically replace Radar-detected secrets with code that retrieves those secrets from Vault. Works best with modern Sonnet and GPT models.
License-independent Vault Features: Manage Vault connections, index and browse KV secrets, and add or update secrets without a Radar license.
Copy Secret Path: Copy a key's fully qualified Vault path with one click from the Vault Connections tree.
Automatic Vault Reindexing: Keep indexed Vault inventory up to date with a configurable background timer for each connection.
Available Commands
Vault Radar: Scan content in active editor - Scan the currently active file
Vault Radar: Scan entire workspace - Scan all files in the workspace with a progress indicator
Vault Radar: Set License Key - Configure your Vault Radar license key
Vault Radar: Clear License Key - Remove the configured license key
Vault Radar: Set License File - Configure a license file path
Vault Radar: Clear License File - Remove the configured license file path
Vault Radar: Index Vault - Index KV secrets in a connected Vault server
Vault Features
Vault connection management, indexing, inventory browsing, and secret writes use the Vault API directly and do not require a Radar license or the Radar CLI daemon. You still need Vault credentials and permissions for the operations you perform. Secret detection and scanning require a valid Radar license.
Copy Secret Path
In the Vault Connections tree, expand an indexed secret and click the inline Copy Secret Path button on a key node. The extension copies the path to the clipboard and displays Path copied to clipboard.
- KV v1:
[namespace/]<mount>/<secretPath>:<key>
- KV v2:
[namespace/]<mount>/data/<secretPath>:<key>
The namespace prefix is omitted for the root namespace. This copies the path, not the secret value, and does not make a Vault API request.
Automatic Vault Reindexing
Each connection has a background timer to refresh its indexed inventory while the extension is running. Configure vault-radar.vault.autoReindexIntervalHours in VS Code settings:
| Setting behavior |
Value |
| Default interval |
3 hours |
| Allowed settings range |
0-24 hours, including fractional hours |
| Disable scheduled reindexing |
0 |
| Minimum effective positive interval |
5 minutes; smaller positive values are raised to 5 minutes and a warning is logged |
On activation, timers for saved, previously indexed connections use their last-indexed timestamps; overdue connections are scheduled immediately. After a scheduled index finishes, the next timer uses the full configured interval.
For connections without an index, run Vault Radar: Index Vault first. New connections are indexed automatically by default through the separate vault-radar.vault.autoIndexOnConnection setting. Setting the reindex interval to 0 does not disable manual indexing or indexing on connection creation.
If a scheduled reindex stops with an authentication warning, update the connection credentials and run Vault Radar: Index Vault manually to resume scheduling.
Installation steps
- Install HCP Vault Radar from the VS Code Marketplace.
- For Vault features, add a connection from the Vault Connections panel and configure your Vault credentials. No Radar license is required.
- To enable secret detection, acquire a Vault Radar license and configure it with one of the following commands:
Vault Radar: Set License File command to configure your license file
Vault Radar: Set License Key command to configure your license key
- Reload the VS Code window after configuring the license to enable scanning.
For more information, see the official HashiCorp installation instructions here.
Telemetry
We collect anonymous telemetry to understand and improve extension performance and usability. This
telemetry is in line with the VS Code guidelines, and can be disabled. See the VS Code extension telemetry documentation for more details.