Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Count per affected host #455

Open
RShivek opened this issue Mar 31, 2023 · 1 comment
Open

Count per affected host #455

RShivek opened this issue Mar 31, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@RShivek
Copy link

RShivek commented Mar 31, 2023

Hello, I am looking for a way or workaround to count number of vulnerability based on severity per affected host and display as a summary table in report.

@RShivek RShivek added the enhancement New feature or request label Mar 31, 2023
@Zeecka
Copy link
Collaborator

Zeecka commented Apr 2, 2023

You can create a custom filter based on finding affected scope and us the already created custom filter count (which count findings by severity).

This filter might works :

// Keep finding based on a given scope
// Example: {findings | scope: '<p>127.0.0.1</p>'}
// Example 2: {findings | scope: '<p>127.0.0.1</p><p>localhost</p>'}
expressions.filters.scope = function(input, scope) {
    if(!input) return input;
    var output = [];
    for(var i = 0; i < input.length; i++){
        if(input[i].scope === scope){
            output.push(input[i]);
        }
    }
    return output;
}

Usage : {findings | scope: '<p>domain.tld</p>' | count: 'critical'}.

Also, you should be able to iterate over the filter : {#findings | scope: '<p>domain.tld</p>'} {title} {/}.

Note that scope field of a finding is a rich text, and not a list of text. Therefore, you may not be able to achieve everything you want. The solution may be to create a custom field with your expected type.

@Zeecka Zeecka self-assigned this May 8, 2023
@Zeecka Zeecka added the question Further information is requested label May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants