Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pipe MountPoint to audit logs #20411

Merged
merged 3 commits into from Apr 27, 2023
Merged

Pipe MountPoint to audit logs #20411

merged 3 commits into from Apr 27, 2023

Conversation

clemon
Copy link
Contributor

@clemon clemon commented Apr 27, 2023

VAULT-15882
required for Vault Insights, this PR simply pipes the existing Request.MountPoint into audit logs

@hashicorp-cla
Copy link

hashicorp-cla commented Apr 27, 2023

CLA assistant check
All committers have signed the CLA.

@clemon clemon added the backport/1.13.x Backport changes to `release/1.13.x` label Apr 27, 2023
@clemon
Copy link
Contributor Author

clemon commented Apr 27, 2023

  • vault server in dev mode, audit logs enabled
  • ./vault kv put -mount=secret chettest foo=bar
  • audit log contains mount_point
{
  "time": "2023-04-27T21:13:03.726637Z",
  "type": "response",
  "auth": {
    [...]
  },
  "request": {
    "mount_point": "secret/",
    "mount_type": "kv",
    "mount_accessor": "kv_4f00a322",
    "mount_running_version": "v0.14.2+builtin",
    "mount_class": "secret",
    [...]
  },
  "response": {
    "mount_point": "secret/",
    "mount_type": "kv",
    "mount_accessor": "kv_4f00a322",
    "mount_running_plugin_version": "v0.14.2+builtin",
    "mount_class": "secret",
    [...]
    }
  }
}

@clemon
Copy link
Contributor Author

clemon commented Apr 27, 2023

via user-defined path

  • ./vault secrets enable -path=chetkv kv
  • ./vault kv put -mount=chetkv chettest foo=bar
  • audit log contains mount_point chetkv
{
  "time": "2023-04-27T21:17:33.390072Z",
  "type": "response",
  "auth": {
    [...]
  },
  "request": {
    "mount_point": "chetkv/",
    "mount_type": "kv",
    "mount_accessor": "kv_f0cfb6c8",
    "mount_running_version": "v0.14.2+builtin",
    "mount_class": "secret",
    [...]
  },
  "response": {
    "mount_point": "chetkv/",
    "mount_type": "kv",
    "mount_accessor": "kv_f0cfb6c8",
    "mount_running_plugin_version": "v0.14.2+builtin",
    "mount_class": "secret"
  }
}

@clemon
Copy link
Contributor Author

clemon commented Apr 27, 2023

via user-generated subpath

  • ./vault secrets enable -path=chetkv2/subpath kv
  • ./vault kv put -mount=chetkv2/subpath chettest foo=bar
  • audit log contains mount_point chetkv2/subpath
{
  "time": "2023-04-27T21:22:10.659441Z",
  "type": "response",
  "auth": {
    [...]
  },
  "request": {
    "mount_point": "chetkv2/subpath/",
    "mount_type": "kv",
    "mount_accessor": "kv_a9420101",
    "mount_running_version": "v0.14.2+builtin",
    "mount_class": "secret",
    [...]
  },
  "response": {
    "mount_point": "chetkv2/subpath/",
    "mount_type": "kv",
    "mount_accessor": "kv_a9420101",
    "mount_running_plugin_version": "v0.14.2+builtin",
    "mount_class": "secret"
  }
}

changelog/20411.txt Outdated Show resolved Hide resolved
Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>
Copy link
Contributor

@swayne275 swayne275 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eyyyyy first Vault PR! Great work!

@swayne275
Copy link
Contributor

would you mind backporting this to version 1.12.x also? i know I didn't specify that at the beginning, but it looks like clusters that currently have insights are running v1.12.x

@clemon clemon merged commit ce96236 into main Apr 27, 2023
92 checks passed
@clemon clemon deleted the chet/15882-audit-log-mount-path branch April 27, 2023 22:32
clemon added a commit that referenced this pull request Apr 27, 2023
* MountPoint piped to audit logs
---------
Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>
clemon added a commit that referenced this pull request Apr 27, 2023
* MountPoint piped to audit logs
---------
Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>
clemon added a commit that referenced this pull request Apr 27, 2023
* MountPoint piped to audit logs
---------
Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>
clemon added a commit that referenced this pull request Apr 28, 2023
* MountPoint piped to audit logs
---------
Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>
clemon added a commit that referenced this pull request Apr 28, 2023
* MountPoint piped to audit logs
---------
Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>
clemon pushed a commit that referenced this pull request Apr 28, 2023
* MountPoint piped to audit logs
---------
Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>
clemon added a commit that referenced this pull request Apr 28, 2023
* MountPoint piped to audit logs
---------
Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>
clemon added a commit that referenced this pull request Apr 28, 2023
* MountPoint piped to audit logs
---------
Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>
clemon pushed a commit that referenced this pull request Apr 28, 2023
* MountPoint piped to audit logs
---------
Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.13.x Backport changes to `release/1.13.x` pr/no-milestone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants