Wiz Defend is Here: Threat detection and response for cloud
Eliminate Critical Risks in the Cloud

Uncover and remediate the critical severity issues in your cloud environments without drowning your team in alerts.

Azure Security Risks & Mitigation Steps

This article offers an extensive examination of Azure environments’ most pressing security risks along with suggested approaches for effectively mitigating these challenges.

Wiz Experts Team
13 minutes read

Managing Azure security risks involves several crucial aspects, such as implementing the correct identity access management (IAM) permissions, finding and eliminating misconfigurations, protecting data, and ensuring the security of containerized and serverless applications. This article offers an extensive examination of Azure environments’ most pressing security risks along with suggested approaches for effectively mitigating these challenges. Let’s jump right in.

Top Azure security risks

While Azure security is a vast topic, there are few common areas where security risks invariably creep in. Here are the top six usual suspects and the necessary guardrails to prevent these risks from leading to breaches:

1. Microsoft Entra ID complexity

Microsoft Entra ID (formerly Azure AD) is the native IAM solution from Azure, and it’s widely used by organizations to manage access to cloud resources. Due to the complex nature of the service, misconfigurations associated with identity federation, hybrid integration, and conditional access can lead to severe consequences.

Improperly configured federation protocols such as SAML could allow hackers to manipulate authentication processes and impersonate legitimate users. Miconfigured access permissions for admin accounts create an opening in your security perimeter, especially misconfigured access permissions for legacy admin accounts synchronized with on-premises environments. (Attackers compromising on-premises environments can easily gain full control over Entra ID tenants.)

Challenges can also arise from password policy shortcomings and the misuse of Azure service principals and Entra ID accounts. If password complexity requirements are not enforced, attackers can use brute-force methods to crack the password easily. Phishing attacks or malware can compromise even the strongest of passwords. And passwords that employees reuse across work and personal accounts are a common target for exploitation by attackers. This could lead to a domino effect: A compromised system with weak security where a password is reused could lead to a compromised Azure environment.

Implement robust processes to manage configurations, identities, and access controls to mitigate these risks:

Best practices to protect Microsoft Entra ID 

  • Enable multi-factor authentication (MFA) for all accounts, especially admin accounts with elevated privileges.

  • Implement Conditional Access templates that help align your IAM policies with Microsoft-recommended best practices.

  • Leverage Microsoft Entra Password Protection to ensure that users are not setting weak or commonly used passwords.

  • Implement access risk policies to identify and prevent suspicious logins that could indicate identity theft.

  • Use certificate-based authentication for service principals, in addition to granting access based on the principle of least privilege. When compared to passwords, certificates are difficult to crack or steal, considering you can securely store them in key management solutions.

2. Azure Resource Manager and policy misconfigurations

Azure Resource Manager (ARM) is used by organizations to implement infrastructure as code (IaC) and shift their security left. However, misconfigurations in ARM templates, policies, and scripts can introduce significant security risks. Compounding the issues that misconfigurations cause, inadequate guardrails (including overly permissive Azure policies) could allow insecure deployments to go unnoticed. 

While overly permissive policies allow excessive access or bypass security measures, conflicting policies can create confusion and potentially leave security gaps. To ensure a secure Azure environment, it’s crucial to implement strict controls on ARM templates and enforce well-defined security policies following Azure security best practices

Best practices to protect Azure Resource Manager and implement effective Azure policies

  • Leverage Azure DevOps Services or other CI/CD pipelines to automate deployments and enforce security checks. 

  • Define Azure policies that implement restrictions around locations, resource types, and configurations; group them using policy initiatives wherever possible.

Here’s a built-in policy that can be enabled to ensure that all your Azure virtual machine subnets have a network security group attached:

