mozilla / frost

Unit testing framework for test driven security of AWS, GCP, Heroku and more.
https://mozilla.github.io/frost/
Mozilla Public License 2.0
104 stars 24 forks source link

Add test for subscriptions without topics. #428

Closed Micheletto closed 3 years ago

Micheletto commented 3 years ago

This PR intends to do two things:

  1. Stop the sns_subscription_attributes() function from crashing the test_sns_pending_verified.py test when the AWS API throws an error on getting attributes for a subscription that does not have a parent topic.
  2. Add a test to find subscriptions that have no parent topic.

It works as is, but there are few things that need fixing before a merge.

No doubt there are other pythonic issues.

Micheletto commented 3 years ago

I believe this is ready to merge.

Some comments for the PR:

1. Stop the `sns_subscription_attributes()` function from crashing the **test_sns_pending_verified.py** test when the AWS API throws an error on getting attributes for a subscription that does not have a parent topic.

No longer querying subscription attributes.

topic = ':'.join(re.split(':', s_arn)[0:6])

No longer doing this.

  * `sns_parent_topic_exists()`
  * `sns_get_subscription_attrs()`

These functions are gone.