# Secure Netlify Functions

**URL:** <https://answers.netlify.com/t/secure-netlify-functions/23350>\
**Category:** Support\
**Tags:** security, lambda-functions\
**Created:** [September 26, 2020, 11:29pm UTC](https://answers.netlify.com/t/secure-netlify-functions/23350 "2020-09-26T23:29:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tysonalcorn](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/tysonalcorn/32/16358_2.png) [@tysonalcorn](https://answers.netlify.com/u/tysonalcorn)\
**Post date:** [September 26, 2020, 11:29pm UTC](https://answers.netlify.com/t/secure-netlify-functions/23350/1 "2020-09-26T23:29:33Z")

</div>

Is there a way to secure Netlify functions in such a way that only the site itself can access them? I’m building a B2B SaaS and one of the requirements of the project is that each customer must have its own database and the users of each customer must be stored and authenticated in/from that database (which means I can’t use Netlify identity). To do this, I created a Netlify lambda function that creates a skeleton database off of a pre-built schema when the customer signs up. However, I need to secure this function so that only the application and no one/nothing else can access and use it. Does anyone have any idea?

Thank you kindly!

-Tyson

---

<div class="post-metadata">

**Author:** ![jen](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/jen/32/6044_2.png) [@jen](https://answers.netlify.com/u/jen)\
**Post date:** [October 1, 2020, 7:03pm UTC](https://answers.netlify.com/t/secure-netlify-functions/23350/2 "2020-10-01T19:03:00Z")

</div>

Hey @tysonalcorn,  
Our signed proxy redirects should work this. Here’s a thread discussing them:

> [@Verify user in Node.js backend](https://answers.netlify.com/t/verify-user-in-node-js-backend/3916/5):
>
> Hi @jonathan-fielding, You can verify the signature of our JWT’s in a Netlify function. In fact if you pass an Identity JWT in as a bearer token in an Authorization header, we’ll verify for you automatically and inject the user data in to the functions context. From there you can actually run some logic with that data or sign a new JWT and send it to your own backend. Another option is to use JWS with netlify redirects so that you can confirm that the request comes Netlify directly. You can rea…

And our docs on them:

> **[Rewrites and proxies](https://docs.netlify.com/routing/redirects/rewrites-proxies/#signed-proxy-redirects)**
>
> Use rewrite rules to fetch a location behind the scenes while the URL in the visitor’s address bar remains the same. Proxy to another service or site.

Let us know if that helps or if you have any other questions!

---

<div class="post-metadata">

**Author:** ![payzanto](https://avatars.discourse-cdn.com/v4/letter/p/74df32/32.png) [@payzanto](https://answers.netlify.com/u/payzanto)\
**Post date:** [January 9, 2022, 12:36am UTC](https://answers.netlify.com/t/secure-netlify-functions/23350/3 "2022-01-09T00:36:39Z")

</div>

Hi Jen! It’s not clear to me how signed proxy redirects help here. I read through the documentation and I’m still confused. I have a basic Netlify function but I only want my site to be able to access it. How can I do that?

---

<div class="post-metadata">

**Author:** ![payzanto](https://avatars.discourse-cdn.com/v4/letter/p/74df32/32.png) [@payzanto](https://answers.netlify.com/u/payzanto)\
**Post date:** [January 9, 2022, 12:44am UTC](https://answers.netlify.com/t/secure-netlify-functions/23350/4 "2022-01-09T00:44:32Z")

</div>

I found [[Support Guide]: How to apply Access Control for Netlify Functions?](https://answers.netlify.com/t/how-to-apply-access-control-for-netlify-functions/46519), I think this is what I’m looking for.
