Bitbucket

Prerequisites

    Install Bitbucket for your platform
    Setup project to scan

Instructions for SCA scans

    Create or update the bitbucket-piplines.yml file to run the scans.
    Copy the following and use it in the above build step by replacing
      lang - java | python | node | PHP | go | rust | dotnet
      api-key - your API key
      project-name - your project name
Linux
1
# This is a sample build configuration for Python.
2
# You can specify a custom docker image from Docker Hub as your build environment.
3
# The Cloud Defense scan tool runs scan on packages used and detects vulnerabilities.
4
image: python:3.7.3
5
​
6
pipelines:
7
default:
8
- step:
9
name: Scan and Report
10
caches:
11
- pip
12
script:
13
- pip install -r requirements.txt
14
- curl https://raw.githubusercontent.com/CloudDefenseAI/cd/master/latest/cd-latest-linux-x64.tar.gz > /tmp/cd-latest-linux-x64.tar.gz && tar -C /usr/local/bin -xzf /tmp/cd-latest-linux-x64.tar.gz && chmod +x /usr/local/bin/cdefense
15
- cdefense scan --lang=<lang> --project-name=<project-name> --api-key=<api-key> --path=requirements.txt --verbose
16
- echo $?
Copied!
Example: Your .yaml file may look something similar
​
Failed Build:
​
Successful Build:
​
Last modified 1mo ago