Skip to content

Securing use of anon APIKEY, maybe inet_client_addr()? #485

Answered by guicaro
guicaro asked this question in Questions
Discussion options

You must be logged in to vote

I ended up going to Vercel for a Serveless function to act as my backend.

  1. In the function called by my frontend (using the fetch API, I am getting the ip from req and the data that I will send to Supabase
  2. I compare the ip from req with my known ip address of machine where my frontend resides
  3. If (2) matches I make the call to Supabase using the supabase-js client. If it does not match I simply send back a 404 response

Yes, an attacker could still run this Serveless function from Vercel thousands of times, but at least it won't compromise my data on Supabase as ip will not match. I was also considering AWS Lambda and using an IAM Policy to restrict execution of an AWS Lambda based on ip. …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kiwicopple
Comment options

Answer selected by guicaro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants