Repository navigation
Security tightening of API endpoints - #9680
Merged
Merged
Conversation
taylorsilva
force-pushed
the
heartbeat-restrict
branch
from
August 7, 2026 02:27
a070fa5 to
5d472c5
Compare
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]>
taylorsilva
force-pushed
the
heartbeat-restrict
branch
from
August 7, 2026 02:45
5d472c5 to
dcf8aad
Compare
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]>
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.