Skip to main content

Prerequisites

You need to be an administrator of the Azure DevOps organization you want to connect to Hacktron. This is required to create a Personal Access Token with the scopes Hacktron uses to read code, post pull request statuses, and register the service hooks that trigger reviews.

Configure access

1

Open Personal Access Tokens

In Azure DevOps, open User settings (the icon next to your avatar in the top right) and select Personal access tokens.Azure DevOps Personal Access Tokens
2

Create a new token

Click New Token. Give it a descriptive name, e.g. “Hacktron”, and select the organization you want to connect.Create Azure DevOps Token
Personal access tokens have expiration dates. Set the expiration to cover the duration of your intended use of Hacktron to avoid service interruption.
3

Grant the required scopes

Switch the scope selector to Show all scopes and grant the following:
  • Code - “Read & write” and “Status”
  • Project and Team - “Read”
  • Service Connections - “Read, query & manage”
  • Identity - “Read”
The “Read & write” Code scope lets Hacktron clone repositories and post review comments; “Status” lets it report pull request check results. The Service Connections scope lets Hacktron register the service hooks that notify it when a pull request is opened or updated, so reviews run automatically. Hacktron does not retain any source code after each review is complete.
Azure DevOps Token ScopesClick Create, then copy the generated token. Azure DevOps shows it only once.Azure DevOps Copy Token
4

Open Integrations page

In Hacktron, go to Integrations and click Connect under Azure DevOps.Azure DevOps Integration
5

Enter the token

Enter your organization URL (e.g. https://dev.azure.com/hacktronai) and the token you created earlier, and click Connect.Azure DevOps Integration Connect Step
6

Select your repository scopes

Select the repositories that you want Hacktron to have access to.Azure DevOps Integration Select Repositories
That’s it! Hacktron will now run security reviews for every pull request in the selected repositories.

Azure DevOps Server

Hacktron supports self-hosted Azure DevOps Server through the same Personal Access Token flow described above. The only difference is one extra step when you connect. Follow the same Configure access steps to create a Personal Access Token with the same scopes on your Azure DevOps Server instance. When you open the Connect Azure DevOps modal in Hacktron, select Azure DevOps Server and enter your instance’s base URL and organization (e.g. https://azuredevops.example.com/DefaultCollection) as well.
Self-hosted prerequisites: - Your Azure DevOps Server instance must be reachable from Hacktron over HTTPS with a valid TLS certificate. - The token must carry the same scopes listed above on your Azure DevOps Server instance.