docs: Restructure table of contents (#3230)
* docs: Restructure table of contents * docs: Copy edits to Develop/Get started sections * docs: Add index to HCP Boundary section * docs: Move OSS/Install section to top-level * docs: Move Concepts above Configuration
This commit is contained in:
1 parent
dba7d88523
commit
d49b7ae629
22 files changed
+361
-486
No files matched your search
@@ -1,41 +0,0 @@
|
||||
---
|
||||
layout: docs
|
||||
page_title: Documentation
|
||||
description: Building Boundary
|
||||
---
|
||||
|
||||
# Building Boundary
|
||||
|
||||
Building Boundary from source requires:
|
||||
|
||||
- [Go](https://golang.org/dl/). Boundary developers keep current with new
|
||||
releases of Go in order to take advantage of new features and to ensure that
|
||||
security issues within Go are addressed. If building Boundary yourself, always
|
||||
use the latest version and keep current.
|
||||
- `make` installed
|
||||
- [Docker](https://docs.docker.com/get-docker/) installed
|
||||
- Basic development environment (git, xcode if you're on Mac, etc)
|
||||
|
||||
1. `$ git clone https://github.com/hashicorp/boundary` or if you're using SSH auth for
|
||||
github, `$ git clone git@github.com:hashicorp/boundary`
|
||||
2. `$ cd boundary`
|
||||
3. `$ make install`
|
||||
|
||||
The first time you run `make install` it will build UI assets, which will take a
|
||||
long time. After the initial build, you can update those assets to the
|
||||
currently-pinned version via `make build-ui`.
|
||||
|
||||
Once you've built Boundary, the binary will be available at `<repo path>/bin/boundary`. Move this
|
||||
binary to somewhere in your `$PATH` such as `/usr/local/bin`.
|
||||
|
||||
## Cross Platform Build
|
||||
|
||||
If you need to cross compile boundary for another OS or architecture, use the [GOOS and GOARCH](https://github.com/hashicorp/boundary/blob/master/scripts/build.sh#L26)
|
||||
environment variable to set this. Example: `$ GOOS=linux GOARCH=amd64 make install`
|
||||
|
||||
For more details, please consult the [Boundary project on GitHub](https://github.com/hashicorp/boundary#build-and-start-boundary-in-dev-mode).
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
UI assets are built inside a Docker container. If this build step fails, try
|
||||
increasing memory and swap available to Docker.
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
layout: docs
|
||||
page_title: Developing Boundary
|
||||
description: Developing Boundary
|
||||
---
|
||||
|
||||
# Developing Boundary
|
||||
|
||||
The side-bar contains some common development tasks, but for the most up-to-date information about developing Boundary, please consult
|
||||
our [project on GitHub](https://github.com/hashicorp/boundary) for more information.
|
||||
@@ -1,21 +0,0 @@
|
||||
---
|
||||
layout: docs
|
||||
page_title: Developing the UI
|
||||
description: Developing the Boundary User Interface
|
||||
---
|
||||
|
||||
# Developing the Boundary User Interface
|
||||
|
||||
For detailed instructions and the most up-to-date information on developing the
|
||||
Boundary admin UI, please consult [the project README on GitHub](https://github.com/hashicorp/boundary-ui).
|
||||
|
||||
## Run a Local Fork of the UI Locally in Dev Mode
|
||||
|
||||
If you're developing the Boundary UI locally you can point a dev mode server at a
|
||||
local checkout of the repo without building it into the binary. We call this
|
||||
directory a passthrough directory, and you can enable it using an env var while in
|
||||
conjunction with running Boundary in dev mode:
|
||||
|
||||
```bash
|
||||
BOUNDARY_DEV_UI_PASSTHROUGH_DIR=../boundary-ui/ui/admin/dist boundary dev
|
||||
```
|
||||
@@ -1,220 +0,0 @@
|
||||
---
|
||||
layout: docs
|
||||
page_title: Connect to Dev Mode Target
|
||||
description: |-
|
||||
Connecting to your first target
|
||||
---
|
||||
|
||||
## Connect to Your First Target
|
||||
|
||||
The default target is a `tcp` target with a default port of `22` (which
|
||||
corresponds to the default SSH port using TCP). This target is set up with
|
||||
`127.0.0.1` as its address. When you execute `boundary connect` against this
|
||||
target, a local authenticated proxy to the address is established on the
|
||||
target's default port (`127.0.0.1:22`).
|
||||
|
||||
```shell-session
|
||||
$ boundary connect -target-id ttcp_1234567890
|
||||
```
|
||||
|
||||
There is also a secondary `tcp` target with (`ttcp_0987654321`) which uses host
|
||||
sets instead of an address. The host sets for this target contain the default
|
||||
host, which has the address 127.0.0.1. When you execute `boundary connect`
|
||||
against this target, the single available host will be selected and a local
|
||||
authenticated proxy to the host is also established on the target's default port
|
||||
(127.0.0.1:22).
|
||||
|
||||
```shell-session
|
||||
boundary connect -target-id ttcp_0987654321
|
||||
```
|
||||
|
||||
For the purpose of this guide, both of these targets accomplish the same goal,
|
||||
however they have different purposes. Refer to the
|
||||
[domain](/boundary/docs/concepts/domain-model/index) documentation for more information.
|
||||
|
||||
For the rest of this guide, assume the default is used.
|
||||
|
||||
The output displays the address and port that your SSH client must utilize. In
|
||||
the next section the `ssh` connect helper is used to make it easier to connect
|
||||
to the target with a client.
|
||||
|
||||
The `boundary connect` command has a number of notable options, such as
|
||||
`-listen-port` to choose the port on which the connect command will listen for
|
||||
an incoming connection. This is convenient for allowing Boundary to work with
|
||||
applications that allow you to select the connection address but not the port.
|
||||
For many applications, there are still some extra hurdles that can exist, which
|
||||
is why connect helpers can be useful.
|
||||
|
||||
The dev-mode default target allows you to make as many connections as you want
|
||||
within the authorized session. When you are finished making connections, simply
|
||||
`Ctrl-C/Command-C` the `boundary connect` process to shut down the session.
|
||||
|
||||
### Using Connect Helpers
|
||||
|
||||
Boundary includes connect helpers that automatically accept host SSH key prompts
|
||||
for you. These are written as `boundary connect <subcommand>`.
|
||||
|
||||
In the following example, the helper will automatically execute `ssh` for you,
|
||||
filling in the local address and port. An expected host ID is set to avoid
|
||||
warnings on future connections when a different port is allocated automatically.
|
||||
A host key must still be accepted upon first connect.
|
||||
|
||||
```shell-session
|
||||
$ boundary connect ssh -target-id ttcp_1234567890
|
||||
```
|
||||
|
||||
If you want to pass additional flags to the SSH client, add them to the command
|
||||
line separated by a double-dash; anything after the double dash will be passed
|
||||
to the executed client. For instance:
|
||||
|
||||
```shell-session
|
||||
$ boundary connect ssh -target-id ttcp_1234567890 -- -l some-other-user
|
||||
```
|
||||
|
||||
There is also a `-style` flag to allow the command to format arguments in a
|
||||
different style expected by different SSH clients. Besides the default `ssh`,
|
||||
the `boundary connect ssh` command supports `-style putty` to support passing
|
||||
connection information to PuTTY.
|
||||
|
||||
One advantage to styles is that Boundary will provide information to the client
|
||||
in the format that makes sense. For example, the `-username` flag is used to
|
||||
specify a username other than your currently logged-in user. This ensures that
|
||||
regardless of your `-style` choice, the username is properly passed to the
|
||||
executed client, and you don't need to figure out the syntax yourself.
|
||||
|
||||
## Selecting Targets
|
||||
|
||||
When using `boundary connect` you must identify the target used for connecting.
|
||||
Convention in this documentation is to use the target ID because it refers to a
|
||||
single explicit value, however other flags are supported:
|
||||
|
||||
- `target-name`: The name of the target
|
||||
- `target-scope-id`: The ID of the scope in which the target lives
|
||||
- `target-scope-name`: The name of the scope in which the target lives
|
||||
|
||||
Note however that these are not uniquely identifying, as names can be re-used
|
||||
across scopes. As a result, when not using the target ID, you must use the
|
||||
target's name in conjunction with the scope name or scope ID so that Boundary
|
||||
can correctly identify the desired target.
|
||||
|
||||
Here is an SSH example in dev mode:
|
||||
|
||||
```shell-session
|
||||
$ boundary connect ssh -target-name "Generated target" -target-scope-name "Generated project scope"
|
||||
```
|
||||
|
||||
## Built-In vs. Exec
|
||||
|
||||
Boundary comes with built-in wrappers for popular layer 7 connection protocols,
|
||||
such as:
|
||||
|
||||
- `ssh`: defaults to the local SSH client (`ssh`)
|
||||
- `postgres`: defaults to the official Postgres CLI client (`psql`)
|
||||
- `rdp`: defaults to the built-in Windows RDP client (`mstsc`)
|
||||
- `http`: defaults to `curl`
|
||||
- `kube`: defaults to `kubectl`
|
||||
|
||||
However, `boundary connect` can accommodate executing clients even when there is
|
||||
no built-in support for a specific client using `-exec`. The `-exec` flag is a
|
||||
very powerful tool, allowing you to wrap Boundary TCP sessions in your preferred
|
||||
client. You can use this flag to create an authenticated proxy to almost
|
||||
anything.
|
||||
|
||||
Whether using `-exec` or one of the listed helpers, you can pass flags to the
|
||||
executed command by including them after a double-dash `--`:
|
||||
|
||||
```shell-session
|
||||
$ boundary connect ssh -target-id ttcp_1234567890 -- -l myuser -i ~/.ssh/identity
|
||||
```
|
||||
|
||||
You also have access to some templated values that are substituted into the
|
||||
command arguments, and these values are additionally injected as environment
|
||||
variables in the executed command:
|
||||
|
||||
- `{{boundary.ip}}` (`BOUNDARY_PROXIED_IP`): The IP address of the listening
|
||||
socket that `boundary connect` has opened.
|
||||
- `{{boundary.port}}` (`BOUNDARY_PROXIED_PORT`): The port of the listening
|
||||
socket that `boundary connect` has opened.
|
||||
- `{{boundary.addr}}` (`BOUNDARY_PROXIED_ADDR`): The host:port format of the
|
||||
address. This is essentially equivalent to `{{boundary.ip}}:{{boundary.port}}`.
|
||||
|
||||
For example, if you wanted to use Boundary to create an authenticated firewall
|
||||
around 'curl', you could update the default TCP target from a default port
|
||||
of `:22` to `:443`:
|
||||
|
||||
```shell-session
|
||||
$ boundary targets update tcp -default-port 443 -id ttcp_1234567890
|
||||
|
||||
Target information:
|
||||
Address: 127.0.0.1
|
||||
Created Time: Fri, 25 Sep 2020 18:35:47 PDT
|
||||
Description: Provides an initial target in Boundary
|
||||
ID: ttcp_1234567890
|
||||
Name: Generated target
|
||||
Session Connection Limit: 1
|
||||
Session Max Seconds: 28800
|
||||
Type: tcp
|
||||
Updated Time: Fri, 25 Sep 2020 18:36:18 PDT
|
||||
Version: 2
|
||||
|
||||
Scope:
|
||||
ID: p_1234567890
|
||||
Name: Generated project scope
|
||||
Parent Scope ID: o_1234567890
|
||||
Type: project
|
||||
|
||||
Attributes:
|
||||
Default Port: 443
|
||||
```
|
||||
|
||||
In the output above the default port for the target has now changed to `:443`.
|
||||
|
||||
Now, `curl` can be used as the executed client for the TCP target session to do
|
||||
an authenticated download of hashicorp.com:
|
||||
|
||||
```shell-session
|
||||
$ boundary connect -exec curl -target-id ttcp_1234567890 \
|
||||
-- -vvsL --output /dev/null hashicorp.com
|
||||
|
||||
* Trying 76.76.21.21...
|
||||
* TCP_NODELAY set
|
||||
* Connected to hashicorp.com (76.76.21.21) port 80 (#0)
|
||||
> GET / HTTP/1.1
|
||||
> Host: hashicorp.com
|
||||
> User-Agent: curl/7.64.1
|
||||
> Accept: */*
|
||||
...<truncated output>...
|
||||
```
|
||||
|
||||
Note that `-exec` is available for subcommands that wrap clients as well. As an
|
||||
example, if `putty.exe` is available on a Windows host but the command is being
|
||||
run from WSL, the following allows usage of the wrapper while specifying the
|
||||
correct available binary (as WSL must use `.exe` when invoking Windows binaries):
|
||||
|
||||
```shell-session
|
||||
$ boundary connect ssh -style putty -exec putty.exe -target-id ttcp_1234567890
|
||||
```
|
||||
|
||||
## Connect using Desktop Client
|
||||
|
||||
While using the desktop client, choose the target and connect to retrieve local
|
||||
proxy details.
|
||||
|
||||
<video
|
||||
muted
|
||||
playsInline
|
||||
autoPlay
|
||||
loop
|
||||
class="boundary-clickthrough-video boundary-clickthrough-desktop-video"
|
||||
>
|
||||
<source
|
||||
type="video/mp4"
|
||||
src="https://www.datocms-assets.com/2885/1613612836-boundary-desktop-clickthrough-connect-target-v1-0-0.mp4"
|
||||
/>
|
||||
</video>
|
||||
|
||||
## Next Steps
|
||||
|
||||
See our [basic administration
|
||||
workflows](/boundary/tutorials/oss-administration)
|
||||
for in depth discussion on managing scopes, targets, identities, and sessions.
|
||||
@@ -1,70 +0,0 @@
|
||||
---
|
||||
layout: docs
|
||||
page_title: What is Dev Mode?
|
||||
description: Getting started with Boundary OSS in Dev mode
|
||||
---
|
||||
|
||||
# What is Dev Mode?
|
||||
|
||||
Before getting started with Boundary OSS, it's important to understand a few key
|
||||
concepts. Please consult our [Boundary concepts](/boundary/docs/concepts) page to
|
||||
familiarize yourself with Boundary's architecture and terminology.
|
||||
|
||||
Dev mode is a method for getting started with Boundary quickly for testing and
|
||||
learning purposes. As the name implies, dev mode is not a production
|
||||
installation method, and provides a way to get Boundary running with a Postgres
|
||||
database easily. Do not use dev mode in a production environment, see the
|
||||
[Production Installation](/boundary/docs/oss/installing/high-availability) section for
|
||||
production-ready deployment methods.
|
||||
|
||||
Dev mode brings up a fully-functioning instance of Boundary, including:
|
||||
|
||||
- A controller server
|
||||
- A worker server
|
||||
- A Postgres database
|
||||
|
||||
These components should all be considered ephemeral - no data persistence occurs
|
||||
across dev mode restarts. Along with these external components, dev mode also
|
||||
creates several resources within Boundary to make it easier and faster to
|
||||
connect to your first target:
|
||||
|
||||
1. An org [scope](/boundary/docs/concepts/domain-model/scopes) and a project scope with a
|
||||
default ID of `o_1234567890` and `p_1234567890` respectively.
|
||||
1. A password [auth method](/boundary/docs/concepts/domain-model/auth-methods) with a
|
||||
default auth method ID of `ampw_1234567890`.
|
||||
1. An OIDC [auth method](/boundary/docs/concepts/domain-model/auth-methods) with a
|
||||
default auth method ID of `amoidc_1234567890`.
|
||||
1. An admin user with login name `admin` and password `password`.
|
||||
1. An unprivileged user with login name `user` and password `password`.
|
||||
1. A static [host catalog](/boundary/docs/concepts/domain-model/host-catalogs) with a
|
||||
default ID of `hcst_1234567890`.
|
||||
1. A static [host](/boundary/docs/concepts/domain-model/hosts) and [host
|
||||
set](/boundary/docs/concepts/domain-model/host-sets) with default ID's of
|
||||
`hst_1234567890` and `hsst_1234567890` respectively.
|
||||
1. A TCP [target](/boundary/docs/concepts/domain-model/targets) with a default ID of
|
||||
`ttcp_1234567890`, directly set-up with an address and port.
|
||||
1. A TCP [target](/boundary/docs/concepts/domain-model/targets) with a default ID of
|
||||
`ttcp_0987654321` using the previously mentioned static host set.
|
||||
|
||||
The default ID suffixes can be overwritten or randomly generated, and there are
|
||||
many other dev mode controls. To see a complete list of these override flags,
|
||||
consult `boundary dev -h`.
|
||||
|
||||
If you plan on provisioning a large number of resources in dev mode, it's
|
||||
strongly recommended that users leverage our [Terraform Provider for
|
||||
Boundary](https://github.com/hashicorp/terraform-provider-boundary) for managing
|
||||
configuration of Boundary. This will simplify starting up and shutting down your
|
||||
Boundary dev instance.
|
||||
|
||||
## Requirements
|
||||
|
||||
There are a few requirements for running dev mode:
|
||||
|
||||
- [Docker](https://docs.docker.com/get-docker/) is installed
|
||||
- A route to download the [Postgres Docker
|
||||
image](https://hub.docker.com/_/postgres) is available or a local image cache
|
||||
is available
|
||||
- A [Boundary binary](/boundary/downloads) in your `$PATH`
|
||||
- _Optionally_, an [installation of Boundary
|
||||
Desktop](/boundary/tutorials/oss-getting-started/oss-getting-started-desktop-app)
|
||||
if you want to use the desktop examples
|
||||
@@ -1,49 +0,0 @@
|
||||
---
|
||||
layout: docs
|
||||
page_title: High Availability Installation
|
||||
description: |-
|
||||
How to install Boundary as a high availability service
|
||||
---
|
||||
|
||||
# High Availability Installation
|
||||
|
||||
Installing Boundary as a high availability service requires certain infrastructure considerations. At the most basic level, running 3 controller and 3 worker instances gives a fundamental level of high availability for the control plane (controller), as well as bandwidth for a number of sessions on the data plane (worker). Both server types should be run in a fault-tolerant configuration, that is, in a self-healing environment such as an auto-scaling group. The documentation here does not cover self-healing infrastructure and assumes the operator has their preferred scheduling methods for these environments.
|
||||
|
||||
## Network Requirements
|
||||
|
||||
The following ports should be available:
|
||||
|
||||
- Clients must have access to the Controller's `api` port (default 9200)
|
||||
- Clients must have access to the Worker's port (default 9202)
|
||||
- Workers must have access to the Controller's `cluster` port (default 9201)
|
||||
- Workers must have a route and port access to the hosts defined within the system in order to provide connectivity
|
||||
|
||||
## Architecture
|
||||
|
||||
The general architecture for the server infrastructure requires 3 controllers and 3 workers. Note that it is possible to run a controller and worker within the same process, but the guide here assumes separate deployments. The documentation here uses virtual machines running on Amazon EC2 as the example environment, but this use case can be extrapolated to almost any cloud platform to suit operator needs:
|
||||
|
||||

|
||||
|
||||
As shown above, Boundary is broken up into its controller and worker server components across 3 [EC2 instances](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance), in
|
||||
3 separate [subnets](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/subnet), in three separate availability zones, with the controller API and UI being publically exposed by an [application load balancer (ALB)](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb). The worker and controller VM's are in independent [auto-scaling groups](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/autoscaling_group), allowing them to maintain their exact capacity.
|
||||
|
||||
The workers must be able to establish a connection to the hosts with which they interact. In the architecture above, we place them in the public subnet so our remote client can establish a session between them and the target VM.
|
||||
|
||||
Boundary requires an external [Postgres](https://www.postgresql.org/) and [KMS](https://aws.amazon.com/kms/). In the example above, we're using AWS managed services for these components. For Postgres, we're using [RDS](https://aws.amazon.com/rds/) and for KMS we're using Amazon's [Key Management Service](https://aws.amazon.com/kms/).
|
||||
|
||||
## Architecture Breakdown
|
||||
|
||||
### API and Console Load Balancer
|
||||
|
||||
Load balancing the controller allows operators to secure the ingress to the Boundary system. We recommend placing all Boundary servers in private networks and using load balancing techniques to expose services such as the API and administrative console to public networks. In the high availability architecture, we recommend load balancing using a layer 7 load balancer and further constraining ingress to that load balancer with layer 4 constraints such as [security groups](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html) or [IP tables](https://wiki.archlinux.org/index.php/Iptables).
|
||||
|
||||
For general configuration, we recommend the following:
|
||||
|
||||
- HTTPS listener with valid TLS certificate for the domain it's serving or TLS passthrough
|
||||
- Health checks should use TCP port 9200
|
||||
|
||||
### Controller Configuration
|
||||
|
||||
When running Boundary controller as a service we recommend storing the file at `/etc/boundary-controller.hcl`. A `boundary` user and group should exist to manage this configuration file and to further restrict who can read and modify it.
|
||||
|
||||
For detailed configuration options, see our [configuration docs](/boundary/docs/configuration).
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
layout: docs
|
||||
page_title: Installing Boundary
|
||||
description: |-
|
||||
How to install boundary.
|
||||
---
|
||||
|
||||
# Overview
|
||||
|
||||
This section covers installing Boundary for different modes of operation and across different environments
|
||||
|
||||
For community-supported reference architectures, please see [Reference Architectures](/boundary/docs/oss/installing/reference-architectures).
|
||||
|
||||

|
||||
@@ -1,486 +0,0 @@
|
||||
---
|
||||
layout: docs
|
||||
page_title: Running Boundary in Non-Dev Environments
|
||||
description: |-
|
||||
How to install boundary in non-dev environments.
|
||||
---
|
||||
|
||||
# Installing Boundary Without Generated Resources
|
||||
|
||||
What are generated resources? When you run `boundary dev` or `boundary database init`, Boundary automatically
|
||||
generates a number of resources to make getting started easier. Default scopes, auth methods, user, account, and
|
||||
targets are just some of the resources Boundary will generate unless you tell it not to.
|
||||
|
||||
In a production or long-running environment, these resources are not necessary, but without them, managing
|
||||
Boundary from scratch isn't straight forward. How do you create your first user and login to administer a Boundary
|
||||
deployment that has no authentication methods, users, accounts, etc.? This section describes how to get your freshly
|
||||
deployed Boundary installation off the ground for non-dev environments.
|
||||
|
||||
## Recovery KMS Workflow
|
||||
|
||||
Initializing Boundary without generated resources starts with your Boundary configuration file. Specifically,
|
||||
the controller configuration specifies three KMS blocks:
|
||||
|
||||
```hcl
|
||||
<truncated>
|
||||
kms "aead" {
|
||||
purpose = "root"
|
||||
aead_type = "aes-gcm"
|
||||
key = "sP1fnF5Xz85RrXyELHFeZg9Ad2qt4Z4bgNHVGtD6ung="
|
||||
key_id = "global_root"
|
||||
}
|
||||
|
||||
kms "aead" {
|
||||
purpose = "worker-auth"
|
||||
aead_type = "aes-gcm"
|
||||
key = "8fZBjCUfN0TzjEGLQldGY4+iE9AkOvCfjh7+p0GtRBQ="
|
||||
key_id = "global_worker-auth"
|
||||
}
|
||||
|
||||
kms "aead" {
|
||||
purpose = "recovery"
|
||||
aead_type = "aes-gcm"
|
||||
key = "8fZBjCUfN0TzjEGLQldGY4+iE9AkOvCfjh7+p0GtRBQ="
|
||||
key_id = "global_recovery"
|
||||
}
|
||||
<truncated>
|
||||
```
|
||||
|
||||
In this example, we're using hardcoded AEAD keys, but in a real world non-dev deployment, you
|
||||
should use your cloud provider's KMS such as [AWS KMS](/boundary/docs/configuration/kms/awskms) to manage the keys Boundary
|
||||
uses to encrypt sensitive information.
|
||||
|
||||
The KMS block we're focused on is the `recovery` block. This block specifies the key used to "recover" Boundary
|
||||
but you can also use it to authenticate to Boundary and manage it as a "global" super user. This allows
|
||||
you to authenticate from the CLI or from Terraform in order to manage Boundary without any generated
|
||||
resources.
|
||||
|
||||
To authenticate to Boundary using the recovery KMS workflow:
|
||||
|
||||
<Tabs>
|
||||
<Tab heading="CLI">
|
||||
|
||||
|
||||
To use the recovery workflow on the CLI, you must pass the `-recovery-config <path_to_kms_recovery_config>` flag or set the environment
|
||||
variable for `BOUNDARY_RECOVERY_CONFIG` for every command ran. Authentication takes place for every command
|
||||
ran when using the recovery workflow, there is no `boundary authenticate` step:
|
||||
|
||||
```bash
|
||||
$ cat << EOF > /tmp/recovery.hcl
|
||||
kms "aead" {
|
||||
purpose = "recovery"
|
||||
aead_type = "aes-gcm"
|
||||
key = "8fZBjCUfN0TzjEGLQldGY4+iE9AkOvCfjh7+p0GtRBQ="
|
||||
key_id = "global_recovery"
|
||||
}
|
||||
EOF
|
||||
|
||||
$ boundary users create <truncated> -recovery-config /tmp/recovery.hcl
|
||||
...
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab heading="Terraform">
|
||||
|
||||
|
||||
To configure your provider to use the recovery KMS workflow, provide the KMS block as the value for
|
||||
`recovery_kms_hcl`:
|
||||
|
||||
```hcl
|
||||
provider "boundary" {
|
||||
addr = 'https://boundary.mycorp.com:9200'
|
||||
recovery_kms_hcl = <<EOT
|
||||
kms "aead" {
|
||||
purpose = "recovery"
|
||||
aead_type = "aes-gcm"
|
||||
key = "8fZBjCUfN0TzjEGLQldGY4+iE9AkOvCfjh7+p0GtRBQ="
|
||||
key_id = "global_recovery"
|
||||
}
|
||||
EOT
|
||||
}
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
|
||||
## Initialize the Database
|
||||
|
||||
Before you can start Boundary, the database must be initialized. It's useful to look at the help output for the init command:
|
||||
|
||||
```
|
||||
$ boundary database init -h
|
||||
...
|
||||
```
|
||||
|
||||
From this command, you can see the flags available to skip the creation of auto-generated resources.
|
||||
|
||||
To initialize the Boundary database without generated resources:
|
||||
|
||||
```
|
||||
$ boundary database init \
|
||||
-skip-auth-method-creation \
|
||||
-skip-host-resources-creation \
|
||||
-skip-scopes-creation \
|
||||
-skip-target-creation \
|
||||
-config /etc/boundary.hcl
|
||||
```
|
||||
|
||||
When you start Boundary, you will effectively have a blank sheet to work against. The initial migrations in the database have been run (note that this includes creating special users like `u_anon` and the `global` scope) and the internal keyrings have been initialized. From here, it's required that
|
||||
you use the KMS recovery workflow described above to create at a minimum an auth method, a user, an account, and a
|
||||
role with sufficient grants. Otherwise, you need to continue to use the recovery workflow for management. It's important
|
||||
to realize that this is effectively a global super user type of workflow and comes with security concerns.
|
||||
|
||||
## Creating Your First Login Account
|
||||
|
||||
This section covers how to configure your first auth method, user, account, and role to login to Boundary without
|
||||
the recovery KMS workflow. In this example, we're going to make an admin user for the global and project level
|
||||
scopes we create. This will allow our user to configure targets within those scopes and manage them.
|
||||
|
||||
### Create Org and Project Scopes
|
||||
|
||||
In this example, we're going to create an org and project scope and skip creating an administrator and admin role
|
||||
for each scope. We're going to specify a role for managing these scopes by selected users in a later step.
|
||||
|
||||
<Tabs>
|
||||
<Tab heading="CLI">
|
||||
|
||||
|
||||
```bash
|
||||
$ boundary scopes create -name 'org' -scope-id 'global' \
|
||||
-recovery-config /tmp/recovery.hcl \
|
||||
-skip-admin-role-creation \
|
||||
-skip-default-role-creation
|
||||
<truncated>
|
||||
|
||||
$ boundary scopes create -name 'project' -scope-id <org_scope_id_from_last_step> \
|
||||
-recovery-config /tmp/recovery.hcl \
|
||||
-skip-admin-role-creation \
|
||||
-skip-default-role-creation
|
||||
<truncated>
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab heading="Terraform">
|
||||
|
||||
|
||||
```hcl
|
||||
resource "boundary_scope" "org" {
|
||||
scope_id = "global"
|
||||
name = "organization"
|
||||
description = "Organization scope"
|
||||
|
||||
auto_create_admin_role = false
|
||||
auto_create_default_role = false
|
||||
}
|
||||
|
||||
resource "boundary_scope" "project" {
|
||||
name = "project"
|
||||
description = "My first project"
|
||||
scope_id = boundary_scope.org.id
|
||||
auto_create_admin_role = false
|
||||
auto_create_default_role = false
|
||||
}
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
|
||||
### Create an Auth Method
|
||||
|
||||
Create an auth method in the organization scope.
|
||||
|
||||
<Tabs>
|
||||
<Tab heading="CLI">
|
||||
|
||||
|
||||
```bash
|
||||
$ boundary auth-methods create password \
|
||||
-recovery-config /tmp/recovery.hcl \
|
||||
-scope-id <org_scope_id> \
|
||||
-name 'my_method' \
|
||||
-description 'My password auth method'
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab heading="Terraform">
|
||||
|
||||
|
||||
```hcl
|
||||
resource "boundary_auth_method" "password" {
|
||||
name = "my_password_auth_method"
|
||||
description = "Password auth method"
|
||||
type = "password"
|
||||
scope_id = boundary_scope.org.id
|
||||
}
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
|
||||
### Create a Login Account
|
||||
|
||||
Create a login account for the auth method.
|
||||
|
||||
<Tabs>
|
||||
<Tab heading="CLI">
|
||||
|
||||
|
||||
```bash
|
||||
$ boundary accounts create password \
|
||||
-recovery-config /tmp/recovery.hcl \
|
||||
-login-name "myuser" \
|
||||
-auth-method-id <auth_method_id_from_last_step>
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab heading="Terraform">
|
||||
|
||||
|
||||
```hcl
|
||||
resource "boundary_account" "myuser" {
|
||||
name = "myuser"
|
||||
description = "User account for my user"
|
||||
type = "password"
|
||||
login_name = "myuser"
|
||||
password = "foofoofoo"
|
||||
auth_method_id = boundary_auth_method.password.id
|
||||
}
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
|
||||
### Create a User
|
||||
|
||||
Create a user and associate the user with the login account created in the previous step.
|
||||
This user will also be the principal in the role we create in the following step.
|
||||
|
||||
<Tabs>
|
||||
<Tab heading="CLI">
|
||||
|
||||
|
||||
```bash
|
||||
$ boundary users create -scope-id <org_scope_id> \
|
||||
-recovery-config /tmp/recovery.hcl \
|
||||
-name "myuser" \
|
||||
-description "My user!"
|
||||
|
||||
$ boundary users add-accounts \
|
||||
-recovery-config /tmp/recovery.hcl \
|
||||
-id <myuser_user_id> \
|
||||
-account <myuser_account_id>
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab heading="Terraform">
|
||||
|
||||
|
||||
```hcl
|
||||
resource "boundary_user" "myuser" {
|
||||
name = "myuser"
|
||||
description = "My user!"
|
||||
account_ids = [boundary_account.myuser.id]
|
||||
scope_id = boundary_scope.org.id
|
||||
}
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
|
||||
### Create Roles to Manage Scopes
|
||||
|
||||
The following describes the four baseline roles you'll need to create to manage resources within the org and project
|
||||
scopes created above. These roles are similar to the roles created for you if generation had not been skipped during `boundary database init` when executed with the `-skip-initial-login-role-creation` flag, Declaring roles explicitly
|
||||
allows you to manage them independently and fully within Terraform or via the CLI. In doing so, you can precisely define their access.
|
||||
|
||||
The following example creates 4 roles:
|
||||
|
||||
1. To allow anonymous (unauthenticated) users the ability to list scopes and auth methods in the global scope.
|
||||
1. To allow anonymous (unauthenticated) users the ability to list scopes and auth methods in the organization scope.
|
||||
1. To allow `myuser` user administration grants at the org scope.
|
||||
1. To allow `myuser` user administration grants at the project scope.
|
||||
|
||||
#### Anonymous listing role for global scope
|
||||
|
||||
<Tabs>
|
||||
<Tab heading="CLI">
|
||||
|
||||
|
||||
Assumes recovery key export from above steps is still set:
|
||||
|
||||
```bash
|
||||
# Create global anonymous listing role
|
||||
$ boundary roles create -name 'global_anon_listing' \
|
||||
-recovery-config /tmp/recovery.hcl \
|
||||
-scope-id 'global'
|
||||
|
||||
$ boundary roles add-grants -id <global_anon_listing_id> \
|
||||
-recovery-config /tmp/recovery.hcl \
|
||||
-grant 'id=*;type=auth-method;actions=list,authenticate' \
|
||||
-grant 'id=*;type=scope;actions=list,no-op' \
|
||||
-grant 'id={{.Account.Id}};actions=read,change-password'
|
||||
|
||||
$ boundary roles add-principals -id <global_anon_listing_id> \
|
||||
-recovery-config /tmp/recovery.hcl \
|
||||
-principal 'u_anon'
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab heading="Terraform">
|
||||
|
||||
|
||||
```hcl
|
||||
resource "boundary_role" "global_anon_listing" {
|
||||
scope_id = "global"
|
||||
grant_strings = [
|
||||
"id=*;type=auth-method;actions=list,authenticate",
|
||||
"id=*;type=scope;actions=list,no-op",
|
||||
"id={{.Account.Id}};actions=read,change-password"
|
||||
]
|
||||
principal_ids = ["u_anon"]
|
||||
}
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
|
||||
#### Anonymous listing role for org scope
|
||||
|
||||
<Tabs>
|
||||
<Tab heading="CLI">
|
||||
|
||||
|
||||
Assumes recovery key export from above steps is still set:
|
||||
|
||||
```bash
|
||||
$ boundary roles create -name 'org_anon_listing' \
|
||||
-recovery-config /tmp/recovery.hcl \
|
||||
-scope-id <org_scope_id>
|
||||
|
||||
$ boundary roles add-grants -id <org_anon_listing_id> \
|
||||
-recovery-config /tmp/recovery.hcl \
|
||||
-grant 'id=*;type=auth-method;actions=list,authenticate' \
|
||||
-grant 'type=scope;actions=list' \
|
||||
-grant 'id={{.Account.Id}};actions=read,change-password'
|
||||
|
||||
$ boundary roles add-principals -id <org_anon_listing_id> \
|
||||
-recovery-config /tmp/recovery.hcl \
|
||||
-principal 'u_anon'
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab heading="Terraform">
|
||||
|
||||
|
||||
```hcl
|
||||
resource "boundary_role" "org_anon_listing" {
|
||||
scope_id = boundary_scope.org.id
|
||||
grant_strings = [
|
||||
"id=*;type=auth-method;actions=list,authenticate",
|
||||
"type=scope;actions=list",
|
||||
"id={{.Account.Id}};actions=read,change-password"
|
||||
]
|
||||
principal_ids = ["u_anon"]
|
||||
}
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
|
||||
#### Org admin role for myuser
|
||||
|
||||
<Tabs>
|
||||
<Tab heading="CLI">
|
||||
|
||||
|
||||
Assumes recovery key export from above steps is still set:
|
||||
|
||||
```bash
|
||||
$ boundary roles create -name 'org_admin' \
|
||||
-recovery-config /tmp/recovery.hcl \
|
||||
-scope-id 'global' \
|
||||
-grant-scope-id <org_scope_id>
|
||||
|
||||
$ boundary roles add-grants -id <org_admin_id> \
|
||||
-recovery-config /tmp/recovery.hcl \
|
||||
-grant 'id=*;type=*;actions=*'
|
||||
|
||||
$ boundary roles add-principals -id <org_admin_id> \
|
||||
-recovery-config /tmp/recovery.hcl \
|
||||
-principal <myuser_user_id>
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab heading="Terraform">
|
||||
|
||||
|
||||
```hcl
|
||||
resource "boundary_role" "org_admin" {
|
||||
scope_id = "global"
|
||||
grant_scope_id = boundary_scope.org.id
|
||||
grant_strings = [
|
||||
"id=*;type=*;actions=*"
|
||||
]
|
||||
principal_ids = [boundary_user.myuser.id]
|
||||
}
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
|
||||
#### Project admin for myuser
|
||||
|
||||
<Tabs>
|
||||
<Tab heading="CLI">
|
||||
|
||||
|
||||
Assumes recovery key export from above steps is still set:
|
||||
|
||||
```bash
|
||||
$ boundary roles create -name 'project_admin' \
|
||||
-recovery-config /tmp/recovery.hcl \
|
||||
-scope-id <org_scope_id> \
|
||||
-grant-scope-id <project_scope_id>
|
||||
|
||||
$ boundary roles add-grants -id <project_admin_id> \
|
||||
-recovery-config /tmp/recovery.hcl \
|
||||
-grant 'id=*;type=*;actions=*'
|
||||
|
||||
$ boundary roles add-principals -id <project_admin_id> \
|
||||
-recovery-config /tmp/recovery.hcl \
|
||||
-principal <myuser_user_id>
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab heading="Terraform">
|
||||
|
||||
|
||||
```hcl
|
||||
resource "boundary_role" "project_admin" {
|
||||
scope_id = boundary_scope.org.id
|
||||
grant_scope_id = boundary_scope.project.id
|
||||
grant_strings = [
|
||||
"id=*;type=*;actions=*"
|
||||
]
|
||||
principal_ids = [boundary_user.myuser.id]
|
||||
}
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
|
||||
### Login as Your New User
|
||||
|
||||
```shell-session
|
||||
boundary authenticate password \
|
||||
-auth-method-id <auth_method_id>
|
||||
```
|
||||
@@ -1,43 +0,0 @@
|
||||
---
|
||||
layout: docs
|
||||
page_title: Postgres Installation
|
||||
description: |-
|
||||
Postgres configuration for Boundary
|
||||
---
|
||||
|
||||
# Postgres Configuration
|
||||
|
||||
This section covers Postgres-specific installation requirements.
|
||||
|
||||
## Version
|
||||
|
||||
Boundary has only been tested on Postgres 11 or greater.
|
||||
|
||||
## Network
|
||||
|
||||
Boundary controllers must be able to reach Postgres.
|
||||
In non-HA configurations, this means Boundary servers;
|
||||
if you're running in [high availability](/boundary/docs/oss/installing/high-availability),
|
||||
then the controllers need access to the Postgres server infrastructure.
|
||||
Worker nodes never need access to the database.
|
||||
|
||||
## Users/Roles
|
||||
|
||||
After the database has been initialized,
|
||||
the database user for a Boundary controller
|
||||
only requires permissions for [Data Manipulation](https://www.postgresql.org/docs/current/dml.html)
|
||||
(select, insert, update, and delete) operations.
|
||||
|
||||
Database initialization requires elevated privileges.
|
||||
When initializing the database with the `boundary database init` command,
|
||||
the boundary database user
|
||||
requires the `superuser` role plus `all privileges` on the boundary database.
|
||||
|
||||
## Required Postgres Modules
|
||||
|
||||
Boundary has a dependency on the Postgres
|
||||
[pgcrypto](https://www.postgresql.org/docs/11/pgcrypto.html) module
|
||||
which is one of the standard modules supplied with Postgres.
|
||||
Please see the
|
||||
[Additional Supplied Modules](https://www.postgresql.org/docs/11/contrib.html)
|
||||
page in the Postgres documentation for more information.
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
layout: docs
|
||||
page_title: Reference Architectures
|
||||
description: |-
|
||||
Boundary reference architectures
|
||||
---
|
||||
|
||||
# Reference Architectures
|
||||
A number of community-supported reference architectures for non-dev deployments can be found in Boundary's dedicated [reference architecture repo](https://github.com/hashicorp/boundary-reference-architecture).
|
||||
|
||||
|
||||
While some of the initial reference deployments have been seeded by the Boundary team, the seeded examples are for demonstration purposes only and intended convey how to get Boundary up and running on popular cloud and container platforms.
|
||||
|
||||
For those exploring Boundary in non-dev mode, we highly encourage contributing configurations to the repo such that others may benefit from them.
|
||||
@@ -1,121 +0,0 @@
|
||||
---
|
||||
layout: docs
|
||||
page_title: Run and Login
|
||||
description: |-
|
||||
How to run Boundary services in dev mode and login for the first time.
|
||||
---
|
||||
|
||||
# Run and Login to Boundary
|
||||
|
||||
To start Boundary in dev mode:
|
||||
|
||||
```shell-session
|
||||
$ boundary dev
|
||||
```
|
||||
|
||||
## Login to Boundary
|
||||
|
||||
Boundary uses a predictable login name (`admin`) and password (`password`) in
|
||||
dev mode. These can be overridden, or randomly generated, with flags to
|
||||
`boundary dev`. The auth method resource in the global scope is set as the primary auth method for that scope. This allows you to omit the auth method ID when authenticating, enabling the short-form `boundary authenticate`:
|
||||
|
||||
<Tabs>
|
||||
<Tab heading="CLI">
|
||||
|
||||
|
||||
```shell-session
|
||||
$ boundary authenticate
|
||||
Please enter the login name (it will be hidden):
|
||||
Please enter the password (it will be hidden):
|
||||
```
|
||||
|
||||
If you are on Windows or macOS, the system password store will be used to store
|
||||
the new token. On any other operating system, you may get an error indicating
|
||||
that the token could not be stored. Boundary defaults to using
|
||||
[pass](https://www.passwordstore.org/) on these machines, which uses [GNU
|
||||
Privacy Guard](https://gnupg.org/) to encrypt values. If it is not available,
|
||||
the token will be displayed and can be stored in a system of your choice and
|
||||
passed in via the `BOUNDARY_TOKEN` environment variable.
|
||||
|
||||
It is recommended to make use of `pass` or another alternative (such as any
|
||||
implementation of the freedesktop.org Secret Service feature). Installation and
|
||||
configuration of `pass` or other alternatives is beyond the scope of this
|
||||
article; consult the documentation for `pass` or your specific OS distribution
|
||||
help pages.
|
||||
|
||||
Note that if `-format json` is used on this command, Boundary will not save the
|
||||
token to the system password store. In this case, the authentication information
|
||||
will only be printed to your terminal in JSON format. You can use the
|
||||
`BOUNDARY_TOKEN` environment variable or `-token` flag to provide the token in
|
||||
subsequent commands.
|
||||
|
||||
</Tab>
|
||||
<Tab heading="Admin Console">
|
||||
|
||||
|
||||
To authenticate to the Admin UI, open
|
||||
[http://127.0.0.1:9200](http://127.0.0.1:9200) in a browser and enter the login
|
||||
name and password:
|
||||
|
||||
<video muted playsInline autoPlay loop class="boundary-clickthrough-video">
|
||||
<source
|
||||
type="video/mp4"
|
||||
src="https://www.datocms-assets.com/2885/1602260993-boundary-clickthrough-getting-started-run-and-login.mp4"
|
||||
/>
|
||||
</video>
|
||||
|
||||
</Tab>
|
||||
|
||||
|
||||
<Tab heading="Desktop Client">
|
||||
<p>
|
||||
|
||||
|
||||
To authenticate using the Boundary desktop client, launch Boundary desktop client
|
||||
and connect to boundary to using [http://127.0.0.1:9200](http://127.0.0.1:9200)
|
||||
and enter the login name and password:
|
||||
|
||||
<video
|
||||
muted
|
||||
playsInline
|
||||
autoPlay
|
||||
loop
|
||||
class="boundary-clickthrough-video boundary-clickthrough-desktop-video"
|
||||
>
|
||||
<source
|
||||
type="video/mp4"
|
||||
src="https://www.datocms-assets.com/2885/1613612831-boundary-desktop-clickthrough-authenticate-v1-0-0.mp4"
|
||||
/>
|
||||
</video>
|
||||
|
||||
</p>
|
||||
</Tab>
|
||||
|
||||
|
||||
<Tab heading="Terraform">
|
||||
|
||||
|
||||
You can also use these overrides to configure the [Terraform provider for
|
||||
Boundary](https://github.com/hashicorp/terraform-provider-boundary):
|
||||
|
||||
```hcl
|
||||
provider "boundary" {
|
||||
base_url = "http://127.0.0.1:9200"
|
||||
auth_method_id = "ampw_1234567890"
|
||||
auth_method_username = "admin"
|
||||
auth_method_password = "password"
|
||||
}
|
||||
```
|
||||
|
||||
Note in the example above we're setting `base_url` to `http` and not `https` as
|
||||
the Boundary server does not use TLS in development mode.
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
|
||||
## Next Steps
|
||||
|
||||
See [connecting to your first
|
||||
target](/boundary/docs/oss/installing/connect-to-dev-target) for how to use Boundary to
|
||||
run your first SSH session.
|
||||
@@ -1,90 +0,0 @@
|
||||
---
|
||||
layout: docs
|
||||
page_title: Systemd Installation
|
||||
description: |-
|
||||
How to install Boundary under Systemd on Linux
|
||||
---
|
||||
|
||||
# Installing Boundary under Systemd
|
||||
|
||||
This section covers how to install Boundary under the [systemd](https://systemd.io/) init system on modern Linux distributions. In this section, we'll cover an example of breaking out the controller and worker servers onto separate instances, though you can opt to run both on a single server.
|
||||
|
||||
## Filesystem Configuration
|
||||
|
||||
`TYPE` below can be either `worker` or `controller` if you want to run them independently, e.g. for high availability. If you want to run combined nodes, modify as desired.
|
||||
|
||||
1. `/etc/boundary-${TYPE}.hcl`: Configuration file for the boundary service.
|
||||
|
||||
2. `/usr/local/bin/boundary`: The Boundary binary, which can be built from the [source](https://github.com/hashicorp/boundary) or downloaded from our [release page](/boundary/downloads).
|
||||
|
||||
3. `/etc/systemd/system/boundary-${TYPE}.service`: Systemd unit file for the Boundary service.
|
||||
|
||||
## User & Group Configuration
|
||||
|
||||
We recommend running Boundary as a non-root user and using this user to manage the Boundary process running under systemd. The example init files here do exactly that. Our example install script below creates a user and group on Ubuntu or Debian-like systems.
|
||||
|
||||
## Systemd Unit file
|
||||
|
||||
```
|
||||
[Unit]
|
||||
Description=${NAME} ${TYPE}
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/local/bin/${NAME} server -config /etc/${NAME}-${TYPE}.hcl
|
||||
User=boundary
|
||||
Group=boundary
|
||||
LimitMEMLOCK=infinity
|
||||
Capabilities=CAP_IPC_LOCK+ep
|
||||
CapabilityBoundingSet=CAP_SYSLOG CAP_IPC_LOCK
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
## Systemd All-in-One Installation Script
|
||||
|
||||
Here's a simple install script that creates the `boundary` group and user, installs the
|
||||
systemd unit file, and enables it at startup:
|
||||
|
||||
```
|
||||
#!/bin/bash
|
||||
# Installs the boundary as a service for systemd on linux
|
||||
# Usage: ./install.sh <worker|controller>
|
||||
|
||||
TYPE=$1
|
||||
NAME=boundary
|
||||
|
||||
sudo cat << EOF > /etc/systemd/system/${NAME}-${TYPE}.service
|
||||
[Unit]
|
||||
Description=${NAME} ${TYPE}
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/local/bin/${NAME} server -config /etc/${NAME}-${TYPE}.hcl
|
||||
User=boundary
|
||||
Group=boundary
|
||||
LimitMEMLOCK=infinity
|
||||
Capabilities=CAP_IPC_LOCK+ep
|
||||
CapabilityBoundingSet=CAP_SYSLOG CAP_IPC_LOCK
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
# Add the boundary system user and group to ensure we have a no-login
|
||||
# user capable of owning and running Boundary
|
||||
sudo adduser --system --group boundary || true
|
||||
sudo chown boundary:boundary /etc/${NAME}-${TYPE}.hcl
|
||||
sudo chown boundary:boundary /usr/local/bin/boundary
|
||||
|
||||
# Make sure to initialize the DB before starting the service. This will result in
|
||||
# a database already initialized warning if another controller or worker has done this
|
||||
# already, making it a lazy, best effort initialization
|
||||
if [ "${TYPE}" = "controller" ]; then
|
||||
sudo /usr/local/bin/boundary database init -config /etc/${NAME}-${TYPE}.hcl || true
|
||||
fi
|
||||
|
||||
sudo chmod 664 /etc/systemd/system/${NAME}-${TYPE}.service
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable ${NAME}-${TYPE}
|
||||
sudo systemctl start ${NAME}-${TYPE}
|
||||
```
|
||||
@@ -1,100 +0,0 @@
|
||||
---
|
||||
layout: docs
|
||||
page_title: Boundary Health Endpoints
|
||||
description: |-
|
||||
Verify the Boundary controller server is up and able to receive requests
|
||||
---
|
||||
|
||||
## Boundary Health Endpoints
|
||||
|
||||
Boundary provides health monitoring through the `/health` path using a listener
|
||||
with the `"ops"` purpose. By default, a listener with that purpose runs on port
|
||||
`9203`. See the [example configuration](#example-configuration) section for an
|
||||
example listener stanza in a `config.hcl` file.
|
||||
|
||||
### Requirements
|
||||
|
||||
To enable the controller health endpoint, any Boundary instance must be
|
||||
started with a controller. That is, a `controller` block and a `purpose = "api"`
|
||||
listener must be defined in Boundary's configuration file. Additionally, a
|
||||
`purpose = "ops"` listener must also be defined in Boundary's configuration
|
||||
file. Under these conditions, the `ops` server (which hosts the controller health
|
||||
api) will be exposed.
|
||||
|
||||
### Shutdown Grace Period
|
||||
|
||||
Optionally, when the controller health endpoint is enabled, Boundary can be
|
||||
configured to change the controller health response to `503 Service Unavailable`
|
||||
upon receiving a shutdown signal, and wait a configurable amount of time before
|
||||
starting the shutdown process.
|
||||
|
||||
This feature is designed to integrate with load balancers to reduce the risk of
|
||||
an outgoing Boundary instance causing disruption to incoming requests.
|
||||
|
||||
In this state, Boundary is still capable of processing requests as normal, but
|
||||
will report as unhealthy through the controller health endpoint. In
|
||||
load-balanced environments, this would cause this "unhealthy" instance to be
|
||||
removed from the pool of instances eligible to handle requests, and thereby, reducing the
|
||||
likelihood that it will receive a request to handle during shutdown.
|
||||
|
||||
This feature is disabled by default, even if the controller health endpoint is
|
||||
enabled. You can set it up by defining `graceful_shutdown_wait_duration` in the
|
||||
`controller` block of Boundary's configuration file. The value should be set to
|
||||
a string that is parseable by
|
||||
[ParseDuration](https://pkg.go.dev/time#ParseDuration).
|
||||
|
||||
### API
|
||||
|
||||
The new controller health service introduces a single read-only endpoint:
|
||||
|
||||
| Status | Description |
|
||||
|--------------|----------------------------------------------------------------|
|
||||
| `200` | `GET /health` returns HTTP status 200 OK if the controller's api gRPC Server is up |
|
||||
| `5xx` | `GET /health` returns HTTP status `5XX` or request timeout if unhealthy |
|
||||
| `503` | `GET /health` returns HTTP status `503 Service Unavailable` status if the controller is shutting down |
|
||||
|
||||
All responses return empty bodies. `GET /health` does not support any input.
|
||||
|
||||
## Example configuration
|
||||
|
||||
Health checks are available for a controller defined with a `purpose = "ops"`
|
||||
listener stanza. For details on what fields are allowed in this stanza, refer to
|
||||
the documentation about [TCP Listener](/boundary/docs/configuration/listener/tcp).
|
||||
|
||||
An example listener stanza:
|
||||
|
||||
```hcl
|
||||
controller {
|
||||
name = "boundary-controller"
|
||||
database {
|
||||
url = "postgresql://<username>:<password>@10.0.0.1:5432/<database_name>"
|
||||
}
|
||||
}
|
||||
|
||||
listener "tcp" {
|
||||
purpose = "api"
|
||||
tls_disable = true
|
||||
}
|
||||
|
||||
listener "tcp" {
|
||||
purpose = "ops"
|
||||
tls_disable = true
|
||||
}
|
||||
```
|
||||
|
||||
To enable a shutdown grace period, update the `controller` block with a defined
|
||||
wait duration:
|
||||
|
||||
```hcl
|
||||
controller {
|
||||
name = "boundary-controller"
|
||||
database {
|
||||
url = "env://BOUNDARY_PG_URL"
|
||||
}
|
||||
graceful_shutdown_wait_duration = "10s"
|
||||
}
|
||||
```
|
||||
|
||||
A complete example can be viewed under the [Controller
|
||||
configuration](/boundary/docs/configuration/controller#complete-configuration-example)
|
||||
docs.
|
||||
@@ -1,27 +0,0 @@
|
||||
---
|
||||
layout: docs
|
||||
page_title: Operating Boundary
|
||||
description: |-
|
||||
Operational tasks in Boundary.
|
||||
---
|
||||
|
||||
# Maintaining and Operating Boundary
|
||||
|
||||
Visibility into various components of Boundary plays an important role in
|
||||
ensuring the health of its controllers and workers. While additional monitoring
|
||||
components are planned for subsequent Boundary releases, metrics for controllers
|
||||
and workers can now be exported and then collected by Prometheus. Metrics
|
||||
provide insight into the current state of a Boundary deployment by enabling the
|
||||
diagnosis of deployed controllers and workers. Enabling metrics assists in the
|
||||
detection and mitigation of anomalies in a deployment.
|
||||
|
||||
These docs describe the available metrics and the naming and labeling standards
|
||||
used. Additionally, the health of controllers can be monitored using the
|
||||
`/health` endpoint. The health endpoint is enabled by defining a listener in
|
||||
Boundary's configuration file, and a health response may be configured to add a
|
||||
shutdown grace period process.
|
||||
|
||||
* Refer to the [Metrics](/boundary/docs/oss/operations/metrics) documentation to learn
|
||||
more about Boundary metrics.
|
||||
* Refer to the [Health Endpoint](/boundary/docs/oss/operations/health) documentation to
|
||||
learn more about Boundary health endpoints.
|
||||
@@ -1,101 +0,0 @@
|
||||
---
|
||||
layout: docs
|
||||
page_title: Boundary Metrics
|
||||
description: |-
|
||||
Obtain visibility of various components of a running Boundary
|
||||
---
|
||||
|
||||
## Boundary Metrics
|
||||
|
||||
Boundary provides metrics through the `/metrics` path using a listener with the
|
||||
`"ops"` purpose. By default, a listener with that purpose runs on port `9203`.
|
||||
See the [example configuration](#example-configuration) section for an example
|
||||
listener stanza in a `config.hcl` file.
|
||||
|
||||
Metrics are important for understanding what is happening in a Boundary
|
||||
deployment, enabling diagnoses of deployed controllers and workers. The exported
|
||||
metrics grant greater visibility into the various components of a running
|
||||
Boundary deployment through Prometheus.
|
||||
|
||||
The metrics uses the [OpenMetric
|
||||
exposition](https://prometheus.io/docs/instrumenting/exposition_formats/#openmetrics-text-format)
|
||||
format which can be read by
|
||||
[Prometheus](https://prometheus.io/docs/introduction/overview/).
|
||||
|
||||
### Controller
|
||||
|
||||
The following table lists the current names and descriptions of metrics provided
|
||||
by controllers.
|
||||
|
||||
| Name | Description |
|
||||
|---------------------------------------------------------------|-----------------------------------------------|
|
||||
| `boundary_controller_api_http_request_duration_seconds` | Histogram of latencies for HTTP requests. |
|
||||
| `boundary_controller_api_http_request_size_bytes` | Histogram of request sizes for HTTP requests. |
|
||||
| `boundary_controller_api_http_response_size_bytes` | Histogram of response sizes for HTTP requests. |
|
||||
| `boundary_controller_cluster_grpc_request_duration_seconds` | Histogram of latencies for requests made to the gRPC service running on the cluster listener. |
|
||||
|
||||
### Worker
|
||||
|
||||
The following table lists the current names and descriptions of metrics provided
|
||||
by workers.
|
||||
|
||||
| Name | Description |
|
||||
|---------------------------------------------------------------|-----------------------------------------------|
|
||||
| `boundary_worker_proxy_http_write_header_duration_seconds` | Histogram of time elapsed after the TLS connection is established to when the first http header is written back from the server. |
|
||||
| `boundary_worker_proxy_websocket_active_connections` | A gauge of the current count of open proxy connections on the worker. |
|
||||
| `boundary_worker_proxy_websocket_received_bytes_total` | Count of received bytes sent over all proxy connections handled by the worker. |
|
||||
| `boundary_worker_proxy_websocket_sent_bytes_total` | Count of sent bytes sent over all proxy connections handled by the worker. |
|
||||
|
||||
### Other
|
||||
|
||||
The following table lists the current miscellaneous metrics provided by Boundary.
|
||||
|
||||
| Name | Description |
|
||||
|---------------------------------------------------------------|-----------------------------------------------|
|
||||
| `boundary_build_info` | A gauge set to 1 with label values detailing the current Go version, git revision, and Boundary version. |
|
||||
|
||||
### Metric Labels
|
||||
|
||||
Each metric uses labels to help organize and narrow its scope so that users can
|
||||
filter for different characteristics, allowing more flexible analysis of the
|
||||
measurements collected.
|
||||
|
||||
#### Metrics for HTTP requests include the following labels:
|
||||
|
||||
| Label | Description |
|
||||
|--------------|----------------------------------------------------------------|
|
||||
| `code` | The HTTP status code of the request (e.g., “200”, “400”, etc.). |
|
||||
| `path` | The path, excluding query parameters, associated with the request. The value for this label replaces resource IDs with "{id}" (for example, `/v1/groups/{id}` is a possible value for this label). Any unexpected paths receive the value "unknown." |
|
||||
| `method` | The name of the method on the HTTP request. For example "GET", “POST”, “DELETE”. |
|
||||
|
||||
|
||||
#### Metrics for gRPC requests include the following labels:
|
||||
|
||||
| Label | Description |
|
||||
|-----------------|-----------------------------------------------------------------|
|
||||
| `grpc_method` | The name of the method on the grpc service (e.g., `GetGroup`). |
|
||||
| `grpc_service` | The proto service name including the package (e.g., `controller.api.services.v1.GroupService`). |
|
||||
| `grpc_code` | The grpc [status code](https://github.com/grpc/grpc-go/blob/master/codes/codes.go) in human-readable format. For example, `OK`, `IllegalArgument`, `Unknown`. |
|
||||
|
||||
|
||||
## Example configuration
|
||||
|
||||
Defining a listener stanza in the config file is sufficient for enabling metrics
|
||||
reporting in Boundary. For details on what fields are allowed in this stanza,
|
||||
refer to the documentation about [TCP
|
||||
Listener](/boundary/docs/configuration/listener/tcp).
|
||||
|
||||
An example listener stanza:
|
||||
|
||||
```hcl
|
||||
listener "tcp" {
|
||||
purpose = "ops"
|
||||
tls_disable = true
|
||||
}
|
||||
```
|
||||
|
||||
## Tutorial
|
||||
|
||||
Refer to the [Prometheus
|
||||
Metrics](/boundary/tutorials/oss-configuration/prometheus-metrics)
|
||||
tutorial for a step-by-step introduction to metrics.
|
||||
Reference in new issue
Block a user