HashiCorp Cloud Platform
HCP Vault Radar extension installation for VS Code
Install the HCP Vault Radar extension for Visual Studio Code from the Visual Studio Code Marketplace.
Install the extension
Click the extensions icon in the VS Code Activity Bar.
Search for
HCP Vault Radar
.Click Install.
Set the license key
Once you install the extension, choose one of the supported options for setting the license key to begin using the extension.
When prompted, click Set license key.
Paste the license key into the window.
Press Enter on your keyboard.
Restart VS Code.
You can also set or change the value of the license key by opening the command
palette and running > Vault Radar: Set license key
.
Integrate Vault
The HCP Vault Radar IDE extension gives you the option to integrate with HashiCorp Vault. You can see if secrets added in your source code are already stored in Vault.
This integration is optional.
Click the HCP Vault Radar icon in the VS Code Activity Bar.
Click Add Vault Connection.
Enter a nickname for the Vault connection in the quick picks dialog box and press the enter button on your keyboard.
Example:
hcp-vault-prod-useast1
Enter the address for the Vault cluster that is accessible by VS Code and press the enter button on your keyboard.
Example:
https://vault-cluster-public-vault-abc456.ghi101112.zA.hashicorp.cloud:8200
(Optional) For HCP Vault Dedicated, or Vault Enterprise clusters, enter the namespace and press the enter button on your keyboard.
Leave the quick pick dialog box empty if you are not using namespaces.
Example:
admin
Select the auth method and press the enter button on your keyboard.
The extension supports the following auth methods:
- Token
- AppRole
- OIDC
The associated policies for the selected auth method must include the ability to read secrets from the KV v2 secrets engine path entered in the previous step.
Enter the required information for the selected authentication method.
- Enter the Vault token and press the enter button on your keyboard.
The extension starts an indexing operation based on the token's policy. Once indexing completes, the extension displays any secrets found in the IDE and stored in one of the allowed KV v2 secrets engine.
You can re-index using the HCP Vault Radar icon in the VS Code Activity Bar, or open the command palette.
> Vault Radar: Index Vault
Uninstall the extension
Remove license (optional)
If you do not plan to re-install the extension, remove the stored license key.
Open the command palette and clear the key.
> Vault Radar: Clear License Key
Click Yes, clear license key.
Remove the extension
Click the gear icon for the HashiCorp Vault Radar extension.
Click Uninstall.
Restart VS Code.