Implement a mobsfscan job
Description
Implement a mobsfscan job to perform static code analysis on the application's source code.
Implementation ideas
# templates/gitlab-ci-mobsf.yml
# Adding two inputs
sources-folder:
description: Application sources folder
default: '.'
sources-scan-disabled:
description: Enable scan of sources
type: boolean
default: false
# Adding two Variables
MOBSF_SOURCES_FOLDER: $[[ inputs.sources-folder ]]
MOBSF_SOURCES_SCAN_DISABLED: $[[ inputs.sources-scan-disabled ]]
# Adding mobsfscan job
mobsfscan:
extends: .mobsf-base
stage: package-test
image: opensecurity/mobsfscan:0.4.5
script:
- mobsfscan ${MOBSF_SOURCES_FOLDER} --json | tee reports/mobsf-mobsfscan.native.json
artifacts:
when: always
paths:
- "reports/mobsf-mobsfscan.native.json"
rules:
- if: '$MOBSF_SOURCES_SCAN_DISABLED == "true"'
when: never
- !reference [.test-policy, rules]