I've got a web app (App 1) and am setting up an API endpoint. I will send a request to that endpoint from App 2. App 1 and App 2 are in the same VPC.
I'd like for App 1 to allow NO outbound traffic except for an API response to App 2.
So let's say this is the code for the App 1 endpoint
def api(request):
val = request.POST['value'] * 2
send_email('Subject', 'Message', 'to@example.com', 'from@example.com')
return val
My security group would allow the val to be returned to App 2, but would block the email being sent as it would be data escaping the app.
I may have seen that the answer might be NO security groups for the allowed outbound. That prevents all outbound traffic, EXCEPT for already prescreened inbound connects since the apps will respond.