Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Snyk Scan | Kitploit
Tools/BitbucketBitbucket/snyk/snyk-scan
Vulnerability ScannersContainer SecurityDevSecOpsSupply Chain Security
Bitbucketsnyk/snyk-scan

Snyk Scan

View Repository
2 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

Bitbucket Pipelines Pipe: Snyk

This pipe uses Snyk to find, fix and monitor known vulnerabilities in your app dependencies and docker image.

YAML Definition

Add the following snippet to the script section of your bitbucket-pipelines.yml file:

root@kitploit:~
- pipe: snyk/snyk-scan:1.0.2
  variables:
    SNYK_TOKEN: "<string>"
    # LANGUAGE: "<string>" # Required unless SNYK_TEST_JSON_INPUT is set
    # IMAGE_NAME: "<string>" # Only required if LANGUAGE set to "docker"
    # SNYK_BASE_IMAGE: "<string>" # Custom base image
    # CODE_INSIGHTS_RESULTS: "<boolean>" # Optional.
    # SNYK_TEST_JSON_INPUT: "<string>" # Optional. The filename or path of a JSON file containg the output from running a test with the Snyk CLI (with json output option).
    # PROTECT: "<boolean>" # Optional.
    # DONT_BREAK_BUILD: "<boolean>" # Optional.
    # MONITOR: "<boolean>" # Optional.
    # SEVERITY_THRESHOLD: "<low|medium|high|critical>" # Optional.
    # ORGANIZATION: "<string>" # Optional.
    # PROJECT_FOLDER: "<string>" # Optional.
    # TARGET_FILE: "<string>" # Optional.
    # EXTRA_ARGS: "<string>" # Optional.
    # DEBUG: "<boolean>" # Optional.
    # SNYK_API: "<string"> # Optional.

Variables

(*) = required variable.

Details

By integrating Snyk into Bitbucket Pipelines you can continuously test, fix and monitor your codebase for known vulnerabilities in your dependencies and docker image.

To find out more about Snyk, head over to our website.

For languages / package managers with more advanced environments such as Java with Maven or Gradle, you should directly use the Snyk CLI in your pipeline. See the "Directly using the Snyk CLI" example. If you also want to generate a Code Insights report, you can feed the the Snyk CLI test output into this Pipe - see the "Generating the Code Insights report from existing Snyk JSON output" example.

Prerequisites

Snyk API Token is necessary to use this pipe.

  • If you don't yet have an account on snyk.io, head over and register.
  • To obtain a token log in to your Snyk account and obtain an API token from the account page.
  • Add the generated token as a secured environment variable in Bitbucket Pipelines.

Examples

Basic app dependencies scan example

Uses Snyk to scan a Node.js application and break the build if any vulnerabilities found.

root@kitploit:~
script:
  - npm install

  - npm test

  - pipe: snyk/snyk-scan:1.0.2
    variables:
      SNYK_TOKEN: $SNYK_TOKEN
      LANGUAGE: "node"

  - npm publish

Supplying your own base image

Uses custom supplied Docker Image to run your Snyk Scans. Useful if you do not wish to use the default Snyk Images. The image will take the format <MY_CUSTOM_IMAGE>:<TAG>, where MY_CUSTOM_IMAGE and TAG corresponds to the SNYK_BASE_IMAGE and LANGUAGE variables respectively.

root@kitploit:~
script:
  - docker build -t $IMAGE_NAME .

  - pipe: snyk/snyk-scan:1.0.2
    variables:
      SNYK_TOKEN: $SNYK_TOKEN
      LANGUAGE: "latest"
      SNYK_BASE_IMAGE: $BASE_IMAGE_NAME
      TARGET_FILE: "Dockerfile"

  - docker push $IMAGE_NAME

### Basic Docker image scan example
Uses Snyk to scan a Docker image and break the build if any vulnerabilities found.

