concourse/tsa
Eng Zer Jun 9085531583
refactor: move from io/ioutil to io and os packages
The io/ioutil package has been deprecated as of Go 1.16 [1]. This commit
replaces the existing io/ioutil functions with their new definitions in
io and os packages.

[1]: https://golang.org/doc/go1.16#ioutil

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-06-18 16:54:49 +08:00
..
cmd/tsa refactor: move from io/ioutil to io and os packages 2023-06-18 16:54:49 +08:00
etc/systemd move everything under ./tsa 2018-09-18 15:25:31 -04:00
scripts continue update test syntax for ginkgo v2 2023-03-11 00:11:23 -05:00
tsacmd refactor: move from io/ioutil to io and os packages 2023-06-18 16:54:49 +08:00
tsafakes update fake files generated by latest version of counterfeiter. 2021-02-23 09:23:47 +08:00
README.md #4566: removed `registering workers` from tsa readme.md 2019-12-06 11:46:13 +02:00
client.go Revert "revert lager/v3 import path to lager" 2023-04-27 14:50:56 -04:00
commands.go #4566: removed register-worker from tsa constants 2019-11-26 14:38:22 +02:00
deleter.go Revert "revert lager/v3 import path to lager" 2023-04-27 14:50:56 -04:00
deleter_test.go Revert "revert lager/v3 import path to lager" 2023-04-27 14:50:56 -04:00
events.go Merging in master 2018-11-08 16:45:12 -05:00
heartbeater.go Revert "revert lager/v3 import path to lager" 2023-04-27 14:50:56 -04:00
heartbeater_test.go Revert "revert lager/v3 import path to lager" 2023-04-27 14:50:56 -04:00
keepalive.go Revert "revert lager/v3 import path to lager" 2023-04-27 14:50:56 -04:00
keepalive_test.go test: update references to use ginkgo/v2 2023-03-10 17:33:13 -05:00
lander.go Revert "revert lager/v3 import path to lager" 2023-04-27 14:50:56 -04:00
lander_test.go Revert "revert lager/v3 import path to lager" 2023-04-27 14:50:56 -04:00
random_atc_endpoint_picker.go bump lager to v3 2023-04-27 10:38:04 -04:00
retirer.go Revert "revert lager/v3 import path to lager" 2023-04-27 14:50:56 -04:00
retirer_test.go Revert "revert lager/v3 import path to lager" 2023-04-27 14:50:56 -04:00
sweeper.go refactor: move from io/ioutil to io and os packages 2023-06-18 16:54:49 +08:00
sweeper_test.go Revert "revert lager/v3 import path to lager" 2023-04-27 14:50:56 -04:00
timeout_conn.go Merging in master 2018-11-08 16:45:12 -05:00
tsa_suite_test.go test: update references to use ginkgo/v2 2023-03-10 17:33:13 -05:00
worker_status.go Revert "revert lager/v3 import path to lager" 2023-04-27 14:50:56 -04:00
worker_status_test.go Revert "revert lager/v3 import path to lager" 2023-04-27 14:50:56 -04:00

README.md

tsa

controls worker authentication within concourse

Airport Security

by stuckincustoms

reporting issues and requesting features

please report all issues and feature requests in concourse/concourse

about

TSA is the way workers securely register to join a Concourse deployment. It provides authentication and transport encryption (if required). Worker machines can ssh into TSA with a custom command to register or have traffic forwarded to them. Once an SSH session has been established then TSA begins to automatically heartbeat information about the worker into the ATC's pool.

The main advantage that this provides over the old style of registration is that Workers no longer need to be internet routable in order to have the ATC reach them. They open a reverse tunnel through the TSA which, when collocated with ATC, is far more likely to be easily routable. This also allows for simpler setup and better security as before you either had to expose your Garden server publicly or set up some interesting custom security if the workers and ATC were not in the same private network.

usage

First, create two new SSH keys:

$ ssh-keygen -t rsa -f host_key
$ ssh-keygen -t rsa -f worker_key

Next, let's create an authorized keys file so that our workers are able to authenticate with us without providing a password:

cat worker_key.pub > authorized_keys

Now to start tsa itself:

tsa \
  --peer-address $PEER_ADDRESS \
  --host-key ./host_key \
  --authorized-keys ./authorized_keys \
  --session-signing-key $SIGNING_KEY \
  --atc-url $ATC_URL

The variables here should be set to:

Variable Description
$PEER_ADDRESS The host or IP where this machine can be reached by the ATC for the purpose of forwarding traffic to remote workers.
$SIGNING_KEY RSA key used to sign the tokens used when communicating to the ATC.
$ATC_URL ATC URL reachable by the TSA (e.g. https://ci.concourse-ci.org).

forwarding workers

In order to have a worker on a remote network register with tsa and have its traffic forwarded you can run the following command:

ssh -p 2222 $TSA_HOST \
  -i worker_key \
  -o UserKnownHostsFile=host_key.pub \
  -R0.0.0.0:7777:127.0.0.1:7777 \
  -R0.0.0.0:7788:127.0.0.1:7788 \
  forward-worker \
    --garden 0.0.0.0:7777 \
    --baggageclaim 0.0.0.0:7788 \
  < worker.json

Note that in this case you should always have Garden and BaggageClaim listen on 127.0.0.1 so that they're not exposed to the outside world. For this reason there is no $GARDEN_ADDR or $BAGGAGECLAIM_URL.

The worker.json file should contain the following:

{
    "platform": "linux",
    "tags": []
}