Fix CRLY.01176: Constrain IAM Write Access#42
Open
curly-review[bot] wants to merge 1 commit intomasterfrom
Open
Fix CRLY.01176: Constrain IAM Write Access#42curly-review[bot] wants to merge 1 commit intomasterfrom
curly-review[bot] wants to merge 1 commit intomasterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue Details
ID: CRLY.01176
Severity: HIGH
File: sam/cfn/cfn-dynamodb-tables.yaml
Remediation Summary
Description
The IAM policy defined in the provided YAML file allows unrestricted write access to DynamoDB tables and CloudWatch alarms. This poses a security risk as it could lead to unauthorized modifications or deletions. To mitigate this, we need to constrain the IAM policy to only allow write access under specific conditions.
Steps
Identify the IAM policy that needs modification:
The policy in question is defined in the
sam/cfn/cfn-dynamodb-tables.yamlfile.Update the IAM policy to restrict write access:
We need to add conditions to the policy statements that allow write access only under specific circumstances. For example, we can restrict write access to certain DynamoDB tables or CloudWatch alarms.
Implement the changes programmatically:
Here's an example of how you can modify the IAM policy using AWS CloudFormation in YAML:
In this example:
dynamodb:DescribeTableandcloudwatch:*actions are allowed with a condition that restricts access to a specific table name.dynamodb:UpdateTableaction is allowed only for a specific DynamoDB table.Ensure that the updated IAM policy is deployed using your CI/CD pipeline. This can be done by updating the CloudFormation stack or using the AWS SDK in your preferred programming language.
By following these steps, you can constrain IAM write access and enhance the security of your AWS resources.