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

Update marcellanz/transit_pkcs1v15 RSA encryption support #25486

Merged
merged 39 commits into from
Oct 9, 2024

Conversation

sgmiller
Copy link
Contributor

Make it compatible with recent versions of Vault's key policy engine.

marcellanz and others added 15 commits July 19, 2022 19:06
Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>
Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>
Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>
Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>
Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>
Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>
@sgmiller sgmiller requested a review from a team as a code owner February 16, 2024 17:19
@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Feb 16, 2024
Copy link

github-actions bot commented Feb 16, 2024

Build Results:
All builds succeeded! ✅

Copy link

github-actions bot commented Feb 16, 2024

CI Results:
All Go tests succeeded! ✅

sdk/helper/keysutil/policy.go Dismissed Show dismissed Hide dismissed
…vault into sgm/pkcs15-padding-conflicts

# Conflicts:
#	builtin/logical/transit/path_datakey.go
#	builtin/logical/transit/path_decrypt.go
#	builtin/logical/transit/path_encrypt.go
#	builtin/logical/transit/path_rewrap.go
@sgmiller sgmiller requested review from stevendpclark and a team February 21, 2024 17:18
@sgmiller sgmiller added this to the 1.17.0-rc milestone Feb 21, 2024
sgmiller and others added 5 commits February 21, 2024 11:35
 - Fix padding scheme dropdown console error by adding values
   to the transit-key-actions.hbs
 - Populate both padding scheme drop down menus within rewrap,
   not just the one padding_scheme
 - Do not submit a padding_scheme value through POST for non-rsa keys
…_scheme

 - Map the appropriate API fields for the RSA padding scheme to the
   batch items within the rewrap API
 - Add the ability to create RSA keys within the encrypt API endpoint
 - Add test case for rewrap api that leverages the padding_scheme fields
@anwittin anwittin modified the milestones: 1.17.0-rc, 1.18.0-rc May 28, 2024
@anwittin anwittin modified the milestones: 1.18.0-rc, 1.19.0-rc Sep 17, 2024
@sgmiller sgmiller requested a review from a team as a code owner October 3, 2024 21:24
Copy link
Contributor

@hellobontempo hellobontempo left a comment

Choose a reason for hiding this comment

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

Nice work! Thanks for tackling the UI side of this as well. If possible, a screenshot of this change in the UI is helpful for posterity.

Also, do you plan to add test coverage for this? I believe it'd be similar to the test written [here])https://github.com/hashicorp/vault/blob/main/ui/tests/integration/components/transit-key-actions-test.js#L69)

I'm also happy to write one if that'd be helpful! Otherwise, any of the data-test- selectors that were added in the .hbs files can be removed as they're not being used.

ui/app/templates/components/transit-key-action/datakey.hbs Outdated Show resolved Hide resolved
ui/app/templates/components/transit-key-action/decrypt.hbs Outdated Show resolved Hide resolved
onchange={{action (mut @padding_scheme) value="target.value"}}
>
{{#each (array "oaep" "pkcs1v15") as |scheme|}}
<option selected={{if @padding_scheme (eq @padding_scheme scheme) (eq scheme "oaep")}} value={{scheme}}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question here as above

ui/app/components/transit-key-actions.js Outdated Show resolved Hide resolved
ui/app/templates/components/transit-key-action/decrypt.hbs Outdated Show resolved Hide resolved
>
{{#each (array "oaep" "pkcs1v15") as |scheme|}}
<option
selected={{if @decrypt_padding_scheme (eq @decrypt_padding_scheme scheme) (eq scheme "oaep")}}
Copy link
Contributor

Choose a reason for hiding this comment

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

same comment here about setting the default for decrypt_padding_scheme in the transit-key-actions.js file and simplifying this conditional to just {{eq @decrypt_padding_scheme scheme}}

Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>
@sgmiller
Copy link
Contributor Author

sgmiller commented Oct 4, 2024

Nice work! Thanks for tackling the UI side of this as well. If possible, a screenshot of this change in the UI is helpful for posterity.

Also, do you plan to add test coverage for this? I believe it'd be similar to the test written [here])https://github.com/hashicorp/vault/blob/main/ui/tests/integration/components/transit-key-actions-test.js#L69)

I'm also happy to write one if that'd be helpful! Otherwise, any of the data-test- selectors that were added in the .hbs files can be removed as they're not being used.

This was a community created PR, and the author may not still be around to tackle UI testing/changes. If you have bandwidth feel free.

 - The data key api was using the incorrect parameter name for
   the padding scheme
 - Enforce that padding_scheme is only used on RSA keys, we
   are punting on supporting it for managed keys at the moment.
@sgmiller sgmiller merged commit 3c0656e into main Oct 9, 2024
91 checks passed
@sgmiller sgmiller deleted the sgm/pkcs15-padding-conflicts branch October 9, 2024 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants