Integration of FAST with Bamboo¶
The integration of FAST in CI MODE into the Bamboo workflow can be configured using one of the methods below:
-
via the YAML specification
-
via the JAVA specification
-
via Bamboo UI
The example below uses the YAML specification to configure the integration.
Passing FAST Node Token¶
To securely use the FAST node token, pass its value in the Bamboo global variable.
Configured workflow
Further instructions require already configured workflow that corresponds to one of the following points:
- The test automation is implemented. In this case, the request recording and security testing steps will be added.
- The set of baseline requests is already recorded. In this case, the security testing step will be added.
Adding the Step of Request Recording¶
To implement the request recording, apply the following settings to the job of automated application testing:
-
Add the command running FAST Docker container in the
CI_MODE=recording
mode with other required variables before the command running automated tests. For example: -
Configure proxying of automated tests via FAST node. For example:
Docker Network
Before recording requests, make sure that the FAST node and the tool for automated testing are running on the same network.
Example of the automated testing step with running FAST node in the recording mode
test:
key: TST
tasks:
- script:
interpreter: /bin/sh
scripts:
- docker network create my-network
- docker run --rm --name dvwa -d --network my-network wallarm/fast-example-dvwa-base
- docker run --name fast -d -e WALLARM_API_TOKEN=${bamboo_WALLARM_API_TOKEN} -e CI_MODE=recording -e WALLARM_API_HOST=us1.api.wallarm.com -e ALLOWED_HOSTS=dvwa -p 8080:8080 --network my-network --rm wallarm/fast
- docker run --rm -d --name selenium -e http_proxy='http://fast:8080' --network my-network selenium/standalone-firefox:latest
- docker run --rm --name tests --network my-network wallarm/fast-example-dvwa-tests
- docker stop selenium fast
An example includes the following steps:
- Create the Docker network
my-network
. - Run the test app
dvwa
on themy-network
network. - Run the FAST node in the recording mode on the network
my-network
. - Run the tool for automated testing Selenium with FAST node as a proxy on the network
my-network
. - Run the automated tests on the network
my-network
. - Stop the tool for automated testing Selenium and FAST node in the recording mode.
Adding the Step of Security Testing¶
To implement the security testing, add the corresponding separate step to your workflow following instructions:
-
If the test application is not running, then add the command to run the application.
-
Add the command running the FAST Docker container in the
CI_MODE=testing
mode with other required variables after the command running the application.Using the recorded set of baseline requests
If the set of baseline requests was recorded in another pipeline, specify the record ID in the TEST_RECORD_ID variable. Otherwise, the last recorded set will be used.
Example of the command:
Docker Network
Before security testing, make sure that the FAST node and the test application are running on the same network.
Example of the security testing step
The commands are running on the my-network
network created at the request recording step. The test app, app-test
, is also running at the request recording step.
-
Add
security_testing
to the list ofstages
. In the example, this step finalizes the workflow. -
Define the body of the new job
security_test
.security_test: key: SCTST tasks: - script: interpreter: /bin/sh scripts: - docker run --name fast -e WALLARM_API_TOKEN=${bamboo_WALLARM_API_TOKEN} -e CI_MODE=testing -e WALLARM_API_HOST=us1.api.wallarm.com -p 8080:8080 -e TEST_RUN_URI=http://dvwa:80 --network my-network --rm wallarm/fast - docker stop dvwa - docker network rm my-network
An example includes the following steps:
- Run the FAST node in the testing mode on the network
my-network
. TheTEST_RECORD_ID
variable is omitted since the set of baseline requests was created in the current pipeline and is the last recorded. The FAST node will be stopped automatically when testing is finished. - Stop the test application
dvwa
. - Delete the
my-network
network.
Getting the Result of Testing¶
The result of security testing will be displayed in the build logs in Bamboo UI. Also, Bamboo allows downloading the full .log
file.
More Examples¶
You can find more examples of integrating FAST to Bamboo workflow on our GitHub.
Further questions
If you have questions related to FAST integration, please contact us.