Skip to content

Commit f049b76

Browse files
fix: #114 More secure IoT policy (#115)
* fix: #114 More secure IoT policy * chore: add contributor
1 parent ca538ad commit f049b76

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ If you have a new feature idea, please create and issue.
331331

332332
(alphabetical)
333333

334+
- [Ben Moses](https://github.com/benjymoses)
334335
- [Kristian Dreher](https://www.linkedin.com/in/kristiandreher)
335336
- [Roger Chi](https://rogerchi.com/)
336337
- [Sebastian / avocadomaster](https://github.com/avocadomaster)

src/infraDeploy.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,15 @@ const policyDocument = {
3737
Version: '2012-10-17',
3838
Statement: [
3939
{
40-
Action: 'iot:*',
41-
Resource: '*',
4240
Effect: 'Allow',
41+
Action: [
42+
'iot:DescribeEndpoint',
43+
'iot:Connect',
44+
'iot:Publish',
45+
'iot:Subscribe',
46+
'iot:Receive',
47+
],
48+
Resource: '*',
4349
},
4450
],
4551
};

test/utils/expectInfraDeployed.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,20 @@ export async function expectInfraDeployed(lambdaName: any) {
3030
':layer:LambdaLiveDebugger:',
3131
);
3232
expect(policyDocument).toEqual({
33+
Version: '2012-10-17',
3334
Statement: [
3435
{
35-
Action: 'iot:*',
3636
Effect: 'Allow',
37+
Action: [
38+
'iot:DescribeEndpoint',
39+
'iot:Connect',
40+
'iot:Publish',
41+
'iot:Subscribe',
42+
'iot:Receive',
43+
],
3744
Resource: '*',
3845
},
3946
],
40-
Version: '2012-10-17',
4147
});
4248
}
4349
}

0 commit comments

Comments
 (0)