The Accurics CLI can be run inside of Microsoft Visual Studio Code (VS Code) either through a right click action on a file, or the quick launcher.
- Microsoft VS Code
- Microsoft VS Code Terraform extension
- Terraform version > .14
- For Integrated mode scans, an Accurics user account with an Operator or greater role
- For Integrated mode scans, an Azure subscription with enough permissions to create a source and network security group
- For Integrated mode scans, an environment on the Accurics Console to scan your IAC repository that you will be using to create the CI/CD builds
Install the Accurics VS Code Extension
The first step is to install the Accurics VS Code extension. You can either install it directly from inside the VS Code Extension Marketplace itself, or by going to the Accurics page on the Visual Studio Marketplace website.
Accurics for Visual Studio Code extension supports Terraform, Kustomize, Helm & Kubernetes YAML. It uses Accurics CLI and Terrascan for scanning the IaC files and reports violations in the output window.
Accurics Extension operates in two modes:
- Standalone: This mode does not require an Accurics account. IaC scans are performed locally within the VS Code environment. Results are displayed in the output window.
- Integrated: Scan results are visible on the Accurics Console. The Accurics Console offers rich capabilities for viewing various KPIs, Policy Violations and Drifts.
To select a mode:
- In the VS Code command palette, type Accurics, and then click Accurics Mode.
- Now, select the desired mode Standard or Integrated.
Using the Standalone mode
- Launch the extension and select Mode as Standalone
- Once the mode is selected, right-click on any IAC file
- Select Accurics Scan. Then select from the list of IaC types: Yaml, Helm, Kustomize, or Terraform.
Accurics extension performs the IaC scan and reports the results in the VS Code output window.
Using the Integrated mode
Launch the extension, select the mode as Integrated and then perfrom the following steps:
- Sign up for an Accurics account.
- Login to the Accurics Console and create an Environment by following the steps in Environment creation wizard. See Set up the Accurics Environment and start your First Scan.
- Select Environment name and download the configuration file.
- Place the configuration file in a local folder of the extension.
- Run the Accurics Configure command and select the downloaded file.
- Right-click on any IAC file within VS Code workspace, and click Accurics Scan.
- Select desired option from the displayed scan commands.
- Specify appropriate command options in the prompted input field, if no command options are provided then the command runs without any option.
The extension performs the scan and reports the results in the VS Code output window as well as on the Accurics Console.