Skip to content

Instantly share code, notes, and snippets.

@ravituvar
Last active September 27, 2017 12:18
Show Gist options
  • Save ravituvar/13d06b73493ab92607a68641b2517f4d to your computer and use it in GitHub Desktop.
Save ravituvar/13d06b73493ab92607a68641b2517f4d to your computer and use it in GitHub Desktop.
ServerlessPermissions.json
https://www.bountysource.com/issues/35584735-narrowing-the-serverless-iam-deployment-policy
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"cloudformation:Describe*",
"cloudformation:List*",
"cloudformation:Get*",
"cloudformation:PreviewStackUpdate"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"cloudformation:CreateStack",
"cloudformation:UpdateStack",
"cloudformation:DeleteStack"
],
"Resource": "arn:aws:cloudformation:*:*:stack/${project}*"
},
{
"Effect": "Allow",
"Action": [
"lambda:Get*",
"lambda:List*",
"lambda:CreateFunction"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"lambda:AddPermission",
"lambda:CreateAlias",
"lambda:DeleteFunction",
"lambda:InvokeFunction",
"lambda:PublishVersion",
"lambda:RemovePermission",
"lambda:Update*"
],
"Resource": "arn:aws:lambda:*:*:function:${project}*"
},
{
"Effect": "Allow",
"Action": [
"lambda:*"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"apigateway:GET"
],
"Resource": [
"arn:aws:apigateway:*::/restapis"
]
},
{
"Effect": "Allow",
"Action": [
"apigateway:GET",
"apigateway:POST",
"apigateway:PUT",
"apigateway:DELETE"
],
"Resource": [
"arn:aws:apigateway:*::/restapis/*/*"
]
},
{
"Effect": "Allow",
"Action": [
"iam:PassRole"
],
"Resource": "arn:aws:iam::*:role/*"
},
{
"Effect": "Allow",
"Action": "kinesis:*",
"Resource": "arn:aws:kinesis:*:*:stream/${project}*"
},
{
"Effect": "Allow",
"Action": "iam:*",
"Resource": "arn:aws:iam::*:role/${project}*"
},
{
"Effect": "Allow",
"Action": "sqs:*",
"Resource": "arn:aws:sqs:*:*:${project}*"
},
{
"Effect": "Allow",
"Action": [
"events:Put*",
"events:Remove*",
"events:Delete*"
],
"Resource": "arn:aws:events:*:*:rule/${project}*"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment