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

lambda: Lambdas can connect and execute queries against RDS without any related IAM policies #27022

Closed
suharsha opened this issue Sep 6, 2023 · 3 comments
Labels
@aws-cdk/aws-lambda Related to AWS Lambda bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@suharsha
Copy link

suharsha commented Sep 6, 2023

Describe the bug

Recently I moved few of my Lambdas in to the same VPC as the RDS as suggested by cdk-nag. Then to adjust RDS permissions on those Lambdas, I removed all RDS IAM policies which they had initially and did some tests. They were still able to connect to the RDS and run queries too even without any RDS related IAM permissions.

Expected Behavior

Lambdas without proper RDS IAM permissions should not be able to connect to RDS or run queries in RDS. They should log an error and specify which permissions are missing.

Current Behavior

Lambdas can connect and execute queries on RDS without any RDS related policies

Reproduction Steps

Deploy a Lambda with code to connect to RDS and run a query without any RDS policies

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.93.0

Framework Version

No response

Node.js Version

18

OS

MacOS

Language

Typescript

Language Version

4.9.5

Other information

No response

@suharsha suharsha added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 6, 2023
@github-actions github-actions bot added the @aws-cdk/aws-lambda Related to AWS Lambda label Sep 6, 2023
@suharsha suharsha changed the title (lambda): (Lambdas can connect and execute queries against RDS without any related IAM policies) lambda: Lambdas can connect and execute queries against RDS without any related IAM policies Sep 6, 2023
@msambol
Copy link
Contributor

msambol commented Sep 6, 2023

What type of auth is the Lambda doing? Is it fetching secrets from Secrets Manager? As far as connecting to RDS, that depends on the security group attached to the RDS instance.

@peterwoodworth
Copy link
Contributor

Thanks for the response @msambol, @suharsha if this doesn't help, could you provide the code necessary to reproduce the issue you're experiencing?

@peterwoodworth peterwoodworth added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Sep 6, 2023
@github-actions
Copy link

github-actions bot commented Sep 9, 2023

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-lambda Related to AWS Lambda bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

3 participants