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

Add custom metadata to data responses #51

Merged
merged 7 commits into from
Oct 26, 2021

Conversation

ccapurso
Copy link
Contributor

@ccapurso ccapurso commented Oct 22, 2021

Overview

This PR extends KVv2's key metadata field custom_metadata to the CreateOperation, ReadOperation, and PatchOperation responses for the /<mount>/data/:path endpoint. Extending this field to other endpoints allows for better auditing capability.

There is an associated implicit change in ACL semantics in that the field is available to the data endpoint independent of the calling token's ACLs (i.e. read access to /<mount>/metadata/:path). This concept has been mentioned in a separate docs PR.

Design of Change

The CreateOperation, ReadOperation, and PatchOperation handlers already access the secret's key metadata. The field will simply be added to the logical.Response for these handlers. It should also be noted that this field will automatically be included in the CLI output and has been verified in Vault PR #12907.

Related Issues/Pull Requests

@ccapurso ccapurso marked this pull request as ready for review October 25, 2021 20:10
@ccapurso ccapurso requested a review from a team October 25, 2021 20:21
@raskchanky
Copy link
Contributor

There is an associated implicit change in ACL semantics in that the field is available to the data endpoint independent of the calling token's ACLs (i.e. read access to //metadata/:path).

I'm curious if this is by design or an unavoidable side effect of something else. Are customers likely to be surprised if they issue a token that does not have read access to the metadata endpoint but find metadata present in the data response?

@ccapurso
Copy link
Contributor Author

ccapurso commented Oct 25, 2021

I'm curious if this is by design or an unavoidable side effect of something else. Are customers likely to be surprised if they issue a token that does not have read access to the metadata endpoint but find metadata present in the data response?

@raskchanky, this was discussed internally and it was determined that there wasn't a big security concern of providing this information as custom_metadata contains less sensitive information than the secret itself. We did discuss the potential for configuring the backend to enable/disable this functionality but will not be implementing anything like that at this time.

@ccapurso ccapurso merged commit bc1c42d into master Oct 26, 2021
@ccapurso ccapurso deleted the add-custom-metadata-to-data-responses branch October 26, 2021 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants