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

Add support for variables inbase image name #5621

Closed
LvffY opened this issue Jul 19, 2022 · 5 comments · Fixed by #5696
Closed

Add support for variables inbase image name #5621

LvffY opened this issue Jul 19, 2022 · 5 comments · Fixed by #5696
Assignees
Labels
bug Something isn't working community Community contribution

Comments

@LvffY
Copy link

LvffY commented Jul 19, 2022

Context

Because we want to analyse some multistage docker builds or just use variables in the process, we'd like kics to analyse correctly our variables.

Expected Behavior

(Which results are expected from KICS?)

Kics should send an error on the tag latest of the image

Actual Behavior

(Formatted logs and samples helps us to better understand the issue)

With the right variables, kics could miss some warnings on tags of the base image.

Steps to Reproduce the Problem

(Command line arguments and flags used)

  1. Have the following dockerfile :
# syntax=docker/dockerfile:1
ARG BASE_IMAGE=alpine
ARG BASE_IMAGE_TAG=latest

FROM ${BASE_IMAGE}:${BASE_IMAGE_TAG} as main
  1. Run kics analysis
docker run -t -v "$PWD/kics":/path checkmarx/kics scan -p "/path" -o "/path/"
  1. You do not get the following warning Image Version Using 'latest', Severity: MEDIUM

While you get the warning with the following docker file :

# syntax=docker/dockerfile:1
ARG BASE_IMAGE=alpine

FROM ${BASE_IMAGE}:latest as main
@LvffY LvffY added bug Something isn't working community Community contribution labels Jul 19, 2022
@rafaela-soares
Copy link
Contributor

Hello, @LvffY!

Thank you so much for noticing and reporting! We are fixing it in PR #5621 😊

@rafaela-soares rafaela-soares self-assigned this Aug 12, 2022
@rafaela-soares
Copy link
Contributor

@LvffY, do you mind if we use your sample for unit test purposes?

@kaplanlior
Copy link
Contributor

@LvffY, do you mind if we use your sample for unit test purposes?

Good idea.... If so, please approve we can use them under Apache 2.0 license.

@LvffY
Copy link
Author

LvffY commented Aug 13, 2022

@kaplanlior @rafaela-soares No problem for me, you can use it for test purposes under Apache license :)

@rafaela-soares
Copy link
Contributor

Thank you so much, @LvffY!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working community Community contribution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants