Install - .NET Viper Controller on Windows Server with Admin Access for Static Analysis
Installation Steps
Take the following steps to install the vFunction .NET Static Agent on a Windows Server with Admin access:
- Ensure Prerequisites are met
- Download the vFunction Controller Windows Installation ZIP
- Move the Static Agent ZIP package to the Windows Server
- Extract the ZIP to the desired directory, such as C:\vfunction\
- Gather the Static Agent UUIDs
- Log into the vFunction Server’s UI in a browser
- In the top-left corner, click the dropdown and select the relevant Application
- In the top-center menu bar, click the “Learning” tab
- On the left-side, click the “Select Controllers” link
- On the left-side, click the “Install Controller” link
- In the dialog box, find the YAML-formatted text box that contains the following details. You’ll need these details at a later stage below:
controller:
name: {display name for this controller}
host: $your_VF_Server_address
org_id: 93af7f38-0000-0000-0000-bd9516798497
app_id: 9fb228fc-0000-0000-0000-db8e83427e14
client_id: caeadcd1-0000-0000-0000-9c9b37a9e119
client_secret: 68cb85eb-0000-0000-0000-fb9e7f1d9240
- Complete the Installation using either Environment Variables or a YAML
Use Environment Variables to set Installation Parameters
- Copy the script below into a text editor on the Windows Server
- Modify the script below following the directions in the Comments
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process -Force
if (!(Get-Module -Name WebAdministration -ErrorAction SilentlyContinue)) {
Import-Module WebAdministration
}
### Modify the path to the location where the vFunction Installation ZIP was unpacked
$BASE_DIR = "C:\vfunction"
### Paste the App UUIDs from Step #6 above
$HostUrl = "http://172.31.15.51"
$OrgID = "c7d60d04-0000-0000-0000-c07671c6d5cd"
$AppID = "691fe328-0000-0000-0000-38570c32eaac"
$ClientID = "f420b1ba-0000-0000-0000-a724f8cb655f"
$ClientSecret = "04df90cc-0000-0000-0000-2f563d2344b7"
### Add the Path to the Application's DLLs
$AssembliesPath = "C:\\app\\bin"
$svc = "viperinst"
Write-Host "Setting permissions and unblocking files..." -ForegroundColor Gray
icacls "$BASE_DIR\" /grant Everyone:F /T | Out-Null
Get-ChildItem -Path "$BASE_DIR" -Recurse | Unblock-File
$UpperName = $svc.ToUpper().Replace(".", "_").Replace("-", "_")
[System.Environment]::SetEnvironmentVariable("VF_CONTROLLER_${UpperName}_CONTROLLER_NAME", $svc, "Machine")
[System.Environment]::SetEnvironmentVariable("VF_CONTROLLER_${UpperName}_CONTROLLER_HOST", $HostUrl, "Machine")
[System.Environment]::SetEnvironmentVariable("VF_CONTROLLER_${UpperName}_CONTROLLER_ORG_ID", $OrgID, "Machine")
[System.Environment]::SetEnvironmentVariable("VF_CONTROLLER_${UpperName}_CONTROLLER_APP_ID", $AppID, "Machine")
[System.Environment]::SetEnvironmentVariable("VF_CONTROLLER_${UpperName}_CONTROLLER_CLIENT_ID", $ClientID, "Machine")
[System.Environment]::SetEnvironmentVariable("VF_CONTROLLER_${UpperName}_CONTROLLER_CLIENT_SECRET", $ClientSecret, "Machine")
[System.Environment]::SetEnvironmentVariable("VF_CONTROLLER_${UpperName}_CONTROLLER_INSTANCE_ID", $svc, "Machine")
[System.Environment]::SetEnvironmentVariable("VF_CONTROLLER_${UpperName}_VIPER_ASSEMBLIES", $AssembliesPath, "Machine")
& "$BASE_DIR\controller-installation\create-instance.ps1" -instance $svc -viperMode true -type dotnet
& "$BASE_DIR\controller-installation\install.ps1" -instance $svc -scriptMode true
- Run the script in PowerShell
Use YAML to set Installation Parameters
- Copy the script below into a text editor on the Windows Server
- Modify the script below following the directions in the Comments
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process -Force
if (!(Get-Module -Name WebAdministration -ErrorAction SilentlyContinue)) {
Import-Module WebAdministration
}
### Modify the path to the location where the vFunction Installation ZIP was unpacked
$BASE_DIR = "C:\vfunction"
$svc = "viperinst"
Write-Host "Setting permissions and unblocking files..." -ForegroundColor Gray
icacls "$BASE_DIR\" /grant Everyone:F /T | Out-Null
Get-ChildItem -Path "$BASE_DIR" -Recurse | Unblock-File
& "$BASE_DIR\controller-installation\create-instance.ps1" -instance $svc -viperMode true -type dotnet
- Run the PowerShell script
- In a text editor, open the $BASE_DIR\config\installation\instances\$svc\installation.yaml
- Modify the YAML following the instructions below
##### Paste App UUIDs from Step #6
controller:
name: $display name for this controller
host: $your_VF_Server_address
org_id: 93af7f38-0000-0000-0000-bd9516798497
app_id: 9fb228fc-0000-0000-0000-db8e83427e14
client_id: caeadcd1-0000-0000-0000-9c9b37a9e119
client_secret: 68cb85eb-0000-0000-0000-fb9e7f1d9240
##### Add Instance_ID and use the same value as used in the controller.name
instance_id: $display name for this controller
type: dotnet
tags:
# - tag1
server_application:
# name:
# include_classes: com.
# allowed_users:
# new_user_default_password:
viper:
assemblies:
##### Change this value from C:\dummy to the path to the App's DLLs
- C:\dummy
stored_procedure:
# optional db_provider: sqlserver, oracle
# db_provider:
# optional db_connection_string: Server=<IP>;Database=<DB name>;User ID=<ID>;Password=<Password>;Encrypt=False
# db_connection_string:
- Copy the script below into a text editor on the Windows Server
- Modify the script below following the directions in the Comments
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process -Force
if (!(Get-Module -Name WebAdministration -ErrorAction SilentlyContinue)) {
Import-Module WebAdministration
}
### Modify the path to the location where the vFunction Installation ZIP was unpacked
$BASE_DIR = "C:\vfunction"
$svc = "viperinst"
Write-Host "Setting permissions and unblocking files..." -ForegroundColor Gray
icacls "$BASE_DIR\" /grant Everyone:F /T | Out-Null
Get-ChildItem -Path "$BASE_DIR" -Recurse | Unblock-File
& "$BASE_DIR\controller-installation\install.ps1" -instance $svc
- Run the PowerShell script
- Verify that the Static Agent is UP in the vFunction Server UI
- Confirm that Static Analysis is captured in the vFunction Server UI