CloudDefense.AI
  • Connect Repositories
    • Scan a Github/Gitlab
    • Scan an Azure DevOps repository
    • Scan a Bitbucket repository
  • Scans
    • Written code Scan (SAST)
    • Open Source Libraries Scan (SCA)
    • Secrets Scan
    • DAST Scans
    • API Scan from CloudDefense UI
  • CI/CD
    • GitHub Enterprise Actions
    • Methods for CI/CD integration with CLI
    • CI/CD Policies
    • Jenkins integration with cdefence
  • Integration
    • IaC on GCR Scan
    • IaC on Amazon ECR Scan
    • IaC on Docker Hub Scan
    • Integration with ServiceNow
    • Integration with Jira
    • SSO Okta App Integration
    • Set up CloudDefense Single Sign-On (SSO)
    • SIEM
      • Azure Sentinel
      • IBM Qradar
      • Micro Focus ArcSight Logger
  • Features
    • Sharing Integration
    • How to Enable Multi-Factor Authentication
    • AUTO PR
    • Remediation using SAST Recommendations
    • Global Allowed List and Local allowed list - Documentation
    • File Exclude
  • CloudDefense CLI
    • Cloud Defense CLI
  • On-Prem Installation
    • Install CloudDefense Helm on a Kubernetes Cluster
    • Install CloudDefense suite on a Kubernetes cluster
  • Others
    • Team Management
    • User Management
    • App Management
    • LogIn/Signup process
Powered by GitBook
On this page
  • Installation
  • How to update CLI?
  • Usage
  • Examples
  • SAST
  • FULL SCAN
  1. CloudDefense CLI

Cloud Defense CLI

CloudDefense's CLI helps you find and fix known vulnerabilities in your dependencies, both on local projects and as part of your CI/CD system.

Installation

Please follow instructions specific to your operating system.

How to update CLI?

By just rerunning the command updates the client to latest version.

Mac

Run the following command which will install cdefense tool.

Prefix with sudo if you see any permission error when running this command

curl\https://raw.githubusercontent.com/CloudDefenseAI/cd/master/latest/cd-latest-mac-x64.tar.gz > /tmp/cd-latest-mac-x64.tar.gz && tar -C /usr/local/bin -xzf /tmp/cd-latest-mac-x64.tar.gz && chmod +x /usr/local/bin/cdefense

Linux

Run the following command which will install cdefense tool.

sudo 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

Windows

Download the following tar file and unzip it​ https://github.com/CloudDefenseAI/cd/raw/master/latest/cd-latest-windows.exe.tar.gz

Usage

Run the following command to get started.

cdefense help

NAME:

Cloud Defense CLI Scanner - CLI for scanning and detecting vulnerabilities in any language

USAGE:

cdefense [global options] command [command options] [arguments...]

VERSION:

1.0.1

COMMANDS:

scan, s SCA scan of a given project and post to Cloud Defense server sast, a SAST scan of a given project and post to Cloud Defense server help, h Shows a list of commands or help for one command

GLOBAL OPTIONS:

--help, -h show help (default: false) --version, -v print the version (default: false)

Examples

SCA

Example of python SCA scan

cdefense scan --lang=python --api-key=<YOUR_API_KEY> --path=/d/temp/vulpy/requirements.txt --project-name="my-python-project" ​

Example of java SCA scan

cdefense scan --lang=java --api-key=<YOUR_API_KEY> --path=/d/temp/java-goof --verbose --project-name="My Java Project" ​

Example of php SCA scan

cdefense scan --lang=php --api-key=<YOUR_API_KEY> --path=/d/temp/php-helloworld-app --project-name="my-php-project" ​

Example of NodeJS SCA scan

cdefense scan --lang=node --api-key=<YOUR_API_KEY> --path=/d/temp/nodejs-system --project-name="my-nodejs-project"

SAST

Example of python SAST scan

cdefense sast --lang=python --api-key=<YOUR_API_KEY> --path=/d/temp/vulpy/requirements.txt --project-name="my-python-project" ​

Example of java SAST scan

cdefense sast --lang=java --api-key=<YOUR_API_KEY> --path=/d/temp/java-goof --verbose --project-name="my-java-project" ​

Example of php SAST scan

cdefense sast --lang=php --api-key=<YOUR_API_KEY> --path=/d/temp/php-helloworld-app --project-name="my-php-project" ​

Example of NodeJS SAST scan

cdefense sast --lang=node --api-key=<YOUR_API_KEY> --path=/d/

FULL SCAN

Example of full scan

cdefense online —api-key=<YOU_API_KEY> —repository-url=

PreviousFile ExcludeNextInstall CloudDefense Helm on a Kubernetes Cluster

Last updated 2 years ago