Language: TypeScript
Label: safe
CWE: CWE-287 \u2014 Improper Authentication
When an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct.

Code:
async function deployKubernetesMonitor(
  imageOptions: IImageOptions,
  deployOptions: IDeployOptions,
): Promise<void> {
  if (!existsSync(helmPath)) {
    await downloadHelm();
  }

  await kubectl.applyK8sYaml('test/fixtures/proxying/tinyproxy-service.yaml');
  await kubectl.applyK8sYaml(
    'test/fixtures/proxying/tinyproxy-deployment.yaml',
  );
  await kubectl.waitForDeployment('forwarding-proxy', 'snyk-monitor');

  const imageNameAndTag = imageOptions.nameAndTag.split(':');
  const imageName = imageNameAndTag[0];
  const imageTag = imageNameAndTag[1];
  const imagePullPolicy = imageOptions.pullPolicy;

  await exec(
    `${helmPath} upgrade --install snyk-monitor ${helmChartPath} --namespace snyk-monitor ` +
      `--set image.repository=${imageName} ` +
      `--set image.tag=${imageTag} ` +
      `--set image.pullPolicy=${imagePullPolicy} ` +
      '--set integrationApi=https://api.dev.snyk.io/v2/kubernetes-upstream ' +
      `--set clusterName=${deployOptions.clusterName} ` +
      '--set https_proxy=http://forwarding-proxy:8080',
  );
  console.log(
    `Deployed ${imageOptions.nameAndTag} with pull policy ${imageOptions.pullPolicy}`,
  );
}