Proposal for VBUC light scanner integration with GI

This page has the intention to present a proposal for the VBUC light scanner integration with the Generic Infraestructure.

Introduction

The VBUC light scanner has a high-level integration with the generic infraestructure, allowing to execute the assessment process through rapidscan, but not using all the information that can be provided by the process.

The main characteristics to integrate with the generic infraestructure, in order to obtains all the possible information from the assessment process are:

  • Logger : In order to include the logged information by the assessment process execution into the RapidScan execution log.

  • ProgressDescriptor: To obtains the process progess information and avoid the usage of non real values to represent the process progress.

  • AssessmentModel: This characteristic will be used to obtains the results information from the assessment execution and uploads it to the company servers.

Integration issues

  • The VBUC project is an old project without documentation and a clear defined structure, so if we try to change the project structure or any of his components can take more time that expected.

  • The nuget called VBUC.LightScanner used to integrate the VBUC light scanner with the Generic Infraestructure, needs that some dll from VBUC project had been generated (this dll generation process is executed only once every day) so if we want to add code related to the nugets from the Generic Infraestructure when we wanted to generate a new release we will need to wait almost a day in order to the nugets update into the VBUC project takes effect and the corresponding dll has been generated.

  • The Logger class is a singleton, so it cannot be overwritten on the VBSolution class constructor without affecting a huge amount of code.

Proposal

In order to avoid the previous commented issues, that are caused by a try of include the Generic Infraestructure nugets (or code) into the VBUC project. The following approach has been generated:

Instead of trying to include the GI nugets (or code) into the VBUC project, a data export mechanism can be implemented on the VBUC project. So the GI don't need to enter to the VBUC to extract the information needed, but the VBUC will inform to the GI about the process.

This approach can be achieved implementing an Interface (IVBUCConnector) into the VBUC project with the purpose of report the different information needed to integrate with the GI. So the interface can implement 3 (three) methods, each one related with the corresponding characteristic that want to be integrated:

  • ReportToLogger

  • ReportToProgressDescriptor

  • ReportToAssessmentModel

Using a combination of anonymus types and dynamic object (All supported on .Net framework 4 or later), the VBUC Light Scanner can report the corresponding data object through each method on the interface.

For example: An anonymus object is created on the VBUC project on some part of the assessment execution in order to report a file information (according to the assessment documentation, the AddFile method from CodeModelWriter receive 7 parameters) using the corresponding data names:

So, when the ReportToAssessmentModel method is invoked on the VBUC process execution, the object will be received as a Json Object (SerializeObject method from Json must be used). And with a dynamic object, the data can be manipulated as it was a structured class (the unique requisite is that the object received has the same property name).

The ReportToAssessmentModel can implement any business logic to process the data, in this case the data is passed to a method called AddFileInformation using the collected file data as a parameter.

So, when this piece of code is executed into a Console Application, the following results are generated:

As you can see, there is no need for the VBUC to use the GI nugets in order to generate an integration process and any kind of data can be passed.

The new Interface must be implemented on the VBUC project and the corresponding methods need to be called when it is needed. So, the integration can be achieved, adding a new constructor for the VBSolution class included on the VBUMShell library project that receive an instance of an object that implements the new Interface.

And locate all the corresponding locations when the needed information is reported and use the new interfacemethods to export it to the GI.

Last updated