Install the SDK

​Install the SDK using one of these options:

After installation, you can get started writing rules with our Getting started guide.

Install the SDK with npm

Install our SDK using npm.

Prerequisites to install the SDK with npm

  • Ensure you’ve installed the latest version of npm on your local environment, using Node version 10 or later.

Steps to install the SDK with npm

Run this command to install it for local use:

npm install -g snyk-iac-rules

Once installed, you are ready to use the SDK. Run the following command to verify that it works:

snyk-iac-rules --help

Install the SDK using the prebuilt binaries

You can download and use the SDK's prebuilt binaries. To download the prebuilt binary, visit the Releases tab on the SDK repository page in GitHub:

Releases tab on the SDK repository page
Releases tab on the SDK repository page

After you have downloaded the desired binary archive, open a terminal and run the following commands (note that these commands assume you're running on an Intel-based macOS and downloading version 0.0.5 of the SDK):

$ tar xzf snyk-iac-rules_0.0.5_Darwin_x86_64.tar.gz 
$ sudo mv snyk-iac-rules /usr/local/bin

To verify the ability to use it, run:

snyk-iac-rules --help

Install the SDK with Homebrew

From macOS and Linux environments, you can use Homebrew to install our SDK. The repository for installation is stored in our GitHub.

Prerequisites to install the SDK with Homebrew

  • Supported for macOS and Linux environments only.

  • Ensure Homebrew has already been installed:

    brew tap snyk/tap

Steps to install the SDK with Homebrew

Install the SDK as follows:

brew install snyk-iac-rules

Install the SDK with the Windows Scoop package manager

From Windows environments, you can use Scoop to install our snyk-iac-rules SDK. The repository for installation is stored in our GitHub.

Prerequisites to install the SDK with the Windows Scoop package manager

  • Supported for Windows environments only.

  • Ensure Scoop has already been installed:

    scoop bucket add snyk https://github.com/snyk/scoop-snyk

Steps to install the SDK with the Windows Scoop package manager

Install the SDK as follows:

scoop install snyk-iac-rules

Install the SDK with Docker

You can use Docker to install and run our snyk-iac-rules SDK while writing your custom rules in your local directory. The image is stored in our Docker Hub repo.

Prerequisites to install the SDK with Docker

  • Ensure Docker has already been installed.

  • Supported for Linux containers only.

Steps to install the SDK with Docker

Pull the Docker image as follows:

docker pull snyk/snyk-iac-rules

Run the SDK by using the following command:

docker run --rm -v $(pwd):/app snyk/snyk-iac-rules {SDK command}

For example, to generate a custom rules template you can run:

docker run --rm -v $(pwd):/app snyk/snyk-iac-rules template -r {rule_name}

More information about the SDK

Last updated

Was this helpful?

#4580: CLI: help, Ignore - support ticket 49463-add Iac examples

Change request updated