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

Please use Docker instead of downloading manually the files #2962

Closed
miguelfreitas93 opened this issue Apr 22, 2021 · 10 comments
Closed

Please use Docker instead of downloading manually the files #2962

miguelfreitas93 opened this issue Apr 22, 2021 · 10 comments
Labels
enhancement Enhancement feature request Community: new feature request help wanted Extra attention is needed integrations

Comments

@miguelfreitas93
Copy link
Contributor

miguelfreitas93 commented Apr 22, 2021

Expected Behavior

Have CI examples using docker instead of using complicated downloads on this folder https://github.com/Checkmarx/kics/tree/master/examples

Actual Behavior

Examples presented using wget, not docker

Specifications

  • Version: latest
  • Platform: docker
  • Subsystem: Linux
@miguelfreitas93 miguelfreitas93 added the bug Something isn't working label Apr 22, 2021
@miguelfreitas93
Copy link
Contributor Author

miguelfreitas93 commented Apr 22, 2021

For example, for Gitlab:

image: docker:git

services:
- docker:dind

stages:
  - kics

before_script:
  - docker pull checkmarx/kics:$KICS_VERSION

kics:
  stage: kics
  script:
    - > 
        docker run
        -v $CI_PROJECT_DIR:/code
        checkmarx/kics:$KICS_VERSION
        scan 
        -p /code

For example for Azure Dev Ops Pipelines:
(CxVariables needs to be defined under Pipelines -> Library where variables will be globally stored to all pipelines)

trigger:
- main

variables:
- group: CxVariables

pool:
  vmImage: 'ubuntu-latest'
  
steps:
- script: |
    docker run \
    -v $(Build.Repository.LocalPath):/code \
    checkmarx/kics:$(KICS_VERSION) \
    scan \
    -p /code
  displayName: 'KICS Scan'

For example for Bitbucket Pipelines:

image:
  name: atlassian/default-image:2

pipelines:

  default:
  
  - step:
      name: KICS Scan
      script:
        - docker run
          -v $BITBUCKET_CLONE_DIR:/code
          checkmarx/kics:$KICS_VERSION
          scan
          -p /code
      services:
      - docker

@miguelfreitas93
Copy link
Contributor Author

miguelfreitas93 commented Apr 22, 2021

Also it is required to have a README.md explaining which variables you need to define and which are default variables already defined on the pipeline for example:
For Gitlab example:

- Gitlab Default Variables:
  - CI_PROJECT_DIR -> Folder where Source code can be found

- CI/CD Pipeline variables required to be created:
  - KICS_VERSION -> Docker Tag of kics docker image to be used

For Azure example:

- Azure Default Variables:
  - Build.Repository.LocalPath -> Folder where Source code can be found

- CI/CD Pipeline variables required to be created (on this case, under Library Group):
  - KICS_VERSION -> Docker Tag of kics docker image to be used

For Bitbucket Pipelines example:

- Bitbucket Pipelines Default Variables:
  - BITBUCKET_CLONE_DIR -> Folder where Source code can be found

- CI/CD Pipeline variables required to be created:
  - KICS_VERSION -> Docker Tag of kics docker image to be used

@jbrotsos
Copy link

@miguelfreitas93 I was about to file the same FR but is it necessary to run docker pull & docker run? I believe this would work instead:

image:
name: checkmarx/kics:${KICS_VERSION}

@miguelfreitas93
Copy link
Contributor Author

miguelfreitas93 commented Apr 23, 2021

Yeah, that might work @jbrotsos for some build servers

@rogeriopeixotocx
Copy link
Contributor

@miguelfreitas93 @jbrotsos your feedback is greatly appreciated. We'll take a look at those improvements. But then again, you're also welcome to contribute.

We want to promote community engagement! ✌🏻

@rogeriopeixotocx rogeriopeixotocx removed their assignment Apr 23, 2021
@rogeriopeixotocx rogeriopeixotocx added community Community contribution enhancement Enhancement feature request Community: new feature request and removed bug Something isn't working labels May 7, 2021
@rogeriopeixotocx rogeriopeixotocx added this to the Integrations (CI/CD) milestone May 7, 2021
@rogeriopeixotocx rogeriopeixotocx changed the title [CI Examples] Please use Docker instead of downloading manually the files Please use Docker instead of downloading manually the files May 12, 2021
@rogeriopeixotocx rogeriopeixotocx added the help wanted Extra attention is needed label May 24, 2021
@rogeriopeixotocx
Copy link
Contributor

It's good to provide the option for our users to use docker in their CI/CD pipelines.

We already have integration examples using docker for:

  • Jenkins.
  • CircleCI
  • Github Actions

Currently, those are WIP:

  • Gitlab
  • Azure DevOps

TBD in the near future:

  • Bitbucket

cc: @StanislavPolovnyi @elit-cx @nunoocx @markmishaevcx

@rogeriopeixotocx rogeriopeixotocx removed the community Community contribution label Jun 28, 2021
@roock
Copy link
Contributor

roock commented Jun 29, 2021

@rogeriopeixotocx are you still accepting community contribution for an updated template for Gitlab CI using the docker images?

@rogeriopeixotocx
Copy link
Contributor

Hi @roock, yes we are :)

@roock
Copy link
Contributor

roock commented Dec 2, 2021

This has already been implemented and can be closed

@nunoocx
Copy link
Collaborator

nunoocx commented Dec 2, 2021

Thank you @roock !

@nunoocx nunoocx closed this as completed Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement feature request Community: new feature request help wanted Extra attention is needed integrations
Projects
None yet
Development

No branches or pull requests

5 participants