bridgecrewio / checkov-vscode

Prevent cloud misconfigurations during build-time for Terraform, Cloudformation, Kubernetes, Serverless framework, and other infrastructure-as-code-languages with Checkov by Bridgecrew in your VSCODE IDE.
https://marketplace.visualstudio.com/items?itemName=Bridgecrew.checkov
Apache License 2.0
69 stars 37 forks source link
checkov cloudformation hacktoberfest kubernetes serverless-framework static-analysis terraform vscode vscode-extension

build status Installs-count slack-community

Archival Notice

This repository is no longer maintained nor does the VS Code extension it encapsulate.

Checkov VS Code extension was rebranded as the Prisma Cloud VS Code plugin and can now be found here

Checkov Extension for Visual Studio Code

Checkov is a static code analysis tool for infrastructure-as-code, secrets, and software composition analysis.

The Checkov Extension for Visual Studio Code enables developers to get real-time scan results, as well as inline fix suggestions as they develop cloud infrastructure.

Checkov VSCode plugin in action!

The extension is currently available for download directly from the Visual Studio Extension Marketplace and its source code is available in an Apache 2.0 licensed repository. Development of the extension is ongoing and it is available for pre-release usage 🚧 .

Activating the extension requires a Prisma Cloud Access Key and API. It uses Prisma Cloud APIs to evaluate code and offer automated inline fixes. For more information about data shared with Prisma Cloud see the Disclaimer section below).

Extension features include:

Getting started

Install

Open the Checkov Extension for Visual Studio Code in the Visual Studio Marketplace.

Dependencies

The Checkov extension will invoke the latest version of Checkov.

Configuration

Usage

Troubleshooting logs

To access checkov-vscode logs directory, open the VSCODE Command Palette (Ctrl+Shift+P) or (Command+Shift+P), and run the command Open Checkov Log. It is helpful if you delete the log file and then re-try whichever operation was failing in order to produce clean logs.

Common Issues

Docker file access permissions on MacOS

If you are getting failures and are running the Checkov extension via Docker, it's possible MacOS needs to give Docker permission to access the directory location of your code. In MacOS System Preferences > Privacy and Security > Privacy Find the Files and Folders section from the list, and ensure Docker has access to your code location.

MacOS Files and Folders permissions page

Symptoms of this issue can be found in the extension logs, you will see [info]: Running Checkov with executablePath: docker and then output showing zero passed, failed, or skipped checks, and 1+ parsing errors, as below:

[info]: Running checkov {“executablePath”:“docker”,“arguments”
...
...
[debug]: Checkov task output:
...
 \“passed\“: 0,\r\n        \“failed\“: 0,\r\n        \“skipped\“: 0,\r\n        \“parsing_errors\“: 1,\r\n        \“checkov_version\“: \“1.0.770\“\r\n    }

Contributing

Contribution is welcomed!

Start by reviewing the contribution guidelines. After that, take a look at a good first issue.

Looking to contribute new checks? Learn how to write a new check (AKA policy) here.

Disclaimer

To use this plugin, you will need a Prisma Cloud account. The plugin uses Prisma Cloud's fixes API to analyse and produce code fixes, and enrich the results provided into the IDE. Please notice the Prisma Cloud privacy policy for more details. To generate fixes, files found to have triggered checkov violations are made available to the fixes API for the sole purpose of generating inline fixes code recommendations.