After you obtained the API integration key and completed project and branch creation, next is to seamlessly integrate AmourZero's AI-powered Code Security Analysis into your Bitbucket.
Integration guide
1. Don't forget the unique API Key. You can go to left menu and select "Configuration" under DEVSECOPS section. You will see an unique API Key that have generated for you. Copy that API Key for following step.
2. Follow this video to Enable Pipeline in your Bitbucket repository.
Navigate to your Bitbucket repository and go to "Settings" > "Pipeline" and enable pipelines for your repository.
3. Add Repository Variables
Go to DevOps Tab > Go to Configuration > Copy your API Key by clicking Copy
In your Bitbucket repository, go to "Settings" > "Repository Settings" > "Pipelines" and add the required environment variables like `AZ_TOKEN`.
4. Create a Bitbucket Pipeline Configuration
In the root directory of your project, create a file named `bitbucket-pipelines.yml`. This file will define your pipeline configuration.
5. Define the Pipeline Configuration
Edit the `bitbucket-pipelines.yml` file to define your pipeline configuration. You can use the provided sample configuration and customize it according to your needs.
1 image: atlassian/default-image:3
2 pipelines:
3 default:
4 - parallel:
5 - step:
6 name: ArmourZero Security Test
7 services:
8 - docker
9 script:
10 - docker login -u $DOCKER_USERNAME -p $DOCKER_TOKEN
11 - docker run -v "$(pwd):/app/wrk" --rm armourzero/pipe-scan-dev:latest --apikey="$AZ_TOKEN" --projectkey="TvIrAgIyArEtYzQhCQtixJRldHGqmMdF" --branch="$BITBUCKET_BRANCH" --repo="$BITBUCKET_REPO_FULL_NAME" --runEnv="demo"
12 definitions:
13 services:
14 docker:
15 memory: 3072
16
6. Commit and Push
Commit the `bitbucket-pipelines.yml` file and push it to your Bitbucket repository. This will trigger the pipeline.
7. Monitor the Pipeline
In your Bitbucket repository, go to "Pipelines" to monitor the pipeline's progress, view logs, and access build artifacts.
Notes:
You can also access to the integration information by going to left menu and select "Projects" under DEVSECOPS section, click on the Project ID or the three dots action icon on the project, select "View Project". Then select Integrate menu.