How to Install Snyk in Microsoft Windows

Posted on

How to Install Snyk in Microsoft Windows

This is an article where the focus is just about how to install snyk tool in a host or a device either local or remote. Furthermore, that host or device is running using Microsoft Windows as its operating system. In other words, the process which is available for installing Snyk tool in this article will use a device which is running using Microsoft Windows as its operating system. Before going on further, a short description about Snyk, according to this link which is an official website of Snyk (pronounced sneak) tool, it is a developer security platform for securing code, dependencies, containers, and infrastructure as code.

Table of Contents

Introduction

As the focus of the article is about the Snyk installation, before going on further to that, it actually need several requirements. Those requirements will need a specific preparations. So, the following are several steps for preparing the requirements on installing snyk in it. So, before showing how to install snyk in Microsoft Windows, just perform the following steps :

 

  1. First of all, just make sure that there is a Power Shell tool available. In order to to that, just run the Power Shell tool. Just execute it or run it. Normally, a Windows Shortcut+R will display a text field for typing a text representing the command. Type ‘powershell’ and the Power Shell tool will appear.

  2. After the Power Shell tool appear, just set a certain parameter for setting up the Power Shell environment. Actually, it is for setting the command to permit installing scoop. In other words, installing Snyk need another tool. That tool which is important as a requirement for installing Snyk is ‘scoop’. An article for showing how to install ‘Scoop’ is also exist in ‘How to Install Scoop in Microsoft Windows‘. Below is that command for setting the permission to install ‘scoop’ :

    PS C:\Users\Personal> Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
    
    Execution Policy Change
    The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose
    you to the security risks described in the about_Execution_Policies help topic at
    https:/go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy?
    [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"):

    For the above process, just type ‘Y’ in order to allow executing a certain command in order to install ‘scoop’.

    [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): Y
    PS C:\Users\Personal>
    
  3. After executing the above command in order to permit further process for installing ‘scoop’ before installing Snyk, just type the command below :

    PS C:\Users\Personal> iwr -useb get.scoop.sh | iex
    Initializing...
    Downloading...
    Extracting...
    Creating shim...
    Adding ~\scoop\shims to your path.
    Scoop was installed successfully!
    Type 'scoop help' for instructions.
    PS C:\Users\Personal>

 

Install Snyk in Microsoft Windows

After performing several steps as a preparation in the previous part, just execute the following steps in order to install snyk :

  1. First of all, just still in the Power Shell, just type the following command :

    PS C:\snyk> scoop install snyk
    Installing 'snyk' (1.1105.0) [64bit] from snyk bucket
    snyk-win.exe (58.4 MB) [==========================================================================================================================================] 100%
    Checking hash of snyk-win.exe ... ok.
    Linking ~\scoop\apps\snyk\current => ~\scoop\apps\snyk\1.1105.0
    Creating shim for 'snyk'.
    'snyk' (1.1105.0) was installed successfully!
    PS C:\snyk>
    
  2. As an additional step, just add snyk library by using a Node Package Manager, by typing the following command :

    PS C:\snyk> npm install -g snyk
    npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
    npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
    
    added 1 package, and audited 2 packages in 16s
    
    found 0 vulnerabilities
    npm notice
    npm notice New major version of npm available! 8.11.0 -> 9.5.0
    npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.5.0
    npm notice Run npm install -g npm@9.5.0 to update!
    npm notice
    PS C:\snyk>
    

Test Snyk in Microsoft Windows

Last but not least, after installing snyk, just check to test whether it is running or not by executing the following command :

Microsoft Windows [Version 10.0.22621.1265]
(c) Microsoft Corporation. All rights reserved.

C:\Users\Personal>snyk
CLI help
Snyk CLI scans and monitors your projects for security vulnerabilities and license issues.

For more information visit the Snyk website https://snyk.io

For details see the CLI documentation https://docs.snyk.io/features/snyk-cli

How to get started
1. Authenticate by running snyk auth
2. Test your local project with snyk test
3. Get alerted for new vulnerabilities with snyk monitor

Available commands
To learn more about each Snyk CLI command, use the --help option, for example, snyk auth --help.

Note: The help on the docs site is the same as the --help in the CLI.

snyk auth
Authenticate Snyk CLI with a Snyk account.

snyk test
Test a project for open source vulnerabilities and license issues.

Note: Use snyk test --unmanaged to scan all files for known open source dependencies (C/C++
only).

snyk monitor
Snapshot and continuously monitor a project for open source vulnerabilities and license issues.

snyk container
Test container images for vulnerabilities.

snyk iac
Commands to find and manage security issues in Infrastructure as Code files.

snyk code
Find security issues using static code analysis.

snyk log4shell
Find Log4Shell vulnerability.

snyk config
Manage Snyk CLI configuration.

snyk policy
Display the .snyk policy for a package.

snyk ignore
Modify the .snyk policy to ignore stated issues.

Debug
Use -d option to output the debug logs.

Configure the Snyk CLI
You can use environment variables to configure the Snyk CLI and also set variables to configure the
Snyk CLI to connect with the Snyk API. See Configure the Snyk CLI
https://docs.snyk.io/features/snyk-cli/configure-the-snyk-cli

 

C:\Users\Personal>

As the output of the above appear, it is actually a prove that the snyk tool command is available and it is working properly.

Leave a Reply