Commit Graph
2025 Commits
Author SHA1 Message Date
Johan Brandhorst-Satzkorn 2e0587bff0 credential: fix lint errors (#3746)
The existing pattern was subject to a bug whereby a lock
value was copied every time the value was passed around.
This was happening because of the use of an embedded
protobuf type. To avoid copying a mutex, use a pointer
type in the embedding.

Also fixes a few linter warnings complaining about the use
of unkeyed literals.
2023-09-19 09:17:42 -07:00
Jim 0d19892e03 fix (events): convert multierror to stdlib error (#3743)
* fix (events): convert multierror to stdlib error

multierror errors will be converted to a stdlib error (because
multierror doesn't support json marshaling).

* refact (errors): convert from multierror to stdlib errors.Join(...)

* refact: convert from pkg/errors to stdlib error wrapping
2023-09-17 19:35:43 -04:00
Irena Rindos bf595f8599 feat(events): add deregister pipeline (#3729)
* feat(events): add deregister pipeline
2023-09-14 16:06:10 -04:00
Damian Debkowski e3e848d847 feat(event): new storage event type (#3719) 2023-09-14 10:31:01 -07:00
Irena Rindos 6161635f65 feat(event): add register pipeline (#3714) 2023-09-13 13:08:16 -04:00
Irena Rindos 7bd2d2c913 feat(worker): allow hcp cluster id to be sourced from env var (#3709)
* feat(worker): allow hcp cluster id to be sourced from env var
2023-09-12 13:20:49 -04:00
Irena Rindos 6f10a0ac87 chore: update go-eventlogger (#3707)
* chore: update go-eventlogger
2023-09-12 11:03:18 -04:00
Irena Rindos 9733a250fa refact(event): move observability/event to event (#3704) 2023-09-12 08:15:34 -04:00
Jim 8ee4f6ead0 feat (auth/ldap): add support for new fields to CLI (#3685)
Added support for new flags for: max-page-size and deref-aliases
2023-09-07 19:23:20 -04:00
Elim Tsiagbey d271025863 fix: Flakey upstream connection test (#3689)
The connectivity state changes for `upstream_connection_state` health field is causing the test to be flakey. Commenting out the field during assertions. `upstream_connection_state` health field is tested in other tests
2023-09-07 15:48:53 -04:00
Johan Brandhorst-Satzkorn f89515a19c all: avoid mutating global state in parallel tests (#3687)
The SetupSuiteTargetFilters globally mutates the function used for logic
inside the target handler service. This means that we could get
inconsistent logical behavior in certain tests that were run in parallel,
since the logic can change at runtime. Ensure tests that make use
of this function are never run in parallel with other tests.
2023-09-07 11:52:00 -07:00
Johan Brandhorst-Satzkorn 4789c00177 ui: bump UI commit (#3688)
The old commit artifact has expired.
2023-09-07 11:02:14 -07:00
Michael Gaffney 0af36d3d8a refactor(sql): Consolidate changes to oplog_entry into one migration 2023-09-06 20:05:50 -04:00
Michael Gaffney 3befccffd7 refactor(sql): Reorder and rename oplog kms migrations 2023-09-06 19:55:33 -04:00
Michael Gaffney d8393e5793 style(sql): fix indenting and remove trailing whitespace 2023-09-06 19:11:05 -04:00
Jim a16033b73a fix (kms): move oplog DEK into its own internal kms (#3665)
* fix (auth/ldap): fix which DEK is used for oplog during authenticate

* chore: update go-kms-wrapping dep for new extras/kms changes

The latest version supports setting a table name prefix for a kms
which is needed to fix our oplog DEK problem

* chore: update extras/kms dep

This latest version supports an optional TableNamePrefix which is
required to fix our existing oplog DEK issue.

* fix (oplog): schema oplog DEK fix

These changes will allow use to store the oplog DEK in it's own
set of tables, so they won't get deleted when a scope is deleted

* fix (kms): move oplog DEK into its own internal kms

* tests: update tests to be compatible with oplog fix

* tests: remove migration tests which are incompatible with oplog fix

These tests no longer work because they are missing the required
schema changes for the oplog fix
2023-09-06 18:25:49 -04:00
Jim dc89ca28a1 feat: add API support for additional LDAP auth method fields. (#3679)
* feat (auth/ldap): add Repo support for max page size and deref aliases (#3670)

* chore: update cap/ldap dependency

This latest version of cap/ldap adds support for MaxPageSize and
DerefAliases

* feat (auth/ldap): add MaxPageSize and DerefAliases to storage proto

* feat (api/authmethods): add new ldap fields.

Add support for maximum_page_size and dereference_aliases

* feat (auth/ldap): schema changes to support new LDAP attributes

* feat (auth/ldap): add Repo support for max page size and deref aliases

* feat (handlers/ldap): add support for new fields (#3674)

Added API support for new ldap fields: MaximumPageSize and
DereferenceAliases

* chore: add CHANGELOG entry for new api auth ldap fields
2023-09-06 15:07:45 -04:00
Johan Brandhorst-Satzkorn a73db844fe internal/perms: Fix grant parser bugs (#3660)
* internal/perms: Fix grant parser bugs

This fixes two bugs in the grant parser:

1. The parser would accept "," as an output field when parsing from JSON.
  This would then make it into the canonical string,
  which would make it look like we had a trailing comma.
  Disallow the use of a comma as an output field.
2. The parser would accept empty IDs when parsing from JSON.
  Make this behavior consistent with the text behavior.

* internal/perms: also handle empty IDs in text form

* internal/perms: disallow any commas

Commas anywhere in ids or output fields corrupt
the canonical output string.

* internal/perms: disallow any reserved characters

id, ids and actions could all contain one of the
reserved characters ",", "=" or ";" when used with
JSON.
2023-09-06 09:11:56 -07:00
Jim d5411a26f6 chore: update protobuf dep (#3669) 2023-09-05 13:10:03 -04:00
Elim Tsiagbey fabd4093de feat: Worker Connectivity Health Check (#3650)
* feat: Worker Connectivity Health Check

Add worker upstream connection state. API calls to the worker's ops `/heath?worker_info=1` endpoint should now return a new filed called `upstream_connection_state`

```
{
   "worker_process_info":{
      "state":"active",
      "active_session_count":0,
      "upstream_connection_state":"READY"
   }
}
```

The states returned will be GRPC connection states: https://grpc.github.io/grpc/core/md_doc_connectivity-semantics-and-api.html

There could be multiple upstream addresses but GRPC manual resolver determines the state of the connection.
2023-09-01 13:42:41 -04:00
Jeff Mitchell be8e9fc61c Fix address not returning on 10001+ list value (#3644)
Fixes ICU-10786
2023-08-30 13:40:43 -04:00
Louis Ruch 2235a50a2a feat(ssh): Add support for ssh to run command on remote host (#3633) 2023-08-29 08:45:10 -07:00
Johan Brandhorst-Satzkorn 90cf20d0dd handlers/targets/tcp: run tests in parallel (#3639)
This reduces the runtime from 79s to 24s on my machine
2023-08-28 15:08:20 -07:00
Jim 922fcfb4c0 tests (grants): add basic fuzz test for grants.Parse (#3638) 2023-08-25 21:17:29 -04:00
Irena Rindos df1e64f412 chore(connect): improve messaging if tofu token already used (#3602) 2023-08-17 08:59:17 -04:00
Lars Lehtonen ee6803d106 internal/server: fix dropped testing error (#3015) 2023-08-17 08:55:57 -04:00
Johan Brandhorst-Satzkorn e108ae40ad Upgrade to Go 1.21 (#3573)
* Upgrade to Go 1.21

* event: remove tests depending on pointer comparison

The test now just tests that the logger is non-nil. For
some reason the old test was broken by upgrading
to Go 1.21.0.

* api: use dummy Host header for unix sockets

When using unix sockets with the net/http.Client,
we cannot use the unix socket address directly
in the Host header, as it fails the validation step.
Instead, use a dummy address in the Host header.
2023-08-15 12:04:58 -07:00
Johan Brandhorst-Satzkorn bae219d461 Re-enable copywrite with hack (#3569)
* Ignore license change commit from blame

This changed almost all the files in the repo

* Re-enable copywrite with hack

Adds a hack that removes existing copyright headers
from files before rerunning copywrite with directory
specific configuration.
2023-08-11 15:02:29 -07:00
hashicorp-copywrite[bot]andJohan Brandhorst-Satzkorn 29da0bcb92 [COMPLIANCE] License changes (#3567)
* Adding explicit MPL license for sub-package.

This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository.

* Adding explicit MPL license for sub-package

This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository.

* Updating the license from MPL to Business Source License

Going forward, this project will be licensed under the Business Source License v1.1. Please see our blog post for more details at https://hashi.co/bsl-blog, FAQ at www.hashicorp.com/licensing-faq, and details of the license at www.hashicorp.com/bsl.

* Update copyright file headers to BUS-1.1

* Rerun make gen

This will pick up the last of the license changes

* Revert "Rerun make gen"

This reverts commit dbe0968bffd92745d8663c6940debae098395a6b.

* Remove copywrite from generation script

The current version of copywrite is not sophisticated enough
to only apply the copywrite changes to certain subdirectories,
so to avoid accidentally relicensing our api and sdk modules,
we will stop running the copywrite script until such time
that it can do the right thing.

* License protobuf API as MPL

The protobuf API files are used to generate the SDK,
since we want the SDK to be MPL, the protobuf files
must also be MPL. This extends to all protobuf files
whose sources end up in the SDK directory, including:

- internal/proto/controller/api
- internal/proto/controller/custom_options
- internal/proto/plugin

It also includes the generated service directory in
internal/gen/controller/api/services, since they are
generated from the protobuf sources used for the SDK.

* Change website license file name

This makes the naming scheme consistent with the rest
of the repository.

* Add note on licensing to README

* Set copywrite license to BUSL

* Revert "Add note on licensing to README"

This reverts commit 4d865a91a7a4f11605f0dc4609355d7e3c3cfffe.

---------

Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
2023-08-11 10:31:53 -07:00
Irena Rindos 8396dff233 fix(session recording): correctly return and join errors (#3565)
* fix(session recording): correctly return and join errors
2023-08-10 09:01:55 -04:00
Elim Tsiagbey 4564d15901 feat: Validate BSR files (#3507)
* feat: Validate BSR files

Add support for validating all files in a Boundary Session Recording (BSR). All files and sub container files will be verified by comparing it against checksums for each file in `SHA256SUM` file

### Considerations
- Validation will continue even if there's an error encountered during validation. The validation error will be added to the Validation struct `Error` field
2023-08-04 14:31:20 -04:00
Johan Brandhorst-Satzkorn 5e78fc72c5 tests: add timeout to key version destruction test (#3537) 2023-08-03 11:08:28 -07:00
Irena Rindos 65f20f3d6f fix(bsr): limit chunk length (#3500)
* fix(bsr): limit chunk length
2023-08-03 13:57:49 -04:00
Lars Lehtonen ecadeaee2d internal/daemon/controller/handlers/sessions: fix dropped error (#3529) 2023-08-01 11:26:48 -07:00
Elim Tsiagbey 91b74a04d6 chore: BSR container close check (#3528)
Add check to make sure container isn't nil before `container.close()` is called
2023-08-01 10:19:12 -04:00
Elim Tsiagbey 1548d48f00 fix: Close opened BSR files (#3519)
* fix: Close opened BSR files

- Add checks to close a file if it's not nil
- Close files opened during reads for `OpenSession`, `OpenConnection` & `OpenChannel`
- Close opened scanner readers
2023-07-31 17:13:24 -04:00
Johan Brandhorst-Satzkorn c644396916 server: allow release version to be set in test (#3517)
The old logic made it impossible for the caller to set
the release version with WithReleaseVersion. Only
set the release version when it's not explicitly set already.
2023-07-31 09:41:22 -07:00
Damian Debkowski 0dcdee4758 feat(bsr): support container validation (#3504) 2023-07-28 13:38:51 -07:00
Jim f8ea8c9744 fix (ldap): support only updating the bind-dn and/or bind-password (#3511)
* fix (ldap): support only updating the bind-dn and/or bind-password

* chore: changelog entry for PR #3511
2023-07-27 15:41:37 -04:00
Damian Debkowski da7e8f7c1c fix(bsr): allow reading twice from the same fstest.MemFile (#3498) 2023-07-27 09:25:01 -07:00
Damian Debkowski a67e42b00f refactor(bsr): optimize ChunkEncoder.Encode() (#3476) 2023-07-26 09:12:19 -07:00
Irena Rindos dcdb257b93 fix(bsr): check nanosecond range during decoding (#3496) 2023-07-25 11:58:15 -04:00
Irena Rindos 39953fe329 fix(targets): return LookupTargets error in AuthorizeSession (#3484)
* fix(targets): return LookupTargets error in AuthorizeSession
2023-07-20 11:01:20 -04:00
Elim Tsiagbey 1482f33845 feat: Perform asciicast conversion sanity checks (#3481)
* feat: Perform asciicast conversion sanity checks

Check that the conversion to asciicast is done on `exec` or `shell` session program. Unsupported session programs will throw an error.
2023-07-20 09:58:52 -04:00
Damian Debkowski e285a8ef6f refactor: make secrets optional for storage bucket (#3353) 2023-07-19 14:32:33 -07:00
Todd 86b2f4b90a Strongly type API resource for session recording creation time value attributes (#3480) 2023-07-19 08:46:58 -07:00
Elim Tsiagbey 6afd2c96a5 feat: Add custom summary error type (#3459)
Add custom error type to to decode and encode `Errors` field

Added some extra checks to handle existing BSR summary types with `Error` fields
2023-07-17 11:55:46 -04:00
Elim Tsiagbey 83d089ec9d chore: Change summary errors field type (#3447)
chore: Change summary errors field type

decoding summary `Errors` field currently fails with type `error`.  Using a string type to handle `Errors` field
2023-07-14 10:21:12 -04:00
Elim Tsiagbey ed7bc7cc4d chore: Add missing for summary interfaces (#3438)
Add missing `Errors` Getter & Setter for Session & Connection Summary interfaces
2023-07-13 15:48:27 -04:00
Elim Tsiagbey fd3091d8dc feat: Decode Summary File (#3408)
* feat: Decode Summary File

- Add support for decoding BSR session, connection and channel summary file
- Introduce base summary interfaces that other protocols can extend
- Add new SSH register allocation function for getting SSH Channel Summary Type
2023-07-13 10:25:01 -04:00