While Lucent Sky AVM offers a wide variety of scan options, setting up a scan with these advanced options can be laborious. With configuration as code, scan options can be stored in a configuration file along with the code base. When a scan starts, settings in the configuration file will be used to configure the scan.
This article describes how to use configuration as code to scan an application with advanced options.
You will learn how to:
- Create a YAML configuration file.
- Scan an application using settings in the configuration file.
At the end, you will be able to create a YAML configuration file and scan an application with settings in the configuration file.
Create a YAML configuration file
The configuration file supports the following scan settings, AnalysisTarget, Arguments, WeaknessPolicies, and Vectors.
Each of the scan setting is represented as a string tag. If a tag does not exist in the configuration file or has null as its value, existing settings will be used. To explicitly set an empty string as the value of a setting, use a pair of single quotes.
The valid values for each of the scan settings are identical as those accepted by the CLI. To learn more about scan settings, view the following article in the Lucent Sky Knowledge Base:
Lucent Sky AVM CLI Reference
- Create an empty text file in the root of the application with the name lucent-sky-avm-config.yaml.
A configuration file Insert the following content to the file.
AnalysisTarget: 'ContosoWeb\ContosoWeb.csproj' Arguments: '' WeaknessPolicies: 'CWE330,0' Vectors:
The above example sets the analysis target to ContosoWeb\ContosoWeb.csproj, clears existing scan arguments, sets the weakness policies to CWE330,0, and uses existing setting for vectors.
- Create a .zip file of the application, with the configuration file in the root of the archive file.
Scan an application using settings in the configuration file
- Use the Web UI to create a new scan.
- In the scan settings, make sure Analysis Target and Weakness Policies are empty, insert MsBuild,12 to Scan Arguments, and uncheck Client from Vectors.
- Upload the source code archive with the configuration file to start the scan.
Once the scan is completed, go to the scan details page and confirm the following:
- Analysis Target shows ContosoWeb\ContosoWeb.csproj as set in the configuration file.
- Scan Arguments shows Default as set in the configuration file.
- Weakness Policies shows CWE330,0 as set in the configuration file.
- Vectors does not include Client as the configuration file did not set Vectors and the settings when creating the scan were used.