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

Use custom policy with restricted resource to replace managed policies #693

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kaiyan-sheng
Copy link
Contributor

@kaiyan-sheng kaiyan-sheng commented Apr 19, 2024

What does this PR do?

Elastic Serverless Forwarder Lambda Role uses the following AWS managed policies:

AWSLambdaSQSQueueExecutionRole
AWSLambdaKinesisExecutionRole
AWSLambdaBasicExecutionRole
AWSLambdaVPCAccessExecutionRole

All the above roles have attached policies with wildcard Resource statements (i.e "Resource": "*"). In order to limit the resource here, I'm replacing these policies with custom policies.

Why is it important?

Security concern with IAM definition including too many wildcards.
#266

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.md

@constanca-m
Copy link
Contributor

I had a look again to try to understand where these policies come from, and I believe it depends on the way we are deploying ESF.

So if we use the terraform files (private repo), we do not use managed policies like AWSLambdaSQSQueueExecutionRole, but instead grant the right permissions to the right resources. Exception is the use of policy AWSLambdaBasicExecutionRole. This would have to be changed as well.

For the publish script, you are already covering the cases in the changed file.

I don't think we are using managed policies anywhere else, but it is best to double check.

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

Successfully merging this pull request may close these issues.

2 participants