Commit Graph

18772 Commits

Author SHA1 Message Date
Angel Garbarino
81106b32cc add clarifying comment 2024-01-08 15:08:49 -08:00
Angel Garbarino
7dcb157acc Merge branch 'main' into ui/VAULT-20170/prep-ember-data-upgrade-ids 2024-01-08 13:36:26 -08:00
Angel Garbarino
9088f2b1b7 Prep ember data: relationships (#24712)
* relationships, failing tests

* remove old policies test to get tests passing

* try adding back in
2024-01-08 13:36:12 -08:00
Angel Garbarino
da0b12dcb5 separate out ldap test to have unique ids in create static and dynamic roles 2024-01-08 13:34:25 -08:00
Angel Garbarino
eaad8dfa65 Merge branch 'main' into ui/VAULT-20170/prep-ember-data-upgrade-ids 2024-01-08 13:23:41 -08:00
prajnamohan1
7ffad66b0b Fixed Oauth redirect not working on Android Chrome (#18513)
* Fixed Oauth redirect not working on Android Chrome

This fixes the issue described in https://github.com/hashicorp/vault/issues/16778.
Navigation is blocked in Android chrome while redirecting back after OIDC authentication.
The issue is explained by the lead maintainer of
AppAuth(https://stackoverflow.com/a/41882732).
The latest Chrome version redirects to the app only if triggered by the user and not automatically redirect. Hence, a link is added in the UI to redirect back to the app.

* Update ui/app/templates/vault/cluster/oidc-provider.hbs

Co-authored-by: Chelsea Shaw <82459713+hashishaw@users.noreply.github.com>

* added requested changes

* Modified requested changes and added changelog

* Added requested change

* Modified requested changes

---------

Co-authored-by: Chelsea Shaw <82459713+hashishaw@users.noreply.github.com>
2024-01-08 13:22:03 -06:00
Christopher Swenson
376812adaf Upgrade go-msgpack to v2 2.1.1 (#23750)
And set the `time.Time` option to use the go-msgpack-1.1.5-compatible
encoding in all the places, since that is the (now previous) version in
`go.mod`.

v2 2.1.1 was specifically designed to honor backwards compatibility
with 1.1.5 and 0.5.5, and to clean up the code base to be more
maintainable. There may performance lost with the 1.1.5 to 2.1.1
migration since the fastpath code was removed, but the increased safety
is probably worth it. See
[the release notes for go-msgkack 2.1.0](https://github.com/hashicorp/go-msgpack/releases/tag/v2.1.0)
for more details.

I tested this by running this code, and booting up a cluster with a node
also running Vault 1.15.0 (before the upgrade). Before I made the
changes to set the right `time.Time` option, the previous-version node
would throw a bunch of time-decoding errors. After fixing the option,
the node came up smoothly, even after changing leadership between them.

This relies on
- https://github.com/hashicorp/raft-boltdb/pull/38
- https://github.com/hashicorp/raft/pull/577

I did a simple pair of benchmarks (one with a final sync, one without)
and ran them before and after on both my Mac (M2 Max) laptop and my
Linux (AMD Threadripper 3970X) desktop.

tl;dr There was no performance difference for this benchmark.

```
goos: darwin
goarch: arm64
pkg: github.com/hashicorp/vault/physical/raft
                   │    a.txt    │            b.txt             │
                   │   sec/op    │   sec/op     vs base         │
RaftWithNetwork-10   58.65m ± 2%   58.62m ± 2%  ~ (p=0.937 n=6)
```

```
goos: linux
goarch: amd64
pkg: github.com/hashicorp/vault/physical/raft
cpu: AMD Ryzen Threadripper 3970X 32-Core Processor
                   │    c.txt    │            d.txt             │
                   │   sec/op    │   sec/op     vs base         │
RaftWithNetwork-64   5.861m ± 1%   5.837m ± 0%  ~ (p=0.240 n=6)
```
2024-01-08 10:36:58 -08:00
Violet Hynes
09427955b2 Add -type -f to the -find delete call as part of test collect reports (#24711) 2024-01-08 18:17:35 +00:00
Angel Garbarino
2cd415d824 Merge branch 'main' into ui/VAULT-20170/prep-ember-data-upgrade-ids 2024-01-08 09:54:58 -08:00
Angel Garbarino
7387408bd9 id changes on tests 2024-01-08 09:53:22 -08:00
Angel Garbarino
f160e1ae50 adapter fixes for ids 2024-01-08 09:25:08 -08:00
dependabot[bot]
3931207244 Bump github.com/dvsekhvalnov/jose2go from 1.5.0 to 1.6.0 (#24639)
Bumps [github.com/dvsekhvalnov/jose2go](https://github.com/dvsekhvalnov/jose2go) from 1.5.0 to 1.6.0.
- [Commits](https://github.com/dvsekhvalnov/jose2go/compare/v1.5...v1.6.0)

---
updated-dependencies:
- dependency-name: github.com/dvsekhvalnov/jose2go
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-01-08 12:24:19 -05:00
Matthew Irish
49ee9e72a7 ui: add ember exam (#24669)
* feature(ember-exam): add ember-exam to split ui tests and run them in parallel

* update yarn.lock

* update package.json scripts

* test(oidc): comment out test with race condition in oidc test

* chore(test): use 127.0.0.1 in testem config and add uuid to pki mount path

* test(kv-workflow): make policy creation unique per-test

* chore(test): use --preserve-test-name so flakey test reporting is preserved

* yarn test:filter runs ember test instead of exam for easier filtering

* fix kv control group tests

---------

Co-authored-by: Chelsea Shaw <cshaw@hashicorp.com>
2024-01-08 11:17:11 -06:00
dependabot[bot]
d13edc6107 Bump golang.org/x/crypto from 0.14.0 to 0.17.0 in /sdk (#24576)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.14.0 to 0.17.0.
- [Commits](https://github.com/golang/crypto/compare/v0.14.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-01-08 11:15:57 -05:00
Kuba Wieczorek
2047ce7527 [VAULT-22480] Add audit fallback device (#24583)
Co-authored-by: Peter Wilson <peter.wilson@hashicorp.com>
2024-01-08 13:57:43 +00:00
Tom Proctor
6e537bb376 Support reloading database plugins across multiple mounts (#24512)
* Support reloading database plugins across multiple mounts
* Add clarifying comment to MountEntry.Path field
* Tests: Replace non-parallelisable t.Setenv with plugin env settings
2024-01-08 12:21:13 +00:00
claire bontempo
ee0ccea547 UI: Changes jwks_ca_pem param to a 'file' edit type (#24697)
* change jwks_ca_pem to file edit type

* add changelog
2024-01-07 12:06:03 -08:00
Jordan Reimer
3153673894 Sync Destinations List Name Filter Updates (#24695)
* updates destination name filter to use FilterInput component

* simplifies destinations list redirect condition

* fixes issue with sync destination type filter and issue filtering by both name and type

* unsets page query param in sync destination secrets route
2024-01-05 16:41:57 -07:00
divyaac
87ab7497fa Docs changes (#24242) 2024-01-05 15:31:16 -08:00
Kyle Schochenmaier
205680c077 add docs for configuring jwt validation pubkeys for vso (#24599)
* add docs for configuring jwt validation pubkeys for vso and update jwt auth docs to mention key rotation


Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>
2024-01-05 16:55:48 -06:00
claire bontempo
8f784a3afb Secrets Sync UI: Small UX copy improvements (#24693)
* update secret details alert banner

* small copy changes

* remove empty description block

* update tests

* use pluralize helper

* change banner wording
2024-01-05 22:23:02 +00:00
Chelsea Shaw
d5af0658ef UI: fix PKI issuer capabilities (#24686) 2024-01-05 20:40:55 +00:00
Marc Boudreau
8caaa13132 VAULT-21608: Endpoints to Retrieve Active Pre- and Post- Login Messages (#24626)
* add foundation to allow enterprise edition to walk up from current namespace to root

* add sys/internal/ui/*-messages paths

* add tests for consume custom messages endpoints

* more tests and change structure of link parameter

* add error when multiple links are provided for a custom message
2024-01-05 15:27:56 -05:00
Rémi Lapeyre
3aee6ec464 Fix UI when editing database roles (#24660)
* Fix UI when editing database roles

When using a database role the UI will try to update the database connection
associated to the role. This is to make sure that the role is allowed to
use this connection:

    async _updateAllowedRoles(store, { role, backend, db, type = 'add' }) {
      const connection = await store.queryRecord('database/connection', { backend, id: db });
      const roles = [...connection.allowed_roles];
      const allowedRoles = type === 'add' ? addToArray([roles, role]) : removeFromArray([roles, role]);
      connection.allowed_roles = allowedRoles;
      return connection.save();
    },

    async createRecord(store, type, snapshot) {
      const serializer = store.serializerFor(type.modelName);
      const data = serializer.serialize(snapshot);
      const roleType = snapshot.attr('type');
      const backend = snapshot.attr('backend');
      const id = snapshot.attr('name');
      const db = snapshot.attr('database');
      try {
        await this._updateAllowedRoles(store, {
          role: id,
          backend,
          db: db[0],
        });
      } catch (e) {
        throw new Error('Could not update allowed roles for selected database. Check Vault logs for details');
      }

      return this.ajax(this.urlFor(backend, id, roleType), 'POST', { data }).then(() => {
        // ember data doesn't like 204s if it's not a DELETE
        return {
          data: assign({}, data, { id }),
        };
      });
    },

This is intended to help the administrator as the role will only work if
it is allowed by the database connection.

This is however an issue if the person doing the update does not have
the permission to update the connection: they will not be able to use
the UI to update the role even though they have the appropriate permissions
to do so (using the CLI or the API will work for example).

This is often the case when the database connections are created by a
centralized system but a human operator needs to create the roles.

You can try this with the following test case:

    $ cat main.tf
    resource "vault_auth_backend" "userpass" {
      type = "userpass"
    }

    resource "vault_generic_endpoint" "alice" {
      depends_on           = [vault_auth_backend.userpass]
      path                 = "auth/userpass/users/alice"
      ignore_absent_fields = true

      data_json = jsonencode({
        "policies" : ["root"],
        "password" : "alice"
      })
    }

    data "vault_policy_document" "db_admin" {
      rule {
        path         = "database/roles/*"
        capabilities = ["create", "read", "update", "delete", "list"]
      }
    }

    resource "vault_policy" "db_admin" {
      name   = "db-admin"
      policy = data.vault_policy_document.db_admin.hcl
    }

    resource "vault_generic_endpoint" "bob" {
      depends_on           = [vault_auth_backend.userpass]
      path                 = "auth/userpass/users/bob"
      ignore_absent_fields = true

      data_json = jsonencode({
        "policies" : [vault_policy.db_admin.name],
        "password" : "bob"
      })
    }

    resource "vault_mount" "db" {
      path = "database"
      type = "database"
    }

    resource "vault_database_secret_backend_connection" "postgres" {
      backend           = vault_mount.db.path
      name              = "postgres"
      allowed_roles     = ["*"]
      verify_connection = false

      postgresql {
        connection_url = "postgres://username:password@localhost/database"
      }
    }
    $ terraform apply --auto-approve

then using bob to create a role associated to the `postgres` connection.

This patch changes the way the UI does the update: it still tries to
update the database connection but if it fails to do so because it does not
have the permission it just silently skip this part and updates the role.

This also update the error message returned to the user in case of issues
to include the actual errors.

* Add changelog

* Also ignore error when deleting a role

* Address code review comments

---------

Co-authored-by: Chelsea Shaw <82459713+hashishaw@users.noreply.github.com>
2024-01-05 11:11:33 -08:00
claire bontempo
0e23ae96ab UI: remove keyvauluri from credentials section (#24679)
* remove keyvauluri from credentials section

* move comment
2024-01-05 10:49:38 -08:00
Steven Clark
fbb70eb0c6 Fix pluralization typo in ACME entity assignment doc (#24676) 2024-01-05 10:52:33 -05:00
miagilepner
5aea0dac1c [VAULT-22641] Include secret sync associations with hyperloglog estimations (#24586)
* include secret sync associations with hlls

* add test comment

* secret sync associations -> secret syncs
2024-01-05 14:11:23 +01:00
miagilepner
2051758f04 rename secret sync association to secret syncs in activity log (#24671) 2024-01-05 11:27:20 +01:00
claire bontempo
36fc2c1a73 Secrets Sync UI: Bug fixes part 3 (#24644)
* update header to refer to destination name

* teeny design improvements VAULT-22943

* update azure model attrs

* remove padding, add destination type to description VAULT-22930 VAULT-22943

* fix overview popupmenu nav to sync secrets VAULT-22944

* update sync banner, hyperlink secret

* redirect when all destinations are deleted VAULT-22945

* add keyVaultUri to credentials for editing

* fix extra space and test for sync banner

* use localName to get dynamic route section to fix pagination transition error

* add copy header remove duplicate app type

* add cloud param to azure mirage destination

* add comments

* enter line

* conditionally render view synced secrets button

* revert pagination route change

* combine buttons and add logic for args

* rename to route

* remove model arg
2024-01-04 20:02:12 +00:00
David Suarez
52917e0908 Set consistency prior to calling CreateSesion (#24649)
* Set consistency prior to calling CreateSesion

* Add changelog

---------

Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-01-04 14:09:59 -05:00
dependabot[bot]
3b08d08909 Bump google.golang.org/grpc in /vault/hcp_link/proto (#23966)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.56.2 to 1.56.3.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.56.2...v1.56.3)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-01-04 14:09:12 -05:00
Thy Ton
2cd8bbaa75 add token_reviewer_jwt_set to resp data on config read example on k8s auth api doc (#24564) 2024-01-04 13:27:49 -05:00
Christopher Swenson
52d9d43a1c Refactor auto-auth backoff to helper package. (#24668)
I have an upcoming PR for event notifications that needs similar
exponential backoff logic, and I prefer the API and logic in the
auto-auth exponential backoff rather than that of
github.com/cenkalti/backoff/v3.

This does have a small behavior change: the auto-auth min backoff
will now be randomly reduced by up to 25% on the first call. This is
a desirable property to avoid thundering herd problems, where a bunch
of agents won't all try have the same retry timeout.
2024-01-04 10:26:41 -08:00
dependabot[bot]
edaa48ad90 Bump github.com/containerd/containerd from 1.7.0 to 1.7.11 (#24598)
Bumps [github.com/containerd/containerd](https://github.com/containerd/containerd) from 1.7.0 to 1.7.11.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v1.7.0...v1.7.11)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-01-04 13:20:09 -05:00
dependabot[bot]
0c12eedd19 Bump golang.org/x/crypto from 0.6.0 to 0.17.0 in /api (#24579)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.6.0 to 0.17.0.
- [Commits](https://github.com/golang/crypto/compare/v0.6.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-01-04 13:19:40 -05:00
Violet Hynes
a649d2b9a9 VAULT-17292 CE portion of changes (#24667)
* VAULT-17292 CE portion of changes

* VAULT-17292 docs

* VAULT-17292 changelog
2024-01-04 13:01:38 -05:00
Steven Clark
ade75bcf00 Update licensing across various source files (#24672) 2024-01-04 12:59:46 -05:00
Andy Assareh
ab2e0e5a28 typo corrections - spelling and grammar (#24625)
* typo corrections - spelling

* spelling and grammar
2024-01-04 12:50:42 -05:00
Deniz Onur Duzgun
cf07c3d497 Remove unused token (#24577) 2024-01-04 12:40:27 -05:00
dependabot[bot]
bb82e0bdb7 Bump google.golang.org/grpc from 1.41.0 to 1.56.3 in /api/auth/gcp (#23970)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.41.0 to 1.56.3.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.41.0...v1.56.3)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-01-04 12:34:00 -05:00
dependabot[bot]
c535c54537 Bump @babel/traverse from 7.15.4 to 7.23.2 in /website (#24042)
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.15.4 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-01-04 12:33:15 -05:00
dependabot[bot]
90ab8fab46 Bump golang.org/x/net from 0.7.0 to 0.17.0 in /api (#24043)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.7.0 to 0.17.0.
- [Commits](https://github.com/golang/net/compare/v0.7.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-01-04 11:38:10 -05:00
dependabot[bot]
40780f5003 Bump golang.org/x/net from 0.9.0 to 0.17.0 in /vault/hcp_link/proto (#24044)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.9.0 to 0.17.0.
- [Commits](https://github.com/golang/net/compare/v0.9.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-01-04 11:37:27 -05:00
Ikko Eltociear Ashimine
7f1a43c9a4 Update namespace-picker.js (#24653)
therefor -> therefore

Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-01-04 11:36:51 -05:00
Violet Hynes
75d0581464 VAULT-8790 Ensure time.NewTicker never gets called with a negative value (#24402)
* Ensure time.NewTicker never gets called with a negative value

* Remove naughty newline

* VAULT-8790 review feedback
2024-01-03 15:34:41 -05:00
Chris Capurso
6b142b4dcc VAULT-22552: Add MaxConnsPerHost field to Agent template_config (#24548)
* add MaxConnectionsPerHost to agent template config

* set MaxConnsPerHost in consul-template manager config

* add MaxConnectionsPerHost to agent generate-config

* fix agent generate-config tests

* doc updates

* bump consul-template to 0.36.0

* add changelog entry

* minor docs change

* fix nil pointer deref for MaxConnectionsPerHost template config

* Update template docs

Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>

---------

Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-01-03 15:06:41 -05:00
Jordan Reimer
1c04c8ab62 fixes issue transitioning to overview from destination route via breadcrumb (#24663) 2024-01-03 11:07:43 -07:00
Steven Clark
610c8a4d38 Move Vault's customized pkcs7 fork into a shared location (#24658)
- The PKI plugin needs to use the customized pkcs7 fork
   so move it out from the aws credential plugin's package
   into a shared location
2024-01-03 12:11:44 -05:00
Matthew Irish
73254908e6 docs(web repl): add initial docs about the UI REPL (#24642)
* docs(web repl): add initial docs about the UI REPL

* feature(repl): add link to the new docs in the REPL

* chore(repl): Web CLI or Broweser CLI -> Web REPL

* Use Hds::Link::Inline instead of DocLink

Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>

* Update ui/app/templates/components/console/ui-panel.hbs

Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>

* Update website/content/docs/commands/web.mdx

Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>

* Update website/content/docs/commands/web.mdx

Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>

* Fix typos and update phrasing.

Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>

* docs(web repl): add a refrence to the repl docs on the ui config page

* Update KV version 2 reference

Co-authored-by: Chelsea Shaw <82459713+hashishaw@users.noreply.github.com>

* fix linting

---------

Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>
Co-authored-by: Chelsea Shaw <82459713+hashishaw@users.noreply.github.com>
2024-01-02 22:17:51 +00:00
hc-github-team-es-release-engineering
366db10cf2 [DO NOT MERGE UNTIL EOY] update year in LICENSE and copywrite files (#24368) 2024-01-02 13:22:15 -08:00