Best way to scope lambda functions Allowed principals #137
-
I'm deploying hosted runners into an application with some automated policies check. Both setup and webhook handle lambdas are getting flagged because they're pretty open and publicly exposed. Is there a way to access to these? Should I resolve these from the outputs and then configure? I want to avoid doing a sort of manual check and then getting code to invoke by ARN or something. Should these even be taken and resolved from the outputs somehow? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
The setup Lambda only accepts requests when the correct secret is passed as a query parameter. That secret is reset once setup is complete. It is public to make it easy for the user to quickly complete setup regardless of the network configuration. cdk-github-runners/src/lambdas/setup/index.ts Lines 129 to 149 in 13f319d The webhook Lambda only accepts requests signed by GitHub with the secret value that we set during setup. It is public because GitHub needs to be able to call it. Only repos that you enabled will be able to get this secret value. cdk-github-runners/src/lambdas/webhook-handler/index.ts Lines 40 to 55 in 13f319d I plan on having a way to disable the setup function so it can be removed once you're done with it. For the webhook function, I am hoping to find a simple enough way to apply a security group with IPs from here (only the I'm not sure what you mean by:
Bottom line the Lambdas are public, but protected. Anyone can technically call them, but can't do anything without the secrets. Also see #88. |
Beta Was this translation helpful? Give feedback.
-
With 0.9.2 you can use:
|
Beta Was this translation helpful? Give feedback.
With 0.9.2 you can use: