Commit Graph
1079 Commits
Author SHA1 Message Date
Louis Ruch f8b27645d9 fix(scheduler): Update job run query to not error on running conflict (#1914) 2022-03-11 15:11:14 -08:00
Irena Rindos bc6689fb16 docs(permissions): break permissions into sections (#1893)
* docs(permissions): break permissions into sections

* fixup! docs(permissions): break permissions into sections
2022-03-08 10:36:11 -05:00
Timothy Messier bdb98d508e fix(genapi): Sort slice in removeDups template function (#1889)
The removeDups template function converts a slice into a map and
back into a slice in order to leverage the map keys to remove
duplicates. However, since the iteration order over a map is not
specified it would be possible to get different orders for multiple runs
of `make api`. While this would not have an impact on any functionality,
it is causing sporadic failures for the new make-gen-deltas CI job.

See: https://go.dev/ref/spec#For_statements
Ref: d57603022a
2022-03-04 11:44:41 -05:00
Justen Walker 8279397dbb fix(connect): do not panic on multiple -- args (#1858)
Passthrough args looks for the an instance of -- and re-slices the arg
list to pass through those args to the underlying connect exec command.
However such commands may also need to parse their own '--', such as
kubectl exec.

This change updates the logic so that boundary arg parser only considers
the first instance of '--' when deciding which args to pass to the
-exec= commands.

Fixes: #1857
2022-02-28 10:39:09 -07:00
Carlos Alcaide Corvo b529f4af44 Bump ui version (#1868) 2022-02-17 10:49:39 -05:00
Louis Ruch 4ed4575802 chore(fmt): make fmt 2022-02-16 15:52:37 -08:00
Todd 7ee1f74388 fix(hostsets/plugin): Only delete preferred endpoints when there are preferred endpoints to delete. (#1865) 2022-02-16 16:12:34 -07:00
Carlos Alcaide Corvo 360ff9cf2b Update changelog with latest changes in the UI (#1866)
* Update changelog with latest changes in the UI

* Change to lowercase for consistency

* Bump UI version
2022-02-16 18:00:08 -05:00
Todd e4d1e501cf fix(warehouse): Handle duplicate addresses when migrating into wh_network_address_dimension (#1860) 2022-02-15 15:49:41 -07:00
Irena Rindos c6c10cbec7 Merge pull request #1859 from hashicorp/irindos-remove-terminate-session
refactor(session): Remove dead session termination code
2022-02-15 06:39:43 -08:00
Irena Rindos 5d6aa3b729 refactor(session): Remove dead session termination code 2022-02-15 08:55:25 -05:00
Todd 11ce54f8fb Add DW network address dimension tables (#1855) 2022-02-14 16:30:18 -07:00
Louis Ruch 8cab9a4315 feat(scheduler): Update job description on conflict (#1852) 2022-02-11 17:20:19 -08:00
Todd 3242d3936e Add test coverage for dns names on a host when authorizing a session in target_service_test.go. Add the recent fixes to the changelog. (#1854) 2022-02-10 16:06:03 -07:00
Justen Walker bd30ff4140 fix(controller/targets): authorize-session should allow h_ ids (#1853)
* fix(controller/targets): authorize-session should allow h_ ids

The targets controller previously only allowed hosts from a static catalog
since it checked for the ID subtype from the static package.

This change validates host ids with the plugin.Subtype as well

Fixes: #1850

* test: cover authorize-session with host id

Add a regression test to cover the case where an explicit host ID was
given when calling AuthorizeSession
2022-02-10 13:59:57 -07:00
Justen Walker 6166d2240f bug(plugin): Fix incorrect use of WithIpAddrs in Repository.Endpoints (#1849)
When creating the options for the preferencer, this used WithIpAddrs for both the host addresses and also DNS names. This causes errors when a host contains DNS names that are not IP addresses (ie: whenever dns names are present).

This change will:
- Replace WithIpAddrs with WithDNSNames option for DNS Names when constructing options for the preferencer.
- Add a test which includes a DNS name to prevent regressions

Fixes #1848
2022-02-10 13:59:35 -07:00
Louis Ruch aaaf0241ff bug(host): Fix sync job failure blocking other set syncs (#1841)
During the plugin_host_set_sync job, a single set failing to  sync
can cause all following syncs to fail.
2022-02-04 12:02:37 -08:00
Haotian fa00a06bef feat(host): Add host set information to static host (#1828)
* feat(host): Add host set information to static host

Updates LookupHost and ListHost API to include sets a static host is part of, as like with plugin hosts.

* test: updated TestList_Plugin and TestCrud to be more consistent under race conditions
2022-02-01 10:06:13 -08:00
Jeff Mitchell 5743580ca5 Update authenticate command/subcommands help text (#1835)
* Make it clear in the subcommands that the given strings are examples
* Add an OIDC example to show that there are different types
* Remove password flag from examples
2022-01-31 11:50:45 -05:00
Irena Rindos 86245c48da Merge pull request #1824 from hashicorp/irindos-fix-session-termination-msg
bug(connect): Fix Session has expired messaging
2022-01-18 12:50:43 -08:00
Irena Rindos 24ae5dfe94 bug(connect): Fix Session has expired messaging 2022-01-18 13:38:12 -05:00
Irena Rindos 963fbcbdf2 bug(session): Fix CreateSession foundStates logical ordering 2022-01-14 14:31:08 -05:00
Louis Ruch 61fe77572e chore: make tools & make gen 2022-01-13 14:03:46 -08:00
Louis Ruch ac78ee6315 Merge pull request #1819 from hashicorp/louis-scheduler
feat(scheduler): Add support for run now option
2022-01-13 12:22:06 -08:00
Louis Ruch c4506ec743 feat(scheduler): Add support for run now option 2022-01-13 11:51:53 -08:00
Jeff Mitchell 5d33393cbd Add target resource listing to default roles (#1803)
This addresses the issue of a user being created in a normal or
dev environment that is given access to authorize sessions against
specific targets but the permission hasn't been configured for the UI
clients to actually list them.

Resolves #1791
2022-01-13 09:26:35 -05:00
Irena Rindos edae7c899f bug(session): Allow only valid state transitions 2022-01-12 16:01:49 -05:00
Louis Ruch a90f1f4eb1 feat(target): Decode based on credential type 2022-01-10 09:57:27 -08:00
Jim 591ec476e7 refactor: Update internal/db and oplog to use go-dbw package for database operations. (#1785)
* chore: Add new dbw dependency

* refactor: Convert to use dbw.DB

* refactor (db): Change GetTicket(...) signature

* feature (db tests): Added TestDeleteWhere(...)
Adding this allows us to eliminate a leak of the gorm library

* refactor: Add ctx to ScanRows(...) signature
This is required to refactor all the deprecated errors pkg calls.
This refactor required adding a context to quite a few call chains
and in particular the job scheduler bits

* feature (db/tests): Add support for test opt: WithTestLogLevel(...)
This test only option allows callers to specify a log level for the
underlying db package (where supported/applicable) when calling
TestSetup(...)

* refactor (db): Simplify Db type
Only store the underlying *DB and create the *RW on demand when
needed.

* refactor (oplog): Port to using dbw pkg for db operations

* refactor (db): Remove gormDB(...) func

* tests (db): Add unit tests for TestDeleteWhere(...)

* chore: make fmt changes to formatting
2022-01-05 14:38:38 -05:00
A-440Hz 3afbfbf8c2 fix(cli): Remove duplication of target host sources (#1805)
fix(cli): Remove duplication of target host sources
2021-12-17 19:11:28 -08:00
Louis Ruch 425a56179f feat(worker): Implement egress credentials
Egress credentials Issued during AuthorizeSession are stored in the
session repo. These credentials are retrieved and stored in-memory on the
worker during the LookupSession call. Each proxy handler will need to
handle the credentials as required.
2021-12-17 11:27:10 -08:00
Louis Ruch 5fe23ab14d feat(session): Store session credentials
Creates a new session_credential table and repository functions
to add and list credentials attached to a session. All credentials
are encrypted using the session scope id.
2021-12-17 11:26:52 -08:00
Timothy Messier 27ebfa1125 Merge pull request #1796 from hashicorp/llb-credential-type-mapping
This allows users to set the type of credential that a credential
library will provide.

A User Password credential type and an Unspecified credential type are included
with the expectation that additional credential types will be added in the
future. This change also adds the credential type attribute to existing
credential libraries and sets it to Unspecified. The credential type can
only be set when a credential library is created.

The vault credential library includes functionality for converting a
Vault Secret into a User Password Credential. This mapping is enabled by
default, however, the user can override the attributes used for this
mapping.
2021-12-17 14:03:58 -05:00
Louis Ruch d46daa573f feat(server): Add grpc_middleware recovery interceptor 2021-12-16 20:22:20 -08:00
Louis Ruch b8afd4f50c feat(cli): Display credential type in library list 2021-12-16 10:01:44 -05:00
Michael Gaffney 4636d34943 test(credential): Add credential mapping override to delete test 2021-12-16 10:01:43 -05:00
Michael Gaffney 888f8cea03 test(credential): Add credential mapping override to list test 2021-12-16 10:01:43 -05:00
Louis Ruch e75f1d2f73 feat(credential): Add mapping override update for API/SDK/CLI
This change adds support for updating a credential mapping override on a
credential library.
2021-12-16 10:01:43 -05:00
Louis Ruch da20a8b434 feat(credential): Add support for Vault KV2 2021-12-16 10:01:38 -05:00
Michael Gaffney 035182681a feat(credential): Allow updating of credential mapping overrides 2021-12-16 09:52:18 -05:00
Michael Gaffney 9cdfc5f986 docs(vault): Add comment about the default value of HttpMethod 2021-12-16 09:52:18 -05:00
Michael Gaffney ba8188e6d7 feat(credential): Add mapping override to credential library on lookup
This change returns any mapping override set on a credential library
when the library is retrieved from the repository using the lookup
method.
2021-12-16 09:52:18 -05:00
Michael Gaffney 0e637f47b5 feat(credential): Use credential type when issuing credentials
This change uses the credential type attribute when issuing credentials
including mapping overrides.
2021-12-16 09:52:16 -05:00
Michael Gaffney 17762ed01e test(vault): Fix use of assert library in tests 2021-12-16 09:43:34 -05:00
Louis Ruch 1cc35fb0df feat: Credential library mapping API/SDK/CLI on create path
* feat(sdk): Add fields to credential library proto

Adds CredentialType and CredentialMappingOverrides to credential
library SDK.

* feat(api): Add fields to credenttial library service

Adds support for CredentialType and CredentialMappingOverrides
to the credential library service (API)

* feat(cli): Add feilds for credential library cmd

Adds support for CredentialType and CredentialMappingOverrides to the
credential library cmd command.
2021-12-16 09:43:34 -05:00
Michael Gaffney c317901db4 feat(credential): add credential type to credential library on create
This change adds a credential type attribute to credential library and
allows it to be set when creating a credential library.

Specifying the type of credential returned from a library allows for new
features and additional error checking to be added over time. A
User Password credential type and an Unspecified credential type are
included with the expectation that additional credential types will be
added in the future. This change also adds the credential type attribute
to existing credential libraries and sets it to Unspecified.

Known Limitations:

- Credential type is only supported on the repository create method.
  Support for the other CRUD methods will be added in the future.
2021-12-16 09:43:32 -05:00
Louis Ruch f4b9b83caf fmt: Fix import groups 2021-12-15 22:34:16 -08:00
Louis Ruch 9b39345c7f bug(credential): Fix panic in credential Issue
Vault KV backend returns a nil secret and no error if the secret does not
exist. This caused a panic in during Issue:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x1388279]

goroutine 2639 [running]:
github.com/hashicorp/boundary/internal/credential/vault.(*Repository).Issue(0xc001222200, {0x3b932d0, 0xc001203350}, {0xc000dc6e90, 0xc}, {0xc0010e5e40, 0x0, 0x0})
        /home/louis/boundary/internal/credential/vault/repository_credentials.go:67 +0x2d9
github.com/hashicorp/boundary/internal/servers/controller/handlers/targets.Service.AuthorizeSession({{}, 0xc000cd4a38, 0xc000cd4840, 0xc000cd48d0, 0xc000cd4a50, 0xc000cd4870, 0xc000cd4858, 0xc000cd48b8, 0xc0001a8880}, {0x3b932d0, ...}, ...)
        /home/louis/boundary/internal/servers/controller/handlers/targets/target_service.go:1059 +0x1525
github.com/hashicorp/boundary/internal/gen/controller/api/services._TargetService_AuthorizeSession_Handler.func1({0x3b932d0, 0xc001203350}, {0x1a0dd40, 0xc000dc8880})
        /home/louis/boundary/internal/gen/controller/api/services/target_service_grpc.pb.go:631 +0x78
github.com/hashicorp/boundary/internal/servers/controller.auditResponseInterceptor.func1({0x3b932d0, 0xc001203350}, {0x1a0dd40, 0xc000dc8880}, 0x461279, 0x40d234)
        /home/louis/boundary/internal/servers/controller/interceptor.go:262 +0x4e
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1({0x3b932d0, 0xc001203350}, {0x1a0dd40, 0xc000dc8880})
        /home/louis/go/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware@v1.3.0/chain.go:25 +0x3a
github.com/hashicorp/boundary/internal/servers/controller.statusCodeInterceptor.func1({0x3b932d0, 0xc001203350}, {0x1a0dd40, 0xc000dc8880}, 0x203000, 0x203000)
        /home/louis/boundary/internal/servers/controller/interceptor.go:207 +0x34
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1({0x3b932d0, 0xc001203350}, {0x1a0dd40, 0xc000dc8880})
        /home/louis/go/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware@v1.3.0/chain.go:25 +0x3a
github.com/hashicorp/boundary/internal/servers/controller.errorInterceptor.func1({0x3b932d0, 0xc001203350}, {0x1a0dd40, 0xc000dc8880}, 0x18e2b40, 0x0)
        /home/louis/boundary/internal/servers/controller/interceptor.go:156 +0x4e
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1({0x3b932d0, 0xc001203350}, {0x1a0dd40, 0xc000dc8880})
        /home/louis/go/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware@v1.3.0/chain.go:25 +0x3a
github.com/hashicorp/boundary/internal/servers/controller.auditRequestInterceptor.func1({0x3b932d0, 0xc001203350}, {0x1a0dd40, 0xc000dc8880}, 0x1a1c860, 0xc0010e5280)
        /home/louis/boundary/internal/servers/controller/interceptor.go:248 +0x198
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1({0x3b932d0, 0xc001203350}, {0x1a0dd40, 0xc000dc8880})
        /home/louis/go/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware@v1.3.0/chain.go:25 +0x3a
github.com/hashicorp/boundary/internal/servers/controller.requestCtxInterceptor.func1({0x3b932d0, 0xc001203260}, {0x1a0dd40, 0xc000dc8880}, 0x18, 0xc0010e52a0)
        /home/louis/boundary/internal/servers/controller/interceptor.go:140 +0x5de
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1({0x3b932d0, 0xc001203260}, {0x1a0dd40, 0xc000dc8880})
        /home/louis/go/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware@v1.3.0/chain.go:25 +0x3a
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1({0x3b932d0, 0xc001203260}, {0x1a0dd40, 0xc000dc8880}, 0xc00331abb8, 0x18675e0)
        /home/louis/go/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware@v1.3.0/chain.go:34 +0xbf
github.com/hashicorp/boundary/internal/gen/controller/api/services._TargetService_AuthorizeSession_Handler({0x1ada420, 0xc00093a180}, {0x3b932d0, 0xc001203260}, 0xc001200840, 0xc000465260)
        /home/louis/boundary/internal/gen/controller/api/services/target_service_grpc.pb.go:633 +0x138
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000cca540, {0x3bb4c58, 0xc0005a9c80}, 0xc001208480, 0xc0004a7440, 0x499e2b8, 0x0)
        /home/louis/go/pkg/mod/google.golang.org/grpc@v1.40.0/server.go:1297 +0xccf
google.golang.org/grpc.(*Server).handleStream(0xc000cca540, {0x3bb4c58, 0xc0005a9c80}, 0xc001208480, 0x0)
        /home/louis/go/pkg/mod/google.golang.org/grpc@v1.40.0/server.go:1626 +0xa2a
google.golang.org/grpc.(*Server).serveStreams.func1.2()
        /home/louis/go/pkg/mod/google.golang.org/grpc@v1.40.0/server.go:941 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
        /home/louis/go/pkg/mod/google.golang.org/grpc@v1.40.0/server.go:939 +0x294
2021-12-15 16:13:30 -08:00
Carlos Alcaide Corvo 86eead3a3e Bump UI version (#1795) 2021-12-15 13:11:19 -08:00
Louis Ruch 72a15b8d2d bug(target): Add *-host-sources actions to target service (#1794) 2021-12-15 10:06:35 -08:00