Commit Graph

18751 Commits

Author SHA1 Message Date
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
Sarah Chavis
c0e5a9ab1e Add KVv2 known issue to release notes (#24632)
* Add KVv2 known issue to release notes

* Update website/content/partials/known-issues/kv2-url-change.mdx

* Update website/content/partials/known-issues/kv2-url-change.mdx

---------

Co-authored-by: Yoko Hyakuna <yoko@hashicorp.com>
2024-01-02 08:35:02 -08:00
claire bontempo
066b4a1808 Secrets sync UI: Round of bug fixes part 2 (#24631)
* include all destomatopm types in list filter VAULT-22916

* move refresh list and clear dataset to finally VAULT-22917

* make empty state link prettier;

* update empty state message to show display name

* update tests

* wrap create destination CTA in enterprise conditional

* include link in p tag
2023-12-22 23:22:54 +00:00
Austin Gebauer
43c282f15a tools: upgrades gofumpt to v0.5.0 (#24637) 2023-12-22 14:36:44 -08:00
Max Coulombe
1cae21fb2f Fix small doc error (#24627)
* fix small doc error for vercel destination

Co-authored-by: Calvin Leung Huang <1883212+calvn@users.noreply.github.com>

---------

Co-authored-by: Calvin Leung Huang <1883212+calvn@users.noreply.github.com>
2023-12-22 09:14:22 -05:00
claire bontempo
f2cc80c282 Secrets Sync UI: Refactor vercel-project destination to expect array from server (#24628)
* fix vercel project to expect array from server

* add test

* use reduce function!
2023-12-21 14:39:05 -08:00
Raymond Ho
0ed86eb1a8 fix race condition on GetWorkerCounts by cloning map (#24616) 2023-12-21 10:28:36 -08:00
Austin Gebauer
84bc8b1743 docs: adds more targeted guidance for GCP workload identity (#24620)
* docs: adds more targeted guidance for GCP workload identity

* hopefully fix markdown
2023-12-21 10:25:08 -08:00
Austin Gebauer
082d2a6412 docs: fix code snippet copy for SAML auth method (#24619) 2023-12-21 08:48:07 -08:00
Justin Clayton
e7838a3594 Add some clarity to retry_join docs (#24605)
This edit was made based on customer feedback
2023-12-20 16:24:38 -08:00
Sarah Chavis
c93c0b39b4 [DOCS] Add how-to guide for containerize plugins (#24537)
Co-authored-by: Yoko Hyakuna <yoko@hashicorp.com>
2023-12-20 14:45:23 -08:00
Mike Palmiotto
3389a572b9 enos: Add Default LCQ validation to autopilot upgrade scenario (#24602)
* enos: Add default lcq validation to autopilot upgrade scenario

* Add timeout/retries to default lcq autopilot test
2023-12-20 15:25:20 -07:00
claire bontempo
0529b11571 Secrets Sync: Bug fixes part 1 (#24580) 2023-12-20 13:08:53 -08:00
Scott Miller
1384aefc69 CE changes for recovery mode docker tests (#24567)
* CE changes for recovery mode docker tests

* more conflicts

* move vars from ent
2023-12-20 10:41:58 -06:00
Marc Boudreau
b1d3f9618e flatten custom messages response structure (#24601) 2023-12-20 11:35:15 -05:00
Sarah Chavis
1d8d80e8de Remove invalid link (#24593) 2023-12-19 19:55:35 +00:00
benz0
954da5006c Update audit.mdx (#24561)
* Update audit.mdx

Per the discussion here: https://hashicorp.enterprise.slack.com/archives/CPEPB6WRL/p1656678311708759

This parameter does not apply to DR replication.
This document should specify that the `local` parameter only applies to performance replication because even with this enabled the audit device configuration is still replicated to a DR cluster. This is also the expected and desired behavior.

* Fixed typos

---------

Co-authored-by: Yoko Hyakuna <yoko@hashicorp.com>
2023-12-19 18:10:53 +00:00
Peter Wilson
d69a308098 refactor audit broker (#24587) 2023-12-19 17:05:30 +00:00
Marc Boudreau
3bdb7006dc VAULT-22535: Make end_time, type, and authenticated optional parameters for UI Custom Messages (#24528)
* make end_time, type, and authenticated optional parameters
authenticated will default to true
type will default to banner
end_time will be nil if not provided meaning it remains active forever

* improve method names

* add some go docs for functions that don't have any

---------

Co-authored-by: Peter Wilson <peter.wilson@hashicorp.com>
2023-12-19 09:16:55 -05:00
miagilepner
0b741c4d58 VAULT-22640: Add secret sync associations to precomputed queries (#24555)
* add support for secret sync associations to precomputed queries

* pr fixes

* update comment
2023-12-19 13:42:38 +00:00
Rachel Culpepper
2c08a2eb83 fix issues with copying config (#24573) 2023-12-18 15:32:35 -06:00
Christopher Swenson
4980cb0fe1 Delete metadata-read event (#24568)
We never generated such an event. This was just a mistake when
I wrote the initial docs.
2023-12-18 10:23:01 -08:00