Skip to content

Commit cb2f9f9

Browse files
committed
add a simple demo for iam policy stream
1 parent 7bad618 commit cb2f9f9

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,22 @@ For testing the app within the GitHub Actions workflow, you can refer to the pro
139139

140140
Visit the [IAM Policy Stream](https://app.localstack.cloud/inst/default/policy-stream) to view the permissions required for each API call. This feature enables you to explore and progressively enhance security as your application develops.
141141

142-
To get started, restart the LocalStack container using the command `localstack restart` and load the Cloud Pod. Then, click on **Enable**.
142+
To get started, restart the LocalStack container using the command `localstack restart` and load the Cloud Pod. Then, click on **Enable Stream**. You can un-select **Show internal calls** to prevent IAM policies that are unnecessary for the demo.
143143

144-
> Add **SQS** in the **Exclude Services** dropdown. This step filters out background API calls that aren't necessary for the demo.
144+
Toggle **Enforce IAM Policies** to enable strict IAM enforcement. For demo purpose, the following policy statement has been removed from the `configurations/submit_quiz_policy.json`:
145+
146+
```json
147+
{
148+
"Effect": "Allow",
149+
"Action": ["sqs:GetQueueUrl", "sqs:SendMessage"],
150+
"Resource": "arn:aws:sqs:us-east-1:000000000000:QuizSubmissionQueue"
151+
}
152+
```
145153

146154
Engage with the application or run tests to generate a policy stream for various services. During this process, you may notice some **IAM Violations**. These are intentionally included to demonstrate how the IAM Policy Stream can be used to test policies in a secure developer setting, helping to identify and resolve missing policies to ensure everything works in production environments.
147155

156+
Find the missing policy statements and fix the IAM Policy on the [IAM Resource Browser](https://app.localstack.cloud/inst/default/resources/iam/roles) (for `SubmitQuizRole`) or patch it locally and update the policy using AWS CLI.
157+
148158
## Chaos Engineering
149159

150160
To experiment with Chaos in your developer environment, visit the [Chaos Engineering dashboard](https://app.localstack.cloud/chaos-engineering). Here, you can inject various chaos scenarios, such as rendering the DynamoDB service unavailable in the `us-east-1` region or introducing a 90% occurrence of `ProvisionedThroughputExceededException` errors in your DynamoDB calls to observe how the application handles these disruptions.

configurations/submit_quiz_policy.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,6 @@
66
"Action": "dynamodb:GetItem",
77
"Resource": "arn:aws:dynamodb:us-east-1:000000000000:table/Quizzes"
88
},
9-
{
10-
"Effect": "Allow",
11-
"Action": ["sqs:GetQueueUrl", "sqs:GetQueueAttributes"],
12-
"Resource": "*"
13-
},
14-
{
15-
"Effect": "Allow",
16-
"Action": "sqs:SendMessage",
17-
"Resource": "arn:aws:sqs:us-east-1:000000000000:QuizSubmissionQueue"
18-
},
199
{
2010
"Effect": "Allow",
2111
"Action": [

0 commit comments

Comments
 (0)