-
Notifications
You must be signed in to change notification settings - Fork 55
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 Transform Secrets engine support #102
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
calvn
reviewed
Jun 29, 2020
c913dc5
to
2a10df8
Compare
2a10df8
to
945dbdc
Compare
calvn
reviewed
Jul 6, 2020
calvn
reviewed
Jul 6, 2020
calvn
reviewed
Jul 6, 2020
98bc2d4
to
ac52a2a
Compare
ac52a2a
to
a2cef6c
Compare
calvn
reviewed
Jul 6, 2020
calvn
approved these changes
Jul 7, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ENTERPRISE VAULT ONLY
Description
The vault ruby gem was updated to allow usage of the transform secrets engine a little while back. This PR allows for the usage of that engine within rails, extending the
vault_attribute
class function to accept atransform_secret
hash that allows for the usage of FPE with a vault-internal tweak_source. Support for additional tweak_sources and transformation types may be provided in the future.Similar to the Transit engine already implemented, this functionality uses a db column either provided by the user with the
encrypted_column
option, or uses thevault_attribute
name provided with a_encrypted
appended as a suffix (e.g.vault_attribute :ssn
will havessn_encrypted
as the column that stores the value.Note: due to constraints from ActiveRecord, we do NOT encourage people to use the name of the attribute as the column name (i.e. specifying
encrypted_column: 'ssn'
for the above example). The reason is this causes some instance attribute collisions that creates some confusion on the exact state of the data, particularly after callingreload
on the object.Usage Instructions
Currently, the only fields accepted by the
transform_secrets
hash are:transformation
- required - String of the transformation namerole
- String of the role name to be using the given transformationAll configuration of a given transformation should be done in vault, either via the HTTP API (which vault-ruby uses), or via the Vault CLI. Information on how to do so can be found here.