CI/CD Integration - Viper for .NET apps


Overview

A vFunction organization can continuously trigger static analysis to monitor for improvements and drift in an application. Continuous static analysis can be configured via a CI/CD pipeline integration.

This integration is used to statically analyze the Application’s binaries when new binaries are deployed. Once the static analysis has completed, it is automatically uploaded to the vFunction Server to be used for monitoring improvements and drift.


Prerequisites

  1. A Service Account for a vFunction Server
  2. A CI/CD pipeline that can, over HTTP or HTTPS, access the vFunction Server
  3. The ability to make configuration changes to the pipeline

Steps to create a Service Account

  1. Log into the vFunction Dashboard, e.g. https://vfunction.organization.com
  2. Click on the person icon in the upper-right corner
  3. Select My Account in the dropdown menu
  4. Select Accounts from the left-hand sidebar
  5. Click the button to Generate Service Account in the center dialog box
  6. Copy the Service Account ID and Password for use in your pipeline

Create a vFunction YAML with the Application’s Details

  1. Create a app-config.yaml to be placed in the root of the repository (or in a designated location from which the vFunction Viper process will run):
# Mandatory list of archives that make up the contents of the repository.
# Wildcards '**' for recursive folders and '*' for filenames are supported.
assemblies:
  # Note that the path below leads to the directory where the DLLs exist, such as C:\app\bin
  - path/to/app/dir
app:
  included_namespaces:
    # These are the top-level package names for the Application
    # This field is case-sensitive if, for example, the top-level package is "vFunction."
    - namespace1.
    - namespace2.
stored_procedure:
#  This section is optional for enabling getting stored procedures of oracle
#  or sqlserver. The next two lines are an example showing how to configure this for oracle and then 
#  there is an example showing how to configure it for sqlserver.
#  db_provider: "oracle"
#  db_connection_string: "User Id=sys;Password=sa;DBA Privilege=SYSDBA;Data Source=//localhost:1521/xe;"
#  db_provider: "sqlserver"
#  db_connection_string: "Server=localhost;Database=OMSNET6;User ID=SA;Password=vFunction2021!;Encrypt=False"
  1. Place the app-config.yaml within the repository, such as Bitbucket, and note the location for use in the next step

Add vFunction variables and scripts into relevant Repository

Follow the steps that are relevant to your organization’s Repository: