Instance scan - Access to findings within a check

Filip Ustohal
Tera Contributor

Hello community,

I have a task to create Instance scan checks (based on our internal best practices). So far I have implemented table checks, column type checks and linter checks with no problem. 

Linter checks are specific to automatically include also Finding details, which I would like to include also in another types of checks (column type and table checks) where finding details are not automatically generated.

The problem is that within the OOTB Instance scan (and its tables relation) configuration, I am not able to populate the information about particular place of a problem (in a script) to the particular finding (result finding). Because from what I understand, there is running in the background the scan which in the end (after all objects are analysed within 1 check) create just 1 Result and afterwards (based on finding count in the result) create the Findings (as relation 1:1:M - check:result:findings).

 

WHAT I WANT TO ACHIEVE: 

Populate "Finding details" (line of a problem in a script) in each particular finding after each itteration of the check script (or condition) in Column type or Table type checks.

Is it possible to somehow access the "current.finding" object in the script? Or does anyone know, what is the structure of the "node" in linter type check and if eventually "engine.finding.incrementWithNode(node);" can be also used in Table and Column type checks and how?

 

 

NOTE: The checks which I am mentioning cannot be implemented as Linter checks - must be implemented as Column type or Table checks, because of concrete constraints.

 

Thank you for the answers!

 

1 ACCEPTED SOLUTION

R Jyothikrishn1
Giga Expert

Hi Filip Ustohal, 

Hope this helps you.

This worked for me, in San Diego instance,
try adding below script in table check, to populate the finding_details field. 

engine.finding.increment();
var z = engine.finding;
z.setValue('finding_details',"Sample Details");




View solution in original post

3 REPLIES 3

R Jyothikrishn1
Giga Expert

Hi Filip Ustohal, 

Hope this helps you.

This worked for me, in San Diego instance,
try adding below script in table check, to populate the finding_details field. 

engine.finding.increment();
var z = engine.finding;
z.setValue('finding_details',"Sample Details");




Thank you very much! It worked indeed. 

Hi Team,

 

Table check is read only where to apply the below script

 

engine.finding.increment();
var z = engine.finding;
z.setValue('finding_details',"Sample Details");