Bitbucket Cloud
Overview
Arnica Integrates directly with your Bitbucket Cloud application to help secure the development environment while identifying risks in real time - alerting your team and assisting with remediation actions. Arnica's integration is configurable allowing org-level provisioning or access to specified projects to extract the necessary data and take remediation actions.
Ensure service account continuity
Create a dedicated application user
Arnica's Bitbucket integration leverages a Bitbucket generated API Token tied to a specified user. To avoid the revocation of this token upon the impersonated user's departure, it is highly recommended to create and integrate using a standard application user.
The created user will be visible to all developers as part of Arnica's interactions, such as comments on merge requests. Hence, it is recommended to name the service account properly, such as arnica-service-account
Prerequisites
IP allowlist
In some cases, customers may use IP allowlist to restrict which source IP addresses can access a specific workspace. To validate this functionality, navigate to https://bitbucket.org/[WORKSPACE_NAME]/workspace/settings/access-controls and check the IP allowlisting configuration.
If this configuration is enabled, add Arnica's IP addresses, as documented in the Ingress traffic section of the On-Premises integrations page.
Grant permissions to application user
Login to the Bitbucket Cloud workspace
Navigate to the
User Groupspage located inhttps://bitbucket.org/[YOUR_WORKSPACE]/workspace/settings/groupsClick on the
Administratorsgroup and add the dedicated application security user to this group.
If your environment is comprised of multiple workspaces, repeat the steps above for each workspace with the same user.
Installation process
Generate an API token
Login with the application user and navigate to the Atlassian API Tokens page.
Click on
Create API token with scopesand provide a recognizable name and expiration in 1 year from the creation date.The next step asks to choose the app will be accessed by the token. Select
Bitbucket.Add the following 15 scopes:
read:account,read:me,read:user:bitbucket,read:pipeline:bitbucket,write:pipeline:bitbucket,read:project:bitbucket,read:pullrequest:bitbucket,write:pullrequest:bitbucket,read:repository:bitbucket,write:repository:bitbucket,admin:repository:bitbucket,read:webhook:bitbucket,write:webhook:bitbucket,delete:webhook:bitbucketandread:workspace:bitbucket.Review the changes and create the token. When the token is displayed, copy it to a temporary location for later use during the Arnica integration.
Get the email address
Remain in the logged in session from the previous step and navigate to the Profile and visibility page.
Copy the email address of the account at the bottom of the page.
Integrate
Navigate to the Integrations page in Arnica and click on
Bitbucket Cloud.Fill in the email address (not username) and the API Token from the steps above.
Click on
Validateto ensure that the credentials work properly and then click onOK.
FAQ
Q: Why does the service account need to have administrative permissions? A: While the service account is granted with administrative permissions, the API Token used by Arnica has least privileges. It was designed this way to maintain access to required admin-only permissions without exposing the token to full admin rights.
Last updated
Was this helpful?