Skip to content

Decrypt oracle #87

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

Merged
merged 37 commits into from
Oct 12, 2018
Merged

Decrypt oracle #87

merged 37 commits into from
Oct 12, 2018

Conversation

mattsb42-aws
Copy link
Member

Description of changes:

This provides the initial iteration of the decrypt oracle.

Not addressed in this PR is how we plan to handle CD for this API. I'll tackle that separately.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@mattsb42-aws mattsb42-aws requested a review from a team September 27, 2018 01:56
if arn.startswith("arn:") and ":alias/" not in arn:
return arn

raise ValueError("KMS CMK ARN provided for integration tests must be a key not an alias")
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we raise a custom exception type here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Would that add value? The problem that this exception is identifying is that a user-provided value is incorrect. That seems to me to be the definition of ValueError.

Copy link
Contributor

Choose a reason for hiding this comment

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

If you expect something to catch this exception, then yes. Its cheap to provide a custom exception, and we aren't giving up anything that ValueError provides.

Copy link
Member Author

Choose a reason for hiding this comment

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

The only place this error will manifest is in pytest error logs.

* remove import safeguards to allow 3.5.0 and 3.5.1 to not fail
* convert from comment-style typehints to inline
Copy link
Contributor

@SalusaSecondus SalusaSecondus left a comment

Choose a reason for hiding this comment

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

IANAPD

]
},
{
"Effect": "Deny",
Copy link
Contributor

Choose a reason for hiding this comment

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

For this statement, I think you need to split it into two, because the NotAction and the NotResource are joined by an AND. So the statement as written says "DENY if and only if it is NOT an approved action AND it is NOT an approved resource." That means you won't get an explicit DENY if it is an unapproved action for an approved resource (or vice-versa).

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not 100% on the policy combination, but splitting them into two (Action * with NotResource specifics and NotAction specifics with Resource *) made everything fail, including the CloudWatch logging. Reverted back to the (NotAction specifics with NotResource specifics) for now.

@mattsb42-aws mattsb42-aws merged commit 1d0e40d into aws:master Oct 12, 2018
@mattsb42-aws mattsb42-aws deleted the decrypt-oracle branch October 12, 2018 22:40
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.

3 participants