Fortinet white logo
Fortinet white logo

Bitbucket

Bitbucket

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.

pipelines:
default:
	- step :
		runs-on:
			- self.hosted 
			- linux 
		name: Build and Scan
		services:
			- docker
		script:
			- env_file=`mktemp`
			- env | grep -E "BITBUCKET_PROJECT_UUID|BITBUCKET_BUILD_NUMBER|BITBUCKET_BRANCH|BITBUCKET_COMMIT" > $env_file
			- docker run --pull always --rm --env-file $env_file -v "$(pwd)":/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.

pipelines:
default:
	- step :
		runs-on:
			- self.hosted 
			- linux 
		name: Build and Scan
		services:
			- docker
		script:
			- env_file=`mktemp`
			- env | grep -E "BITBUCKET_PROJECT_UUID|BITBUCKET_BUILD_NUMBER|BITBUCKET_BRANCH|BITBUCKET_COMMIT" > $env_file
			- docker run --pull always --rm --env-file $env_file -v "$(pwd)":/scan registry.fortidevsec.forticloud.com/fdevsec_dast:latest
			-rm $env_file 

Bitbucket

Bitbucket

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.

pipelines:
default:
	- step :
		runs-on:
			- self.hosted 
			- linux 
		name: Build and Scan
		services:
			- docker
		script:
			- env_file=`mktemp`
			- env | grep -E "BITBUCKET_PROJECT_UUID|BITBUCKET_BUILD_NUMBER|BITBUCKET_BRANCH|BITBUCKET_COMMIT" > $env_file
			- docker run --pull always --rm --env-file $env_file -v "$(pwd)":/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.

pipelines:
default:
	- step :
		runs-on:
			- self.hosted 
			- linux 
		name: Build and Scan
		services:
			- docker
		script:
			- env_file=`mktemp`
			- env | grep -E "BITBUCKET_PROJECT_UUID|BITBUCKET_BUILD_NUMBER|BITBUCKET_BRANCH|BITBUCKET_COMMIT" > $env_file
			- docker run --pull always --rm --env-file $env_file -v "$(pwd)":/scan registry.fortidevsec.forticloud.com/fdevsec_dast:latest
			-rm $env_file