Fabrikam HR Assistant: Handling Sensitive Data and Compliance
Fabrikam is building an internal HR assistant using Azure OpenAI Service and Microsoft Teams. The assistant will answer employee questions about benefits, payroll, and leave policies. The HR data is stored in a SQL Database and includes personally identifiable information (PII) such as social security numbers and salary details. The company has a strict data residency requirement: all data must remain in the EU. The assistant will be used by 5,000 employees across 10 countries. The security team is concerned about data leakage and prompt injection attacks. They have implemented Azure Private Link for the Azure OpenAI endpoint and restricted network access. However, during a pilot, an employee was able to extract another employee's salary by asking the assistant to 'list all salaries for employees in the sales department'. The assistant returned a list of names and salaries. The pilot was immediately halted.
1. What security control was missing that allowed the data leakage, and how should it be implemented?
Read the worked answer
The missing control is proper authorization and data filtering at the data access layer. The assistant likely used a service principal or managed identity with broad read access to the SQL Database, and the generative model was allowed to query the database directly without enforcing row-level security based on the authenticated user. To fix this, implement row-level security (RLS) in SQL Database and ensure the assistant queries the database using the authenticated user's identity (e.g., via on-behalf-of flow) or uses a middleware that filters results based on the user's role and department. Additionally, the assistant should not have direct access to raw PII; instead, use a data abstraction layer that returns only aggregated or masked data. For salary information, only allow access if the user is the employee themselves or an authorized HR representative. Implement Azure OpenAI's content filtering and prompt shields to detect and block attempts to extract sensitive data. Also, use Azure AI Content Safety to monitor and block harmful content. Finally, conduct a threat modeling exercise and penetration testing before re-launching the pilot.
2. How would you ensure data residency and compliance with EU regulations while using Azure OpenAI?
Read the worked answer
To ensure data residency, deploy the Azure OpenAI resource in an EU region (e.g., West Europe or Sweden Central) and configure the model to process data only in that region. Azure OpenAI does not store customer data; however, logs and monitoring data must also be stored in EU regions. Use Azure Monitor and Log Analytics in the same EU region. Ensure that any data sent to the model is not transferred outside the EU. For the SQL Database, host it in the same EU region and enable geo-redundant backups only within the EU. Additionally, review the Azure OpenAI data privacy documentation: prompts and completions are not used to train models and are not stored unless explicitly enabled. Disable any diagnostic settings that send data outside the EU. For compliance, use Microsoft Purview to classify and track data, and ensure that the solution complies with GDPR by implementing data subject request processes. Conduct a DPIA (Data Protection Impact Assessment) and document the data flows. Finally, use Azure Policy to enforce that all resources are deployed in allowed EU regions.