JFrog GitLab
Following is a sample code segment that can be configured in your configuration file to perform a SAST scan.
Note: Make sure to update the parameters in the sample code according to your environment before using it.
default: image:docker:latest include: -remote:"https://releases.jfrog.io/artifactory/jfrog-cli/gitlab/v2/.setup-jfrog-unix.yml" jfrog-docker-build: variables: IMAGE_NAME:sample.jfrog.io/jfrog-gitlab-docker/jfrog-docker-example-image:$CI_PIPELINE_IID JFROG_CLI_BUILD_NAME:JFROG_CLI_BUILD_NAME JFROG_CLI_BUILD_NUMBER:$CI_PIPELINE_IID tags: -gitlab-org-docker services: -docker:dind script: -env_file=`mktemp` -env | grep -E "JFROG_CLI_BUILD_NUMBER" > $env_file -docker run --pull always --rm --env-file $env_file --mount type=bind,source="$(pwd)",target=/scan registry.fortidevsec.forticloud.com/fdevsec_sast:latest -rm $env_file
Following is a sample code segment that can be configured in configuration file to perform a DAST scan.
default: image:docker:latest include: -remote:"https://releases.jfrog.io/artifactory/jfrog-cli/gitlab/v2/.setup-jfrog-unix.yml" jfrog-docker-build: variables: IMAGE_NAME:sample.jfrog.io/jfrog-gitlab-docker/jfrog-docker-example-image:$CI_PIPELINE_IID JFROG_CLI_BUILD_NAME:JFROG_CLI_BUILD_NAME JFROG_CLI_BUILD_NUMBER:$CI_PIPELINE_IID tags: -gitlab-org-docker services: -docker:dind script: -env_file=`mktemp` -env | grep -E "JFROG_CLI_BUILD_NUMBER" > $env_file -docker run --pull always --rm --env-file $env_file --mount type=bind,source="$(pwd)",target=/scan registry.fortidevsec.forticloud.com/fdevsec_dast:latest -rm $env_file