sbstjn / serverless-dynamodb-autoscaling

Serverless Plugin for Amazon DynamoDB Auto Scaling configuration.

Home Page:https://sbstjn.com/serverless-dynamodb-auto-scaling-with-cloudformation.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove `*` resource configuration for role policy

sbstjn opened this issue · comments

The permissions for the created role must have a restricted access policy. The current implementation should not be used in production environments.

  'Statement': [
    {
      'Effect': 'Allow',
      'Action': [
        'dynamodb:DescribeTable',
        'dynamodb:UpdateTable',
        'cloudwatch:PutMetricAlarm',
        'cloudwatch:DescribeAlarms',
        'cloudwatch:DeleteAlarms',
        'cloudwatch:GetMetricStatistics',
        'cloudwatch:SetAlarmState'
      ],
      'Resource': '*'
    }
  ]

A first step to a more secure solution would be at least a policy bound to the account and table name:

{
            "Action": [
                "dynamodb:DescribeTable",
                "dynamodb:UpdateTable"
            ],
            "Resource": "arn:aws:dynamodb:*:AccountID:table/TableName",
            "Effect": "Allow"
        }

Included in the 0.1.1 release.