JamesWoolfenden / pike

Pike is a tool for determining the permissions or policy required for IAC code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SNS:CreateTopic missing + possibly others..

Woolersuk opened this issue · comments

Describe the bug
Hello good sir...

I added a resource for SNS notifications & noticed I didn't have permission, when I ran a pike scan, this was not picked up...

To Reproduce
in a TF repo, add in something like this:

module "mail_notification" {
source = "geekcell/sns-email-notification/aws"
version = "1.0.2"

email_addresses = ["myemail@whatever.com"]
name = "My_Alert"
}

Expected behavior
SNS permissions are shown..

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
In the end, I had to add the following permissions using the module above if it helps!

            "SNS:CreateTopic",
            "SNS:DeleteTopic",
            "SNS:GetSubscriptionAttributes",
            "SNS:GetTopicAttributes",
            "SNS:ListTagsForResource",
            "SNS:Publish",
            "SNS:SetTopicAttributes",
            "SNS:Subscribe",
            "SNS:TagResource",
            "SNS:Unsubscribe",

ok the perms for topic subscription were empty:
"SNS:Subscribe",
"SNS:GetSubscriptionAttributes",
"SNS:Unsubscribe"

were missing.
So only "SNS:Publish" is different. I'm not seeing this as required for making an snstopic/subscription maybe you had other resources/actions that required it?

i pushed a new version

I was also creating an aws_autoscaling_notification if that helps too.

nothing obvious without seeing the code, not really expecting publish unless you actually try an use the topic

Sorry, yes, the module I'm using creates these:

aws_sns_topic.main
aws_sns_topic_subscription.main

i dont think SNS:Publish is required, ok to close this?

Yeah.