mapbox / mapbox/cloudfriend

If multiple lambdas use a externally-created role, created log policies collide

Open
#123 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
74
Forks
10
PR merge metrics
No merged PRs in 30d

Description

In #113, we added the ability for Lambda functions created using Lambda shortcuts to use an IAM role that already exists. When specified, an inline policy would be created and attached to the specified role. However, if multiple Lambda function use the same role, they will each overwrite the "lambda-log-access" policy. Because the inline policy is scoped to a single Lambda cloud watch group, it's possible that only one of the lambda functions ends up with CloudWatch access. This means the other function can no longer write to logs.

As a workaround, you can provide a statement with broader `logs:*` access in the IAM role. But perhaps there's something we could do within this module to grant access to multiple log groups when multiple Lambdas use the same role.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the Lambda shortcut handling and the creation of the inline "lambda-log-access" policy for externally created roles. Reproduce the case with multiple Lambda functions sharing one role, then verify that each function retains CloudWatch access without overwriting the other functions' log permissions.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript
Domain
authorization, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.