-
Notifications
You must be signed in to change notification settings - Fork 199
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 azure KMS as another option in refs #410
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
|
||
logger = logging.getLogger(__name__) | ||
|
||
# We are using default credentials as defined in the link: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good candidate have in documentation instead of comments. I'd suggest adding this and any other needed docs for azkms to docs/secrets.md
:) That way they are also searchable/indexed in the website https://kapitan.dev
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
kapitan/cli.py
Outdated
secret_obj = AzureKMSSecret(data, vault, key, encode_base64=args.base64) | ||
raise KapitanError("No KMS vault specified. Use --azure-vault or specify it in parameters.kapitan.secrets.azkms.vault and use --target-name") | ||
if not encryption_algorithm: | ||
raise KapitanError("No KMS vault specified. Use --azure-key-algo or specify it in parameters.kapitan.secrets.azkms.vault and use --target-name") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No KMS Key algorithm specified*
The msg here should be updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general looks good! 👍
Don't forget to add some docs under docs/secrets.md
.
kapitan/cli.py
Outdated
# | ||
# Azure KMS marker -- remove it | ||
# | ||
# TODO: same key but in a different vault (check ..) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This TODO should either be fixed before merging or be more detailed so that if needed someone else can also take over. :)
kapitan/refs/secrets/azkms.py
Outdated
rsa_oaep_256 = "RSA-OAEP-256" | ||
rsa1_5 = "RSA1_5" | ||
|
||
# an old classic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In comments, we need an explanation of what the code below does or other edge cases.
This comment seems unclear.
kapitan/refs/secrets/azkms.py
Outdated
# an old classic | ||
@staticmethod | ||
def value_of(value): | ||
for m, mm in EncryptionAlgorithm.__members__.items(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is m
and what is mm
in this context?
One of them is algorithm members probably. But it helps readability a lot if we use longer-named variables here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for _attribute_name, _ in EncryptionAlgorithm.members.items():
Travis is failing because |
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
"gkms secrets module" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to azkms
""" | ||
#TODO : import the module so that it depends on | ||
|
||
rsa_oaep = "RSA-OAEP" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not turn this into a dict?
# an old recepie using java style attribuet access for Enum's | ||
@staticmethod | ||
def value_of(value): | ||
for _attribute_name, _ in EncryptionAlgorithm.__members__.items(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use dict instead?
Would be interested in seeing this merged. Is forking and doing a PR good practice? |
If you maintain the other authors' commits I don't see why not. :) |
Fixes issue #
Add azure kms as another backend as described here
https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/keyvault/azure-keyvault-keys#cryptographic-operations
this requires a key vault with a key and a service principal with - GET, ENCRYPT and DECRYPT added to it
Proposed Changes
add another module azkms
update cli with --vault option
add in azure pip dependencies
TODO: add a test module for azkms