Skip to content
This repository was archived by the owner on Nov 16, 2026. It is now read-only.

Latest commit

 

History

History
95 lines (66 loc) · 9.45 KB

AzureMLSecurity.md

File metadata and controls

95 lines (66 loc) · 9.45 KB

Problem Statement

What are the security considerations to take into account when building a machine learning solution, especially if it's built on Azure Machine Learning Service (AML)? This article summerizes the key points that developers can act upon toward building a secure ML solution. For a complete guide, see this Microsoft documentation.

Inside Azure ML

Azure ML is a Platform-as-a-Service (PAAS). As any PAAS, security is a shared responsibility between the customer and Microsoft.

When you deploy an AML Workspace, you not only provision resources required by AML in your own subscription, Microsoft also provisions resources for you in a Microsoft managed subscription. Depending on your security requirements, you can have different levels of control over these resources. The following diagrams from AML documentation depict the resources deployed with an AML Workspace.

AML Model Traing

AML Model Inferencing

Network Security

Take the following measures to secure your network and endpoints. You don’t have to implement all of them. For example, you can add your Storage account to a virtual network with a Service Endpoint without having to enable Private Link on your AML workspace.

  1. Create a Private Link-enabled Workspace to enable communication between your VNet and the AML Workspace.

  2. Add Azure Key Vault to the virtual network with a Service Endpoint or a Private Endpoint. Set Key Vault to "Allow trusted Microsoft services to bypass this firewall".

  3. Add your Azure storage account to the virtual network with a Service Endpoint or a Private Endpoint.

  4. Enable Azure Container Registry with AML in a virtual network and enable subnet delegation in Azure Container Instances.

Identity & Access Control

Information Protection

  • Enable Container Registry Vulnerability Scanning to ensure Docker images are clear of malicious components
  • Encryption –
    • For production grade encryption, use AML Compute cluster for training, and AKS for inferencing. AML Compute Instance is for dev/test
    • Turn on hbi_workspace flag for workspace that contains sensitive data
    • You can use CMK (Customer Managed Key) for encryption in the following AML services
      • Azure Storage
      • Azure Cosmos DB (create your own)
      • Azure Container Registry (create your own)
      • Azure Container Instance
      • Azure Kubernetes Service
  • Logging –
    • Don’t store sensitive data in environment variables – environment variables are logged, encrypted and stored by Microsoft
    • Don’t put sensitive data in run_id
    • Don’t put sensitive data in application logs
  • Auditing & Compliance

Threats Unique to Machine Learning

Production deployments of machine learning solutions in enterprises are still fairly new and few, awareness and understanding of ML security risks are low. Full discussion of ML security risks is out of the scope of this doc, however, here are some examples for raising awareness:

  • An attacker could poison training and testing data, for example, a chatbot trained on publicly available data can be poisoned with offensive content.
  • An attacker can temper the model algorithm, for example, a self-driving car can be tricked to determine a dangerous area is safe to drive when the weakness in its vision model is exploited.

Make sure to analyze the risks and impact in case your ML solution is compromised. Mitigate as much as you can, and have a response plan.

References