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

Introduce resset Action permissions for KMS key ops. #34

Closed
wants to merge 1 commit into from

Conversation

timflyio
Copy link
Contributor

@timflyio timflyio commented Sep 9, 2024

No description provided.

ActionSign
ActionVerify
ActionEncrypt
ActionDecrypt
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@btoews are you OK having this sort of KMS-specific detail in the macaroon library?
Would it be better to have some generic names here like "ActionOp1", "ActionOp2" and then in petsem authority define those names as "ActionSign", "ActionVerify"?

Copy link
Member

Choose a reason for hiding this comment

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

I'd like to avoid adding KMS-specific values to this package, especially since we've only given ourselves 16 bits for Action. I couldn't put my finger on a better solution, so I spent some time experimenting. The best I came up with was to make ResourceSet take a second type parameter for the Action. This seems to work pretty cleanly. Let me know what you think #35 https://github.com/superfly/nomad-firecracker/pull/2667

Copy link
Member

Choose a reason for hiding this comment

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

Another thing that works well with having a second, extended Action type is that it's more backwards compatible with existing macaroons. For Encrypt, for example, we can require ActionControl | ActionEncrypt. When checking the Apps caveat, we'll only look for the ActionControl part, but we'll look for ActionControl and ActionEncrypt when verifying Secrets or SecretTypes caveats.

@timflyio timflyio marked this pull request as ready for review September 9, 2024 19:41
@timflyio
Copy link
Contributor Author

merging your nmf changes into my nmf PR and dropping this PR.

@timflyio timflyio closed this Sep 10, 2024
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