.NET

Prerequisites

    Install CLI​
    Supported projects files
      .csproj
      .vbproj
      packages.config

Command-line

Run the following command line by setting your parameters.
1
cdefense scan --lang=dotnet --api-key=<YOUR_API_KEY> \
2
--path=/path/to/your-project --project-name="Dot Net Sample App" --verbose --go
Copied!

Github Action Example

1
# This is a basic workflow to help you get started with Actions
2
​
3
name: Dotnet CI Scan
4
​
5
# Controls when the action will run. Triggers the workflow on push or pull request
6
# events but only for the master branch
7
on:
8
push:
9
branches: [ master ]
10
repository_dispatch:
11
12
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
13
jobs:
14
# This workflow contains a single job called "build"
15
build:
16
# The type of runner that the job will run on
17
runs-on: ubuntu-latest
18
​
19
# Steps represent a sequence of tasks that will be executed as part of the job
20
steps:
21
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
22
- uses: actions/[email protected]
23
​
24
- name: Cloud Defense Scan
25
run: |
26
curl https://raw.githubusercontent.com/CloudDefenseAI/cd/master/latest/cd-latest-linux-x64.tar.gz > /tmp/cd-latest-linux-x64.tar.gz
27
tar -C /tmp -xzf /tmp/cd-latest-linux-x64.tar.gz
28
chmod +x /tmp/cdefense
29
/tmp/cdefense scan --verbose --lang=dotnet --go --project-name=vulnerable-dotnet-github-action --api-key=<YOUR_API_KEY>
Copied!
​
Last modified 1mo ago