CICD Integration - Using Maven
Before scanning applications using Falcon Scan, make sure you have:
|
Adding Repositories
-
The binaries required to scan the projects are available in
IZ Maven Central
repository. Include following repositories and plugin repositories in settings.xml
<repositories>
<repository>
<id>iz-maven-repo</id>
<name>IZ Maven Repo</name>
<url>https://iz-public-m2.s3.eu-west-2.amazonaws.com/releases</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>iz-maven-plugin-repo</id>
<url>https://iz-public-m2.s3.eu-west-2.amazonaws.com/releases</url>
</pluginRepository>
</pluginRepositories>
CICD Integration
-
Go to the project root directory from command line/terminal
-
Run
mvn com.integralzone.falcon:falcon-scan-cli:scan
command with following options-
-DserviceHost=xxx
Falcon Scan service URL -
-DauthToken=xxx
Security token generated from the server -
-DapplicationKey=x.x
Unique id of the application / project being scanned -
-DapplicationName=.
Name of the application being scanned -
-Dsource=xxx
Optional. Location of the project source directory. If ignored, current directory will be used as the project source directory -
-DscmBranchName=xxx
Optional. SCM branch for which code is being analyzed. If ignored, the default value will be `master` -
-DpullRequestId=xxx
_Optional.SCM Pull request name for which code is being analyzed -
-Dorganization=xxx
Optional. Organization under which the project should be categorized. If ignored, the default organization will be used. Value can be any of Organization Name / Id / Ext Id
-
Please refer to the section below for instructions on how to retrieve the organization ID.
-
Complete example may look like
PROJECT_ROOT_DIR> mvn com.integralzone.falcon:falcon-scan-cli:scan -DserviceHost=${FALCON_HOST} -DauthToken=${FALCON_TOKEN} -DapplicationKey=orders-sapi -Dsource=. -DapplicationName="Orders SAPI"
Retrieve Organization ID
-
Navigate to main menu
Organizations
→Organizations
-
In the displayed list of organizations, each one will have an associated
Id
as shown below. -
Use the Organization ID when performing the CICD scan with the
-Dorganization
parameter._For example: -Dorganization=cm0oy5hht00efv640wm935np9_