From 2bae26912389dca75b6bba326bfd33b47833de29 Mon Sep 17 00:00:00 2001 From: xargs <51077147+XargsUK@users.noreply.github.com> Date: Wed, 2 Oct 2024 23:26:06 +0100 Subject: [PATCH] fix(docker): set interactive flag, remove tty flag #9 --- src/checkov/checkovRunner.ts | 2 +- src/utils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/checkov/checkovRunner.ts b/src/checkov/checkovRunner.ts index 0d3d2d5..2a54c05 100644 --- a/src/checkov/checkovRunner.ts +++ b/src/checkov/checkovRunner.ts @@ -47,7 +47,7 @@ const getDockerRunParams = (workspaceRoot: string | undefined, filePath: string, const [configFileDockerParams, configFileCheckovParams] = getPathParamsForDockerRun(configMountDir, configFilePath, '--config-file'); const [externalChecksDockerParams, externalChecksCheckovParams] = getPathParamsForDockerRun(externalChecksMountDir, externalChecksDir, '--external-checks-dir'); - const dockerParams = ['run', '--rm', '--tty', '--interactive', nameParam, ...debugLogParams, '--env', 'BC_SOURCE=vscode', '--env', `BC_SOURCE_VERSION=${extensionVersion}`, + const dockerParams = ['run', '--rm', '--interactive', nameParam, ...debugLogParams, '--env', 'BC_SOURCE=vscode', '--env', `BC_SOURCE_VERSION=${extensionVersion}`, '-v', `"${mountRoot}:${dockerMountDir}"`, ...caCertDockerParams, ...configFileDockerParams, ...externalChecksDockerParams, '-w', dockerMountDir]; return [...dockerParams, image, ...configFileCheckovParams, ...caCertCheckovParams, ...externalChecksCheckovParams, '-f', filePathToScan]; diff --git a/src/utils.ts b/src/utils.ts index e70fefd..8036cda 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -116,7 +116,7 @@ export const getWorkspacePath = (logger: winston.Logger): string | void => { }; export const runVersionCommand = async (logger: winston.Logger, checkovPath: string, checkovVersion: string | undefined): Promise => { - const command = checkovPath === 'docker' ? `docker run --rm bridgecrew/checkov:${checkovVersion} -v` : `${checkovPath} -v`; + const command = checkovPath === 'docker' ? `docker run --rm --interactive bridgecrew/checkov:${checkovVersion} -v` : `${checkovPath} -v`; logger.debug(`Version command: ${command}`); const resp = await asyncExec(command); logger.debug(`Response from version command: ${resp[0]}`);