Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scope down log permissions in Lambda shortcut(s) #69

Open
drboyer opened this issue Sep 13, 2019 · 1 comment
Open

Scope down log permissions in Lambda shortcut(s) #69

drboyer opened this issue Sep 13, 2019 · 1 comment

Comments

@drboyer
Copy link
Contributor

drboyer commented Sep 13, 2019

The Lambda shortcut in this repo currently grants logs:* access, i.e. access to all actions for the log group created by this shortcut:

Effect: 'Allow',
Action: 'logs:*',
Resource: {
'Fn::GetAtt': [`${LogicalName}Logs`, 'Arn']
}

While it's good that this permission is scoped to only the single log group resource, I wonder if we should scope down the actions Lambda functions have access to, by default? Based on other examples, it seems like the only actions required for typical log-writing functionality are:

'logs:CreateLogStream',
'logs:PutLogEvents',
'logs:DescribeLogStreams'

Any reasoning or discussion surrounding scoping down logs:* permissions?

/cc: @rclark @williamhammond

@rclark
Copy link
Contributor

rclark commented Sep 15, 2019

👍 I'd just run out a check that everything works as intended before merging. All the Lambda walkthroughs I've read tell you to assign logs:* on resource * (which is one reason to use this shortcut in the first place), though I think that if the log group already exists then you're right about only needing these 3 actions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants