Boundary
Boundary Interactive Sandboxes
Experiment with HashiCorp products in a safe, pre-configured environment.
HashiCorp Sandboxes provide interactive environments where you can experiment with HashiCorp products without any installation or setup. They're perfect for:
- Learning how products work in a real environment
- Testing configurations and commands without affecting your systems
- Exploring product features in a safe sandbox
- Following along with tutorials and documentation
Each sandbox comes pre-configured with everything you need to start using the product immediately. Just click on a sandbox below to launch it in your browser.
Available Boundary sandboxes
When you launch a sandbox, you'll be presented with a terminal interface where you can interact with the pre-configured environment. The sandbox runs in your browser and doesn't require any downloads or installations.
Each sandbox session lasts for up to 1 hour, giving you plenty of time to experiment. Your work isn't saved between sessions, so be sure to copy any important configurations before your session ends.
- HCP Boundary SandboxExperiment with HCP Boundary. This sandbox contains a workstation with the Boundary Desktop Client, two Boundary workers, a HashiCorp Vault server, an Ubuntu SSH target, a PostgreSQL database target, and a Windows Server Active Directory domain controller target.
- Boundary Enterprise SandboxExperiment with Boundary Enterprise. This sandbox contains a Boundary Enterprise cluster (one controller server and two workers) configured with a Boundary target (Ubuntu 24.04), a Postgres database, and Vault.
- Boundary Community Edition SandboxExperiment with Boundary. This sandbox contains a Boundary Community Edition cluster (one controller server and one worker) configured with a Boundary target (Ubuntu 24.04) and a Postgres database.
Sandbox documentation
Warning
This environment is not production-ready and does not follow our recommendations for production-ready cluster deployments. Please refer to the How HCP Boundary works documentation and the Deploy Boundary on HashiCorp Cloud Platform (HCP) pages for more information.This is a development and testing environment. It provides the learner an opportunity to interact with an HCP Boundary cluster by setting up Boundary workers and targets you can interact with. This environment can serve as a companion to the documentation, or a place to experiment with the product.
This sandbox creates resources within an HCP Boundary environment you provide credentials for. While the sandbox attempts to clean up any resources it creates upon termination, we cannot guarantee resources will not remain after the sandbox is terminated. Continue reading for more recommendations about using the sandbox environment.
This sandbox contains two Boundary workers, a HashiCorp Vault server, and SSH, RDP, and PostgreSQL targets for testing.
You must bring your own HCP Boundary cluster to this sandbox. It will not function until you configure it with access to your HCP Boundary cluster. If you do not want to provide access to your HCP Boundary cluster to the sandbox, consider using the Boundary Enterprise Sandbox instead.
Note
You must provide the following to use the HCP boundary Sandbox:
- HCP Boundary cluster ID (from your HCP Boundary URI)
- HCP Boundary admin username (or other admin-level username)
- HCP Boundary admin password
To use this sandbox without risk, we strongly recommend using a dev or test HCP org with HCP Boundary deployed. If you do not want to configure a separate HCP org, the sandbox will create a separate testing org within the HCP Boundary cluster you provide.
The admin-level user your provide is used by the sandbox to deploy resources using the Boundary Terraform provider. The auth_method_login_name authentication method is needed to configure HCP Boundary using the Terraform provider, which is why admin-level credentials are required.
The sandbox contains an SSH server and database target running on an Ubuntu 24.04 server using the openssh-server and postgresql-server packages. The following Boundary users are preconfigured for SSH access on the ubuntu-host host:
Priya:
- username:
priya - password:
priya_password
- username:
Oliver:
- username:
oliver - password:
oliver_password
- username:
Khalid:
- username:
khalid - password:
khalid_password
- username:
A Windows Server target is configured to allow for password access for the following user:
- windows-dc server:
- username:
DomainUser - password:
DomainP@ssw0rd!!!
- username:
The Windows server is configured as an Active Directory domain controller to demo credential injection from Boundary using Vault's LDAP secrets engine.
A PostgreSQL database is also configured on the ubuntu-host host and is available on port 5432:
- Postgres Database:
- name:
northwind - username:
postgres - password:
postgres
- name:
Sandbox setup
Launch the HCP Boundary Sandbox. It will take a few minutes to deploy.
The shell in the Workstation CLI tab has the Boundary, Vault, and Terraform CLI tools installed.
You should export the following environment variables:
$ export BOUNDARY_ADDR="http://your_hcp_boundary_cluster_address" \
export BOUNDARY_ADMIN_USERNAME=your_hcp_boundary_admin_username \
export BOUNDARY_ADMIN_PASSWORD=your_hcp_boundary_admin_password
After setting the environment variables, you can log into Boundary from the CLI using your HCP Boundary credentials:
$ boundary authenticate
Please enter the login name (it will be hidden):
Please enter the password (it will be hidden):
Authentication information:
Account ID: acctpw_sC5a4GP9JA
Auth Method ID: ampw_CzkwJb5RRR
Expiration Time: Thu, 03 Apr 2025 01:36:55 UTC
User ID: u_UURrzGLCik
The token name "default" was successfully stored in the chosen keyring and is not displayed here.
After authenticating, you can manually experiment with the workers or targets, or configure your HCP Boundary environment using the automated Terraform scripts.
Start by configuring the Boundary workers from the Workstation CLI tab:
$ ./setup-workers/start-workers.sh && ./setup-workers/register-workers.sh
The start-workers script will configure the ingress Boundary worker with your HCP Boundary cluster address, and then start the ingress and egress workers. The register-workers script uses the worker tokens to register the workers with your HCP Boundary cluster.
After the scripts complete, you can verify the workers are registered to your HCP Boundary cluster using the CLI or Boundary Admin UI.
After configuring the workers, set up the credentials, hosts, and targets in your HCP Boundary cluster using Terraform:
$ cd ~/terraform/ && ./configure-boundary.sh
Terraform will configure all the resources within your HCP Boundary cluster.
This sandbox times out after 90 minutes. It will attempt to clean up the resources it creates with Terraform once it terminates. If you want to clean up the resources yourself, refer the Sandbox cleanup section below.
CLI access
The shell in the Workstation Shell tab has the Boundary, Vault, and Terraform CLI tools installed.
There are two ways you can log in to Boundary for these exercises:
- HCP Boundary admin user
- sandbox-user (configured by Terraform)
HCP Boundary requires you to create an admin user account when you first launch the cluster. You can use this user to get admin-level access from the CLI or the Boundary Desktop Client.
You can log into Boundary from the CLI using your HCP Boundary admin credentials:
$ boundary authenticate
If you used Terraform to configure the demo resources for the sandbox, two users will be pre-configured for you in the sandbox org:
- sandbox-user
- Username: sandbox-user
- Password: sandbox-user
- unprivileged
- Username: unprivileged
- Password: sandbox-user
You can log in with these users to learn more about how access in managed.
Access the Boundary Admin UI
After configuring your HCP Boundary cluster from the sandbox using Terraform, you can log into your HCP Boundary Admin UI using the following user credentials:
- Username:
sandbox-user - Password:
sandbox-user
Or log in as the unprivileged user:
- Username:
unprivileged - Password:
sandbox-user
UI access
You can using the Boundary Desktop Client to access your targets from either:
- The Workstation Desktop tab within the sandbox environment
- Your local machine where the Boundary Desktop Client is installed
You can interact with your HCP Boundary cluster from the Workstation Desktop tab. This is an Apache Guacamole virtualized desktop for the workstation VM.
Note
Apache Guacamole is known for copy-paste limitations into the browser-based virtualization environment. Refer to the Apache Guacamole docs to learn more about how to copy-paste values like your HCP Boundary cluster address into to VM using the clipboard.
Instead of using the virtual desktop, you can use the Boundary Desktop Client on your local machine. This workflow assumes your HCP Boundary user credentials have the privileges needed to display targets within the sandbox org created by Terraform. You will have access to the sandbox targets if you log into the client using the sandbox-user created by Terraform.
Connect to targets
The following resources are configured by Terraform:
- Orgs:
sandbox org [timestamp]
- Projects:
sandbox project
- Host Catalogs:
ubuntu-host-catalogwindows-host-catalog
- Credential Stores:
ubuntu-host-credswindows-host-creds
- Targets:
ubuntu-target-tcpssh-recording-target-priyawindows-dcnorthwind-db
- Aliases:
priyasandbox.windowssandbox.northwindsandbox.ubuntu-target
You can access these targets from the Boundary workstation by configuring the CLI, using the Boundary Desktop Client from the Workstation Desktop tab, or using the Boundary Desktop Client on your local machine.
To connect to the northwind database on the ubuntu-host host:
$ boundary connect postgres northwind
Credentials are being brokered but no -dbname parameter provided. psql may misinterpret another parameter as the database name.
psql (16.8 (Ubuntu 16.8-0ubuntu0.24.04.1))
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off)
Type "help" for help.
postgres=#
When you connect to the ubuntu-target target it will display the available
brokered credentials for the oliver and priya users, and automatically
select one of them to log you in as. Copy and paste or type the user's password
to connect:
$ boundary connect ssh ubuntu-target
Credentials:
Credential Source Description: Credentials for oliver user on ubuntu-host host
Credential Source ID: credup_XuqoTfBGrj
Credential Source Name: oliver-creds
Credential Store ID: csst_iHuwhwzstA
Credential Store Type: static
Credential Type: username_password
Secret:
password: oliver_password
username: oliver
Credential Source Description: Credentials for priya user on ubuntu-host host
Credential Source ID: credup_po69wMQRNN
Credential Source Name: priya-creds
Credential Store ID: csst_iHuwhwzstA
Credential Store Type: static
Credential Type: username_password
Secret:
password: priya_password
username: priya
The authenticity of host 'hst_hi2n8ghvx8 ([127.0.0.1]:45223)' can't be established.
ED25519 key fingerprint is SHA256:kCPyzCG/O2ckQ5zvoxT1O9NTgNz+KNnTf+fDildd0QI.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'hst_hi2n8ghvx8' (ED25519) to the list of known hosts.
oliver@hst_hi2n8ghvx8's password:
oliver@ubuntu-host$
You can also select a user to authenticate as by passing additional login
parameters to boundary connect ssh:
$ boundary connect ssh ubuntu-target -username priya
Credentials:
Credential Source Description: Credentials for oliver user on ubuntu-host host
Credential Source ID: credup_XuqoTfBGrj
Credential Source Name: oliver-creds
Credential Store ID: csst_iHuwhwzstA
Credential Store Type: static
Credential Type: username_password
Secret:
password: oliver_password
username: oliver
Credential Source Description: Credentials for priya user on ubuntu-host host
Credential Source ID: credup_po69wMQRNN
Credential Source Name: priya-creds
Credential Store ID: csst_iHuwhwzstA
Credential Store Type: static
Credential Type: username_password
Secret:
password: priya_password
username: priya
priya@hst_hi2n8ghvx8's password:
priya@ubuntu-host$
To connect to the sandbox.windows target using RDP, open the Workstation Desktop tab and launch the Boundary Desktop Client.
Sandbox cleanup
The sandbox will automatically attempt to clean up your HCP Boundary sandbox resources if you stop the sandbox or the environment times out after 90 minutes. This includes any session recordings you created, assuming the workers are still registered with your HCP Boundary cluster.
To manually clean up the sandbox resources created with Terraform:
$ cd ~/terraform/ && ./terraform-destroy.sh
Vault integration
If you configure HCP Boundary with Terraform, the HashiCorp Vault server in the sandbox will be configured to act as a credential broker for Boundary. You can access the Vault server from the Boundary workstation, where the VAULT_ADDR=https://vault-server:8200 environment variable is set.
You can access Vault from the workstation terminal using the root token in the /home/learner/vault directory, which is also available as an env var in /home/learner/.bashrc
$ source .bashrc
$ vault login $VAULT_ROOT_TOKEN
To learn more about setting up a Vault credential library, check out the Vault credential brokering quickstart tutorial.
Credential injection from Vault is enabled for the ssh-recording-target-priya target:
$ boundary connect ssh -host-id hcst_CjTPFUqeM3 -target-name ssh-recording-target-priya -target-scope-name "sandbox project"
priya@ubuntu-host$
The credential is attached to the ssh-recording-target-priya, which allows it
to be injected directly into the session. Injected credentials are listed under
Injected Application Credential Sources when reading target details. Unlike credential
brokering, injected credentials are never passed into the client's session.
$ boundary targets read -id tssh_Q4Q9fYzTgT
Target information:
Address: ubuntu-host
Created Time: Wed, 10 Sep 2025 18:05:37 UTC
Description: SSH target
Egress Worker Filter: "egress" in "/tags/type"
ID: tssh_Q4Q9fYzTgT
Name: ssh-recording-target-priya
Session Connection Limit: -1
Session Max Seconds: 28800
Type: ssh
Updated Time: Wed, 10 Sep 2025 18:05:39 UTC
Version: 2
Scope:
ID: p_9T9Ir8dN4I
Name: sandbox project
Parent Scope ID: o_5znI0AIrjc
Type: project
Authorized Actions:
add-credential-sources
no-op
add-host-sources
set-host-sources
set-credential-sources
read
remove-host-sources
remove-credential-sources
update
delete
authorize-session
Aliases:
ID: alt_L0gxwZoZ80
Value: priya
Injected Application Credential Sources:
Credential Store ID: csst_l7eFlcnqbI
ID: credup_tEnpnN5uvl
Attributes:
Default Port: 22
Enable Session Recording: true
Storage Bucket ID: sb_k3cw9Va7Ch
Credential injection from Vault is also enabled for the sandbox.windows target. It is easiest to connect to this target using the Boundary Desktop Client and then access the target using an RDP client.
The credential is attached to the windows-ad target, which allows it
to be injected directly into the session. Injected credentials are listed under
Injected Application Credential Sources when reading target details. Unlike credential brokering, injected credentials are never passed into the client's session.
$ boundary targets read -id trdp_phNY9nVMe4
Target information:
Created Time: Mon, 04 May 2026 22:59:25 UTC
Description: Windows AD RDP target
Egress Worker Filter: "egress" in "/tags/type"
ID: trdp_phNY9nVMe4
Ingress Worker Filter: "ingress" in "/tags/type"
Name: windows-ad
Session Connection Limit: -1
Session Max Seconds: 28800
Type: rdp
Updated Time: Mon, 04 May 2026 22:59:26 UTC
Version: 3
Scope:
ID: p_GpARm40b1A
Name: sandbox project
Parent Scope ID: o_aADb9Xay6t
Type: project
Authorized Actions:
remove-host-sources
no-op
update
add-credential-sources
authorize-session
add-host-sources
set-host-sources
remove-credential-sources
read
set-credential-sources
delete
Aliases:
ID: alt_SsJbeSu7rg
Value: sandbox.windows
Host Sources:
Host Catalog ID: hcst_NJITVXpkpY
ID: hsst_UGmntudNrL
Injected Application Credential Sources:
Credential Store ID: csvlt_QLgahocuZf
ID: clvlt_rD1h6KkPGm
Attributes:
Default Port: 3389
Target Aliases
You can use target aliases in the global scope to refer to resources.
Target aliases simplify the process of connecting to a target, and can
specify which host to use when requesting a session. Target aliases also
make it simple to connect to a host:
$ boundary connect ssh priya
priya@ubuntu-host$
The alias for the RDP target is sandbox.windows, and is listed next to the target in the Boundary Desktop Client.
Troubleshooting and experimenting
You can access the targets and databases directly without using Boundary. For example, you can SSH into the ubuntu-host as the Oliver user:
$ ssh oliver@ubuntu-host
oliver@hst_hi2n8ghvx8's password:
oliver@boundary-host$
Or you can access the northwind database on the ubuntu-host with psql:
$ psql -h ubuntu-host -d northwind -p 5432 -U postgres
psql (16.8 (Ubuntu 16.8-0ubuntu0.24.04.1))
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off)
Type "help" for help.
postgres=#
This bypasses Boundary, allowing you to experiment with the target configuration directly. Note that you do not have root access to the target or other servers. You can execute systemctl and journalctl on the controller and worker servers to restart the Boundary service if you make a configuration change, and view logs.
This sandbox contains:
- An ingress Boundary worker server with Boundary installed. The worker needs to be needs to be configured with the HCP Boundary cluster address, started, and registered to HCP Boundary.
- An egress Boundary worker server with Boundary installed. The worker has an upstream connection to the ingress worker, and needs to be started before it is registered to HCP Boundary.
- A target Ubuntu 24.04 server with the openssh-server and postgresql-server packages installed. SSH is configured to allow for password access for three demo users.
- A target Windows server with the openssh-server with Active Directory set up. RDP is configured to allow for password access for a single demo user, and LDAP users.
- An optional Vault server to integrate with Boundary.
- A workstation server running Ubuntu 24.04 with the Boundary, Vault, Terraform and PostgreSQL client CLI tools installed.
┌───────────────┐ ┌─────────────────┐ ┌──────────────┐
│ │ │ │ │ │
│ Targets ◄───────┤ Egress Worker ├──────► Vault Server │
│ SSH, Postgres,│ │ │ │ │
│ Windows │ │ │ │ │
└───────────────┘ └──────┬──▲───────┘ └──────────────┘
│ │
│ │
┌─────────────┘ └────────────────┐
▼ │
┌── Boundary Control Plane ──┐ │
│ │ ┌────────┴───────┐
│ HCP Boundary │ │ │
│ Control Plane ◄─────────┤ Ingress Worker │
│ │ │ │
└─────────────▲──────────────┘ └────────▲───────┘
│ │
│ │
│ ┌──────────────────────┐ │
└───► Boundary Workstation ◄──────┘
└──────────────────────┘
This environment is not a production-ready.
To learn more about Boundary's architecture, refer to the Recommended architecture section of the Boundary documentation.
This environment is not production-ready, as it does not follow recommendations for production cluster deployments. Refer to these resources for more information:
- Install Boundary
- Boundary reference architecture
- Boundary Enterprise deployment guide
- Vault with integrated storage reference architecture
- Vault with integrated storage deployment guide
- Harden Vault server deployments
HCP Boundary edition
The HCP Boundary Sandbox uses the Boundary Enterprise CLI and Vault Community editions. This means you cannot use Vault Enterprise features here.
TLS
TLS is not enabled for any of the components in this sandbox environment.
Platform limitations
Because of the limitations of this platform:
- All servers are located in the same network. In a real-world example, the Boundary control plane, target server, Vault cluster, and workstation would be on separate, isolated networks. The egress Boundary worker is then placed on the same network as the targets it provides access to, such as the SSH, database, or Vault servers in this lab.
- All servers can be accessed directly by SSH using their hostnames, bypassing Boundary.
- The workstation and other servers do not allow root-level access.
You can try the following exercises to explore the HCP Boundary Sandbox, and to learn about features and workflows.
These exercises are also available in the sandbox's /home/learner/get-started/exercises/ directory.
Select an exercise tab to view each exercise.
Setup the sandbox
If you haven't configured the sandbox workers and run Terraform yet, follow the steps below to get set up.
Start the workers
Execute the following scripts in the setup-workers directory:
$ source ./setup-workers/start-workers.sh && source .setup-workers/register-workers.sh
Note: use the command above to execute the scripts. The source command will retain the environment variables in your current session.
The script will prompt you to enter the following environment variables:
- BOUNDARY_ADDR
- BOUNDARY_ADMIN_USERNAME
- BOUNDARY_ADMIN_PASSWORD
NOTE: This sandbox is designed to manage resources in your HCP Boundary account. You must provide a username with admin-level access to HCP Boundary so Terraform can manage scopes to create the resources for the sandbox. For using the sandbox, we recommend providing credentials for an HCP Boundary cluster within a dev or test HCP org.
Warning
Do not connect the HCP Sandbox to a production HCP Boundary cluster.
Set up Boundary
After the workers are started and registered to HCP Boundary, you can set up the Boundary hosts, targets, credentials, and other resources using Terraform:
$ cd ~/terraform/ && ./configure-boundary.sh
The script will set up all the resources in the terraform/ directory, including the demo targets and credential libraries. After setting up Boundary, you can connect to targets using the CLI or the Boundary Desktop Client in the Workstation Desktop tab.
What is a Boundary target?
Targets are a Boundary resource that represent a networked service or host that a user can connect to. Targets provide an endpoint with an associated set of permissions for establishing a session. Targets need to be associated with a host to establish a connection.
To set up some targets for this exercise, you need to connect HCP Boundary to your sandbox's Ingress worker. Some scripts are provided to automate this process for you.
For example, in the sandbox the following host exists:
ubuntu-host
The host is configured with a hostname (address) of ubuntu-host. This is the address of the host in the lab environment that Boundary will use to start a connection. Functionally, a host provides the address where Boundary should attempt to start a session.
Targets provide further connection details, such as the protocol and port the connection should use. In this sandbox, two examples of targets are ubuntu-target-tcp and northwind-db. Both these targets are for services running on the ubuntu-host vm, at address boundary-target. The database target should connect to the host on port 5432, while ubuntu-target-tcp sets port 22 as the default port to enable SSH connections. HCP Boundary also provides ssh target types you will explore later.
The following Boundary users are preconfigured for SSH access on the ubuntu-host host:
Priya:
- username:
priya - password:
priya_password
- username:
Oliver:
- username:
oliver - password:
oliver_password
- username:
Khalid:
- username:
khalid - password:
khalid_password
A postgres database is also configured on the ubuntu-host host and is available on port 5432:
- Database:
- name:
northwind - username:
postgres - password:
postgres
- name:
A Windows server target is configured to allow for password access for the following user:
- DomainUser:
- username:
DomainUser - password:
DomainP@ssw0rd!!!
- username:
Access the Boundary Admin UI
You should log into the Boundary Admin UI at the URI for your HCP Boundary controller. You can find this URI in the HCP Boundary portal.
For example, your HCP Boundary Admin UI address may resemble the following:
https://aa40f8f1-ec39-4d10-b835-xxxxxxxxxxxx.boundary.hashicorp.cloud/
After configuring HCP Boundary using Terraform, the following resources are configured in your sandbox org:
Org:
sandbox org [timestamp]Project:
sandbox projectHost Catalogs:
ubuntu-host-catalogwindows-host-catalogCredential Store:
ubuntu-host-credswindows-host-credsTargets:
ubuntu-target-tcpssh-recording-target-priyanorthwind-dbwindows-dcAliases:
priyasandbox.windowssandbox.northwindsandbox.ubuntu-target
You can access these targets from the Boundary workstation by configuring the CLI. Targets can also be accessed using the Boundary Desktop Client in the Workstation Desktop tab, or from on your local machine.
CLI Access
The shell in the Workstation tab has the Boundary, Vault, and Terraform CLI tools installed.
The following environment variables have been set:
VAULT_ADDR=https://vault-server:8200
There are two ways you can log in to Boundary for these exercises:
- HCP Boundary admin user
- sandbox-user (configured by Terraform)
HCP Boundary requires you to create an admin user account when you first launch the cluster. You can use this user to get admin-level access from the CLI or the Boundary Desktop Client.
You can log into Boundary from the CLI using your HCP Boundary admin credentials:
$ boundary authenticate
If you used Terraform to configure the demo resources for the sandbox, two users will be preconfigured for you in the sandbox org:
- sandbox-user
- Username: sandbox-user
- Password: sandbox-user
- unprivileged
- Username: unprivileged
- Password: sandbox-user
You can log in with these users to learn more about how access in managed.
The sandbox-user account has permission to manage all resources within the sandbox org. You can use it to complete any of the sandbox exercises.
To log in with the sandbox-user configured by Terraform, you will need to locate the auth-method-id. You can find it in the Terraform outputs, or by running the following command in the ~/terraform directory:
$ terraform output
Export your auth-method-id as an environment variable:
$ export BOUNDARY_AUTH_METHOD_ID=ampw_ZbB6UXpW3B
Now you can log in using boundary authenticate and the sandbox-user credentials:
- Username:
sandbox-user - Password:
sandbox-user
$ boundary authenticate
Please enter the login name (it will be hidden):
Please enter the password (it will be hidden):
Authentication information:
Account ID: acctpw_sC5a4GP9JA
Auth Method ID: ampw_CzkwJb5RRR
Expiration Time: Thu, 03 Apr 2025 01:36:55 UTC
User ID: u_UURrzGLCik
The token name "default" was successfully stored in the chosen keyring and is not displayed here.
Exercise:
Connect to a target using the CLI
After authentication, you can connect to targets using the boundary connect command.
To connect to the northwind database on the ubuntu-host host, refer to the target by the alias sandbox.northwind:
$ boundary connect postgres sandbox.northwind
Credentials are being brokered but no -dbname parameter provided. psql may misinterpret another parameter as the database name.
psql (16.8 (Ubuntu 16.8-0ubuntu0.24.04.1))
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off)
Type "help" for help.
postgres=#
When you connect to the ubuntu-target target it will display the available brokered credentials for the oliver and priya users, and automatically select one of them to log you in as. Copy and paste or type the user's password to connect:
$ boundary connect ssh ubuntu-target
Credentials:
Credential Source Description: Credentials for oliver user on ubuntu-host host
Credential Source ID: credup_XuqoTfBGrj
Credential Source Name: oliver-creds
Credential Store ID: csst_iHuwhwzstA
Credential Store Type: static
Credential Type: username_password
Secret:
password: oliver_password
username: oliver
Credential Source Description: Credentials for priya user on ubuntu-host host
Credential Source ID: credup_po69wMQRNN
Credential Source Name: priya-creds
Credential Store ID: csst_iHuwhwzstA
Credential Store Type: static
Credential Type: username_password
Secret:
password: priya_password
username: priya
The authenticity of host 'hst_hi2n8ghvx8 ([127.0.0.1]:45223)' can't be established.
ED25519 key fingerprint is SHA256:kCPyzCG/O2ckQ5zvoxT1O9NTgNz+KNnTf+fDildd0QI.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'hst_hi2n8ghvx8' (ED25519) to the list of known hosts.
oliver@hst_hi2n8ghvx8's password:
oliver@ubuntu-host$
You can also select a user to authenticate as by passing additional login parameters to boundary connect ssh:
$ boundary connect ssh ubuntu-target -username priya
Credentials:
Credential Source Description: Credentials for oliver user on ubuntu-host host
Credential Source ID: credup_XuqoTfBGrj
Credential Source Name: oliver-creds
Credential Store ID: csst_iHuwhwzstA
Credential Store Type: static
Credential Type: username_password
Secret:
password: oliver_password
username: oliver
Credential Source Description: Credentials for priya user on ubuntu-host host
Credential Source ID: credup_po69wMQRNN
Credential Source Name: priya-creds
Credential Store ID: csst_iHuwhwzstA
Credential Store Type: static
Credential Type: username_password
Secret:
password: priya_password
username: priya
priya@hst_hi2n8ghvx8's password:
priya@ubuntu-host$
Connect using the Boundary Desktop Client
Open the Workstation Desktop tab. Launch the Boundary Desktop Client on the desktop.
Copy your HCP Boundary cluster address into the Boundary Desktop Client when prompted.
On the Sign In page, click the Choose a different scope dropdown and select sandbox org.
Log in using the following user credentials:
- HCP Boundary Cluster URI
- Org:
sandbox org [timestamp] - Username:
sandbox-user - Password:
sandbox-user
This user was configured by Terraform. Its permissions are scoped to only allow access to the targets configured in the sandbox org. It does not allow access to any resources outside of the sandbox org.
You should see a list of the targets configured by Terraform.
If you do not see the targets, check that you successfully ran the terraform configure-boundary.sh script.
Click the Connect button next to a target, such as ssh-recording-target-priya.
From the sessions page, click the Shell tab. This will automatically launch the built-in terminal and attempt to open a session.
Note
To connect to the sandbox.windows target, you will need to launch the Remmina RDP client from the desktop and enter in the proxy address of 127.0.0.1:PORT_VALUE, with the port assigned by Boundary after clicking Connect.
You should find a running session on the Sessions page. Try terminating the session from here. If session recording is enabled for your test target, verify that a recording was created.
Now, log out of the Boundary Desktop Client by clicking on the admin user dropdown and clicking "Sign Out".
On the Sign In page, click the Choose a different scope dropdown and select sandbox org again.
Log back in as the unprivileged user:
- Org:
sandbox org [timestamp] - Username:
unprivileged - Password:
sandbox-user
What do you notice about this user's permissions? Do you have access to the same set of targets and hosts? How is this access configured?
You can learn more about grants and permissions in Boundary in the Permissions in Boundary docs.
Bonus: Connect from your local machine
On your local machine, you can use the Boundary Desktop Client to establish sessions.
HashiCorp recommends Windows and macOS users install the Boundary client components using the Boundary Installer:
You can also install the Boundary Desktop Client directly instead:
After installing, open the Boundary Desktop Client.
Enter your HCP Boundary URL, and authenticate using the sandbox-user.
Try connecting to any of the targets like you did before in the browser.
Introduction to credential handling
Two types of credential handling are available in HCP Boundary:
- Credential brokering
- Credential injection
Credential brokering occurs when target credentials are sent directly back to the client for use in their shell.
The ubuntu-target-tcp target is configured using credential brokering.
If you request a session using boundary connect:
$ boundary connect -target-name ubuntu-target-tcp -target-scope-name "sandbox project"
Proxy listening information:
Address: 127.0.0.1
Connection Limit: -1
Expiration: Thu, 11 Sep 2025 05:50:32 MDT
Port: 50708
Protocol: tcp
Session ID: s_V1VU9SRtpS
Credentials:
Credential Source Description: Credentials for oliver user on ubuntu-host host
Credential Source ID: credup_3GaWPZ3mEj
Credential Source Name: oliver-creds
Credential Store ID: csst_0CQp4Oo4kx
Credential Store Type: static
Credential Type: username_password
Secret:
password: oliver_password
username: oliver
Credential Source Description: Credentials for priya user on ubuntu-host host
Credential Source ID: credup_9BGBG74JRl
Credential Source Name: priya-creds
Credential Store ID: csst_0CQp4Oo4kx
Credential Store Type: static
Credential Type: username_password
Secret:
password: priya_password
username: priya
Then Boundary opens a proxy on the specified port, 50708 in this example. Notice that the proxy runs until the connection is manually closed, using ctrl+c.
If you had access to another shell session, the user would then able to connect to the target using their client of choice and the brokered credentials, such as oliver:
$ ssh 127.0.0.1 -p 38769 -l oliver
The authenticity of host '[127.0.0.1]:38769 ([127.0.0.1]:38769)' can't be established.
ED25519 key fingerprint is SHA256:fDiCeP2Ou6WZ3Eq8QdESwd6jGVBL0OHa8EbK1uMuGEw.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[127.0.0.1]:38769' (ED25519) to the list of known hosts.
oliver@127.0.0.1's password:
oliver@ubuntu-host$
You can open a terminal in the Workstation Desktop tab if you want to try this workflow.
Otherwise, terminate the session using ctrl+c.
The user must pass brokered credentials directly, unless you use one of the Boundary connect helpers. A connect helper, such as ssh or psql, attempts to request a session and open it in a single command:
$ boundary connect ssh -target-name ubuntu-target-tcp -target-scope-name "sandbox project"
Credentials:
Credential Source Description: Credentials for oliver user on ubuntu-host host
Credential Source ID: credup_LNvXHyngBa
Credential Source Name: oliver-creds
Credential Store ID: csst_gfwRVvu1S7
Credential Store Type: static
Credential Type: username_password
Secret:
password: oliver_password
username: oliver
Credential Source Description: Credentials for priya user on ubuntu-host host
Credential Source ID: credup_sD2MoO0sCd
Credential Source Name: priya-creds
Credential Store ID: csst_gfwRVvu1S7
Credential Store Type: static
Credential Type: username_password
Secret:
password: priya_password
username: priya
The authenticity of host 'hst_hdxk4jjo03 ([127.0.0.1]:42837)' can't be established.
ED25519 key fingerprint is SHA256:fDiCeP2Ou6WZ3Eq8QdESwd6jGVBL0OHa8EbK1uMuGEw.
This host key is known by the following other names/addresses:
~/.ssh/known_hosts:1: [hashed name]
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'hst_hdxk4jjo03' (ED25519) to the list of known hosts.
oliver@hst_hdxk4jjo03's password:
oliver@ubuntu-host$
In this example, Boundary understands it should use the SSH protocol to handle any credentials available for the target. It uses the first set of credentials it finds, in this case, oliver. Boundary then attempts to pass the password on your behalf and establish a connection.
Credential brokering is very different from credential injection, which is available for Enterprise or HCP deployments. Credential injection requires a target type be set when creating the target. Compare the target types for ubuntu-target-tcp and ssh-recording-target-priya:
$ boundary search -resource targets -query "name='ubuntu-target-tcp' OR name='ssh-recording-target-priya'"
Target information:
ID: tssh_8ZGy748yYB
Scope ID: p_tRDxdhqrhg
Version: 2
Type: ssh
Name: ssh-recording-target-priya
Description: SSH target
Address: ubuntu-host
Authorized Actions:
delete
add-credential-sources
no-op
add-host-sources
set-host-sources
authorize-session
update
set-credential-sources
read
remove-host-sources
remove-credential-sources
ID: ttcp_8Na7RYxIG9
Scope ID: p_tRDxdhqrhg
Version: 3
Type: tcp
Name: ubuntu-target-tcp
Description: SSH target for ubuntu-host
Authorized Actions:
remove-host-sources
delete
add-credential-sources
set-credential-sources
remove-credential-sources
authorize-session
update
no-op
read
add-host-sources
set-host-sources
Note that ubuntu-target-tcp is type tcp, while ssh-recording-target-priya is type ssh.
For credential injection to work, an ssh target must be assigned application injected credentials:
$ boundary targets read -id tssh_8ZGy748yYB
Target information:
Address: ubuntu-host
Created Time: Fri, 08 May 2026 20:06:10 UTC
Description: SSH target
Egress Worker Filter: "egress" in "/tags/type"
ID: tssh_8ZGy748yYB
Name: ssh-recording-target-priya
Session Connection Limit: -1
Session Max Seconds: 28800
Type: ssh
Updated Time: Fri, 08 May 2026 20:06:11 UTC
Version: 2
Scope:
ID: p_tRDxdhqrhg
Name: sandbox project
Parent Scope ID: o_DYvYF1M7Yw
Type: project
Authorized Actions:
no-op
read
add-credential-sources
authorize-session
add-host-sources
remove-credential-sources
update
set-credential-sources
delete
set-host-sources
remove-host-sources
Aliases:
ID: alt_iuECSqKE7i
Value: priya
Injected Application Credential Sources:
Credential Store ID: csvlt_Fti67bybdx
ID: clvlt_7zkbn4pQwz
Attributes:
Default Port: 22
Enable Session Recording: true
Storage Bucket ID: sb_alDVLn6CMS
Here the credential clvlt_7zkbn4pQwz from credential store csvlt_Fti67bybdx is attached to the target. When a session is started, the attached credential is injected directly into the session, and never passed to the end user's shell.
$ boundary connect ssh -target-name ssh-recording-target-priya -target-scope-name "sandbox project"
priya@ubuntu-host$
Although this looks similar to the credential brokering workflow when using the ssh connect helper, it's important to note the functional difference. Brokered credentials are always passed back to the client's shell, even if they are passed on behalf of the user to start a session. Injected credentials are never sent back to the user. They are used by Boundary to initiate the session, and then the client is connected. Injected credentials are never exposed to the end client.
SSH targets can have both injected and brokered credentials attached to them. This is useful when the user needs additional credentials after the initial session has been established. An example is accessing a database after connecting to the target using SSH.
Exercise:
Set up a new static credential of type username and password for the khalid user:
username: khalid
password: khalid_password
Use this credential in the next lesson to set up a new ssh target.
Boundary has built-in static credential management capabilities. If you are familiar with HashiCorp Vault, create a new credential library in the vault-ubuntu-credentials credential store for the khalid user.
Tip
If you want to experiment with Vault, you can access vault from the boundary-workstation terminal using the root token in the /home/learner/vault directory, which is also available as an env var in /home/learner/.bashrc.
$ source .bashrc
$ vault login $VAULT_ROOT_TOKEN
Success! You are now authenticated. The token information displayed below
is already stored in the token helper. You do NOT need to run "vault login"
again. Future Vault requests will automatically use this token.
Key Value
--- -----
token hvs.n69aVEhtLJM7rtocx7WRMaVa
token_accessor DXtAVFy7vv8HUHAsBdtQTF6B
token_duration ∞
token_renewable false
token_policies ["root"]
identity_policies []
policies ["root"]
Refer to the existing configuration for the priya target to see an example for setting up the credential. This configuration is defined in the Terraform files:
~/terraform/targets.md
You can also look at the Boundary usage docs to learn about setting up Vault credentials using the Admin UI or CLI:
Configure an SSH target for session recording
SSH targets in HCP Boundary and Boundary Enterprise enable the following features:
- Credential injection
- SSH session recording
Exercise
You may complete this exercise use the Admin UI, CLI, or Terraform.
Create a new ssh target called
khalid-target- Set a target type of
ssh - Set the default port to
22 - Set an egress worker filter (required for session recording):
"egress" in "/tags/type"
- Set a direct target address of
ubuntu-hostOR - Assign the
ubuntu-targets-host-setby adding a host source
- Set a target type of
Assign an injected application credential to the target
Attach a static credential in Boundary OR
Attach the Vault credential library named
ubuntu_khalidBonus: assign the target a target alias
- Aliases simplify the target connection
- Create an alias called
sandbox.khalid
Bonus: enable session recording on the target
- You must have assigned an egress worker filter when creating the target
- Workers store and process recordings before uploading them to external storage (minio)
Verify the new target by connecting to it from the workstation
boundary connect ssh -target-name khalid-target -target-scope-name "sandbox project"or, connect by target ID (such astssh_vE4VcjEMs7)boundary connect ssh -target-id tssh_vE4VcjEMs7or, use a target alias to connect to the targetboundary connect ssh sandbox.khalid
Enforce compliance standards with storage policies
Session recordings are used to enforce compliance standards for your organization. If you must comply with HIPPA or SOC standards, storage policies ensure records of sessions are retained for the required amount of time.
By default, session recordings are set with a retention policy of Forever, and cannot be deleted.
Exercise
Create a new retention policy that allows you to delete session recordings.
In the Boundary Admin UI:
Navigate to the Storage Policies page.
- Select the sandbox org org from the top navigation bar.
- Select Storage Policies from the left navigation panel.
Click Create a new storage policy.
Fill in the form details:
- Name:
do-not-retain - Description:
delete after 1 day - Retention Policy:
Do not protect, allow deletion at any time - Deletion Policy:
Custom - Delete after:
1days
Click Save.
- Name:
Add the storage policy to the org.
- From the left navigation panel, select Org Settings.
- Click Add Storage Policy.
- From the Add Storage Policy page, select the
do-not-retainpolicy.
Click Save.
Re-apply the storage policy to the session recording.
- Navigate back to the Global scope and select Session Recordings from the left navigation panel.
- Open a recording by clicking on View next to the recording. Under the Manage dropdown, select Re-apply storage policy.
Delete the session recording.
- Click the Manage dropdown again, then select Delete recording and confirm the operation by clicking OK.
Repeat this process for any remaining recordings.
Bonus exercise
Implement a storage policy that conforms to SOC 2 retention policies (7 years):
- Retention Policy: SOC 2 (7 years)
- Deletion Policy: Custom Delete after: 2657 days Toggle the switch beside Allow orgs to override.
Explore how the HCP Boundary Sandbox is configured
The /home/learner/get-started/ARCHITECTURE.md file describes the architecture of this sandbox environment.
This includes the following components:
- Boundary controller (self-hosted postgres)
- Ingress Boundary worker
- Egress Boundary worker
- Vault server
- MinIO storage backend
- Ubuntu target
Examine these components and answer the following questions:
- What are the requirements for these components?
- How must they be configured to create a functional and secure Boundary deployment?
- How do the ingress and egress workers function in a multi-hop sessions deployment, and how can this provide enhanced security for your network?
You can check the controller or worker configurations by examining /etc/boundary.d/boundary.hcl file on the those hosts.
Use the following documentation to deepen your understanding:
Bring your own targets
Configure your own targets with your HCP Boundary environment.
This exercise requires that you spin up hosts in an external environment.
Some possibilities include:
- A cloud providers, like AWS, GCP, or Microsoft Azure
- Local VMs or containers on your own machine
You must set up a Boundary worker with access to the targets you want to connect to. You need at least one worker (an egress worker to connect to the target), but if you only configure a single worker then you may have to expose the worker's public address for Boundary to connect to it.
HCP Boundary and Boundary Enterprise allow for multi-hop session worker configurations, where an ingress worker handles the initial connection from Boundary, then continues to "hop" to the next worker in the chain until it reaches the egress worker. Both the ingress an egress workers must be configured on the target, while any intermediate workers are set up as part of the worker configuration file as upstreams.
A single egress worker is recommended for a proof-of-concept. You can learn more about multi-hop sessions here:
Set up a target with Docker
As an example, you can create docker containers on your local machine.
Docker can be used to deploy an openssh-server target.
Ensure Docker is running, and then deploy an openssh container to use as a target.
$ docker run -d \ --name openssh-server \ -e USER_NAME=admin \ -e PASSWORD_ACCESS=true \ -e USER_PASSWORD=password \ -p 2222:2222 \ lscr.io/linuxserver/openssh-server:latestNote that the username for the openssh server is
admin, the password ispassword, and the target is available on your localhost at port2222(127.0.0.1:2222).Check that the container is running.
$ docker ps --format "table {{.ID}}\t{{.Names}}\t{{.Image}}\t{{.Status}}" CONTAINER ID NAMES IMAGE STATUS 6e63f8178576 openssh-server lscr.io/linuxserver/openssh-server:latest Up 20 secondsConfigure a worker.
You can deploy a Boundary worker with Docker to provide access to the openssh target container.
When using this image as a worker with HCP Boundary or Boundary Enterprise, you do not need to provide the license using an environment variable or config, but the worker must connect with a licensed controller.
Note
If your cluster is configured for multi-hop sessions, add an upstream worker for
initial_upstreamsinstead.Create a new file in your working directory called
config.hcl.Supply the controller DNS for the
initial_upstreams, which is the a resolvable address for the HCP Boundary cluster. If your cluster is listening on a port other than 9201, then change that value too.listener "tcp" { address = "127.0.0.1:9202" purpose = "proxy" } worker { initial_upstreams = ["<YOUR_CONTROLLER_ADDRESS>:9201"] public_addr = "openssh-worker" auth_storage_path = "/tmp/openssh-worker" recording_storage_path = "/tmp/boundary" tags { type = ["worker", "openssh"] } }Save the config.hcl file.
Deploy the worker.
Open a new terminal and switch to the directory with the
config.hclfile, then deploy theboundary-enterpriseDocker container. It will automatically source the config file if you deploy it where the file is located.$ docker run \ --network host \ --hostname=openssh-worker \ -v "$(pwd)":/boundary/ \ hashicorp/boundary-enterpriseThe worker will start attempting to connect to the controller.
In this example, the worker is connecting with a worker-led auth token. A controller-led workflow instead uses a shared KMS so the worker can register itself.
Scroll to the top of the output and copy the Worker Auth Registration Request value.
Export the Worker Auth Request Token value as an environment variable.
$ export WORKER_TOKEN="<Worker Auth Registration Request Value>"Register the worker.
You can register the worker using the Admin Console Web UI or the CLI.
Log into the CLI as the admin user, providing the admin login name and password when prompted.
$ boundary authenticate Please enter the login name (it will be hidden): Please enter the password (it will be hidden): Authentication information: Account ID: acctpw_VOeNSFX8pQ Auth Method ID: ampw_ZbB6UXpW3B Expiration Time: Thu, 15 Aug 2025 12:35:32 MST User ID: u_ogz79sV4sT The token was successfully stored in the chosen keyring and is not displayed here.Tip
If you get the following error:
Error looking up primary auth method ID for the global scope. Try setting a primary auth method for the global scope, or use an auth method subcomma (see 'boundary authenticate -h' for available sub command usage).then you may have a provisioning issue with the sandbox. Relaunch the sandbox and try again.
The token is used to issue a create worker request that authorizes the worker to Boundary and make it available.
Create a new worker:
$ boundary workers create worker-led -worker-generated-auth-token=$WORKER_TOKEN Worker information: Active Connection Count: 0 Created Time: Mon, 12 Aug 2025 19:54:57 MDT ID: w_IPfR7jBVri Local Storage State: unknown Type: pki Updated Time: Mon, 12 Aug 2025 19:54:57 MDT Version: 1 Scope: ID: global Name: global Type: global Authorized Actions: update delete add-worker-tags set-worker-tags remove-worker-tags no-op readCreate credentials for the openssh-target.
If you want to enable session recording, credential injection must be set up. This requires you to create a new credential for the target.
Locate the
sandbox projectscope id.Create a new static credential store:
$ boundary credential-stores create static \ -name "SSH Credentials" \ -scope-id $PROJECT_IDCopy the credential store ID from the output, such as
csst_xNlFeo0sIb.The openssh
passwordattribute must be passed as an environment variable, or from a file. Export it as an env var:$ export OPENSSH_PASSWORD=passwordCreate a new credential of type
username-password. Pass in the credential store ID you copied in the last step.$ boundary credentials create username-password \ -name "openssh credentials" \ -credential-store-id $BOUNDARY_CRED_STORE_ID \ -username admin \ -password env://OPENSSH_PASSWORDCopy the credential ID from the output, such as
credup_d0vdR0XxCw.Create a new target.
Create a target for the
opensshhost. You can create the target using the CLI or Admin UI.An egress worker filter specifies which worker has access to the target, such as a worker deployed in the same network as the target. An ingress worker specifies how to route a Boundary client to the target network, and is not used in this example.
Recall the tags associated with the
openssh-worker, which also provides access to theopensshhost:Tags: Configuration: type: ["worker" "openssh"] Canonical: type: ["worker" "openssh"]The tags for this worker are:
"type" = ["worker", "openssh"]An appropriate filter to select this worker is:
"openssh" in "/tags/type"Create a new target of type
sshnamedopenssh-target.Set the default port to
2222. To optionally enable session recording, pass the storage bucket ID and egress worker filter. You can get the project ID and storage bucket ID (such as sb_nzFv30oX2E) from the Admin UI or CLI.$ boundary targets create ssh -scope-id $PROJECT_ID \ -name "openssh-target" \ -alias "openssh.target" \ -session-connection-limit -1 \ -address "127.0.0.1" \ -default-port 2222 \ -egress-worker-filter '"openssh" in "/tags/type"' \ -storage-bucket-id=$STORAGE_BUCKET_ID \ -enable-session-recording=trueCopy the target ID from the output, such as
tssh_4B5TnVtlbb.Now associate
openssh-targetwith the credential library. Pass in the target ID and credential ID you copied earlier.$ boundary targets add-credential-sources -id $TARGET_ID -injected-application-credential-source $TARGET_CREDENTIAL_IDTest the target connection.
From the boundary-workstation, test the openssh-target.
Enter
yeswhen prompted to establish the connection.$ boundary connect ssh -target-id $TARGET_ID Welcome to OpenSSH Server 3fe7e57f5505:~$
Warning
This environment is not production-ready as it does not follow our recommendations for production-ready cluster deployments. Please refer to the Install Boundary documentation and the Boundary Enterprise Deployment Guide pages for more information.This is a development and testing environment. It provides the learner an opportunity to interact with a Boundary Enterprise cluster, and sets up targets the learner can configure for access using Boundary. This environment can serve as a companion to the documentation, or a place to experiment with the product.
The Boundary Enterprise cluster contains one controller server and one worker, each with Boundary installed and running. A PostgreSQL database is running on the Boundary controller.
The Boundary target is an Ubuntu 24.04 server with the openssh-server and postgresql-server packages installed. The following Boundary users are preconfigured for SSH access on the ubuntu-host host:
Priya:
- username:
priya - password:
priya_password
Oliver:
- username:
oliver - password:
oliver_password
Khalid:
- username:
khalid - password:
khalid_password
A Windows server target is configured to allow for password access for the following user:
instruqt:
- username:
instruqt - password:
Passw0rd!
A postgres database is also configured on the ubuntu-host host and is available on port 5432:
Database:
- name:
northwind - username:
postgres - password:
postgres
Access the Boundary Admin UI
You can log in to the Boundary Admin UI in the tab named Boundary Admin UI.
To log into the Boundary Admin UI, use the following credentials for the admin user:
- Username:
admin - Password:
password
Or log in as the unprivileged user:
- Username:
user - Password:
password
The following resources are configured within Boundary:
Orgs: sandbox org
Projects: sandbox project
Host Catalogs:
ubuntu-host-catalogcontroller-host-catalog
Credential Stores:
ubuntu-host-creds
Targets:
boundary-dbnorthwind-dbubuntu-target-tcpssh-recording-target-priya
Aliases:
priya
You can access these targets from the Boundary workstation by configuring the CLI.
CLI access
The shell in the Boundary workstation tab has the Boundary, Vault, and Terraform CLI tools installed.
The following environment variables have been set:
BOUNDARY_ADDR=http://boundary-controller:9200VAULT_ADDR=https://vault-server:8200
You can log into Boundary from the CLI: using the admin credentials:
Username: admin
Password: password
$ boundary authenticate
Please enter the login name (it will be hidden):
Please enter the password (it will be hidden):
Authentication information:
Account ID: acctpw_sC5a4GP9JA
Auth Method ID: ampw_CzkwJb5RRR
Expiration Time: Thu, 03 Apr 2025 01:36:55 UTC
User ID: u_UURrzGLCik
The token name "default" was successfully stored in the chosen keyring and is not displayed here.
Tip
If you get the following error:
Error looking up primary auth method ID for the global scope. Try setting a primary auth method for the global scope, or use an auth method subcommand (see 'boundary authenticate -h' for available sub command usage).
then you may have a provisioning issue with the sandbox. Relaunch the sandbox and try again.
After authenticating, you can connect to targets using the boundary connect command.
To connect to the northwind database on the ubuntu-host host:
$ boundary connect postgres northwind
Credentials are being brokered but no -dbname parameter provided. psql may misinterpret another parameter as the database name.
psql (16.8 (Ubuntu 16.8-0ubuntu0.24.04.1))
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off)
Type "help" for help.
postgres=#
When you connect to the ubuntu-target target it will display the available
brokered credentials for the oliver and priya users, and automatically
select one of them to log you in as. Copy and paste or type the user's password
to connect:
$ boundary connect ssh ubuntu-target
Credentials:
Credential Source Description: Credentials for oliver user on ubuntu-host host
Credential Source ID: credup_XuqoTfBGrj
Credential Source Name: oliver-creds
Credential Store ID: csst_iHuwhwzstA
Credential Store Type: static
Credential Type: username_password
Secret:
password: oliver_password
username: oliver
Credential Source Description: Credentials for priya user on ubuntu-host host
Credential Source ID: credup_po69wMQRNN
Credential Source Name: priya-creds
Credential Store ID: csst_iHuwhwzstA
Credential Store Type: static
Credential Type: username_password
Secret:
password: priya_password
username: priya
The authenticity of host 'hst_hi2n8ghvx8 ([127.0.0.1]:45223)' can't be established.
ED25519 key fingerprint is SHA256:kCPyzCG/O2ckQ5zvoxT1O9NTgNz+KNnTf+fDildd0QI.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'hst_hi2n8ghvx8' (ED25519) to the list of known hosts.
oliver@hst_hi2n8ghvx8's password:
oliver@ubuntu-host$
You can also select a user to authenticate as by passing additional login
parameters to boundary connect ssh:
$ boundary connect ssh ubuntu-target -username priya
Credentials:
Credential Source Description: Credentials for oliver user on ubuntu-host host
Credential Source ID: credup_XuqoTfBGrj
Credential Source Name: oliver-creds
Credential Store ID: csst_iHuwhwzstA
Credential Store Type: static
Credential Type: username_password
Secret:
password: oliver_password
username: oliver
Credential Source Description: Credentials for priya user on ubuntu-host host
Credential Source ID: credup_po69wMQRNN
Credential Source Name: priya-creds
Credential Store ID: csst_iHuwhwzstA
Credential Store Type: static
Credential Type: username_password
Secret:
password: priya_password
username: priya
priya@hst_hi2n8ghvx8's password:
priya@ubuntu-host$
Vault integration
You can optionally set up Vault to act as a credential broker for Boundary. You can access the Vault server from the Boundary workstation, where the VAULT_ADDR=https://vault-server:8200 environment variable is set.
You can access vault from the boundary-workstation terminal using the root token in the /home/learner/vault directory, which is also available as an env var in /home/learner/.bashrc
$ source .bashrc
$ vault login $VAULT_ROOT_TOKEN
To learn more about setting up a Vault credential library, check out the Vault credential brokering quickstart tutorial.
Credential injection from Vault is enabled for the ssh-recording-target-priya target:
$ boundary connect ssh -host-id hcst_CjTPFUqeM3 -target-name ssh-recording-target-priya -target-scope-name "sandbox project"
priya@ubuntu-host$
The credential is attached to the ssh-recording-target-priya, which allows it
to be injected directly into the session. Injected credentials are listed under
Injected Application Credential Sources when reading target details. Unlike credential
brokering, injected credentials are never passed into the client's session.
$ boundary targets read -id tssh_Q4Q9fYzTgT
Target information:
Address: ubuntu-host
Created Time: Wed, 10 Sep 2025 18:05:37 UTC
Description: SSH target
Egress Worker Filter: "egress" in "/tags/type"
ID: tssh_Q4Q9fYzTgT
Name: ssh-recording-target-priya
Session Connection Limit: -1
Session Max Seconds: 28800
Type: ssh
Updated Time: Wed, 10 Sep 2025 18:05:39 UTC
Version: 2
Scope:
ID: p_9T9Ir8dN4I
Name: sandbox project
Parent Scope ID: o_5znI0AIrjc
Type: project
Authorized Actions:
add-credential-sources
no-op
add-host-sources
set-host-sources
set-credential-sources
read
remove-host-sources
remove-credential-sources
update
delete
authorize-session
Aliases:
ID: alt_L0gxwZoZ80
Value: priya
Injected Application Credential Sources:
Credential Store ID: csst_l7eFlcnqbI
ID: credup_tEnpnN5uvl
Attributes:
Default Port: 22
Enable Session Recording: true
Storage Bucket ID: sb_k3cw9Va7Ch
Target Aliases
Aliases can be used in the global scope to easily refer to resources.
Target aliases simplify the process of connecting to a target, and can
specify which host to use when requesting a session. Target aliases also
make it simple to connect to a host:
$ boundary connect ssh priya
priya@ubuntu-host$
Troubleshooting and experimenting
You can access the targets and databases directly without using Boundary. For example, you can SSH into the ubuntu-host as the Oliver user:
$ ssh oliver@ubuntu-host
oliver@hst_hi2n8ghvx8's password:
oliver@boundary-host$
Or you can access the northwind database on the ubuntu-host with psql:
$ psql -h ubuntu-host -d northwind -p 5432 -U postgres
psql (16.8 (Ubuntu 16.8-0ubuntu0.24.04.1))
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off)
Type "help" for help.
postgres=#
This bypasses Boundary, allows you to experiment with the target configuration. Note that you do not have root access to the target or other sandboxes. You can execute systemctl and journalctl on the controller and worker servers to restart the Boundary service if you make a configuration change, and view logs.
This sandbox contains:
- A Boundary controller server with Boundary installed and running. A PostgreSQL database is running on the Boundary controller.
- An ingress Boundary worker server with Boundary installed and running. The worker is pre-registered to the Boundary controller.
- An egress Boundary worker server with Boundary installed and running. The worker is pre-registered to the Boundary controller, with an upsteam connection to the ingress worker.
- A target Ubuntu 24.04 server with the openssh-server and postgresql-server packages installed. SSH is configured to allow for password access for three demo users.
- An optional Vault server to integrate with Boundary.
- A workstation server running Ubuntu 24.04 with the Boundary, Vault, Terraform, and Postgres client CLI tools installed.
┌──────────────┐ ┌─────────────────┐ ┌──────────────┐
│ │ │ │ │ │
│ Target ◄───────┤ Egress Worker ├──────► Vault Server │
│(SSH, Postges)│ │ │ │ │
└──────────────┘ └───────┬──▲──────┘ └──────────────┘
│ │
│ │
┌─────────────┘ └────────────────┐
▼ │
┌── Boundary Control Plane ──┐ │
│ │ ┌────────┴───────┐
│ Controller │ │ │
│ (Postges database) ◄─────────┤ Ingress Worker │
│ │ │ │
└─────────────▲──────────────┘ └────────▲───────┘
│ │
│ │
│ ┌──────────────────────┐ │
└───► Boundary Workstation ◄──────┘
└──────────────────────┘
This environment is not a production-ready.
To learn more about Boundary's architecture, refer to the Recommended architecture section of the Boundary documentation.
This environment is not production-ready, as it does not follow recommendations for production cluster deployments. Refer to these resources for more information:
- Install Boundary
- Boundary reference architecture
- Boundary Enterprise deployment guide
- Vault with integrated storage reference architecture
- Vault with integrated storage deployment guide
- Harden Vault server deployments
Community edition
The Boundary Enterprise Sandbox uses Boundary Enterprise and Vault Community editions. This means you cannot use Vauln Enterprise features here.
TLS
TLS is not enabled for any of the components in this sandbox environment.
Platform limitations
Because of the limitations of this platform:
- All servers are located in the same network. In a real-world example, the Boundary control plane, target server, Vault cluster, and workstation would be on separate, isolated networks. The egress Boundary worker is then placed on the same network as the targets it provides access to, such as the SSH, database, or Vault servers in this lab.
- All servers can be accessed directly by SSH using their hostnames, bypassing Boundary.
- The workstation and other servers do not allow root-level access.
You can try the following exercises to explore the Boundary Enterprise sandbox, and to learn about features and workflows.
These exercises are also available in the sandbox's /home/learner/get-started/exercises/ directory.
Select an exercise tab to view each exercise.
What is a Boundary target?
Targets are a Boundary resource that represent a networked service or host that a user can connect to. Targets provide an endpoint with an associated set of permissions for establishing a session. Targets need to be associated with a host to establish a connection.
For example, in the sandbox the following host exists:
ubuntu-host
The host is configured with a hostname (address) of ubuntu-target. This is the address
of the host in the lab environment that Boundary will use to start a connection. Functionally,
a host provides the address where a session should be attempted.
Targets provide further connection details, such as the protocol and port the connection should use.
In this sandbox, two examples of targets are ubuntu-target-tcp and northwind-db. Both these targets
are for services running on the ubuntu-target vm, at address boundary-target. The database target
should connect to the host on port 5432, while ubuntu-target-tcp sets port 22 as the default port
to enable SSH connections. In Boundary Enterprise, there are also ssh target types you will explore later.
The following Boundary users are preconfigured for SSH access on the ubuntu-target host:
Priya:
- username:
priya - password:
priya_password
- username:
Oliver:
- username:
oliver - password:
oliver_password
- username:
Khalid:
- username:
khalid - password:
khalid_password
- username:
A postgres database is also configured on the ubuntu-target host and is available on port 5432:
- Database:
- name:
northwind - username:
postgres - password:
postgres
- name:
A Windows Server target is configured to allow for password access for the following user:
- instruqt:
- username:
instruqt - password:
Passw0rd!
- username:
Access the Boundary Admin UI
You can log in to the Boundary Admin UI in the Boundary Admin UI tab.
To log into the Boundary Admin UI, use the following credentials for the admin user:
- Username:
admin - Password:
password
Or log in as the unprivileged user:
- Username:
user - Password:
password
Within Boundary the following resources are configured:
Org:
sandbox orgProject:
sandbox projectHost Catalogs:
ubuntu-host-catalogcontroller-host-catalog
Credential Store:
ubuntu-target-creds
Targets:
boundary-db(Boundary's local database)northwind-db(on ubuntu-host host)ubuntu-target-tcp(on ubuntu-host host)ssh-recording-target-priya(on ubuntu-host host)
Aliases:
priya
You can access these targets from the Boundary workstation by configuring the CLI. Targets can also be accessed using the Boundary Desktop client on your local machine.
CLI Access
The shell in the Boundary workstation tab has the Boundary, Vault, and Terraform CLI tools installed.
The following environment variables have been set:
BOUNDARY_ADDR=http://controller:9200VAULT_ADDR=http://vault-server:8200
You can log into Boundary from the CLI: using the admin credentials:
- Username:
admin - Password:
password
$ boundary authenticate
Please enter the login name (it will be hidden):
Please enter the password (it will be hidden):
Authentication information:
Account ID: acctpw_sC5a4GP9JA
Auth Method ID: ampw_CzkwJb5RRR
Expiration Time: Thu, 03 Apr 2025 01:36:55 UTC
User ID: u_UURrzGLCik
The token name "default" was successfully stored in the chosen keyring and is not displayed here.
Tip
If you get the following error:
Error looking up primary auth method ID for the global scope. Try setting a primary auth method for the global scope, or use an auth method subcommand (see 'boundary authenticate -h' for available sub command usage).
then you may have a provisioning issue with the sandbox. Relaunch the sandbox and try again.
Exercise:
Connect to a target using the CLI
After authentication, you can connect to targets using the boundary connect command.
Connect to the northwind database on the ubuntu-target host:
$ boundary connect postgres northwind
Credentials are being brokered but no -dbname parameter provided. psql may misinterpret another parameter as the database name.
psql (16.8 (Ubuntu 16.8-0ubuntu0.24.04.1))
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off)
Type "help" for help.
postgres=#
When you connect to the ubuntu-target host it will display the available
brokered credentials for the oliver and priya users, and automatically
select one of them to log you in as. Copy and paste or type the user's password
to connect:
$ boundary connect ssh ubuntu-target
Credentials:
Credential Source Description: Credentials for oliver user on ubuntu-target host
Credential Source ID: credup_XuqoTfBGrj
Credential Source Name: oliver-creds
Credential Store ID: csst_iHuwhwzstA
Credential Store Type: static
Credential Type: username_password
Secret:
password: oliver_password
username: oliver
Credential Source Description: Credentials for priya user on ubuntu-target host
Credential Source ID: credup_po69wMQRNN
Credential Source Name: priya-creds
Credential Store ID: csst_iHuwhwzstA
Credential Store Type: static
Credential Type: username_password
Secret:
password: priya_password
username: priya
The authenticity of host 'hst_hi2n8ghvx8 ([127.0.0.1]:45223)' can't be established.
ED25519 key fingerprint is SHA256:kCPyzCG/O2ckQ5zvoxT1O9NTgNz+KNnTf+fDildd0QI.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'hst_hi2n8ghvx8' (ED25519) to the list of known hosts.
oliver@hst_hi2n8ghvx8's password:
oliver@ubuntu-target$
Select a user to authenticate as by passing additional login parameters to
boundary connect ssh:
$ boundary connect ssh ubuntu-target -username priya
Credentials:
Credential Source Description: Credentials for oliver user on ubuntu-target host
Credential Source ID: credup_XuqoTfBGrj
Credential Source Name: oliver-creds
Credential Store ID: csst_iHuwhwzstA
Credential Store Type: static
Credential Type: username_password
Secret:
password: oliver_password
username: oliver
Credential Source Description: Credentials for priya user on ubuntu-target host
Credential Source ID: credup_po69wMQRNN
Credential Source Name: priya-creds
Credential Store ID: csst_iHuwhwzstA
Credential Store Type: static
Credential Type: username_password
Secret:
password: priya_password
username: priya
priya@hst_hi2n8ghvx8's password:
priya@ubuntu-target$
Bonus: Connect using the Boundary Desktop Client
On your local machine, you can use the Boundary Desktop Client to establish sessions.
HashiCorp recommends Windows and macOS users install the Boundary client components using the Boundary Installer:
You can also install the Boundary Desktop Client directly instead:
After installing, open the Boundary Desktop Client.
Locate your Boundary Controller's public URL in the /home/learner/get-started/public-controller-url file.
Copy this and paste it into the Boundary Desktop Client when prompted.
Authenticate to Boundary using the admin user credentials:
- Username:
admin - Password:
password
Click the Connect button next to a target, such as ssh-recording-target-priya.
From the sessions page, click the Shell tab. This will automatically launch the built-in terminal and attempt to open a session.
You should find a running session on the Sessions page. Try terminating the session from here. If session recording is enabled for your test target, verify that a recording was created.
Now, log out of the Boundary Desktop Client by clicking on the admin user dropdown and clicking "Sign Out".
On the Sign In page, click the Choose a different scope dropdown and select sandbox org.
Log back in as the unprivileged user:
- Org:
sandbox org - Username:
user - Password:
password
What do you notice about this user's permissions? Do you have access to the same set of targets and hosts?
You can learn more about grants and permissions in Boundary in the Permissions in Boundary docs.
Introduction to credential handling
Two types of credential handling are available in Boundary Enterprise:
- Credential brokering
- Credential injection
Credential brokering occurs when target credentials are sent directly back to the client for use in their shell.
The ubuntu-target-tcp target is configured using credential brokering.
If you request a session using boundary connect:
$ boundary connect -target-name ubuntu-target-tcp -target-scope-name "sandbox project"
Proxy listening information:
Address: 127.0.0.1
Connection Limit: -1
Expiration: Thu, 11 Sep 2025 05:50:32 MDT
Port: 50708
Protocol: tcp
Session ID: s_V1VU9SRtpS
Credentials:
Credential Source Description: Credentials for oliver user on ubuntu-target host
Credential Source ID: credup_3GaWPZ3mEj
Credential Source Name: oliver-creds
Credential Store ID: csst_0CQp4Oo4kx
Credential Store Type: static
Credential Type: username_password
Secret:
password: oliver_password
username: oliver
Credential Source Description: Credentials for priya user on ubuntu-target host
Credential Source ID: credup_9BGBG74JRl
Credential Source Name: priya-creds
Credential Store ID: csst_0CQp4Oo4kx
Credential Store Type: static
Credential Type: username_password
Secret:
password: priya_password
username: priya
Then a proxy is opened on the specified port, 50708 in this example. Notice that the proxy runs until
the connection is manually closed, using ctrl+c. The user is then able to connect to the target
using their client of choice and the brokered credentials, such as oliver:
$ ssh 127.0.0.1 -p 38769 -l oliver
The authenticity of host '[127.0.0.1]:38769 ([127.0.0.1]:38769)' can't be established.
ED25519 key fingerprint is SHA256:fDiCeP2Ou6WZ3Eq8QdESwd6jGVBL0OHa8EbK1uMuGEw.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[127.0.0.1]:38769' (ED25519) to the list of known hosts.
oliver@127.0.0.1's password:
oliver@ubuntu-target$
The user must pass these credentials directly, unless you use one of the Boundary connect helpers.
A connect helper, such as ssh or psql, attempts to request a session and open it in a
single command:
$ boundary connect ssh -target-name ubuntu-target-tcp -target-scope-name "sandbox project"
Credentials:
Credential Source Description: Credentials for oliver user on ubuntu-target host
Credential Source ID: credup_LNvXHyngBa
Credential Source Name: oliver-creds
Credential Store ID: csst_gfwRVvu1S7
Credential Store Type: static
Credential Type: username_password
Secret:
password: oliver_password
username: oliver
Credential Source Description: Credentials for priya user on ubuntu-target host
Credential Source ID: credup_sD2MoO0sCd
Credential Source Name: priya-creds
Credential Store ID: csst_gfwRVvu1S7
Credential Store Type: static
Credential Type: username_password
Secret:
password: priya_password
username: priya
The authenticity of host 'hst_hdxk4jjo03 ([127.0.0.1]:42837)' can't be established.
ED25519 key fingerprint is SHA256:fDiCeP2Ou6WZ3Eq8QdESwd6jGVBL0OHa8EbK1uMuGEw.
This host key is known by the following other names/addresses:
~/.ssh/known_hosts:1: [hashed name]
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'hst_hdxk4jjo03' (ED25519) to the list of known hosts.
oliver@hst_hdxk4jjo03's password:
oliver@ubuntu-target$
In this example, Boundary understands it should use the SSH protocol to handle any credentials available for the target. It uses the first set of credentials it finds, in this case, oliver. Boundary then passes the password on your behalf and establishes a connection.
Credential brokering is very different from credential injection, which is available
for Enterprise or HCP deployments. Credential injection requires a target type be set
when creating the target. Compare the target types for ubuntu-target-tcp and ssh-recording-target-priya:
$ boundary search -resource targets -query "name='ubuntu-target-tcp' OR name='ssh-recording-target-priya'"
Target information:
ID: tssh_vE4VcjEMs6
Scope ID: p_RwEjU2ZTlT
Version: 2
Type: ssh
Name: ssh-recording-target-priya
Description: SSH target
Address: ubuntu-target
Authorized Actions:
add-host-sources
no-op
authorize-session
set-credential-sources
remove-credential-sources
read
update
delete
set-host-sources
remove-host-sources
add-credential-sources
ID: ttcp_RVWygmdtmr
Scope ID: p_RwEjU2ZTlT
Version: 3
Type: tcp
Name: ubuntu-target-tcp
Description: SSH target for ubuntu-target
Authorized Actions:
read
update
delete
remove-host-sources
add-credential-sources
add-host-sources
set-credential-sources
remove-credential-sources
no-op
set-host-sources
authorize-session
Note that ubuntu-target-tcp is type tcp, while ssh-recording-target-priya is type ssh.
For credential injection to work, an ssh target must be assigned application injected credentials:
$ boundary targets read -id tssh_vE4VcjEMs6
Target information:
Address: ubuntu-target
Created Time: Thu, 11 Sep 2025 03:57:11 UTC
Description: SSH target
Egress Worker Filter: "egress" in "/tags/type"
ID: tssh_vE4VcjEMs6
Name: ssh-recording-target-priya
Session Connection Limit: -1
Session Max Seconds: 28800
Type: ssh
Updated Time: Thu, 11 Sep 2025 03:57:12 UTC
Version: 2
Scope:
ID: p_RwEjU2ZTlT
Name: sandbox project
Parent Scope ID: o_OLcERTET5o
Type: project
Authorized Actions:
update
delete
set-host-sources
add-credential-sources
authorize-session
add-host-sources
set-credential-sources
remove-host-sources
remove-credential-sources
no-op
read
Aliases:
ID: alt_KVDgkMbVzE
Value: priya
Injected Application Credential Sources:
Credential Store ID: csst_gfwRVvu1S7
ID: credup_sD2MoO0sCd
Attributes:
Default Port: 22
Enable Session Recording: true
Storage Bucket ID: sb_5PyYvthvUt
Here the credential credup_sD2MoO0sCd from credential store csst_gfwRVvu1S7 is
attached to the target. When a session is started, the attached credential is injected
directly into the session, and never passed to the end user's shell.
$ boundary connect ssh -target-name ssh-recording-target-priya -target-scope-name "sandbox project"
priya@ubuntu-target$
Although this looks similar to the credential brokering workflow when using the ssh connect helper, it's important to note the functional difference. Brokered credentials are always passed back to the client's shell, even if they are passed on behalf of the user to start a session. Injected credentials are never sent back to the user. They are used by Boundary to initiate the session, and then the client is connected. Injected credentials are never exposed to the end client.
SSH targets can have both injected and brokered credentials attached to them. This is useful when the user needs additional credentials after the initial session has been established, for example, accessing a database after conneting using SSH.
Exercise:
Set up a new static credential of type username and password for the Oliver user:
username: oliver
password: oliver_password
This credential can be used to set up a new ssh target for Oliver, like the
Priya user.
The difference between these two credentials is that the ubuntu_priya credential is stored in
a Vault credential store, while Oliver's credential is stored within Boundary.
Creating credentials allows end users to authenticate to targets. In the next exercise, you will create a new target and attach a credential to in.
Boundary has built-in static credential management capabilities. If you are familiar with
HashiCorp Vault, examine the Vault credential library called the ubuntu_khalid.
This credential is sourced from Vault like the Priya credential, and is used in Exercise 3.
Tip
If you want to experiment with Vault, you can access vault from the boundary-workstation terminal using the root token in the /home/learner/vault directory, which is also available as an env var in /home/learner/.bashrc.
$ source .bashrc
$ vault login $VAULT_ROOT_TOKEN
Success! You are now authenticated. The token information displayed below
is already stored in the token helper. You do NOT need to run "vault login"
again. Future Vault requests will automatically use this token.
Key Value
--- -----
token hvs.n69aVEhtLJM7rtocx7WRMaVa
token_accessor DXtAVFy7vv8HUHAsBdtQTF6B
token_duration ∞
token_renewable false
token_policies ["root"]
identity_policies []
policies ["root"]
After you finish experimenting with creating credentials, move on the Exercise 3.
Configure an SSH target for session recording
SSH targets in Boundary Enterprise enable the following features:
- Credential injection
- SSH session recording
Exercise
You may complete this exercise use the Admin UI, CLI, or Terraform.
Create a new ssh target called
khalid-target- Set a target type of
ssh - Set the default port to
22 - Set an egress worker filter (required for session recording):
"egress" in "/tags/type"
- Set a direct target address of
ubuntu-hostOR - Assign the
ubuntu-targets-host-setby adding a host source
- Set a target type of
Assign an injected application credential to the target
Attach a static credential in Boundary OR
Attach the Vault credential library named
ubuntu_khalidBonus: assign the target a target alias
- Aliases simplify the target connection
- Create an alias called
sandbox.khalid
Bonus: enable session recording on the target
- You must have assigned an egress worker filter when creating the target
- Workers store and process recordings before uploading them to external storage (minio)
Verify the new target by connecting to it from the workstation
boundary connect ssh -target-name khalid-target -target-scope-name "sandbox project"or, connect by target ID (such astssh_vE4VcjEMs7)boundary connect ssh -target-id tssh_vE4VcjEMs7or, use a target alias to connect to the targetboundary connect ssh sandbox.khalid
Enforce compliance standards with storage policies
Session recordings are used to enforce compliance standards for your organization. If you must comply with HIPPA or SOC standards, storage policies ensure records of sessions are retained for the required amount of time.
By default, session recordings are set with a retention policy of Forever, and cannot be deleted.
Exercise
Create a new retention policy that allows you to delete session recordings.
In the Boundary Admin UI:
- Navigate to the Storage Policies page.
- Select the sandbox org org from the top navigation bar.
- Select Storage Policies from the left navigation panel.
- Click Create a new storage policy.
Fill in the form details:
- Name:
do-not-retain - Description:
delete after 1 day - Retention Policy:
Do not protect, allow deletion at any time - Deletion Policy:
Custom - Delete after:
1days
Click Save.
- Add the storage policy to the org.
- From the left navigation panel, select Org Settings.
- Click Add Storage Policy.
- From the Add Storage Policy page, select the
do-not-retainpolicy.
Click Save.
- Re-apply the storage policy to the session recording.
- Navigate back to the Global scope and select Session Recordings from the left navigation panel.
- Open a recording by clicking on View next to the recording. Under the Manage dropdown, select Re-apply storage policy.
- Delete the session recording.
- Click the Manage dropdown again, then select Delete recording and confirm the operation by clicking OK.
Repeat this process for any remaining recordings.
Bonus exercise
Implement a storage policy that conforms to SOC 2 retention policies (7 years):
- Retention Policy: SOC 2 (7 years)
- Deletion Policy: Custom Delete after: 2657 days Toggle the switch beside Allow orgs to override.
Explore how Boundary Enterprise is deployed
The /home/learner/get-started/ARCHITECTURE.md file describes the architecture of this
sandbox environment.
This includes the following components:
- Boundary controller (self-hosted postgres)
- Ingress Boundary worker
- Egress Boundary worker
- Vault server
- MinIO storage backend
- Ubuntu target
Examine these components and answer the following questions:
- What are the requirements for these components?
- How must they be configured to create a functional and secure Boundary deployment?
- How do the ingress and egress workers function in a multi-hop sessions deployment, and how can this provide enhanced security for your network?
You can check the controller or worker configurations by examining /etc/boundary.d/boundary.hcl
file on the those hosts.
Use the following documentation to deepen your understanding:
Bring your own targets
Configure your own targets with your Boundary Enterprise environment.
This exercise requires that you spin up hosts in an external environment.
Some possibilities include:
- A cloud providers, like AWS, GCP, or Microsoft Azure
- Local VMs or containers on your own machine
You must set up a Boundary worker with access to the targets you want to connect to. You need at least one worker (an egress worker to connect to the target), but if you only configure a single worker then you may have to expose the worker's public address for Boundary to connect to it.
Boundary Enterprise allows for multi-hop session worker configurations, where an ingress worker handles the initial connection from Boundary, then continues to "hop" to the next worker in the chain until it reaches the egress worker. Both the ingress an egress workers must be configured on the target, while any intermediate workers are set up as part of the worker configuration file as upstreams.
A single egress worker is recommended for a proof-of-concept. You can learn more about multi-hop sessions here:
Set up a target with Docker
As an example, you can create docker containers on your local machine.
Docker can be used to deploy an openssh-server target.
Ensure Docker is running, and then deploy an openssh container to use as a target.
$ docker run -d \ --name openssh-server \ -e USER_NAME=admin \ -e PASSWORD_ACCESS=true \ -e USER_PASSWORD=password \ -p 2222:2222 \ lscr.io/linuxserver/openssh-server:latestNote that the username for the openssh server is
admin, the password ispassword, and the target is available on your localhost at port2222(127.0.0.1:2222).Check that the container is running.
$ docker ps --format "table {{.ID}}\t{{.Names}}\t{{.Image}}\t{{.Status}}" CONTAINER ID NAMES IMAGE STATUS 6e63f8178576 openssh-server lscr.io/linuxserver/openssh-server:latest Up 20 secondsConfigure a worker.
You can deploy a Boundary worker with Docker to provide access to the openssh target container.
When using this image as a worker with HCP Boundary or Boundary Enterprise, you do not need to provide the license using an environment variable or config, but the worker must connect with a licensed controller.
Note
If your cluster is configured for multi-hop sessions, add an upstream worker for
initial_upstreamsinstead.Create a new file in your working directory called
config.hcl.Supply the controller DNS for the
initial_upstreams, which is the a resolvable address for the Boundary Enterprise cluster. If your cluster is listening on a port other than 9201, then change that value too.listener "tcp" { address = "127.0.0.1:9202" purpose = "proxy" } worker { initial_upstreams = ["<YOUR_CONTROLLER_ADDRESS>:9201"] public_addr = "openssh-worker" auth_storage_path = "/tmp/openssh-worker" recording_storage_path = "/tmp/boundary" tags { type = ["worker", "openssh"] } }Save the config.hcl file.
Deploy the worker.
Open a new terminal and switch to the directory with the
config.hclfile, then deploy theboundary-enterpriseDocker container. It will automatically source the config file if you deploy it where the file is located.$ docker run \ --network host \ --hostname=openssh-worker \ -v "$(pwd)":/boundary/ \ hashicorp/boundary-enterpriseThe worker will start attempting to connect to the controller.
In this example, the worker is connecting with a worker-led auth token. A controller-led workflow instead uses a shared KMS so the worker can register itself.
Scroll to the top of the output and copy the Worker Auth Registration Request value.
Export the Worker Auth Request Token value as an environment variable.
$ export WORKER_TOKEN="<Worker Auth Registration Request Value>"Register the worker.
You can register the worker using the Admin Console Web UI or the CLI.
Log into the CLI as the admin user, providing the admin login name and password when prompted.
$ boundary authenticate Please enter the login name (it will be hidden): Please enter the password (it will be hidden): Authentication information: Account ID: acctpw_VOeNSFX8pQ Auth Method ID: ampw_ZbB6UXpW3B Expiration Time: Thu, 15 Aug 2025 12:35:32 MST User ID: u_ogz79sV4sT The token was successfully stored in the chosen keyring and is not displayed here.Tip
If you get the following error:
Error looking up primary auth method ID for the global scope. Try setting a primary auth method for the global scope, or use an auth method subcomma (see 'boundary authenticate -h' for available sub command usage).then you may have a provisioning issue with the sandbox. Relaunch the sandbox and try again.
The token is used to issue a create worker request that authorizes the worker to Boundary and make it available.
Create a new worker:
$ boundary workers create worker-led -worker-generated-auth-token=$WORKER_TOKEN Worker information: Active Connection Count: 0 Created Time: Mon, 12 Aug 2025 19:54:57 MDT ID: w_IPfR7jBVri Local Storage State: unknown Type: pki Updated Time: Mon, 12 Aug 2025 19:54:57 MDT Version: 1 Scope: ID: global Name: global Type: global Authorized Actions: update delete add-worker-tags set-worker-tags remove-worker-tags no-op readCreate credentials for the openssh-target.
If you want to enable session recording, credential injection must be set up. This requires you to create a new credential for the target.
Locate the
sandbox projectscope id.Create a new static credential store:
$ boundary credential-stores create static \ -name "SSH Credentials" \ -scope-id $PROJECT_IDCopy the credential store ID from the output, such as
csst_xNlFeo0sIb.The openssh
passwordattribute must be passed as an environment variable, or from a file. Export it as an env var:$ export OPENSSH_PASSWORD=passwordCreate a new credential of type
username-password. Pass in the credential store ID you copied in the last step.$ boundary credentials create username-password \ -name "openssh credentials" \ -credential-store-id $BOUNDARY_CRED_STORE_ID \ -username admin \ -password env://OPENSSH_PASSWORDCopy the credential ID from the output, such as
credup_d0vdR0XxCw.Create a new target.
Create a target for the
opensshhost. You can create the target using the CLI or Admin UI.An egress worker filter specifies which worker has access to the target, such as a worker deployed in the same network as the target. An ingress worker specifies how to route a Boundary client to the target network, and is not used in this example.
Recall the tags associated with the
openssh-worker, which also provides access to theopensshhost:Tags: Configuration: type: ["worker" "openssh"] Canonical: type: ["worker" "openssh"]The tags for this worker are:
"type" = ["worker", "openssh"]An appropriate filter to select this worker is:
"openssh" in "/tags/type"Create a new target of type
sshnamedopenssh-target.Set the default port to
2222. To optionally enable session recording, pass the storage bucket ID and egress worker filter. You can get the project ID and storage bucket ID (such as sb_nzFv30oX2E) from the Admin UI or CLI.$ boundary targets create ssh -scope-id $PROJECT_ID \ -name "openssh-target" \ -alias "openssh.target" \ -session-connection-limit -1 \ -address "127.0.0.1" \ -default-port 2222 \ -egress-worker-filter '"openssh" in "/tags/type"' \ -storage-bucket-id=$STORAGE_BUCKET_ID \ -enable-session-recording=trueCopy the target ID from the output, such as
tssh_4B5TnVtlbb.Now associate
openssh-targetwith the credential library. Pass in the target ID and credential ID you copied earlier.$ boundary targets add-credential-sources -id $TARGET_ID -injected-application-credential-source $TARGET_CREDENTIAL_IDTest the target connection.
From the boundary-workstation, test the openssh-target.
Enter
yeswhen prompted to establish the connection.$ boundary connect ssh -target-id $TARGET_ID Welcome to OpenSSH Server 3fe7e57f5505:~$
Warning
This environment is not production-ready as it does not follow our recommendations for production-ready cluster deployments. Please refer to the Install Boundary documentation and the Boundary Enterprise Deployment Guide pages for more information.This is a development and testing environment. It provides the learner an opportunity to interact with a Boundary Community Edition cluster, and sets up a target the learner can configure for access using Boundary. This environment can serve as a companion to the documentation, or a place to experiment with the product.
Overview The Boundary cluster contains one controller server and one worker, each with Boundary installed and running. A PostgreSQL database is running on the Boundary controller.
The Boundary target is an Ubuntu 24.04 server with the openssh-server and postgresql-server packages installed. SSH is configured to allow for password access for the following users:
Priya:
- username:
priya - password:
priya_password
Oliver:
- username:
oliver - password:
oliver_password
Khalid:
- username:
khalid - password:
khalid_password
A postgres database is also configured on the ubuntu-host host and is available on port 5432:
Database:
- name:
northwind - username:
postgres - password:
postgres
Access the Boundary Admin UI
You can log in to the Boundary Admin UI in the tab named Boundary Admin UI.
To log into the Boundary Admin UI, use the following credentials for the admin user:
- Username:
admin - Password:
password
Or log in as the unprivileged user:
- Username:
user - Password:
password
The following resources are configured within Boundary:
Orgs: sandbox org
Projects: sandbox project
Host Catalogs:
ubuntu-host-catalogcontroller-host-catalog
Credential Stores:
ubuntu-host-creds
Targets:
boundary-dbnorthwind-dbubuntu-target-sshpriya-target-ssh
Aliases:
northwindboundary-dbubuntu-targetpriya
You can access these targets from the Boundary workstation by configuring the CLI.
CLI access
The shell in the boundary-workstation tab has the Boundary, Vault, and Terraform CLI tools installed.
The sandbox automatically sets the following environment variables:
BOUNDARY_ADDR=http://boundary-controller:9200VAULT_ADDR=http://vault-server:8200
You can log into Boundary from the CLI using the admin credentials:
- Username:
admin - Password:
password
$ boundary authenticate
Please enter the login name (it will be hidden):
Please enter the password (it will be hidden):
Authentication information:
Account ID: acctpw_sC5a4GP9JA
Auth Method ID: ampw_CzkwJb5RRR
Expiration Time: Thu, 03 Apr 2025 01:36:55 UTC
User ID: u_UURrzGLCik
The token name "default" was successfully stored in the chosen keyring and is not displayed here.
Tip
If you get the following error:
Error looking up primary auth method ID for the global scope. Try setting a primary auth method for the global scope, or use an auth method subcommand (see 'boundary authenticate -h' for available sub command usage).
then you may have a provisioning issue with the sandbox. Relaunch the sandbox and try again.
After authentication, you can connect to targets using the boundary connect command.
To connect to the northwind database on the ubuntu-target host:
$ boundary connect postgres northwind
Credentials are being brokered but no -dbname parameter provided. psql may misinterpret another parameter as the database name.
psql (16.8 (Ubuntu 16.8-0ubuntu0.24.04.1))
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off)
Type "help" for help.
postgres=#
When you connect to the ubuntu-target host it will display the available brokered credentials for the oliver and priya users, and automatically select one of them to log you in as. Copy and paste or type the user's password to connect:
$ boundary connect ssh ubuntu-target
Credentials:
Credential Source Description: Credentials for oliver user on ubuntu-target host
Credential Source ID: credup_XuqoTfBGrj
Credential Source Name: oliver-creds
Credential Store ID: csst_iHuwhwzstA
Credential Store Type: static
Credential Type: username_password
Secret:
password: oliver_password
username: oliver
Credential Source Description: Credentials for priya user on ubuntu-target host
Credential Source ID: credup_po69wMQRNN
Credential Source Name: priya-creds
Credential Store ID: csst_iHuwhwzstA
Credential Store Type: static
Credential Type: username_password
Secret:
password: priya_password
username: priya
The authenticity of host 'hst_hi2n8ghvx8 ([127.0.0.1]:45223)' can't be established.
ED25519 key fingerprint is SHA256:kCPyzCG/O2ckQ5zvoxT1O9NTgNz+KNnTf+fDildd0QI.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'hst_hi2n8ghvx8' (ED25519) to the list of known hosts.
oliver@hst_hi2n8ghvx8's password:
oliver@ubuntu-target$
You can also select a user to authenticate as by passing additional login
parameters to boundary connect ssh:
$ boundary connect ssh ubuntu-target -username priya
Credentials:
Credential Source Description: Credentials for oliver user on ubuntu-target host
Credential Source ID: credup_XuqoTfBGrj
Credential Source Name: oliver-creds
Credential Store ID: csst_iHuwhwzstA
Credential Store Type: static
Credential Type: username_password
Secret:
password: oliver_password
username: oliver
Credential Source Description: Credentials for priya user on ubuntu-target host
Credential Source ID: credup_po69wMQRNN
Credential Source Name: priya-creds
Credential Store ID: csst_iHuwhwzstA
Credential Store Type: static
Credential Type: username_password
Secret:
password: priya_password
username: priya
priya@hst_hi2n8ghvx8's password:
priya@ubuntu-target$
Vault integration
You can optionally set up Vault to act as a credential broker for Boundary. You can access the Vault server from the Boundary workstation, where the VAULT_ADDR=https://vault-server:8200 environment variable is set.
You can access vault from the boundary-workstation terminal using the root token in the /home/learner/vault directory, which is also available as an env var in /home/learner/.bashrc
$ source .bashrc
$ vault login $VAULT_ROOT_TOKEN
To learn more about setting up a Vault credential library, check out the Vault credential brokering quickstart tutorial.
Target Aliases
Aliases can be used in the global scope to easily refer to resources.
Target aliases simplify the process of connecting to a target, and can
specify which host to use when requesting a session. Target aliases also
make it simple to connect to a host:
$ boundary connect ssh priya
Credentials:
Credential Source Description: Credentials for priya user on ubuntu-host host
Credential Source ID: credup_1mAHYNb151
Credential Source Name: priya-creds
Credential Store ID: csst_UNyJUFBSct
Credential Store Type: static
Credential Type: username_password
Secret:
password: priya_password
username: priya
priya@hst_nvhzci8fak's password:
priya@ubuntu-host$
Troubleshooting and experimenting
You can access the targets and databases directly without using Boundary. For example, you can SSH into the ubuntu-host as the Oliver user:
$ ssh oliver@ubuntu-host
oliver@hst_hi2n8ghvx8's password:
oliver@boundary-host$
Or you can access the northwind database on the ubuntu-host with psql:
$ psql -h ubuntu-host -d northwind -p 5432 -U postgres
psql (16.8 (Ubuntu 16.8-0ubuntu0.24.04.1))
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off)
Type "help" for help.
postgres=#
This bypasses Boundary, allows you to experiment with the target configuration. Note that you do not have root access to the target or other sandboxes. You can execute systemctl and journalctl on the controller and worker servers to restart the Boundary service if you make a configuration change, and view logs.
This sandbox contains:
- A Boundary controller server with Boundary installed and running. A PostgreSQL database is running on the Boundary controller.
- A Boundary worker server with Boundary installed and running. The worker is pre-registered to the Boundary controller.
- A target Ubuntu 24.04 server with the openssh-server and postgresql-server packages installed. SSH is configured to allow for password access for three demo users.
- An optional Vault server to integrate with Boundary.
- A workstation server running Ubuntu 24.04 with the Boundary, Vault, Terraform, and Postgres client CLI tools installed.
┌──────────────┐ ┌──────────────┐
│ │ ┌─────────────────┐ │ │
│ Target │ │ │ │ Vault Server │
│(SSH, Postges)◄───────┤ Boundary Worker ├──────► (optional) │
│ │ │ │ │ │
└──────────────┘ └──────▲──┬───────┘ └──────────────┘
│ │
│ │
┌─────────────┘ └──────────────────┐
│ │
│ │
│
┌──── Boundary Control Plane ───┐ │
│ │ │
│ Controller │ ┌──────────▼───────────┐
│ ◄────────► Boundary Workstation │
│ (Postges Database) │ └──────────────────────┘
│ │
└───────────────────────────────┘
This environment is not a production-ready.
To learn more about Boundary's architecture, refer to the Recommended architecture section of the Boundary documentation.
This environment is not production-ready, as it does not follow recommendations for production cluster deployments. Refer to these resources for more information:
- Install Boundary
- Boundary reference architecture
- Boundary Enterprise deployment guide
- Vault with integrated storage reference architecture
- Vault with integrated storage deployment guide
- Harden Vault server deployments
Community edition
The Boundary Sandbox uses the Boundary and Vault Community editions. This means you cannot use enterprise features here.
TLS
TLS is not enabled for any of the components in this sandbox environment.
Platform limitations
Because of the limitations of this platform:
- All servers are located in the same network. In a real-world example, the Boundary control plane, target server, Vault cluster, and workstation would be on separate, isolated networks. The Boundary worker is then placed on the same network as the targets it provides access to, such as the SSH, database, or Vault servers in this lab.
- All servers can be accessed directly by SSH using their hostnames, bypassing Boundary.
- The workstation and other servers do not allow root-level access.
You can try the following exercises to explore the Boundary Community Edition sandbox, and to learn about features and workflows.
These exercises are also available in the sandbox's /home/learner/get-started/exercises/ directory.
Select an exercise tab to view each exercise.
What is a Boundary target?
Targets are a Boundary resource that represent a networked service or host that a user can connect to. Targets provide an endpoint with an associated set of permissions for establishing a session. Targets need to be associated with a host to establish a connection.
For example, in the sandbox the following host exists:
ubuntu-host
The host is configured with a hostname (address) of ubuntu-host. This is the address
of the host in the lab environment that Boundary will use to start a connection. Functionally,
a host provides the address where a session should be attempted.
Targets provide further connection details, such as the protocol and port the connection should use.
In this sandbox, two examples of targets are ubuntu-target-tcp and northwind-db. Both these targets
are for services running on the ubuntu-target vm, at address boundary-target. The database target
should connect to the host on port 5432, while ubuntu-target-tcp sets port 22 as the default port
to enable SSH connections. TCP targets are the only target types available in Boundary Community Edition.
The following Boundary users are preconfigured for SSH access on the ubuntu-target host:
Priya:
- username:
priya - password:
priya_password
- username:
Oliver:
- username:
oliver - password:
oliver_password
- username:
Khalid:
- username:
khalid - password:
khalid_password
- username:
A postgres database is also configured on the ubuntu-target host and is available on port 5432:
- Database:
- name:
northwind - username:
postgres - password:
postgres
- name:
Access the Boundary Admin UI
You can log in to the Boundary Admin UI in the Boundary Admin UI tab.
To log into the Boundary Admin UI, use the following credentials for the admin user:
- Username:
admin - Password:
password
Or log in as the unprivileged user:
- Username:
user - Password:
password
Within Boundary the following resources are configured:
Org:
sandbox orgProject:
sandbox projectHost Catalogs:
ubuntu-host-catalogcontroller-host-catalog
Credential Store:
ubuntu-target-creds
Targets:
boundary-db(Boundary's local database)northwind-db(on ubuntu-host host)ubuntu-target-ssh(on ubuntu-host host)priya-target-ssh(on ubuntu-host host)
Aliases:
priya
You can access these targets from the Boundary workstation by configuring the CLI. Targets can also be accessed using the Boundary Desktop client on your local machine.
CLI Access
The shell in the Boundary workstation tab has the Boundary, Vault, and Terraform CLI tools installed.
The following environment variables have been set:
BOUNDARY_ADDR=http://controller:9200VAULT_ADDR=http://vault-server:8200
You can log into Boundary from the CLI: using the admin credentials:
- Username:
admin - Password:
password
$ boundary authenticate
Please enter the login name (it will be hidden):
Please enter the password (it will be hidden):
Authentication information:
Account ID: acctpw_sC5a4GP9JA
Auth Method ID: ampw_CzkwJb5RRR
Expiration Time: Thu, 03 Apr 2025 01:36:55 UTC
User ID: u_UURrzGLCik
The token name "default" was successfully stored in the chosen keyring and is not displayed here.
Tip
If you get the following error:
Error looking up primary auth method ID for the global scope. Try setting a primary auth method for the global scope, or use an auth method subcommand (see 'boundary authenticate -h' for available sub command usage).
then you may have a provisioning issue with the sandbox. Relaunch the sandbox and try again.
Exercise:
Connect to a target using the CLI
After authentication, you can connect to targets using the boundary connect command.
Connect to the northwind database on the ubuntu-target host:
$ boundary connect postgres northwind
Credentials are being brokered but no -dbname parameter provided. psql may misinterpret another parameter as the database name.
psql (16.8 (Ubuntu 16.8-0ubuntu0.24.04.1))
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off)
Type "help" for help.
postgres=#
When you connect to the ubuntu-target host it will display the available
brokered credentials for the oliver and priya users, and automatically
select one of them to log you in as. Copy and paste or type the user's password
to connect:
$ boundary connect ssh ubuntu-target
Credentials:
Credential Source Description: Credentials for oliver user on ubuntu-target host
Credential Source ID: credup_XuqoTfBGrj
Credential Source Name: oliver-creds
Credential Store ID: csst_iHuwhwzstA
Credential Store Type: static
Credential Type: username_password
Secret:
password: oliver_password
username: oliver
Credential Source Description: Credentials for priya user on ubuntu-target host
Credential Source ID: credup_po69wMQRNN
Credential Source Name: priya-creds
Credential Store ID: csst_iHuwhwzstA
Credential Store Type: static
Credential Type: username_password
Secret:
password: priya_password
username: priya
The authenticity of host 'hst_hi2n8ghvx8 ([127.0.0.1]:45223)' can't be established.
ED25519 key fingerprint is SHA256:kCPyzCG/O2ckQ5zvoxT1O9NTgNz+KNnTf+fDildd0QI.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'hst_hi2n8ghvx8' (ED25519) to the list of known hosts.
oliver@hst_hi2n8ghvx8's password:
oliver@ubuntu-target$
Select a user to authenticate as by passing additional login parameters to
boundary connect ssh:
$ boundary connect ssh ubuntu-target -username priya
Credentials:
Credential Source Description: Credentials for oliver user on ubuntu-target host
Credential Source ID: credup_XuqoTfBGrj
Credential Source Name: oliver-creds
Credential Store ID: csst_iHuwhwzstA
Credential Store Type: static
Credential Type: username_password
Secret:
password: oliver_password
username: oliver
Credential Source Description: Credentials for priya user on ubuntu-target host
Credential Source ID: credup_po69wMQRNN
Credential Source Name: priya-creds
Credential Store ID: csst_iHuwhwzstA
Credential Store Type: static
Credential Type: username_password
Secret:
password: priya_password
username: priya
priya@hst_hi2n8ghvx8's password:
priya@ubuntu-target$
Bonus: Connect using the Boundary Desktop Client
On your local machine, you can use the Boundary Desktop Client to establish sessions.
HashiCorp recommends Windows and macOS users install the Boundary client components using the Boundary Installer:
You can also install the Boundary Desktop Client directly instead:
After installing, open the Boundary Desktop Client.
Locate your Boundary Controller's public URL in the /home/learner/get-started/public-controller-url file.
Copy this and paste it into the Boundary Desktop Client when prompted.
Authenticate to Boundary using the admin user credentials:
- Username:
admin - Password:
password
Click the Connect button next to a target, such as priya-target-ssh.
From the sessions page, click the Shell tab. This will automatically launch the built-in terminal and attempt to open a session.
You should find a running session on the Sessions page. Try terminating the session from here. If session recording is enabled for your test target, verify that a recording was created.
Now, log out of the Boundary Desktop Client by clicking on the admin user dropdown and clicking "Sign Out".
On the Sign In page, click the Choose a different scope dropdown and select sandbox org.
Log back in as the unprivileged user:
- Org:
sandbox org - Username:
user - Password:
password
What do you notice about this user's permissions? Do you have access to the same set of targets and hosts?
You can learn more about grants and permissions in Boundary in the Permissions in Boundary docs.
Introduction to credential handling
Two types of credential handling are available in Boundary:
- Credential brokering
- Credential injection (Boundary Enterprise or HCP Boundary)
Credential brokering occurs when target credentials are sent directly back to the client for use in their shell. This type of credential handling is available in Boundary Community Edition.
The ubuntu-target-tcp target is configured using credential brokering.
If you request a session using boundary connect:
$ boundary connect -target-name ubuntu-target-tcp -target-scope-name "sandbox project"
Proxy listening information:
Address: 127.0.0.1
Connection Limit: -1
Expiration: Thu, 11 Sep 2025 05:50:32 MDT
Port: 50708
Protocol: tcp
Session ID: s_V1VU9SRtpS
Credentials:
Credential Source Description: Credentials for oliver user on ubuntu-target host
Credential Source ID: credup_3GaWPZ3mEj
Credential Source Name: oliver-creds
Credential Store ID: csst_0CQp4Oo4kx
Credential Store Type: static
Credential Type: username_password
Secret:
password: oliver_password
username: oliver
Credential Source Description: Credentials for priya user on ubuntu-target host
Credential Source ID: credup_9BGBG74JRl
Credential Source Name: priya-creds
Credential Store ID: csst_0CQp4Oo4kx
Credential Store Type: static
Credential Type: username_password
Secret:
password: priya_password
username: priya
Then a proxy is opened on the specified port, 50708 in this example. Notice that the proxy runs until
the connection is manually closed, using ctrl+c. The user is then able to connect to the target
using their client of choice and the brokered credentials, such as oliver:
$ ssh 127.0.0.1 -p 38769 -l oliver
The authenticity of host '[127.0.0.1]:38769 ([127.0.0.1]:38769)' can't be established.
ED25519 key fingerprint is SHA256:fDiCeP2Ou6WZ3Eq8QdESwd6jGVBL0OHa8EbK1uMuGEw.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[127.0.0.1]:38769' (ED25519) to the list of known hosts.
oliver@127.0.0.1's password:
oliver@ubuntu-target$
The user must pass these credentials directly, unless you use one of the Boundary connect helpers.
A connect helper, such as ssh or psql, attempts to request a session and open it in a
single command:
$ boundary connect ssh -target-name ubuntu-target-tcp -target-scope-name "sandbox project"
Credentials:
Credential Source Description: Credentials for oliver user on ubuntu-target host
Credential Source ID: credup_LNvXHyngBa
Credential Source Name: oliver-creds
Credential Store ID: csst_gfwRVvu1S7
Credential Store Type: static
Credential Type: username_password
Secret:
password: oliver_password
username: oliver
Credential Source Description: Credentials for priya user on ubuntu-target host
Credential Source ID: credup_sD2MoO0sCd
Credential Source Name: priya-creds
Credential Store ID: csst_gfwRVvu1S7
Credential Store Type: static
Credential Type: username_password
Secret:
password: priya_password
username: priya
The authenticity of host 'hst_hdxk4jjo03 ([127.0.0.1]:42837)' can't be established.
ED25519 key fingerprint is SHA256:fDiCeP2Ou6WZ3Eq8QdESwd6jGVBL0OHa8EbK1uMuGEw.
This host key is known by the following other names/addresses:
~/.ssh/known_hosts:1: [hashed name]
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'hst_hdxk4jjo03' (ED25519) to the list of known hosts.
oliver@hst_hdxk4jjo03's password:
oliver@ubuntu-target$
In this example, Boundary understands it should use the SSH protocol to handle any credentials available for the target. It uses the first set of credentials it finds, in this case, oliver. Boundary then passes the password on your behalf and establishes a connection.
Credential brokering is very different from credential injection, which is available for Enterprise or HCP deployments. Credential injection handles credentials without exposing them to end-users, meaning a Boundary client never receives or handles the credential.
Credential injection requires the SSH or RDP target types available in Boundary Enterprise, instead of the TCP targets you are experimenting with in this sandbox.
To experiment with credential injection and other enterprise features, check out the Boundary Enterprise Sandbox.
Exercise:
Set up a new static credential of type username and password for the khalid user:
username: khalid
password: khalid_password
Use this credential in the next lesson to set up a new ssh target.
Boundary has built-in static credential management capabilities. If you are familiar with
HashiCorp Vault, create a new credential library in the vault-ubuntu-credentials credential store
for the khalid user.
Tip
If you want to experiment with Vault, you can access vault from the boundary-workstation terminal using the root token in the /home/learner/vault directory, which is also available as an env var in /home/learner/.bashrc.
$ source .bashrc
$ vault login $VAULT_ROOT_TOKEN
Success! You are now authenticated. The token information displayed below
is already stored in the token helper. You do NOT need to run "vault login"
again. Future Vault requests will automatically use this token.
Key Value
--- -----
token hvs.n69aVEhtLJM7rtocx7WRMaVa
token_accessor DXtAVFy7vv8HUHAsBdtQTF6B
token_duration ∞
token_renewable false
token_policies ["root"]
identity_policies []
policies ["root"]
After you finish experimenting with creating credentials, move on the Exercise 3.
Configure a TCP target
TCP targets in Boundary allow clients to connect to any generic target, such as databases, SSH or RDP servers, or Kubernetes API servers.
The following targets and target aliases are already set up:
Targets:
boundary-dbnorthwind-dbubuntu-target-sshpriya-target-ssh
Aliases:
northwindboundary-dbubuntu-targetpriya
Exercise
You may complete this exercise use the Admin UI, CLI, or Terraform.
Create a new ssh target called
khalid-target- Set a target type of
tcp - Set the default port to
22 - Set an egress worker filter (required for session recording):
"worker" in "/tags/type"
- Set a direct target address of
ubuntu-hostOR - Assign the
ubuntu-host-setby adding a host source
- Set a target type of
Assign a brokered application credential to the target
Attach a static credential in Boundary OR
Attach the Vault credential library named
ubuntu_khalidBonus: assign the target a target alias
- Aliases simplify the target connection
- Create an alias called
sandbox.khalid
Verify the new target by connecting to it from the workstation
boundary connect ssh -target-name khalid-target -target-scope-name "sandbox project"or, connect by target ID (such astssh_vE4VcjEMs7)boundary connect ssh -target-id tssh_vE4VcjEMs7or, use a target alias to connect to the targetboundary connect ssh sandbox.khalid
Explore how Boundary Community Edition is deployed
The /home/learner/get-started/ARCHITECTURE.md file describes the architecture of this
sandbox environment.
This includes the following components:
- Boundary controller (self-hosted postgres)
- Boundary worker
- Vault server
- Ubuntu target
Examine these components and answer the following questions:
- What are the requirements for these components?
- How must they be configured to create a functional and secure Boundary deployment?
- How does the worker provide access to the target network? Boundary Community Edition only allows for egress workers, which provide access to targets. How can the ingress workers provided in HCP Boundary and Boundary Enterprise improve an organization's security posture?
You can check the controller or worker configurations by examining /etc/boundary.d/boundary.hcl
file on the those hosts.
Use the following documentation to deepen your understanding:
Bring your own targets
Configure your own targets with your Boundary environment.
This exercise requires that you spin up hosts in an external environment.
Some possibilities include:
- A cloud providers, like AWS, GCP, or Microsoft Azure
- Local VMs or containers on your own machine
You must set up a Boundary worker with access to the targets you want to connect to. You need at least one worker (an egress worker to connect to the target), but if you only configure a single worker then you may have to expose the worker's public address for Boundary to connect to it.
Boundary workers provide access to the targets you want to connect to. Deploying a worker is required for this exercise. You can learn more about setting up a worker here:
Set up a target with Docker
As an example, you can create docker containers on your local machine.
Docker can be used to deploy an openssh-server target.
Ensure Docker is running, and then deploy an openssh container to use as a target.
$ docker run -d \ --name openssh-server \ -e USER_NAME=admin \ -e PASSWORD_ACCESS=true \ -e USER_PASSWORD=password \ -p 2222:2222 \ lscr.io/linuxserver/openssh-server:latestNote that the username for the openssh server is
admin, the password ispassword, and the target is available on your localhost at port2222(127.0.0.1:2222).Check that the container is running.
$ docker ps --format "table {{.ID}}\t{{.Names}}\t{{.Image}}\t{{.Status}}" CONTAINER ID NAMES IMAGE STATUS 6e63f8178576 openssh-server lscr.io/linuxserver/openssh-server:latest Up 20 secondsConfigure a worker.
You can deploy a Boundary worker with Docker to provide access to the openssh target container.
When using this image as a worker with HCP Boundary or Boundary Enterprise, you do not need to provide the license using an environment variable or config, but the worker must connect with a licensed controller.
Create a new file in your working directory called
config.hcl.Supply the controller DNS for the
initial_upstreams, which is the a resolvable address for the Boundary cluster. If your cluster is listening on a port other than 9201, then change that value too.listener "tcp" { address = "127.0.0.1:9202" purpose = "proxy" } worker { initial_upstreams = ["<YOUR_CONTROLLER_ADDRESS>:9201"] public_addr = "openssh-worker" auth_storage_path = "/tmp/openssh-worker" tags { type = ["worker", "openssh"] } }Save the config.hcl file.
Deploy the worker.
Open a new terminal and switch to the directory with the
config.hclfile, then deploy theboundaryDocker container. It will automatically source the config file if you deploy it where the file is located.$ docker run \ --network host \ --hostname=openssh-worker \ -v "$(pwd)":/boundary/ \ hashicorp/boundaryThe worker will start attempting to connect to the controller.
In this example, the worker is connecting with a worker-led auth token. A controller-led workflow instead uses a shared KMS so the worker can register itself.
Scroll to the top of the output and copy the Worker Auth Registration Request value.
Export the Worker Auth Request Token value as an environment variable.
$ export WORKER_TOKEN="<Worker Auth Registration Request Value>"Register the worker.
You can register the worker using the Admin Console Web UI or the CLI.
Log into the CLI as the admin user, providing the admin login name and password when prompted.
$ boundary authenticate Please enter the login name (it will be hidden): Please enter the password (it will be hidden): Authentication information: Account ID: acctpw_VOeNSFX8pQ Auth Method ID: ampw_ZbB6UXpW3B Expiration Time: Thu, 15 Aug 2025 12:35:32 MST User ID: u_ogz79sV4sT The token was successfully stored in the chosen keyring and is not displayed here.Tip
If you get the following error:
Error looking up primary auth method ID for the global scope. Try setting a primary auth method for the global scope, or use an auth method subcommand (see 'boundary authenticate -h' for available sub command usage).then you may have a provisioning issue with the sandbox. Relaunch the sandbox and try again.
The token is used to issue a create worker request that authorizes the worker to Boundary and make it available.
Create a new worker:
$ boundary workers create worker-led -worker-generated-auth-token=$WORKER_TOKEN Worker information: Active Connection Count: 0 Created Time: Mon, 12 Aug 2025 19:54:57 MDT ID: w_IPfR7jBVri Local Storage State: unknown Type: pki Updated Time: Mon, 12 Aug 2025 19:54:57 MDT Version: 1 Scope: ID: global Name: global Type: global Authorized Actions: update delete add-worker-tags set-worker-tags remove-worker-tags no-op readCreate credentials for the openssh-target.
Locate the
sandbox projectscope id.Create a new static credential store:
$ boundary credential-stores create static \ -name "SSH Credentials" \ -scope-id $PROJECT_IDCopy the credential store ID from the output, such as
csst_xNlFeo0sIb.The openssh
passwordattribute must be passed as an environment variable, or from a file. Export it as an env var:$ export OPENSSH_PASSWORD=passwordCreate a new credential of type
username-password. Pass in the credential store ID you copied in the last step.$ boundary credentials create username-password \ -name "openssh credentials" \ -credential-store-id $BOUNDARY_CRED_STORE_ID \ -username admin \ -password env://OPENSSH_PASSWORDCopy the credential ID from the output, such as
credup_d0vdR0XxCw.Create a new target.
Create a target for the
opensshhost. You can create the target using the CLI or Admin UI.An egress worker filter specifies which worker has access to the target, such as a worker deployed in the same network as the target.
Recall the tags associated with the
openssh-worker, which also provides access to theopensshhost:Tags: Configuration: type: ["worker" "openssh"] Canonical: type: ["worker" "openssh"]The tags for this worker are:
"type" = ["worker", "openssh"]An appropriate filter to select this worker is:
"openssh" in "/tags/type"Create a new target of type
tcpnamedopenssh-target.Set the default port to
2222, and set the egress worker filter. You can get the project ID from the Admin UI or CLI.$ boundary targets create tcp -scope-id $PROJECT_ID \ -name "openssh-target" \ -alias "openssh.target" \ -session-connection-limit -1 \ -address "127.0.0.1" \ -default-port 2222 \ -egress-worker-filter '"openssh" in "/tags/type"'Copy the target ID from the output, such as
tssh_4B5TnVtlbb.Now associate
openssh-targetwith the credential library. Pass in the target ID and credential ID you copied earlier.$ boundary targets add-credential-sources -id $TARGET_ID -brokered-application-credential-source $TARGET_CREDENTIAL_IDTest the target connection.
From the boundary-workstation, test the openssh-target.
Enter
yeswhen prompted to establish the connection.$ boundary connect ssh -target-id $TARGET_ID Welcome to OpenSSH Server 3fe7e57f5505:~$
Other sandboxes
Explore sandboxes for other HashiCorp products that you might find useful.