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

Gitlab/Github - Labels not applied to scan results of severity: informational / info #1340

Open
marcandre-larochelle-bell opened this issue Apr 11, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@marcandre-larochelle-bell

Description

The labels are not applied to scan results of severity: informational / info for the Gitlab Issue Tracker, potentially the same issue for Github.

Expected Behavior

Labels are assigned to the Gitlab issues

Actual Behavior

No labels assigned due to these lines of code:

private String getString(ScanResults.XIssue resultIssue) {
String label = "NA";
try {
Map<FindingSeverity, String> findingsPerSeverity = properties.getIssueslabel();
for (Map.Entry<FindingSeverity, String> entry : findingsPerSeverity.entrySet()) {
if (resultIssue.getSeverity().equalsIgnoreCase(entry.getKey().toString())) {
label = entry.getValue();
break;
}
}
} catch (Exception e) {
return label;
}
return label;
}

public enum FindingSeverity {
HIGH, MEDIUM, LOW, INFO
}

The FindingSeverity enum contains "INFO", but the scan results returns "Informational", thus when the compare is done on line 407:

if (resultIssue.getSeverity().equalsIgnoreCase(entry.getKey().toString())) {

It doesn't match and no labels are applied later on.

Reproduction

Run a scan for a Gitlab project with the --gitlab.issueslabel.info="any-label" parameter

Environment Details

Docker image: CxFlow 1.7.0-17

@marcandre-larochelle-bell marcandre-larochelle-bell added the bug Something isn't working label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant