What’s the best way to secure my backend API in Azure?

0
3
Asked By TechyNinja88 On

Hey everyone! I'm looking for some guidance on securing my backend API. Here's my setup: I have a web app running in Azure that uses Microsoft Entra ID for user authentication. Currently, my backend API is open to anyone who has the URL and can access it via Postman. I want to make sure that only requests coming from my web app are allowed to hit the API. What's the recommended approach to do this in Azure?

5 Answers

Answered By SecureCoder99 On

There are several effective strategies you can implement. First, activate network restrictions on your API to only allow requests from your front-end app, which will address the Postman access problem. Additionally, think about using managed identities for authentication between the web app and the API. These steps are fairly straightforward and won't cost anything.

Answered By CloudTamer7 On

You absolutely need to secure your API with some type of authentication method. If you're using Azure App Services, implementing OAuth2 with Entra can provide this. On top of that, ensure you have network isolation; use private endpoints and set up VNet integration for your front-end. You can limit traffic specifically from your web app's VNet to your API. If you might need public exposure but still want security, look into using a Web Application Firewall (WAF) with protections like DDoS prevention and rate limiting.

Answered By SecureNerd14 On

It's quite common to face this issue. The standard approach in Azure is to secure your API with Azure AD authentication, requiring your front-end to provide an access token. So, after the user signs in on your web app, it gets a token that your API will validate before processing any requests. You can enhance security further by combining this with CORS and specific service roles.

Answered By CloudGuru22 On

To secure your API the Azure way, treat it as a protected resource. You need to lock it down using Entra ID, which means your front-end should call the API using an access token. This way, if someone tries to hit the API URL directly, they’ll still need a valid token that grants them access. Additionally, consider adding network controls like private endpoints or API Management to further tighten security. Make authorization your first line of defense, followed by network restrictions.

Answered By DevWhiz001 On

Security practices in Azure are always evolving. A good starting point is to look up resources on authentication and authorization specifically for ASP.NET web APIs. Check out Microsoft's documentation for comprehensive insights and best practices.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.