---
updatedAt: 2025-08-06T16:56:31.000Z
agentTools:
  projectIndex: https://docs.brightsec.com/llms.txt
---

# TeamCity

<HTMLBlock>{`
<table id="integrations" >
   <style>
 #integrations {
    border-collapse: separate;
    width: 100%;
    display: block;
    display: table;
  }
 #integrations td,
  th {
    border: 0px solid #ddd;
    padding-left: 0px;
    background-color: #FFFFFF;
  }
  </style>
  <body>
  <tr>
    <td width="70%">
    </td>
    <td width="30%" style="text-align:center" rowspan="3">
      <img src="https://files.readme.io/264ccf1-team-city.png" width="170" height="200"></img>
    </td>
  </tr>
  <tr>
    <td style="text-align:left;vertical-align:text-top;padding:0px">
    You can configure your TeamCity CI/CD pipeline to automatically run a Bright scan with every new build. Once a build is made to the pipeline, Bright initiates security tests and provides all the information that developers need to fix the detected vulnerabilities, without having to leave their development environment.
    </td>
  </tr>
<tr>
    <td style="text-align:left;vertical-align:text-top;padding:0px">
    Although it is possible to configure a CI/CD pipeline with the <a href=/docs/about-bright-api>Bright REST API</a>, it is recommended to use the <a href=/docs/about-bright-cli>Bright CLI</a> for an easier, more robust configuration of your pipeline.
    </td>
  </tr>
</table>
</body>
`}</HTMLBlock>

## Prerequisites

* You have a valid [User Key](https://docs.brightsec.com/docs/manage-your-personal-account#managing-your-personal-api-keys-authentication-tokens), [Project Key](https://docs.brightsec.com/docs/manage-projects#managing-your-project-api-keys-authentication-tokens) or [Organization Key](https://docs.brightsec.com/docs/manage-your-organization#manage-organization-apicli-authentication-tokens) with the following scopes:
  * `bot`
  * `scans:read`
  * `scans:run`
  * `scans:stop`
* Register the Repeater in the [Bright app](https://app.brightsec.com/) and copy the generated `REPEATER_ID`. See [Managing Repeaters](https://docs.brightsec.com/docs/manage-repeaters) for more information.
* Install and configure the TeamCity CI/CD server and agent.

> 📘 Note
>
> The Linux Docker deployment of TeamCity is currently not supported — <https://youtrack.jetbrains.com/issue/TW-74746>.

## Step-by-step guide

1. Open the TeamCity **Administration** panel.
2. From the left menu, select **Projects**, and then click **+ Create project**.

<Image align="center" width="80%" src="https://files.readme.io/72f6744-create-project.png" />

3. In the **Name** field, enter a name for your project (for example, "Bright Scan"), and then click **Create**.

<Image align="center" width="80%" src="https://files.readme.io/fe05882-create-bright-project.png" />

4. In the upper-right corner of the created project page, click **Project Home**.

<Image align="center" width="80%" src="https://files.readme.io/f2ce630-project-home.png" />

5. Click **Create Build Configuration**, and then select **Manually**.
6. In the **Name** field, enter a name for your build configuration (for example, BrightBuild), and then click **Create**.

<Image align="center" width="80%" src="https://files.readme.io/a7e7b3a-create-build.png" />

7. The **New VCS Root** form opens. Click **Skip** to proceed to the next step.

<Image align="center" width="80%" src="https://files.readme.io/a1be02b-skip.png" />

8. From the left menu, select **Parameters**, and then click **+ Add new parameter**.
9. Create the `endBrightToken` (API key) environment variable:
   1. In the **Name** field, enter `endBrightToken`.
   2. In the **Value** filed, enter the value of the token (API key) you have created in the Bright app (see [Prerequisites](#prerequisites)).
   3. Click **Save**.

<Image align="center" width="80%" src="https://files.readme.io/a3acaf9-7.png" />

10. Create the `REPEATER_ID` environment variable:
    1. In the **Name** field, enter `REPEATER_ID`.
    2. In the **Value** filed, enter the ID of the Repeater you have created in the Bright app (see [Prerequisites](#prerequisites)).
    3. Click **Save**.
11. From the left menu, select **Build Steps**.
12. On the **New Build Step** page, do the following:
    1. Set **Runner Type** to `Node.js`.
    2. Set **Run step within Docker container** to `node: 14.17.1`.
    3. Set **Shell script** to the following:

```curl
npm install @brightsec/cli
cd node_modules/.bin
./bright-cli --version
echo "Starting Repeater"
./bright-cli repeater --id %env.REPEATER_ID% --token %env.BrightToken% &
sleep 10
echo "Starting Brightsec Scan"
SCAN_ID=$(./bright-cli scan:run --token %env.BrightToken% --repeater %env.REPEATER_ID% --name "new scan" --crawler Broken Crystals  --smart)
echo "Scan was started with ID Brightsec 
sleep 10
echo "Waiting for issues..."
./bright-cli scan:polling --interval 30s --timeout 30m --breakpoint any --token %env.BrightToken% $SCAN_ID
```

<Image align="center" width="80%" src="https://files.readme.io/c35d63c-8.png" />

13. Click **Save**.
14. On the top right, click **Run** to run the build.

<Image align="center" width="80%" src="https://files.readme.io/ddf62f5-run-build.png" />

15. To check that your build has started, click **Agents**, and then click **Running**.

<Image align="center" width="80%" src="https://files.readme.io/8368b49-running.png" />

16. To check the build logs, open the **Build Log** tab.\
    You can see that the Repeater and scan have started, the polling state is also active. You can also monitor the scan progress in the Bright app.

<Image align="center" width="80%" src="https://files.readme.io/bde1c3a-11.png" />