Skip to content

fix(dynamodb): grant*Data() methods are missing the dynamodb:DescribeTable permission#19129

Merged
mergify[bot] merged 1 commit intoaws:masterfrom
chris-smith-zocdoc:issue_18773
Feb 25, 2022
Merged

fix(dynamodb): grant*Data() methods are missing the dynamodb:DescribeTable permission#19129
mergify[bot] merged 1 commit intoaws:masterfrom
chris-smith-zocdoc:issue_18773

Conversation

@chris-smith-zocdoc
Copy link
Copy Markdown
Contributor

Fixes #18773

This allows the high level dynamodb clients to function correctly


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

@gitpod-io
Copy link
Copy Markdown

gitpod-io bot commented Feb 24, 2022

@github-actions github-actions bot added the @aws-cdk/aws-dynamodb Related to Amazon DynamoDB label Feb 24, 2022
@chris-smith-zocdoc chris-smith-zocdoc force-pushed the issue_18773 branch 2 times, most recently from 340a14f to 321b4de Compare February 24, 2022 04:20
Copy link
Copy Markdown
Contributor

@skinny85 skinny85 left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution @chris-smith-zocdoc! One small suggestion.

'dynamodb:GetShardIterator',
];

export const DESCRIBE_TABLE = 'dynamodb:DescribeTable'; No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What do you think of just adding 'dynamodb:DescribeTable' to the READ_STREAM_DATA_ACTIONS array? I think that's basically what we're going for here, and it would save us from doing any other edits to the production code in this PR (OK, minus the comments 😉).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Do you mean READ_DATA_ACTIONS? READ_STREAM_DATA_ACTIONS is for the DynamoDB stream, not reading/writing to the table.

I did consider adding it to READ_DATA_ACTIONS but that had two issues

  1. It doesn't cover the write use case, ie grantWriteData()
  2. If I added it to both READ_DATA_ACTIONS and WRITE_DATA_ACTIONS then I'd need code to de-dup it for grantReadWriteData

So it seemed simpler to implement it as an additional permission that is added to the necessary grant* calls

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yep, I meant READ_DATA_ACTIONS.

OK, fair enough!

@aws-cdk-automation
Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: 0b5b5bc
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@skinny85 skinny85 changed the title fix(dynamodb): Add dynamodb:DescribeTable to all grant*Data() calls fix(dynamodb): grant*Data() methods are missing the dynamodb:DescribeTable permission Feb 25, 2022
@skinny85 skinny85 changed the title fix(dynamodb): grant*Data() methods are missing the dynamodb:DescribeTable permission fix(dynamodb): grant*Data() methods are missing the dynamodb:DescribeTable permission Feb 25, 2022
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Feb 25, 2022

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 4a44a65 into aws:master Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

@aws-cdk/aws-dynamodb Related to Amazon DynamoDB

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aws_dynamodb: grant*Data() should include the dynamodb:DescribeTable permission

3 participants