Bitbucket

Bitbucket Integration

Pensar Console integrates with Bitbucket Cloud to scan and secure your repositories. The integration uses OAuth to provide secure access to your Bitbucket workspace.

Prerequisites

Before connecting Bitbucket, ensure you have:

  1. A Bitbucket account with access to the repositories you want to scan
  2. Admin access to the Bitbucket workspace you want to connect

Connecting Bitbucket

From Workspace Settings

  1. Navigate to SettingsIntegrations in your Pensar Console workspace
  2. Expand the Bitbucket section
  3. Click Connect Bitbucket
  4. You’ll be redirected to Bitbucket’s authorization page
  5. Review the permissions and click Grant access
  6. Select the Bitbucket workspace you want to connect
  7. You’ll be automatically redirected back to Pensar Console

From Onboarding

When creating a new workspace, you can connect Bitbucket during the onboarding process by clicking Connect your Bitbucket workspace and following the same steps.

Pensar will automatically set up webhooks in your Bitbucket workspace to receive notifications about repository events.

Permissions

When you authorize Pensar, the following permissions are granted:

PermissionPurpose
Read repositoriesAccess repository contents for security scanning
Write repositoriesCreate commits for auto-remediation
Read pull requestsView pull request information
Write pull requestsCreate and manage pull requests for security fixes
Read webhooksView existing webhook configurations
Write webhooksSet up webhooks for real-time notifications

Adding Repositories

After connecting Bitbucket:

  1. Go to ProjectsNew Project in Pensar Console
  2. Your Bitbucket repositories will appear in the repository list
  3. Select a repository and configure your project settings
  4. Click Create Project to start scanning

Managing the Integration

Viewing Connection Status

  1. Navigate to SettingsIntegrations
  2. Expand the Bitbucket section
  3. If connected, you’ll see a confirmation with your workspace name

Disconnecting Bitbucket

To remove the Bitbucket integration:

  1. Navigate to SettingsIntegrations
  2. Expand the Bitbucket section
  3. Click Disconnect Bitbucket

Disconnecting Bitbucket will prevent Pensar from scanning Bitbucket repositories. Any projects using Bitbucket repositories will no longer be able to perform scans.

Troubleshooting

Authorization Failed

If the OAuth authorization fails:

  1. Ensure you have admin access to the Bitbucket workspace
  2. Try clearing your browser cache and cookies
  3. Attempt the connection again from SettingsIntegrations

Repositories Not Appearing

If your repositories don’t appear in the project creation list:

  1. Verify you have at least read access to the repositories in Bitbucket
  2. Check that the correct workspace is connected
  3. Try refreshing the page

Webhook Issues

If you’re not receiving real-time updates:

  1. Navigate to your Bitbucket workspace settings
  2. Go to Webhooks
  3. Verify a Pensar webhook exists and is active
  4. If the webhook is missing, disconnect and reconnect the integration

Need Help?

If you encounter issues setting up your Bitbucket integration, please contact our support team at team@pensarai.com.