DEV Community

yutianle
yutianle

Posted on

TeamCity Access Tokens Inherit Authority Unless the Scope Says Otherwise

TeamCity Access Tokens Inherit Authority Unless the Scope Says Otherwise

TeamCity is a CI/CD server that coordinates builds, artifacts, agents and deployment credentials. A ZoomEye count-only query on November 18, 2026 found 3,373 matches for title="TeamCity" and 69 for app="TeamCity". The gap is a useful reminder that one product can have multiple observable names, and that no single field is a complete inventory.

The query used page 1, page size 1 and sub_type=all. It recorded only total counts. Some title matches may be documentation, trial pages or custom portals. The app count is much smaller and may depend on a specific response signature. These numbers are observations about indexed services, not confirmed production deployments.

TeamCity access tokens are designed to grant the same permissions as the issuing user or fewer permissions when a project scope is applied. The token reference says the value is displayed only once at creation. The token-management documentation describes project and subproject restrictions and warns that some global permissions cannot be assigned to a confined token. A token created without a deliberate scope can therefore inherit authority that reaches beyond the build that needed it.

Inventory tokens by creator and automation. For each token, record the project scope, read-only or full-access preset, expiration and the job or human owner. Check whether a project administrator can create tokens for another user's project and whether that is intentional. Review old tokens after role changes, because a token can remain usable after the person moves to a different team.

Test the boundary with a token restricted to project A. Attempt to list projects, read build logs, change build configuration and access artifacts in project B. TeamCity may deny some operations while allowing a broader project list for navigation, so record each response rather than assuming one denial covers all resources. Test the REST API and any token-authenticated build feature paths used by the organization.

Build agents introduce another dependency. A compromised agent or an overly broad token can request builds that reach deployment credentials. Separate agent pools and runtime users by trust level, and avoid placing global secrets on low-trust agents. Review VCS roots and build features that can create tokens or access external systems. The CI server's permissions are meaningful only when the build execution environment is also controlled.

Patch and identity settings matter as well. Confirm that token-based authentication is intentionally enabled, that local accounts are limited and that a single sign-on provider is not accepting broad directory groups without a mapping review. Disable guest access unless it is explicitly required and tested. A login page is not evidence that every project has the same authorization boundary.

Use the title and app counts together in recurring inventory. If one field changes after an upgrade, compare the exact query, timestamp and response scope before concluding that the deployment count changed. Preserve the target list behind an access-controlled process; a public report should not expose hostnames or ownership details.

The operational goal is to make each TeamCity token explainable. A token with a named owner, a project restriction, an expiry and a monitored use case is much easier to defend than a permanent credential created by an administrator for convenience. CVE searches are not required to find this class of risk, and a title count alone cannot measure it.

References

Top comments (0)