Commit 50364ba7 authored by Thomas Boni's avatar Thomas Boni
Browse files

Merge branch 'feature/dependency_check' into 'latest'

[Update job] 🚓 Owasp Dependency_check 🔎

See merge request r2devops/hub!223
parents 3980d332 350623c3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ The complete list is available [here](https://jeremylong.github.io/DependencyChe

* Job name: `owasp_dependency_check`
* Docker image:
[`openjdk:16-alpine3.12`](https://hub.docker.com/r/_/openjdk){:target="_blank"}
[`owasp/dependency-check:6.1.1`](https://hub.docker.com/r/owasp/dependency-check){:target="_blank"}
* Default stage: `static_tests`
* When: `always`

+2 −2
Original line number Diff line number Diff line
@@ -5,10 +5,10 @@ icon: 👁
maintainer: Protocole
license: MIT
images:
  "openjdk": "16-alpine3.12"
  "owasp": "dependency-check"
tools:
  ".NET": "$DOTNET_VERSION"
  "dependency-check": "6.0.3"
  "dependency-check": "6.1.1"
labels:
  - GitLab
  - Security
+8 −8
Original line number Diff line number Diff line
@@ -2,7 +2,9 @@ stages:
  - static_tests

owasp_dependency_check:
  image: openjdk:16-alpine3.12
  image:
    name: owasp/dependency-check:6.1.1
    entrypoint: [ "" ]
  stage: static_tests
  variables:
    DEPCHECK_NO_UPDATE: "false"
@@ -15,9 +17,9 @@ owasp_dependency_check:
    PROJECT_ROOT: "/"
  script:
    # Installing Dotnet if needed
    - apk add wget curl bash unzip
    - |
      if [ "$DOTNET_DLL_ANALYZE" = "true" ]; then
        apk add wget curl bash unzip
        # Script coming from dotNET_Build job
        apk add autoconf build-base clang clang-dev cmake curl-dev gcc gettext-dev git icu-dev krb5-dev libtool linux-headers llvm make zlib-dev
        curl -O https://dotnet.microsoft.com/download/dotnet-core/scripts/v1/dotnet-install.sh
@@ -25,15 +27,13 @@ owasp_dependency_check:
        bash dotnet-install.sh -Channel ${DOTNET_VERSION}
        export PATH="/root/.dotnet/:$PATH"
      fi
    # Installing Dependency-Check
    - wget https://github.com/jeremylong/DependencyCheck/releases/download/v6.0.3/dependency-check-6.0.3-release.zip
    - unzip -d ${CI_PROJECT_DIR}/ *.zip 
    # Creating Dependency-Check report folder
    - mkdir ${CI_PROJECT_DIR}/report/
    # Env variables checking
    - if [ "$DEPCHECK_NO_UPDATE" = "true" ]; then export DEPCHECK_OPTIONS="-n $DEPCHECK_OPTIONS"; fi
    - if [ "$DEPCHECK_EXPERIMENTALS" = "true" ]; then export DEPCHECK_OPTIONS="--enableExperimental $DEPCHECK_OPTIONS"; fi
    
    - ${CI_PROJECT_DIR}/dependency-check/bin/dependency-check.sh -f JUNIT -s ${CI_PROJECT_DIR}${PROJECT_ROOT} -o ${CI_PROJECT_DIR}/report/ --failOnCVSS ${DEPCHECK_CVSS_SCORE_FAIL} --junitFailOnCVSS ${DEPCHECK_JUNIT_CVSS_FAIL}
    # Lauchning analyze
    - /usr/share/dependency-check/bin/dependency-check.sh -f JUNIT -s ${CI_PROJECT_DIR}${PROJECT_ROOT} -o ${CI_PROJECT_DIR}/report/ --failOnCVSS ${DEPCHECK_CVSS_SCORE_FAIL} --junitFailOnCVSS ${DEPCHECK_JUNIT_CVSS_FAIL}
  cache:
    key: "dependency-check:data"
    paths:
+1 −0
Original line number Diff line number Diff line
🔄 Switch to use official 🐳 Docker image from OWASP