Commit Graph
1731 Commits
Author SHA1 Message Date
ace2def49d Add daily sessions pending view and accompanying snapshot table (#3217)
* feat: add a new daily billing view

* update views and table based on early feedback

* address review comments

* update CTE to be an accurate result of what we expect

* remove 'with time zone' from daily range

* remove timezone

* Update internal/db/schema/migrations/oss/postgres/70/01_hcp_billing_daily.up.sql

Co-authored-by: Michael Gaffney <mgaffney@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Timothy Messier <tim.messier@gmail.com>

* go mod updates

* fix tests

---------

Co-authored-by: Michael Gaffney <mgaffney@users.noreply.github.com>
Co-authored-by: Timothy Messier <tim.messier@gmail.com>
2023-05-24 15:52:34 -04:00
Jeff Mitchell d5ad1f078a Fix test timing (#3241) 2023-05-24 15:37:22 -04:00
Michael Li 357e835fa5 doc: Add missing copyright headers (#3238) 2023-05-22 11:49:27 -04:00
Jeff Mitchell e0787f4de0 Simplify worker auth rotation timing logic (#3237)
* Simplify worker auth rotation timing logic

* Add some jitter
2023-05-20 21:05:19 -04:00
Jeff Mitchell 6f4f51cc9f Fix display of next rotation time (#3236) 2023-05-20 08:25:16 -04:00
Jeff Mitchell 5716a30813 Update nodeenrollment to fix TLS issue; add debug (#3231)
* Add more logging to worker auth rotation and test flags

This makes it much easier to figure out when and why rotation is
happening and control it for tests/debugging.

* Update auth rotation logic

Because we were looking at validity period of client certs, which may
not have matched the actual rotation interval, it was possible (mostly
in test scenarios) for the rotation to happen multiple times on the
roots before we actually hit the worker rotation interval.

This changes how the interval is calculated by looking at the difference
between not-after values on the certs to understand the rotation
interval being used by the controller. We then use that as the starting
point for calculating a next-rotation time.
2023-05-19 17:18:26 -04:00
Jeff Mitchell 77fd51fb12 Add more logging to worker auth rotation and test flags
This makes it much easier to figure out when and why rotation is
happening and control it for tests/debugging.

Remove cert skew

Cherry-picked from release/0.12.x
2023-05-19 17:14:33 -04:00
Haotian d4bcdd8a06 fix(cli): correctly print secrets in authorize-session for current vault credential source subtypes (#3218)
* updates authorize-session case statement with current vault credential source types
2023-05-18 09:54:23 -07:00
Timothy Messier d792cf4487 test(vault): Increase threshold for period assertion (#3216)
This allows for a greater delta between the period returned by vault and
they expected value to account for some delay due to load on the test
runners.
2023-05-11 08:46:59 -04:00
Chris van Meer 2c23848da5 Remove quotations when not needed (#3207) 2023-05-09 13:00:05 -04:00
Jeff Mitchell a6fe1a5815 Update gen templates for license/gen info (#3211) 2023-05-09 12:03:54 -04:00
Jeff Mitchell 869310d7da Only create WithAutomaticVersioning if versioning is used (#3210)
This option did not respect whether or not versioning was enabled when
writing it out during generation.

This does mean that there is a breaking change for auth tokens, but as
it was a no-op anyways it's easy to fix and not something I want to /v2
about.
2023-05-09 11:12:03 -04:00
Jeff Mitchell 037dc0cf18 Add missing nil check in test 2023-05-05 11:56:28 -04:00
Jeff Mitchell f9f7ee2cc4 Fix build 2023-05-05 11:52:41 -04:00
Jeff Mitchell bbe9719e19 Add tracking of worker used for injection (#3204) 2023-05-05 09:22:54 -04:00
Elim Tsiagbey a2f8d87bfb Add support for setting, adding & deleting LDAP account assoicated to a user (#3198) 2023-05-03 09:45:29 -04:00
Johan Brandhorst-Satzkorn e04438b7f8 authmethods: fix test broken by LDAP
These tests were never updated for LDAP
2023-05-02 18:00:24 -07:00
XingLu Wang 9d50db4c44 doc: Fix typo (#3185) 2023-05-02 16:36:20 -04:00
Haotian 762e0d7d0d fix(sql): move added file to correct folder (#3197)
* move rename_constraints.up.sql from 67 to 69

* update sql replacement reference comments
2023-05-01 13:16:10 -07:00
Haotian b806297afe style(db): rename constraint names to follow sql style guide (#2973)
* programatically rename unique and foreign key constraints to enforce 'tablename_uq' and 'reftable_fkey' patterns

* manually rename unique constraints for names over 63 characters

* update changed constraint names in db update testcases
2023-05-01 12:40:10 -07:00
Jim b974063a52 chore (boundary/dev): remove typo (#3194) 2023-05-01 15:12:17 -04:00
Jeff Mitchell c6d7dc01a0 Exit before filtering if no workers are listed (#3196)
This is just an early error message to avoid running the filtering
function if there are no workers to begin with.
2023-05-01 14:20:27 -04:00
Jim af1092e8e8 feat (boundary/dev): add connection info for dev ldap server when running via boundary dev (#3193)
* chore (dev/ldap): update gldap dependency

This update fixes the dup entries returned when searching for users
and/or groups

* feat (boundary/dev): add connection info for dev ldap server
2023-05-01 13:03:58 -04:00
Jim 667ea285be feature (boundary dev): add support for dev ldap auth method (#3192) 2023-04-28 11:35:54 -04:00
Hugo 5f45fb620b fix(perms): Tests use action.List in resource action set (#3188)
`action.List` is a collection action, that is, it is not part of the set
of actions that can be executed against a single instance of any given
resource.

As part of the `ListPermissions` call, `idActions` is expected, that is,
all the actions that can be executed against a resource instance.
`action.List` will never be part of this. This commit updates the tests
to reflect this fact.
2023-04-27 17:48:11 +01:00
Jeff Mitchell d28ea130ee Fix ListPermissions when separate id/type grants are used (#3183)
This makes two changes:

1. ListPermissions assumed every grant string had a type field, which
   does not match all grant formats. It now infers type from ID for
   formats which do not specify type.

2. Allow ID-only grant strings to be valid so long as the type specified
   matches the type of the specified ID.
2023-04-27 10:37:07 -04:00
Zhihe Li 98a6318760 Bump UI commit (#3178) 2023-04-24 11:28:36 -04:00
Jeff Mitchell e7bf134710 Enhance tcp client port vet logic (#3175) 2023-04-21 09:34:59 -04:00
Jeff Mitchell 20391e3503 Add default client port to targets and use in connect command (#2767) 2023-04-21 06:50:53 -04:00
Jim 40d888c7f2 fix (test): update how we determine when/if a test is running. (#3169) 2023-04-20 08:34:43 -04:00
Damian Debkowski c5b1b7bbc7 fix(handler): return human readable error for json cred w/ empty object (#3109)
* fix(handler): return human readable error for json cred w/ empty object

* fix(handler): sync error messages for create/update json cred

* fix(handler): sync error logic for create/update json cred
2023-04-19 10:17:07 -07:00
Jim a4f54cb98f refactor (events): QOL fix: turn off events for tests. (#3163) 2023-04-14 20:01:14 -04:00
Johan Brandhorst-Satzkorn c1a61b9e34 internal/tests/cluster: switch flaky test to polling (#3153)
* internal/tests/cluster: switch flaky test to polling

Also extend deadline from 10 seconds to 1 minute, hopefully
this should fix any flakiness in this test.

* fixup! internal/tests/cluster: switch flaky test to polling
2023-04-05 18:45:52 -04:00
Johan Brandhorst-Satzkorn ecdb77b584 internal/db/sqltest: fix sessions aggregate (#3152)
The sessions aggregate was inserting host_id and host_set_id,
columns which are no longer present on the session table. Also
fix the test that guards against regressions like this in the future.
2023-04-05 12:57:25 -04:00
Hugo 5926dc40ba fix(host/plugin): Remove dead code and duplicate imports 2023-04-04 18:51:04 +01:00
Hugo Vieira e467cbbfa2 feat(cmd): Display plugin host external name if present 2023-04-04 18:51:04 +01:00
Hugo Vieira 45dc8251ec feat(api): Support plugin host external_name field 2023-04-04 18:51:04 +01:00
Hugo Vieira 2ff9b8efac feat(host/plugin): Support External Name field
The new `ExternalName` field is an optional field that is used to store
the cloud providers' human-identifiable name for a given compute
instance. This field is not user-editable, but it is kept in sync with
the cloud provider's through Boundary's `SetSyncJob`.
2023-04-04 18:51:04 +01:00
Jeff MitchellandIrena Rindos bdf7bf7702 Do not allow PKI-KMS workers to have names updated via API (#3143)
Do not allow PKI-KMS workers to have names updated via API

This would cause their public IDs to change, which we do not want.

Descriptions are also disallowed, since those come from the config file.

This also adds logic to allow upgrading from old KMS method to new, with
a test.

Co-authored-by: Irena Rindos <irenarindos@users.noreply.github.com>
2023-04-03 17:44:41 -04:00
Jim 60723c070c feature (is_nil): support checking func for nil (#3142) 2023-04-03 14:20:07 -04:00
Haotian 5b26634b8a feat(ui): serve controller metadata from ui handler (#3120)
* adds noop metadata function to OSS UI handler
* removes old-style build tags for UI handler files
2023-03-31 13:09:48 -07:00
Jeff Mitchell 163ce184b8 KMS-PKI Workers (#3101)
This adds a new mechanism for worker authentication that uses the
third-party arbitration of the original KMS flow by leveraging
recently-added capabilities in nodeenrollment to support a registration
wrapper. This allows for workers to be registered to the system with
just a name and a matching wrapper, while at the same time allowing
these workers to be used for private Vault access and multi-hop as they
contain per-worker encryption keys and support rotation.

Nodes using this mode will generate and rotate credentials in-memory
(using another recently added nodeenrollment capability) so will have a
new set of keys on every startup. This has the side effect of ensuring
that there is never a conflict or re-use of these credentials.

Note that the normal test worker flow was using the now-deprecated KMS
method; there is still a test that uses this (explicitly) but all other
tests using test workers that did not specify a specific PKI flow now
actually use this mechanism. This means there is fairly decent test
coverage in a general sense, plus the specific tests updated/added for
this feature.

This also adds a new KMS type that can be used to have
distinct KMSes for upstream authentication vs. accepting from
downstream.
2023-03-30 16:20:28 -04:00
Elim Tsiagbey 16f48686a7 Refactor Target Repository (#3092)
- Refactor the Target domain repository functions so that they no longer return 4 different types.

`Target` struct now contains `HostSource` & `CredentialSources` with Getters & Setters

- Extending `Target` to contain `HostSource` & `CredentialSources` enables `funcs` to just return `Target` instead of multiple return types.
This also allows easy future refactors and extensions of `Target`
2023-03-30 15:19:30 -04:00
Johan Brandhorst-Satzkorn bc31892f29 internal/db: add set_once_columns function (#3117)
* internal/db: add set_once_columns function

Also replace existing before_soft_delete_credential_vault_store
function and trigger with the new function.

* internal/db/schema: add note to replaced definitions
2023-03-28 13:35:26 -04:00
Elim Tsiagbey b2376356dd Bats Tests: Target Host Sources (#3107)
* Bats Tests: Target Host Sources

- Add bats test coverage for adding a Host Source to a Target
- Create `target_host_sources.bash` file with helper functions for bats test file

## Considerations
Created new resources like a target & host catalog instead of using already created resources because the changes could affect existing tests and it made it easy to change the newly created resources
2023-03-24 17:38:39 -04:00
Johan Brandhorst-Satzkorn e3fc289733 Update buf dependencies (#3116) 2023-03-24 17:01:10 -04:00
Jim 63a2b62b85 chore (deps): update GKW and protobuf; and run "make gen" (#3111) 2023-03-22 14:32:52 -04:00
Jim 982c9c263c chore: update buf version to 1.15.1 (#3102) 2023-03-20 10:37:40 -04:00
Jeff Mitchell fc664eb35f Improve grant validation (#3081)
This adds several relationships into the resource package that are then
made use of to improve the grant validation that runs during Parse. By
understanding mappings between ID and resource type the validation
checks can far better align with actual allowed grant formats so we can
find several common misunderstandings before they simply result in an
authorization failure.

In the future some of these functions could be used in the logic in the
actual ACL checks but it's not currently necessary and I don't want to
lump that change in with this.

Note that the tests have not meaningfully changed, but they _have_ had
to be updated because the stricter validation is actually catching
issues.
2023-03-16 10:11:55 -04:00
Jeff Mitchell 164e6cf212 Update nodeenrollment to 0.1.19 (#3090) 2023-03-15 17:28:45 -04:00