diff --git a/.vscodeignore b/.vscodeignore index 3899967..545bc39 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -7,4 +7,4 @@ vsc-extension-quickstart.md **/tsconfig.json **/.eslintrc.json **/*.map -**/*.ts +**/*.ts \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index fdc6bea..96557b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,17 @@ # Change Log +## [1.0.20] - 2024-09-05 + +### Fixed + +- Fixed an issue where standalone files couldn't be scanned +- Fixed an issue where opening issues from the Prisma Cloud side panel didn't work + ## [1.0.19] - 2024-08-29 ### Added -- Added the following data to Prisma Cloid analytics +- Added the following data to Prisma Cloud analytics - Extension version - VS Code version diff --git a/package-lock.json b/package-lock.json index 0206864..cde1dea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,14 +1,14 @@ { "name": "prisma-cloud", - "version": "1.0.13", + "version": "1.0.20", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "prisma-cloud", - "version": "1.0.13", + "version": "1.0.20", "dependencies": { - "axios": "^1.5.1", + "axios": "^1.7.4", "semver": "^7.5.2", "uuid": "^9.0.1", "winston": "^3.13.0" @@ -573,11 +573,11 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/axios": { - "version": "1.5.1", - "resolved": "https://art.code.pan.run:443/artifactory/api/npm/npm-registry/axios/-/axios-1.5.1.tgz", - "integrity": "sha512-Q28iYCWzNHjAm+yEAot5QaAMxhMghWLFVf7rRdwhUI+c2jix2DUXjAHXVi+s1ibs3mjPO/cCgbA++3BjD0vP/A==", + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", "dependencies": { - "follow-redirects": "^1.15.0", + "follow-redirects": "^1.15.6", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } @@ -1231,11 +1231,22 @@ "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==" }, "node_modules/follow-redirects": { - "version": "1.15.3", - "resolved": "https://art.code.pan.run:443/artifactory/api/npm/npm-registry/follow-redirects/-/follow-redirects-1.15.3.tgz", - "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==", + "version": "1.15.8", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.8.tgz", + "integrity": "sha512-xgrmBhBToVKay1q2Tao5LI26B83UhrB/vM1avwVSDzt8rx3rO6AizBAaF46EgksTVr+rFTQaqZZ9MVBfUe4nig==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], "engines": { "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } } }, "node_modules/form-data": { @@ -3017,11 +3028,11 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "axios": { - "version": "1.5.1", - "resolved": "https://art.code.pan.run:443/artifactory/api/npm/npm-registry/axios/-/axios-1.5.1.tgz", - "integrity": "sha512-Q28iYCWzNHjAm+yEAot5QaAMxhMghWLFVf7rRdwhUI+c2jix2DUXjAHXVi+s1ibs3mjPO/cCgbA++3BjD0vP/A==", + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", "requires": { - "follow-redirects": "^1.15.0", + "follow-redirects": "^1.15.6", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } @@ -3533,9 +3544,9 @@ "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==" }, "follow-redirects": { - "version": "1.15.3", - "resolved": "https://art.code.pan.run:443/artifactory/api/npm/npm-registry/follow-redirects/-/follow-redirects-1.15.3.tgz", - "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==" + "version": "1.15.8", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.8.tgz", + "integrity": "sha512-xgrmBhBToVKay1q2Tao5LI26B83UhrB/vM1avwVSDzt8rx3rO6AizBAaF46EgksTVr+rFTQaqZZ9MVBfUe4nig==" }, "form-data": { "version": "4.0.0", diff --git a/package.json b/package.json index 0e73c65..f18645d 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "repository": "https://github.com/bridgecrewio/prisma-cloud-vscode-plugin", "icon": "static/icons/prisma.png", "description": "a static code analysis tool to scan code for Infrastructure-as-Code (IaC) misconfigurations, Software Composition Analysis (SCA) issues and Secrets vulnerabilities.", - "version": "1.0.19", + "version": "1.0.20", "engines": { "vscode": "^1.79.0" }, @@ -14,13 +14,9 @@ "Other" ], "activationEvents": [ - "*" + "onStartupFinished" ], "main": "./out/extension.js", - "files": [ - "out", - "static" - ], "contributes": { "viewsContainers": { "activitybar": [ @@ -272,7 +268,7 @@ "typescript": "^5.1.6" }, "dependencies": { - "axios": "^1.5.1", + "axios": "^1.7.4", "semver": "^7.5.2", "uuid": "^9.0.1", "winston": "^3.13.0" diff --git a/src/commands/checkov/install.ts b/src/commands/checkov/install.ts index b62bede..597e51b 100644 --- a/src/commands/checkov/install.ts +++ b/src/commands/checkov/install.ts @@ -178,4 +178,4 @@ export class CheckovInstall { return `"${join(dirname(envPath), 'checkov')}"`; } } -}; +} diff --git a/src/extension.ts b/src/extension.ts index d542c18..6132f9c 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,21 +1,23 @@ import * as vscode from 'vscode'; import { registerCommands } from './commands'; +import { CONFIG } from './config'; import { COMMAND } from './constants'; import { registerWindowEvents, registerWorkspaceEvents } from './events'; +import logger, { initiateLogger } from './logger'; import { initializeServices } from './services'; -import { registerSidebar } from './views/interface/primarySidebar'; -import { registerCheckovResultView } from './views/interface/checkovResult'; -import { registerCustomHighlight, lineClickDisposable } from './services/customPopupService'; -import { initializeInstallationId } from './utils'; -import { initiateLogger } from './logger'; import { initializeAnalyticsService } from './services/analyticsService'; -import { CustomersModulesService, initializeCustomersModulesService } from './services/customersModulesService'; import { initializeAuthenticationService } from './services/authenticationService'; +import { CustomersModulesService, initializeCustomersModulesService } from './services/customersModulesService'; +import { lineClickDisposable, registerCustomHighlight } from './services/customPopupService'; +import { initializeInstallationId } from './utils'; +import { registerCheckovResultView } from './views/interface/checkovResult'; +import { registerSidebar } from './views/interface/primarySidebar'; export async function activate(context: vscode.ExtensionContext) { initiateLogger(context.logUri.fsPath); - + logger.info(`Initiating Prisma Cloud VS Code extension version ${vscode.extensions.getExtension(CONFIG.extensionId)?.packageJSON.version}`); + logger.info(`Plugin path: ${context.extensionPath}`); initializeInstallationId(context); CustomersModulesService.loadCachedData(context); await initializeAuthenticationService(context); diff --git a/src/services/checkov/executor.ts b/src/services/checkov/executor.ts index eaac5ed..b014545 100644 --- a/src/services/checkov/executor.ts +++ b/src/services/checkov/executor.ts @@ -30,7 +30,7 @@ export class CheckovExecutor { const executor = CheckovExecutor.executors.get(installation.type); executor ? CheckovExecutor.actualCheckovVersion = await CheckovExecutor.executors.get(installation.type)?.getCheckovVersion(installation) : - logger.error(`No executor found for ${installation.type}, can't determine Checkov version`); + logger.error(`No executor found for ${installation?.type}, can't determine Checkov version`); } public static getExecutor() { @@ -53,7 +53,7 @@ export class CheckovExecutor { } if (!executor) { - logger.error(`No executor found for ${installation.type}, aborting scan operation`); + logger.error(`No executor found for ${installation?.type}, aborting scan operation`); return; } @@ -62,6 +62,11 @@ export class CheckovExecutor { return; } + if (vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 1 && !targetFiles) { + vscode.window.showWarningMessage('Full scan is only supported when working with a single VS Code workspace'); + return; + } + const emptyPrismaSettings = CheckovExecutor.getEmptyPrismaSettings(); if (!emptyPrismaSettings.length) { @@ -76,12 +81,12 @@ export class CheckovExecutor { try { checkovOutput = await executor.execute(installation, targetFiles); } catch (e: any) { - logger.info(`The Checkov execution was failed due to: ${e.message}`); + logger.info(`Checkov execution failed due to: ${e.message}`); AbstractExecutor.isScanInProgress = false; await reRenderViews(); StatusBar.reset(); if (!shouldDisableErrorMessage()) { - vscode.window.showErrorMessage(`Scanning is stopped due to: ${e.message}`); + vscode.window.showErrorMessage(`Scanning stopped due to: ${e.message}`); } return; } @@ -124,18 +129,16 @@ export class CheckovExecutor { private static processOutput(output: CheckovOutput) { if (Array.isArray(output)) { - const failedChecks = output.reduce((acc: CheckovResult[], checkType) => { + return output.reduce((acc: CheckovResult[], checkType) => { if (checkType) { for (const check of checkType.results.failed_checks) { check.check_type = checkType.check_type; check.id = uuidv4(); check.severity = check.severity || SEVERITY.INFO; - }; + } } return acc.concat(checkType?.results.failed_checks ?? []); }, []); - - return failedChecks; } // response from checkov with EmptyCheckovOutput type @@ -169,4 +172,4 @@ export class CheckovExecutor { public static get checkovVersion() { return CheckovExecutor.actualCheckovVersion; } -}; +} diff --git a/src/services/checkov/executors/DockerExecutor.ts b/src/services/checkov/executors/DockerExecutor.ts index c389ebb..cd7a37b 100644 --- a/src/services/checkov/executors/DockerExecutor.ts +++ b/src/services/checkov/executors/DockerExecutor.ts @@ -8,8 +8,10 @@ import { getCertificate, getPrismaApiUrl, getProxyConfigurations } from '../../. import logger from '../../../logger'; import { CheckovInstallation } from '../../../types'; import { asyncExec, isWindows } from '../../../utils'; +import { parseUri } from '../../../utils/fileUtils'; import { reRenderViews } from '../../../views/interface/utils'; import { AbstractExecutor } from './abstractExecutor'; +import * as path from 'path'; export class DockerExecutor extends AbstractExecutor { @@ -28,7 +30,7 @@ export class DockerExecutor extends AbstractExecutor { ...DockerExecutor.getDockerParams(), ...containerName, ...DockerExecutor.getEnvs(), - ...DockerExecutor.getVolumeMounts(), + ...DockerExecutor.getVolumeMounts(files), ...DockerExecutor.getWorkdir(), ...DockerExecutor.getImage(), ...(await DockerExecutor.getCheckovCliParams(installation, DockerExecutor.fixFilePaths(files))), @@ -90,12 +92,19 @@ export class DockerExecutor extends AbstractExecutor { return envs; } - private static getVolumeMounts() { - let volume = `${DockerExecutor.projectPath}:${DockerExecutor.projectPath}`; - const volumeMounts = [ - '--volume', volume - ]; - + private static getVolumeMounts(files?: string[]) { + const volumeMounts = []; + if (files) { + files.forEach(file => { + const dir = path.dirname(file); + volumeMounts.push('--volume', `"${dir}":"${dir}"`); + }); + } else if (vscode.workspace.workspaceFolders) { + const dir = parseUri(vscode.workspace.workspaceFolders[0].uri); + volumeMounts.push('--volume', `${dir}:${dir}`); + } else { + AbstractExecutor.projectPaths.forEach(path => volumeMounts.push('--volume', `${path}:${path}`)); + } const cert = getCertificate(); if (cert) { volumeMounts.push('--volume', `${cert}:${CONFIG.checkov.docker.certificateMountPath}`); @@ -105,7 +114,10 @@ export class DockerExecutor extends AbstractExecutor { } private static getWorkdir() { - return ['--workdir', DockerExecutor.projectPath!]; + if (vscode.workspace.workspaceFolders) { + return ['--workdir', parseUri(vscode.workspace.workspaceFolders[0].uri)]; + } + return []; } private static getImage() { @@ -128,5 +140,5 @@ export class DockerExecutor extends AbstractExecutor { const {stdout} = await asyncExec(`${installation.entrypoint} ${args.join(' ')}`); return stdout.trim(); } -}; +} diff --git a/src/services/checkov/executors/abstractExecutor.ts b/src/services/checkov/executors/abstractExecutor.ts index 196ed07..5f3ca21 100644 --- a/src/services/checkov/executors/abstractExecutor.ts +++ b/src/services/checkov/executors/abstractExecutor.ts @@ -2,35 +2,46 @@ import { ChildProcessWithoutNullStreams } from 'child_process'; import * as vscode from 'vscode'; +import { ShowSettings } from '../../../commands/checkov'; import { CONFIG } from '../../../config'; +import { getAccessKey, getCertificate, getExternalChecksDir, getFrameworks, getNoCertVerify, getSastMaxSizeLimit, getSecretKey, getToken, shouldUseEnforcmentRules } from '../../../config/configUtils'; import { CHECKOV_INSTALLATION_TYPE, REPO_ID } from '../../../constants'; -import { CheckovInstallation, CheckovOutput } from '../../../types'; -import { getDirSize, isPipInstall, isWindows } from '../../../utils'; -import { ShowSettings } from '../../../commands/checkov'; import logger from '../../../logger'; -import { getAccessKey, getCertificate, getExternalChecksDir, getFrameworks, getNoCertVerify, getSastMaxSizeLimit, getSecretKey, getToken, shouldUseEnforcmentRules } from '../../../config/configUtils'; - +import { CheckovInstallation, CheckovOutput } from '../../../types'; +import { getDirSize } from '../../../utils'; +import { getContainingFolderPath, parseUri } from '../../../utils/fileUtils'; export abstract class AbstractExecutor { public static isScanInProgress: boolean = false; - protected static get projectPath() { + /** + * There are 3 possible situations when scanning operation starts: + * 1. The IDE has standalone files opened that are not a part of any workspace + * 2. The IDE has an opened workspace + * 3. The IDE has an opened workspace and some standalone files outside of it that are also opened + * @returns An array of directories containing all possible locations of files that should be scanned. + */ + protected static get projectPaths(): string[] { + const uris: vscode.Uri[] = []; const workspaceFolders = vscode.workspace.workspaceFolders; - - if (!workspaceFolders) { - return null; + if (workspaceFolders) { + uris.push(workspaceFolders[0].uri); } - - if (isWindows()) { - if (isPipInstall()) { - return `"${workspaceFolders[0].uri.fsPath.replace(/\\/g, '/')}"`; - } - else { - return `"/${workspaceFolders[0].uri.path.replace(':', '')}"`; - } - } - - return `"${workspaceFolders[0].uri.path.replace(':', '')}"`; + vscode.window.tabGroups.all.forEach(tabGroup => + tabGroup.tabs.forEach(tab => { + if (tab.input instanceof vscode.TabInputText) { + const document: vscode.TabInputText = tab.input; + if (workspaceFolders) { + if (!workspaceFolders.some(folder => document.uri.fsPath.startsWith(folder.name))) { + uris.push(getContainingFolderPath(document.uri)); + } + } else { + uris.push(getContainingFolderPath(document.uri)); + } + } + }) + ); + return uris.map(uri => parseUri(uri)); } protected static async getCheckovCliParams(installation: CheckovInstallation, files?: string[]) { @@ -64,17 +75,28 @@ export abstract class AbstractExecutor { if (files) { files.forEach((file) => checkovCliParams.push('--file', `"${file}"`)); - } else { - checkovCliParams.push('--directory', AbstractExecutor.projectPath!); - + } else if (vscode.workspace.workspaceFolders) { + const directory = parseUri(vscode.workspace.workspaceFolders![0].uri); + checkovCliParams.push('--directory', directory); + const excludedPaths = AbstractExecutor.projectPaths.filter(path => !path.startsWith(directory)); + if (excludedPaths.length) { + logger.warn(`There are files opened from outside the workspace that won't be scanned in these directories: ${excludedPaths}`); + vscode.window.showWarningMessage('You have opened files from outside your workspace. Those files will not be scanned as part of a full scan'); + } const shouldSkipSast = await AbstractExecutor.shouldSkipSast(); - if (shouldSkipSast) { checkovCliParams.push('--skip-framework', 'sast'); vscode.window.showInformationMessage('SAST didn\'t run due to the size of the repository. Adjust this limit in the settings', 'Prisma Cloud Settings').then(() => { ShowSettings.execute(); }); } + } else { + // If there are no files and no workspace, scan all opened files in the editor + vscode.window.tabGroups.all.forEach(tabGroup => + tabGroup.tabs.forEach(tab => + tab.input instanceof vscode.TabInputText && checkovCliParams.push('--file', parseUri(tab.input.uri)) + ) + ); } const cert = getCertificate(); @@ -141,4 +163,4 @@ export abstract class AbstractExecutor { return true; } } -}; +} diff --git a/src/services/filesService.ts b/src/services/filesService.ts index 168048f..8eb9196 100644 --- a/src/services/filesService.ts +++ b/src/services/filesService.ts @@ -8,22 +8,12 @@ export class FilesService { } public static async openFile(file: string, line: number = 1) { - const workspaceFolders = vscode.workspace.workspaceFolders; - - if (!workspaceFolders) { - return; - } - if (line < 1) { line = 1; } - - const fileUri = vscode.Uri.joinPath(workspaceFolders[0].uri, file); - if (!vscode.window.activeTextEditor) { vscode.commands.executeCommand('workbench.action.previousEditor'); } - - return vscode.window.showTextDocument(fileUri, { selection: new vscode.Range(line - 1, 0, line - 1, 0) }); + return vscode.window.showTextDocument(vscode.Uri.file(file), { selection: new vscode.Range(line - 1, 0, line - 1, 0) }); } -}; +} diff --git a/src/services/resultsService.ts b/src/services/resultsService.ts index f10e26c..ae7e7e8 100644 --- a/src/services/resultsService.ts +++ b/src/services/resultsService.ts @@ -3,10 +3,10 @@ import * as vscode from 'vscode'; import { CONFIG } from '../config'; import { CHECKOV_RESULT_CATEGORY } from '../constants'; import { CheckovResult } from '../types'; +import { isPipInstall, isWindows } from '../utils'; import { TreeDataProvidersContainer } from '../views/interface/primarySidebar/services/treeDataProvidersContainer'; import { CategoriesService } from './categoriesService'; import { CustomPopupService } from './customPopupService'; -import { isPipInstall, isWindows } from '../utils'; type Filter = { filterName: keyof CheckovResult; @@ -70,17 +70,11 @@ export class ResultsService { public static getByFilePath(filePath: string) { const results = ResultsService.get(); - - if (vscode.workspace.workspaceFolders) { - filePath = filePath.replace(vscode.workspace.workspaceFolders[0].uri.path, ''); - } - return results.filter(result => { if (isWindows()) { return result.file_abs_path === `/${filePath}`; } - - return result.repo_file_path === filePath; + return result.file_abs_path === filePath; }); } @@ -155,4 +149,4 @@ export class ResultsService { TreeDataProvidersContainer.refresh(); CustomPopupService.highlightLines(); } -}; +} diff --git a/src/utils/fileUtils.ts b/src/utils/fileUtils.ts new file mode 100644 index 0000000..6202544 --- /dev/null +++ b/src/utils/fileUtils.ts @@ -0,0 +1,20 @@ +import * as path from 'path'; +import * as vscode from 'vscode'; +import { isPipInstall, isWindows } from '.'; + +export const getContainingFolderPath = (uri: vscode.Uri) => { + const filePath = uri.fsPath; + const folderPath = path.dirname(filePath); + return vscode.Uri.file(folderPath); +}; + +export const parseUri = (uri: vscode.Uri) => { + if (isWindows()) { + if (isPipInstall()) { + return `"${uri.fsPath.replace(/\\/g, '/')}"`; + } else { + return `"/${uri.path.replace(':', '')}"`; + } + } + return `"${uri.path.replace(':', '')}"`; +}; \ No newline at end of file diff --git a/src/views/interface/checkovResult/messages/focusString.ts b/src/views/interface/checkovResult/messages/focusString.ts index b29abfc..4fa0797 100644 --- a/src/views/interface/checkovResult/messages/focusString.ts +++ b/src/views/interface/checkovResult/messages/focusString.ts @@ -1,10 +1,9 @@ -import * as vscode from 'vscode'; import { FilesService } from '../../../../services'; export class FocusString { - public static async handle({ repoFilePath, row }: { repoFilePath: string, row: number }) { - if (repoFilePath && row) { - await FilesService.openFile(repoFilePath, row); + public static async handle({ fileAbsPath, row }: { fileAbsPath: string, row: number }) { + if (fileAbsPath && row) { + await FilesService.openFile(fileAbsPath, row); return; } diff --git a/src/views/interface/checkovResult/webviewPanel.ts b/src/views/interface/checkovResult/webviewPanel.ts index 920dc02..99169ed 100644 --- a/src/views/interface/checkovResult/webviewPanel.ts +++ b/src/views/interface/checkovResult/webviewPanel.ts @@ -13,7 +13,6 @@ import { MessageHandlersFactory } from './messages'; export class CheckovResultWebviewPanel { private static context: vscode.ExtensionContext; - private static retryCount: number = 0; public static currentCategory: CHECKOV_RESULT_CATEGORY; public static webviewPanel?: vscode.WebviewPanel; public static checkovResult?: CheckovResult; @@ -24,8 +23,8 @@ export class CheckovResultWebviewPanel { } public static async show(category: CHECKOV_RESULT_CATEGORY, result: CheckovResult, activeEditor: typeof vscode.window.activeTextEditor) { - CheckovResultWebviewPanel.fileEditorMap.set(result.file_abs_path, activeEditor); - CheckovResultWebviewPanel.currentCategory = category; + CheckovResultWebviewPanel.fileEditorMap.set(result.file_abs_path, activeEditor); + CheckovResultWebviewPanel.currentCategory = category; const html = await CheckovResultWebviewPanel.getHtmlTemplate(category); CheckovResultWebviewPanel.checkovResult = result; @@ -81,13 +80,9 @@ export class CheckovResultWebviewPanel { return Boolean(vulnerability_details?.id) || Boolean(check_id); } - if (CategoriesService.isLicensesRisk(check_id) - || CategoriesService.isSecretsRisk(check_id) - || CategoriesService.isWeaknessesRisk(check_type)) { - return false; - } - - return true; + return !(CategoriesService.isLicensesRisk(check_id) + || CategoriesService.isSecretsRisk(check_id) + || CategoriesService.isWeaknessesRisk(check_type)); } private static restrictScaForFile(result: CheckovResult): boolean { @@ -314,7 +309,7 @@ export class CheckovResultWebviewPanel { private static getDataFlowItemString(dataFlow: DataFlow, result: CheckovResult): string { const splitPath = dataFlow.path.split('/'); return `