<< PREVIOUS NEXT >>

 

 

RUST

 

PREREQUISITES

  1. Install CLI

  2. Install Rust and Cargo

  3. Run

    1. cargo install cargo-audit

       

       

  4. Supported projects files

    1. Cargo.lock

COMMAND-LINE

 

Run the following command line by setting your parameters.

 

vsp_defense scan --lang=rust --api-key=<YOUR_API_KEY>  --path=/path/to/your-project/ --project-name="Sample App" 

 

 

 

GITHUB ACTION EXAMPLE

 

 

name: Rust CI Scan

 

on:

  push:

  branches: [master]

  pull:

  branches: [master]

  repository_dispatch:

 

env:

  CARGO_TERM_COLOR: always

 

jobs:

  build:

    runs-on: ubuntu-latest

   

    steps:

     - uses: actions/checkout@v2

     - name: Build

       run : cargo build --verbose

    - name: Cloud Defense Scan

    run: |

       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 /tmp/cdefense

       /tmp/vsp_defense scan --lang=rust --project-name=vulnerable-rust-github-action --api-key= <YOUR_API_KEY>

    - name: Run tests

      run:  cargo test --verbose

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

<< PREVIOUS NEXT >>