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

plugin list fails when audit is enabled #17722

Closed
jorgemarey opened this issue Oct 28, 2022 · 4 comments · Fixed by #18173
Closed

plugin list fails when audit is enabled #17722

jorgemarey opened this issue Oct 28, 2022 · 4 comments · Fixed by #18173
Labels
bug Used to indicate a potential bug core/audit core/plugin

Comments

@jorgemarey
Copy link

Describe the bug
When executing the command vault plugin list (or using the API) if audit is enabled vault will fail and report a error.

2022-10-28T07:19:22.397Z [ERROR] audit: panic during logging: request_path=sys/plugins/catalog error="reflect: reflect.Value.Set using value obtained using unexported field"
2022-10-28T07:19:22.398Z [ERROR] core: failed to audit response: request_path=sys/plugins/catalog
  error=
  | 1 error occurred:
  | 	* panic generating audit log
  | 

To Reproduce

  1. enable audit
  2. Run vault plugin list
  3. See error

Environment:
vault v1.12.0

Additional context

I saw that there were some changes related to output version on plugins, so I guess it's related to that. I also found some issues (#2687 and #1911) with the same error but they're from a long time ago.

@ccapurso ccapurso added bug Used to indicate a potential bug core/audit core/plugin labels Oct 31, 2022
@AnthonyHerman
Copy link

Hitting this as well in v1.12.1

@jmthvt
Copy link

jmthvt commented Nov 16, 2022

If I understand correctly, it would be because of this *version.Version.

SemanticVersion *version.Version `json:"-"`

As per #1911:

reflect just goes as deep as it can, and the callbacks have to check if the fields can be set.

So it eventually hits these *version unexported fields:

type Version struct {
	metadata string
	pre      string
	segments []int64
	si       int
	original string
}

@artur-borys1
Copy link

Hi, are there any updates on this or should I use older (< 1.12.0) version of Vault?

@tomhjp
Copy link
Contributor

tomhjp commented Nov 30, 2022

Thanks for the report, and sorry this didn't get fixed in time for 1.12.2. #18173 should fix it, and will be in 1.12.3.

It's not ideal, but the best listing workaround I can offer for now (other than disabling auditing which is obviously a no-go) is that the "typed" list endpoints don't suffer from this problem, so e.g. vault list sys/plugins/catalog/database, but they don't include versioned plugins right now.

Affected Vault versions are 1.12.0, 1.12.1 and 1.12.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Used to indicate a potential bug core/audit core/plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants