Azure OpenAI CORS

AdityaSa 801 Reputation points
2023-12-24T01:30:18.67+00:00

Previously, Azure OpenAI "Bring your own data" feature required enabling CORS on the storage account. However, I can use this feature without CORS on a new storage account.

Has the CORS requirement been removed or changed by some enhancement?

If I enable "Turn on CORS", it allows all origins with "*" which poses a risk for the customer. How can I restrict its scope to only the customer's OpenAI instance? Are there any other ways to make this more secure?

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
3,798 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Ramr-msft 17,821 Reputation points
    2023-12-25T00:35:11.98+00:00

    Thanks for the details, You can use the OpenAI in your backend and Here is the documentation How to configure Azure OpenAI Service with managed identities.This document covers how to authenticate to your OpenAI resource using Microsoft Entra ID.

    https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/managed-identity

    0 comments No comments

  2. Bhavesh Sharma 0 Reputation points
    2023-12-25T01:16:00.6633333+00:00

    To enhance security and restrict the scope to only your OpenAI instance, consider these steps:

    Specify Origins: Instead of using "*", explicitly specify the origins allowed in the CORS settings. For example, if your OpenAI instance is hosted at a specific domain, specify that domain as the allowed origin.

    Token-Based Authentication: Implement token-based authentication to ensure that only authorized requests are accepted. You can include a token with your requests and validate it on the server side.

    Use HTTPS: If possible, make sure your OpenAI instance and the storage account use HTTPS. This helps to secure data during transmission.

    Networking Restrictions: Utilize Azure networking features, such as virtual networks and service endpoints, to restrict access to the storage account from specific networks.

    Regularly Monitor and Audit: Regularly monitor and audit access to your storage account to detect any unauthorized activity.

    Keep Software Updated: Ensure that all software components, including your OpenAI instance and storage account, are up-to-date with the latest security patches.

    Please refer to the latest Azure and OpenAI documentation for the most accurate and up-to-date information on security best practices.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.