```yaml
script:
  - docker build -t $IMAGE_NAME .

  - pipe: snyk/snyk-scan:1.0.2
    variables:
      SNYK_TOKEN: $SNYK_TOKEN
      LANGUAGE: "docker"
      IMAGE_NAME: $IMAGE_NAME
      TARGET_FILE: "Dockerfile"

  - docker push $IMAGE_NAME

Directly using the Snyk CLI

This is especially relavent for those languages which have more complex build environments - for example Java with Maven or Gradle. In these scenarios, you can test your application with the Snyk CLI using some variation of snyk test. The easiest way to install the Snyk CLI is with npm (npm install -g snyk) but if npm is not available in your build environment, you can download a binary using curl from https://github.com/snyk/snyk/releases.

root@kitploit:~
script:
  - mvn install
  - npm install -g snyk # binary download also available
  - snyk test --all-projects

  # rest of your pipeline...

Generating the Code Insights report from existing Snyk JSON output

This is especially relavent for those languages which have more complex build environments - for example Java with Maven or Gradle. In these scenarios, you can test your application with the Snyk CLI using some variation of snyk test --json > snyk-test-output.json and then feed the output file forward into the Pipe to generate a Code Insights report. The easiest way to install the Snyk CLI is with npm (npm install -g snyk) but if npm is not available in your build environment, you can download a binary using curl from https://github.com/snyk/snyk/releases.

root@kitploit:~
script:
  - mvn install
  - npm install -g snyk # binary download also available
  - snyk test --all-projects --json > snyk-test-output.json

  - pipe: snyk/snyk-scan:1.0.2
    variables:
      SNYK_TOKEN: $SNYK_TOKEN
      SNYK_TEST_JSON_INPUT: "snyk-test-output.json"

  # rest of your pipeline...

Advanced example

Apply Snyk patches to a Node.js app, and continue to scan the dependencies for critical severity vulnerabilities only, but not failing the build if found any. Also opt-in to monitor the dependencies states on Snyk.io to get alerts if new vulns found. Then go on to build the Docker image and scan it for critical severity vulnerabilities.

root@kitploit:~
script:
  - npm install

  - npm test

  - pipe: snyk/snyk-scan:1.0.2
    variables:
      SNYK_TOKEN: $SNYK_TOKEN
      LANGUAGE: "node"
      PROTECT: "true"
      SEVERITY_THRESHOLD: "critical"
      DONT_BREAK_BUILD: "true"
      MONITOR: "true"

  - docker build -t $IMAGE_NAME .

  - pipe: snyk/snyk-scan:1.0.2
    variables:
      SNYK_TOKEN: $SNYK_TOKEN
      LANGUAGE: "docker"
      IMAGE_NAME: $IMAGE_NAME
      TARGET_FILE: "Dockerfile"
      SEVERITY_THRESHOLD: "high"
      DONT_BREAK_BUILD: "true"
      MONITOR: "true"

  - docker push $IMAGE_NAME

Scanning using against a custom API endpoint

For customers using non-default instances of Snyk, the usage of SNYK_API is required to specify the URL. This applies to MT-EU, MT-AU and single tenant customers.

root@kitploit:~
script:
  - npm install

  - npm test

  - pipe: snyk/snyk-scan:1.0.2
    variables:
      SNYK_TOKEN: $SNYK_TOKEN
      SNYK_API: https://api.eu.snyk.io
      LANGUAGE: "node"

  - npm publish

Contributing

To ensure the long-term stability and quality of this project, we are moving to a closed-contribution model effective August 2025. This change allows our core team to focus on a centralized development roadmap and rigorous quality assurance, which is essential for a component with such extensive usage.

All of our development will remain public for transparency. We thank the community for its support and valuable contributions.

Getting Support

GitHub issues have been disabled on this repository as part of our move to a closed-contribution model. The Snyk support team does not actively monitor GitHub issues on any Snyk development project.

For help with Snyk products, please use the Snyk support page, which is the fastest way to get assistance.

License

Copyright (c) 2019 Snyk Ltd. and others. Apache 2.0 licensed, see LICENSE.txt file.

Download Tool
VariableUsage
SNYK_TOKEN (*)The Snyk API Token.
LANGUAGE (*)The development language (e.g. node, ruby, composer, dotnet or docker). See Dockerhub for a full list of possible tags.
NOTE: When using with SNYK_BASE_IMAGE, this field refers to your base image tag
IMAGE_NAME (*)For docker language, the image to do a docker scan on.
SNYK_BASE_IMAGESupply your own base image if you do not wish to use Snyk Images Default: snyk/snyk.
NOTE: LANGUAGE will refer to the your base image tag, please ensure the tag is valid
CODE_INSIGHTS_RESULTSCreate Code Insight report with Snyk test results. Default: false.
SNYK_TEST_JSON_INPUTUse if you just want to create a Code Insights report from a previously generated snyk test --json output. See example below in the "Generating the Code Insights report from existing Snyk JSON output" section.
PROTECTThis will apply the patches specified in your .snyk file to the local file system. (After running Snyk Wizard) Default: false.
DONT_BREAK_BUILDContinue build despite issues found. Default: false.
MONITORRecord a snapshot of the project to the Snyk UI and keep monitoring it after initial test. Default: false.
SEVERITY_THRESHOLDReports on issues equal or higher of the provided level. Allowed Values: low, med, high, critical. Default: low.
ORGANIZATIONOrganization to run the cli with. Default: none.
PROJECT_FOLDERThe folder in which the project resides. Default: ..
TARGET_FILEThe package file (e.g. package.json); equivalent to --file= in the CLI. For Docker should point to the Dockerfile. Default: none.
EXTRA_ARGSExtra arguments to be passed to the snyk cli. Default: none.
DEBUGTurn on extra debug information. Default: false.
SNYK_APISpecifies the Snyk API endpoint. Default: https://api.snyk.io (standard Snyk MT-US environment)