Skip to content

Security tightening of API endpoints - #9680

Merged
taylorsilva merged 4 commits into
masterfrom
heartbeat-restrict
Aug 7, 2026
Merged

taylorsilva merged 4 commits into
masterfrom
heartbeat-restrict

Conversation

@taylorsilva

Copy link
Copy Markdown
Member

Changes proposed by this PR

We lock down a few endpoints here for security.

First, we restrict the RegisterWorker, HeartbeatWorker, and DeleteWorker endpoints to system only access. This basically means you can only access these endpoints via TSA, which is always authenticated with a private key.

We moved ListTeamBuilds to be wrapped by the CheckAuthorizationHandler, which will check that the user has permissions to list the builds for the given team, not just that the user is authenticated. Previously a user could hit this endpoint to see the build metadata for any team. This only exposes start/end time and status of the build. Example of the data exposed:

{"id":420,"team_name":"testflight","name":"18","status":"succeeded","api_url":"/api/v1/builds/420","start_time":1786037156,"end_time":1786037157}

Lastly, we restrict the ListWorkers endpoint so you can only access it if you're part of one or more teams. Not a member of any team? Can't see workers then.

@taylorsilva taylorsilva added this to the v8.3.0 milestone Aug 6, 2026
@taylorsilva taylorsilva added the bug label Aug 6, 2026
We lock down a few endpoints here for security.

First, we restrict the RegisterWorker, HeartbeatWorker, and DeleteWorker
endpoints to system only access. This basically means you can only
access these endpoints via TSA, which is always authenticated with a
private key. Before this, it was previously possible for any
authenticated user to hit the HeartbeatWorker endpoint and inject false
information about the state of the worker into concourse. This could
be used to create a DOS attack where pipelines aren't able to run.

We moved ListTeamBuilds to be wrapped by the CheckAuthorizationHandler,
which will check that the user has permissions to list the builds for
the given team, not just that the user is authenticated. Previously a
user could hit this endpoint to see the build metadata for any team.
This only exposes start/end time and status of the build. Example of the
data exposed:

```json
{"id":420,"team_name":"testflight","name":"18","status":"succeeded","api_url":"/api/v1/builds/420","start_time":1786037156,"end_time":1786037157}
```

Lastly, we restrict the ListWorkers endpoint so you can only access it
if you're part of one or more teams. Not a member of any team? No access
then.

Signed-off-by: Taylor Silva <[email protected]>
create self-signed certs on each test suite run instead so we don't have
to deal with expiring certs ever again.

Signed-off-by: Taylor Silva <[email protected]>
- atc-cert.crt was unused
- Remaining hard coded certs were for "unknown CA" test cases. One was
  expired, the other was set to expire in 2038. Didn't really matter for
  these cases but I'd prefer to be consistent in how we make certs in
  our tests. This feels more robust long-term as well

Signed-off-by: Taylor Silva <[email protected]>
@taylorsilva
taylorsilva merged commit 06766c9 into master Aug 7, 2026
11 checks passed
@taylorsilva
taylorsilva deleted the heartbeat-restrict branch August 7, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant