A simple demonstration on how to set up boundary on dev mode and also using terraform.
Prerequisites
- Docker is installed
- A route to download the Postgres Docker image image or a local image cached
- A Boundary binary in your PATH - Head to the official page to install boundary
boundary dev -login-name="dev-admin" -password="p@ssw0rd"
boundary authenticate password -auth-method-id ampw_1234567890 -login-name dev-admin -password "p@ssw0rd" -keyring-type=none
http://localhost:9200/
wget https://golang.org/dl/go1.16.3.linux-amd64.tar.gz
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.16.3.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
go version
tfenv install 0.13.0
tfenv use 0.13.0
You can check tfenv installation instructions here
BOUNDARY_BIN_DIR=~/projects/boundary/bin; curl https://releases.hashicorp.com/boundary/0.2.0/boundary_0.2.0_linux_amd64.zip --create-dirs -o $BOUNDARY_BIN_DIR/boundary && unzip -o $BOUNDARY_BIN_DIR/boundary -d $BOUNDARY_BIN_DIR
or download directly here extract and move to the ~/projects/boundary/bin
directory.
note: this boundary binary will be sent to every controller/worker, we are extracting on ~/projects/boundary/bin because of this
git clone [email protected]:hashicorp/boundary-reference-architecture.git
cd boundary-reference-architecture/deployment/aws
terraform apply -target module.aws
ssh ubuntu@<controller-ip>
sudo systemctl status boundary-controller
ssh ubuntu@<worker-ip>
sudo systemctl status boundary-worker
terraform apply
Check the terraform output and copy the auth-method-id that was created. We are going to use it to authenticate to the boundary
BOUNDARY_ADDR='http://<YOUR-ELB-DNS-NAME>:9200' \
boundary authenticate password \
-login-name=jim \
-password foofoofoo \
-auth-method-id=ampw_SiNvfLXbjg \
-keyring-type=none
replace the -auth-method-id
for the one you copied from the terraform output.
copy the token that is going to be generated and store it somewhere safe, we are going to need it to connect to our targets later
http://<YOUR-ELB-DNS-NAME>:9200/
Considering we want to allow a person to connect via ssh to this host running postgres to perform some kind of report generation
BOUNDARY_ADDR='http://<YOUR-ELB-DNS-NAME>:9200' \
boundary connect ssh --username ubuntu -target-id <target-id> -token <token-from-previous-steps>
just use --
at the end, like shown below:
BOUNDARY_ADDR='<YOUR-ELB-DNS-NAME>:9200' \
boundary connect ssh --username ubuntu -target-id <target-id> -token <token-from-previous-steps> -- -i ~/.ssh/my-private-key