{
  "properties": {
    "displayName": "Subnets should be associated with a Network Security Group",
    "policyType": "BuiltIn",
    "mode": "All",
    "description": "Protect your subnet from potential threats caused by unrestricted access by implementing a Network Security Group (NSG) to filter ingress and egress traffic.    "metadata": {
      "version": "3.0.0",
      "category": "Security Center"
    },
    "version": "3.0.0",
    "parameters": {
      "effect": {
        "type": "String",
        "metadata": {
          "displayName": "Effect",
          "description": "Enable or disable the execution of the policy"
        },
        "allowedValues": [
          "AuditIfNotExists",
          "Disabled"
        ],
        "defaultValue": "AuditIfNotExists"
      }
    },
    "policyRule": {
      "if": {
        "field": "type",
        "equals": "Microsoft.Network/virtualNetworks/subnets"
      },
      "then": {
        "effect": "[parameters('effect')]",
        "details": {
          "type": "Microsoft.Security/assessments",
          "name": "eade5b56-eefd-444f-95c8-23f29e5d93cb",
          "existenceCondition": {
            "field": "Microsoft.Security/assessments/status.code",
            "in": [
              "NotApplicable",
              "Healthy"
            ]
          }
        }
      }
    },
    "versions": [
      "3.0.0"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/e71308d3-144b-4262-b144-efdc3cc90517",
  "type": "Microsoft.Authorization/policyDefinitions",
  "name": "e71308d3-144b-4262-b144-efdc3cc90517"
}
  • Test and validate policies in non-production environments before production deployments, and implement a continuous monitoring process to review and update policies.

  • Monitor the misconfigurations flagged in Azure Security Center that can be traced back to ARM templates and implement remediation measures. For example, if Azure Security Center flags publicly accessible storage, you’ll likely trace this misconfiguration back to the settings mentioned in the ARM template used to deploy it.

3. Ensuring serverless application security

Serverless applications in Azure such as Azure Functions and Logic Apps offer scalability and ease of deployment, but they also introduce unique security challenges. The main concern centers on application programming interfaces (APIs) that can be exposed by serverless applications—especially if they are left publicly accessible without proper authentication mechanisms or have authorization flaws. If unprotected, attackers can easily use these exposed APIs as backdoors.

Additionally, malicious actors can exploit vulnerabilities in the function code to gain unauthorized access to data or resources. Insecure coding practices, outdated dependencies, or lack of proper validation mechanisms all pose threats to the security of your function code. To ensure the security of serverless applications, prioritize secure coding practices, dependency management, and input validations.

Best practices to protect your serverless applications

  • Along with strong authentication and authorization mechanisms, implement Azure API Management to control access to serverless function APIs.

  • Regularly review and audit API access to identify and address potential misuse.

  • Follow coding best practices such as input validation and the use of secure coding libraries to eliminate software supply chain vulnerabilities.

  • Carry out regular penetration testing and vulnerability scans on serverless functions to proactively identify gaps.

4. Cloud data storage threats

  • Cloud storage offers convenience and scalability but, unfortunately, relying on the cloud provider can open you up to security threats. Access tokens are the keys to your cloud storage, and leaked tokens could enable attackers to gain access to sensitive data. There are many ways these access tokens can fall into the wrong hands: Access tokens can be leaked through phishing attacks, malware infections, or human error. When third-party integrations are used with cloud storage, attackers can compromise those third-party apps and get backdoor entry to cloud storage. Attackers can also use blob hunting tactics, where automated techniques are used to continually scan for publicly accessible storage accounts or accounts with weak access controls and use them to download data. 

    It’s essential to remain vigilant about insider threats too. Malicious insiders with authorized access can steal, modify, or delete sensitive data with the intent of personal gain or sabotage. And these threats are more difficult to find because access patterns seem legitimate. Here are some best practices to mitigate risks associated with cloud storage:

Best practices to protect your cloud data storage

  • Implement the principle of least privilege and use shared access signatures (SAS) to ensure time-limited, granular access control.

  • Enable Microsoft Defender for Storage to identify misconfigurations that can be exploited by blob hunters.

  • Leverage encryption at rest to further protect data, even if storage accounts are compromised.

  • Implement zero-trust mechanisms and continuous log monitoring to identify suspicious activity.

  • Conduct rigorous assessments of third-party partners before moving forward with cloud storage integration.

5. Azure Container Registry and AKS vulnerabilities

  • Container deployments are susceptible to issues associated with Azure Container Registry and Azure Kubernetes Service (AKS) security gaps. The foundation of container security lies within images, so container images with vulnerabilities, malware, or outdated dependencies could compromise your entire application stack. During the container build process, there is a risk of malicious code injection if attackers manage to gain access to the build pipeline or environment. Adding to the complexity, sometimes these vulnerabilities are missed by image scanning mechanisms. 

    However, the security of containerized applications doesn’t stop at the image itself. AKS cluster configuration also plays a critical role in the overall security of applications deployed in the cluster. Misconfigurations like inadequate role-based access control (RBAC) settings or overly permissive network policies can allow attackers to move laterally within the cluster and compromise the containerized workloads—or even the AKS node. 

    Follow these steps to keep your containers safe:

Best practices to protect your Azure Container Registry and AKS

  • Scan container images for vulnerabilities using tools such as Trivy or Clair to ensure that only validated images are deployed.

  • Use Azure CNI and Kubernetes native network policies to restrict traffic that flows between pods. Below is a sample network policy that restricts traffic within the namespace so that only pods labeled dev2 can send traffic over port 443 to pods labeled dev1:

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: demo-policy
  namespace: test
spec:
  podSelector:
  matchLabels:
    app: dev1
  ingress:
  - from:
  - podSelector:
      matchLabels:
        app: dev2
  ports:
  - port: 443
    protocol: TCP
  • Test and validate policies in non-production environments before production deployments, and implement a continuous monitoring process to review and update policies.

  • Monitor the misconfigurations flagged in Azure Security Center that can be traced back to ARM templates and implement remediation measures. For example, if Azure Security Center flags publicly accessible storage, you’ll likely trace this misconfiguration back to the settings mentioned in the ARM template used to deploy it.

3. Ensuring serverless application security

Serverless applications in Azure such as Azure Functions and Logic Apps offer scalability and ease of deployment, but they also introduce unique security challenges. The main concern centers on application programming interfaces (APIs) that can be exposed by serverless applications—especially if they are left publicly accessible without proper authentication mechanisms or have authorization flaws. If unprotected, attackers can easily use these exposed APIs as backdoors.

Additionally, malicious actors can exploit vulnerabilities in the function code to gain unauthorized access to data or resources. Insecure coding practices, outdated dependencies, or lack of proper validation mechanisms all pose threats to the security of your function code. To ensure the security of serverless applications, prioritize secure coding practices, dependency management, and input validations.

Best practices to protect your serverless applications

  • Along with strong authentication and authorization mechanisms, implement Azure API Management to control access to serverless function APIs.

Figure 1: Example architecture that uses Azure API Management (Source: Microsoft)
  • Regularly review and audit API access to identify and address potential misuse.

  • Follow coding best practices such as input validation and the use of secure coding libraries to eliminate software supply chain vulnerabilities.

  • Carry out regular penetration testing and vulnerability scans on serverless functions to proactively identify gaps.

4. Cloud data storage threats

Cloud storage offers convenience and scalability but, unfortunately, relying on the cloud provider can open you up to security threats. Access tokens are the keys to your cloud storage, and leaked tokens could enable attackers to gain access to sensitive data. There are many ways these access tokens can fall into the wrong hands: Access tokens can be leaked through phishing attacks, malware infections, or human error. When third-party integrations are used with cloud storage, attackers can compromise those third-party apps and get backdoor entry to cloud storage. Attackers can also use blob hunting tactics, where automated techniques are used to continually scan for publicly accessible storage accounts or accounts with weak access controls and use them to download data. 

It’s essential to remain vigilant about insider threats too. Malicious insiders with authorized access can steal, modify, or delete sensitive data with the intent of personal gain or sabotage. And these threats are more difficult to find because access patterns seem legitimate. Here are some best practices to mitigate risks associated with cloud storage:

Best practices to protect your cloud data storage

  • Implement the principle of least privilege and use shared access signatures (SAS) to ensure time-limited, granular access control.

  • Enable Microsoft Defender for Storage to identify misconfigurations that can be exploited by blob hunters.

  • Leverage encryption at rest to further protect data, even if storage accounts are compromised.

  • Implement zero-trust mechanisms and continuous log monitoring to identify suspicious activity.

  • Conduct rigorous assessments of third-party partners before moving forward with cloud storage integration.

5. Azure Container Registry and AKS vulnerabilities

Container deployments are susceptible to issues associated with Azure Container Registry and Azure Kubernetes Service (AKS) security gaps. The foundation of container security lies within images, so container images with vulnerabilities, malware, or outdated dependencies could compromise your entire application stack. During the container build process, there is a risk of malicious code injection if attackers manage to gain access to the build pipeline or environment. Adding to the complexity, sometimes these vulnerabilities are missed by image scanning mechanisms. 

However, the security of containerized applications doesn’t stop at the image itself. AKS cluster configuration also plays a critical role in the overall security of applications deployed in the cluster. Misconfigurations like inadequate role-based access control (RBAC) settings or overly permissive network policies can allow attackers to move laterally within the cluster and compromise the containerized workloads—or even the AKS node. 

Follow these steps to keep your containers safe:

Best practices to protect your Azure Container Registry and AKS

  • Scan container images for vulnerabilities using tools such as Trivy or Clair to ensure that only validated images are deployed.

  • Use Azure CNI and Kubernetes native network policies to restrict traffic that flows between pods. Below is a sample network policy that restricts traffic within the namespace so that only pods labeled dev2 can send traffic over port 443 to pods labeled dev1:

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: demo-policy
  namespace: test
spec:
  podSelector:
  matchLabels:
    app: dev1
  ingress:
  - from:
  - podSelector:
      matchLabels:
        app: dev2
  ports:
  - port: 443
    protocol: TCP
  • Implement a process for consistently updating image dependencies and deploying patches.

  • Leverage Microsoft Defender for Containers to monitor assets (such as clusters, nodes, workloads, and container registries), identify vulnerabilities, and prioritize them based on severity. Microsoft Defender for Containers can also provide runtime behavior monitoring to identify potential malware infections and attacks attempting to compromise your workloads.

  • Ensure the security of your build pipelines and implement access-control mechanisms to prevent unauthorized access and tampering. Use platforms like Azure DevOps with built-in security features, including RBAC, secrets management, and logging. You should also ensure that you are granting users only the required permissions to execute their tasks in the build pipeline.

6. Azure Key Vault mismanagement

Unless it’s configured carefully, Azure Key Vault can exacerbate security challenges in Azure cloud environments. Key Vault’s effectiveness depends on proper secrets hygiene: Weak access controls, accidental deletion, and granting excessive privilege can all lead to compromised secrets. 

In turn, compromised secrets can expose sensitive data such as passwords, API keys, and encryption keys, potentially enabling unauthorized access to Azure resources and causing data leaks. Furthermore, compromised cryptographic materials could render your data encryption useless, allowing attackers to decrypt sensitive information. 

Best practices for protecting Azure Key Vault

  • Define clear policies for secrets rotation, minimizing the window of opportunity for attackers.

  • Implement granular access control for both the management plane and data plane using Azure Entra ID. For the management plane, you can use the predefined Key Vault roles or create custom RBAC roles restricting admin rights. For the data plane, you can assign specific permissions to Entra ID identities such as “Get” and “List” for keys/secrets to ensure you’re in alignment with the principle of least privilege.

  • Automate Azure Key Vault configuration using IaC to minimize manual errors.

  • Implement conditional access policies to further strengthen access control settings. You can use conditions such as locations, device platforms, sign-in risks, and more to implement access control.

Figure 2: Entra ID Conditional Access policy configuration (Source: Microsoft)

Enhancing Azure cloud service provider security with third-party tools

While Microsoft Azure offers a robust set of built-in security tools, these tools can still miss potential vulnerabilities and security risks. That’s where specialized security solutions like Wiz come into play.

Wiz’s cloud-native Kubernetes security solution can scan for weaknesses, prioritize risks, and integrate with your development process, empowering you to monitor and mitigate threats in real time. With Wiz, you can expect: 

  • End-to-end scanning: Wiz scans your entire AKS cluster (clusters, hosts, and pods) to identify vulnerabilities and misconfigurations.

  • Prioritized risks: Wiz prioritizes vulnerabilities, threats, and misconfigurations by combining information from cloud platforms and runtime behavior, helping you resolve the most pressing issues first and reducing alert fatigue.

  • Shift-left security: Wiz integrates right into the development process by scanning code and container images to prevent the deployment of vulnerable code, unsigned images, or misconfigured applications.

  • Real-time threat monitoring: Wiz offers up-to-the-minute threat monitoring and identifies suspicious activity on worker nodes, including unauthorized access and data exfiltration.

  • Code-level protection: Wiz scans YAML files and application code. Our all-in-one platform also scans IaC files, Dockerfiles, Helm charts, and Kubernetes manifests. 

  • Compliance management: Wiz offers pre-built controls and rules to help you comply with security standards like PCI DSS, HIPAA, and NIST. You can also create custom compliance rules.

Ready to simplify and strengthen your AKS cluster security? Schedule a demo to see our industry-leading platform in action.

Ruthless risk prioritization

See how Wiz analyzes configurations, vulnerabilities, network settings, identities, access, and secrets to discover critical issues that combined represent real risk.

Get a demo 

Continue reading

The EU Artificial Intelligence Act: A tl;dr

Wiz Experts Team

In this post, we’ll bring you up to speed on why the EU put this law in place, what it involves, and what you need to know as an AI developer or vendor, including best practices to simplify compliance.

What is Application Security (AppSec)?

Application security refers to the practice of identifying, mitigating, and protecting applications from vulnerabilities and threats throughout their lifecycle, including design, development, deployment, and maintenance.