azure
2267 TopicsAzure NSG Challenge : When NIC and Subnet Rules Collide
Imagine this real-world scenario: ๐น A VM needs to connect outbound via RDP (TCP 3389) to an external server for management. ๐น The NIC-level NSG allows outbound RDP, ensuring the VM can initiate connections. ๐น However, the Subnet-level NSG has an inbound deny rule specifically for RDP. ๐ญ Question for IT Pros: ๐ Would the outbound RDP session succeed or be blocked due to the subnet-level NSG? ๐ How do you design NSG rules to prevent misconfigurations while maintaining security? ####################################################### Great challenge! Let's break it down: ๐ฆ Would the outbound RDP session succeed or be blocked? The outbound RDP session would succeed because the subnet-level NSG applies to inbound traffic coming into the subnet, not traffic leaving the VM. Since outbound RDP is explicitly allowed at the NIC level, the VM can initiate connections without issue. However, if the external server tries to respond back, the inbound deny rule at the subnet level would block the return traffic. This effectively disrupts the session, making it seem like the connection failed. ๐ How to design NSG rules effectively? To prevent misconfigurations while maintaining security: 1- Understand NSG processing โ Rules are evaluated independently at the NIC and Subnet levels, but both must allow the required traffic. 2- Use least privilege principles โ Only allow necessary traffic and explicitly deny everything else. 3- Be careful with inbound rules at the subnet level โ Blocking inbound traffic here can unintentionally interfere with legitimate outbound sessions. 4- Log traffic flows with NSG Flow Logs โ Use diagnostic settings to capture insights for troubleshooting. 5- Consider Application Security Groups (ASGs) โ These simplify NSG management by grouping resources dynamically.54Views1like4Comments๐ Azure Application Gateway: Smart Load Balancing & Security
Ensuring high availability and efficient load balancing is crucial for web applications. Azure offers several traffic management solutions, including Application Gateway, Front Door, Load Balancer, and Traffic Manager. Today, let's focus on why Application Gateway stands out as a powerful tool for managing web traffic. ๐ Why we should use Azure Application Gateway? ๐น Layer 7 Load Balancing: Unlike Layer 3 or 4 solutions, Application Gateway makes intelligent routing decisions based on HTTP request properties. For example, requests to /images/ can be directed to dedicated image servers, while /videos/ traffic is routed to specialized video servers. ๐น SSL/TLS Termination (Offloading): Reduces processing load on backend servers by decrypting traffic at the gateway before forwarding it unencrypted. Note: This might conflict with compliance requirements, so verify your appโs security needs !! ๐น Autoscaling: Dynamically scales up or down based on traffic patterns, ensuring cost-effective resource utilization. ๐น Zone Redundancy: Operates across multiple Availability Zones, enhancing fault tolerance without needing separate gateways in each zone. ๐น Web Application Firewall (WAF): Provides centralized security against common exploits like SQL injection and cross-site scripting (XSS). Built on OWASP 3.1 (WAF_v2), it can function in Detection Mode (alerting admins) or Prevention Mode (blocking threats proactively). ๐น URL-Based Routing: Enables smart traffic distribution by directing different types of content to the most appropriate backend pools. Example: http://contoso.com/video/* โ VideoServerPool ๐น Multiple-Site Hosting: Hosts multiple web applications on a single gateway, routing requests based on hostname or domain. Example: http://contoso.com โ ContosoServerPool ๐น Redirection & Rewrite Capabilities: โ Redirect HTTP โ HTTPS to enforce encrypted traffic. โ Rewrite HTTP headers & URLs to enhance security (e.g., add HSTS or remove sensitive response headers). ๐น Cookie-Based Session Affinity: Ensures users maintain session continuity by always connecting to the same backend server. Useful when session state is stored locally. โ๏ธ How to Deploy & Configure Azure Application Gateway โ๏ธ โ Dedicated Subnet: Create a subnet (e.g., myAGSubnet) within a Virtual Network. โ Frontend IP: Define whether to use a public or private IP or both (If you configured multiple listeners) to receive client requests. โ Backend Pool: Assign backend servers via NICs, Virtual Machine Scale Sets, public/internal IPs, or FQDNs. โ HTTP/HTTPS Listener: Specify which port (e.g., 80, 443) will handle incoming requests. โ Routing Rules: Set up domain-based (host-based routing) or path-based routing logic. ๐น Host-Based Routing means routing traffic based on the hostname in the HTTP request header ๐น Path-based Routing allows you to direct traffic to different backend pools based on the URL path in the request. โ Health Probes: Ensure backend servers are online using TCP or HTTP-based monitoring.38Views0likes0Comments๐ Strengthening Azure DNS Zone Security with RBAC and Resource Locks
๐ DNS security is more than just configuration itโs about protecting critical assets against unauthorized changes and accidental deletions. ๐ Managing DNS zones effectively requires a layered security approach. ๐ Two powerful mechanisms in Azure : Role-Based Access Control (RBAC) and Resource Locks ๐ Role-Based Access Control (RBAC) ๐ * Granular DNS Access Control * RBAC ensures controlled access management at both the DNS zone and record set levels. * Instead of assigning broad permissions, RBAC enables precise delegation using built-in roles such as: ๐น Owner โ Full control over the DNS zone, including configurations and deletions. ๐น Contributor โ Can modify DNS settings but cannot change access permissions. ๐น Network Contributor โ Can manage networking configurations related to DNS, but not modify records. ๐น DNS Zone Contributor โ Dedicated role for managing DNS zones without broader networking privileges. โ Key Advantages of RBAC in DNS Security: โ Prevent unauthorized modifications by restricting access to only necessary roles. โ Ensure operational integrity by limiting exposure to critical configurations. โ Improve governance by aligning roles with organizational security policies. ๐ Resource Locks ๐ * Guardrails for DNS Protection * Even with well-defined RBAC settings, accidental deletions can still occur. * Azure Resource Locks add an additional safeguard by preventing changes to a DNS zone or specific record sets. ๐น Zone Lock ----> Protects an entire DNS zone from being deleted, preserving all associated record sets. ๐น SOA Lock ----> Prevents unintentional zone deletions while allowing record modifications within the zone. โ How Resource Locks Enhance Security: โ Shields DNS zones from accidental or malicious deletions. โ Maintains continuity by ensuring record sets remain intact. โ Strengthens compliance controls for critical infrastructure. ๐ Best Practices for Securing DNS with RBAC & Resource Locks ๐ธ Assign least privilege rolesโnever give unnecessary access. ๐ธ Implement locks on essential zones to prevent configuration errors. ๐ธ Regularly audit access permissions using Azure Policy & Activity Logs. ๐ธ Use Automation & Alerts to track modifications for enhanced security. ๐น Implementing RBAC & Resource Locks ensures your cloud environment remains secure, operational, and fault-tolerant.28Views0likes0CommentsAzure VM Networking Components Real Case Scenario
๐ Public IP ๐ ๐น Public IPs allow internet-based services to reach Azure resources, such as web applications hosted on VMs or Azure App Services. ๐น Azure resources can use Public IPs to communicate with external services, ensuring connectivity for APIs, databases, and other cloud-based applications. ๐น Public IPs can be assigned as static (fixed address) or dynamic (changes over time). Static IPs are ideal for services requiring a consistent address, while dynamic IPs are useful for temporary workloads. ๐ Azure Load Balancer (External / Internal) ๐ ๐น Distributes Internet Traffic โ Balances incoming requests from the internet across multiple backend resources. ๐น Balances Private Network Traffic โ Distributes requests within an Azure Virtual Network (VNet). ๐น Supports Multi-Tier Architectures โ Ideal for backend services like databases and application layers. ๐น Enhances Availability โ Ensures high availability by routing traffic to healthy instances. ๐น Provides Outbound Connectivity โ Enables Azure VMs to communicate with external services using NAT. ๐ VNET Subnets Segmentation ๐ ๐น Web Subnet โ Contains two VMs, each with a Network Interface Card (NIC) and is protected by a Network Security Group (NSG) to filter traffic based on rules. ๐น App Subnet โ Similar to the Web Subnet, hosting two VMs with NICs and NSGs, but uses an internal load balancer to balance traffic within the subnet. ๐น Data Subnet โ Also includes two VMs with NICs and NSGs, leveraging an internal load balancer for optimized traffic management. ๐น Gateway Subnet โ Hosts the VPN Gateway, ensuring connectivity between on-premises networks and Azure. ๐ Azure Network Security Groups (NSGs)๐ ๐น Traffic Filtering โ NSGs allow or deny inbound and outbound traffic based on defined security rules. ๐น Granular Control โ Rules can be applied at the subnet or network interface level for precise traffic management. ๐น Default Security Rules โ Azure provides built-in rules to ensure basic security, which can be overridden with custom rules. ๐น Priority-Based Processing โ Rules are evaluated in order of priority (100-4096), with lower numbers processed first. ๐น Supports Service Tags โ Simplifies rule management by using predefined tags like Internet, VirtualNetwork, and AzureLoadBalancer. ๐ Azure VPN Gateway ๐ ๐น Secure Connectivity โ Establishes encrypted connections between Azure Virtual Networks (VNets) and on-premises networks. ๐น Site-to-Site VPN โ Enables secure communication between an on-premises network and Azure using IPsec/IKE VPN tunnels. ๐น Point-to-Site VPN โ Allows individual devices to securely connect to Azure from remote locations using OpenVPN, IKEv2, or SSTP. ๐น VNet-to-VNet Connectivity โ Facilitates secure communication between multiple Azure VNets. ๐น ExpressRoute Failover โ Provides a backup connection for ExpressRoute in case of failure. ๐น High Availability โ Supports active-active configurations for redundancy and reliability. If you found this valuable, consider sharing so more professionals can benefit. Let's keep the conversation growing! ๐26Views0likes0Comments๐ฅ Hybrid Networking 101: Linking On-Prem to Azure ๐ฅ
Many organizations seek to extend their networks to include subnets and virtual machines (VMs) hosted on Azure. The goal is to enable seamless connectivity between on-premises computers in a data center and Azure-based virtual machines. ๐น Common Use Cases for Hybrid Networking: # Application Connectivity: You have an Azure-hosted application that needs access to your on-premises database servers. # Branch Office Integration: Your business operates retail stores worldwide and requires a single centralized service to connect all locations. # Remote Access: You need secure remote access to your Azure VMs and applications. # Data Synchronization: You want to connect on-premises servers with Azure servers for real-time synchronization and data transfer. # To address these scenarios, Azure provides four key networking solutions: โ Point-to-Site VPN (P2S) โ Site-to-Site VPN (S2S) โ ExpressRoute โ Azure Virtual WAN One essential component that supports all these solutions is Azure VPN Gateway. Let's explore its capabilities! ๐ ๐ Azure VPN Gateway ๐ # Secure Connectivity Between Azure & On-Premises by encrypting data while transferring it between Azure VNets and on-premises servers over the internet. # Multiple connections can be established using a single VPN Gateway, sharing available bandwidth across all VPN tunnels. # The gateway consists of Azure-managed VMs, automatically deployed and configured in a GatewaySubnet with a CIDR size of /27. # There are two types of gateways: ๐น VPN Gateway (for encrypted connections) ๐น ExpressRoute Gateway (for dedicated high-speed connectivity) ๐ก Gateway SKUs define performance characteristics, including: # Supported tunnel types (S2S, P2S, VNet-to-VNet) # Maximum aggregate throughput # BGP (Border Gateway Protocol) support # Scalability options (resize within the same generation and family via Azure Portal or PowerShell) ๐ VPN Gateway Types: # Route-Based VPN: Supports S2S & P2S connectionsโwidely used in hybrid networking. # Policy-Based VPN: Limited to Basic SKUs and allows only S2S connections (not ideal for Remote Access). ๐น Local Network Gateway: Represents your on-premises router or firewall, enabling Azure to recognize your internal network's public IP and subnets for connectivity via IPSec IKEv1/2. ๐น Azure Availability Zones can be leveraged for high availability and service continuity. ๐ Point-to-Site VPN (P2S) ๐ ๐น Secure access for individual users connecting remotely to Azure VNets. ๐น Supported protocols: OpenVPNยฎ (SSL/TLS-based; compatible with Windows, Mac, Linux, Android, iOS) SSTP (TLS-based; Windows-only) IKEv2 (IPsec VPN solution; Mac-supported) ๐น Authentication Methods: (1) Certificate Authentication (requires client certificates issued from a trusted root certificate). (2) Azure AD Authentication (available for OpenVPN clients). (3) Active Directory Domain Server Authentication (via RADIUS server integration). ๐ Site-to-Site VPN (S2S) ๐ ๐น Enables on-premises data centers to connect with Azure VNets via IPSec IKEv1/2. ๐น Supports VNet-to-VNet connections over Microsoft's backbone network. ๐น Compatible with hardware devices from vendors such as Cisco, Fortinet, Barracuda, Check Point. ๐น Supports software VPN devices, including Microsoft RRAS and Linux Openswan. ๐น Enables dynamic routing via BGP to propagate network changes automatically. ๐ ExpressRoute ๐ ๐น Dedicated high-speed connectivity to Microsoft Cloud (Azure, Microsoft 365). ๐น Up to 100 Gbps speeds with low latency, ideal for business-critical applications. ๐น Layer 3 connectivity, using BGP for seamless route exchange between on-premises and Azure networks. ๐ Azure Virtual WAN ๐ ๐น A scalable networking service integrating VPN, ExpressRoute, and SD-WAN solutions. ๐น Provides branch connectivity using site-to-site VPN or private ExpressRoute connections. ๐น Supports remote user VPN (P2S) for secure external access. ๐น Follows hub-and-spoke architecture, ensuring full mesh connectivity across Azure regions. If you found this valuable, consider sharing so more professionals can benefit. Let's keep the conversation growing! ๐94Views0likes0Comments๐ฅThe Power of Azureโs Security Arsenal ๐ฅ
โ Using a Public IP without securing your Azure applications and resources exposes you to security threats. Today, weโll explore the most powerful security solutions from Azureโs arsenal. โ Azure provides a multi-layered approach (more than one layer of protection) to secure your resources when using a Public IP. Organizations can now transform this open gateway into a fortified checkpoint. Hereโs how these tools work together to mitigate risks: ๐ Azure DDoS Protection ๐ โ Protects your resources and services from being overwhelmed by malicious traffic. This excellent service is available for Network & IP Protection SKUs. โ Uses Machine Learning to distinguish between normal traffic patterns and malicious flooding attempts (such as SYN floods or UDP amplification attacks) before they impact your applications and services ensuring availability. ๐ Azure Web Application Firewall (WAF) ๐ โ Adds application-layer protection, intercepting HTTP/HTTPS traffic for inspection. โ Blocks suspicious attacks like SQL injection or XSS by applying OWASP core rule sets, which define how attacks occur and how to defend against them, with continuous updates. โ Enhances security for customer-facing services, ensuring trust and protection for your website and users. ๐ Network Security Groups (NSGs) ๐ โ Acts as a virtual firewall at the subnet or network interface level, filtering traffic based on predefined rules. โ Can allow only trusted HTTPS (port 443) connections while blocking unsolicited RDP or SSH attempts. โ Implements the critical security principle of reducing attack surface, ensuring only authorized traffic reaches your target resources. ๐ Azure Private Link ๐ โ In some scenarios, avoiding Public IPs altogether is the best security approach. This powerful service allows secure access to Azure SQL Database or Storage via Private Endpoints inside your virtual network. โ Helps organizations minimize external exposure while maintaining secure, private connections to necessary services. ๐ Azure Bastion ๐ โ Provides secure access to Azure VMs without Public IPs, using RDP/SSH over encrypted TLS 1.2 traffic. โ Uses a browser-based HTML5 web client to establish RDP/SSH sessions over TLS on port 443, fully compatible with any firewall. โ Connects to VMs via Private IPs while enforcing NSG rules to allow access only through Azure Bastion. If you found this valuable, consider sharing so more professionals can benefit. Let's keep the conversation growing! ๐23Views0likes0Comments๐ Mastering Azure Management with Global Admin Elevation ๐
โ Microsoft Entra ID and Azure resources are secured independently from one another. โ Microsoft Entra role assignments do not grant access to Azure resources. โ Azure role assignments do not grant access to Microsoft Entra ID. โ As a Global Administrator in Microsoft Entra ID, you can assign yourself access to all Azure subscriptions and management groups in your tenant. โ Use this capability if you don't have access to Azureโฏsubscription resources, such as virtual machines or storage accounts, andโฏyouโฏwant to use your Global Administrator privilege to gain access to those resources. โ When you elevate your access, you are assigned the User Access Administrator role in Azure at root scope (/).โฏThis allows you to view all resources and assign access in any subscription or management group in the tenant. โ User Access Administrator role assignments can be removed using Azure PowerShell, Azure CLI, or the REST API. ๐ Why would you need to elevate your access? If you are a Global Administrator, there might be times when you want to do the following actions: โ Regain access to an Azure subscription or management group when a user has lost access โ Grant another user or yourself access to an Azure subscription or management group โ See all Azure subscriptions or management groups in an organization โ Allow an automation app (such as an invoicing or auditing app) to access all Azure subscriptions or management groups # Perform steps at root scope # Follow these steps to elevate access for a Global Administrator using the Azure portal. (1) Sign in to the Azure portal as a Global Administrator. Note : If you are using Microsoft Entra Privileged Identity Management, activate your Global Administrator role assignment !! (2) Browse to Microsoft Entra ID > Manage > Properties. (3) Under Access management for Azure resources, set the toggle to Yes. (4) Select Save to save your setting. If you found this valuable, consider sharing so more professionals can benefit. Let's keep the conversation growing! ๐56Views0likes0Comments๐ Azure Control, Data, & MGMT Planes: The Backbone of Cloud Efficiency ๐
Azure operations can be divided into Three categories (Control Plane - Data Plane - Management Plane) This post describes the differences between those three types of operations. Tip : Suppose that the word "plane" means "function" understand this definition like this !! # Control Plane (Function) # @ The Control Plane is responsible for managing and configuring Azure resources. @ It handles administrative tasks such as creating, updating, and deleting resources. @ All requests for control plane operations are sent to the Azure Resource Manager URL For Azure global, the URL is " https://management.azure.comm. " @ Azure Resource Manager handles all control plane requests. It automatically applies the Azure features you implemented to manage your resources, such as: Azure role-based access control (Azure RBAC) - Azure Policy - Management Locks - Activity Logs @ After Azure Resource Manager authenticates the request, it sends the request to the resource provider, which completes the operation. @ The control plane includes two scenarios for handling requests - "green field" and "brown field". @ Green field refers to ---> new resources. Brown field refers to ---> existing resources. # Data Plane (Function) # @ The Data Plane is responsible for interacting with the actual data within Azure resources. @ Once a resource is created, operations like reading, writing, and processing data occur in the Data Plane. @ Requests for data plane operations are sent to an endpoint that's specific to your instance. Ex : "myaccount.blob.core.windows.nett " ---> for storage account @ Operates independently of the Control Plane, meaning even if the Control Plane is unavailable, the Data Plane remains accessible. # Management Plane (Function) # @ The Management Plane oversees monitoring, security, and configuration of Azure services. @ It ensures that resources are operating efficiently and securely. Ex : Azure Monitor: Collecting logs and metrics from resources Ex : Azure Security Center: Managing security policies and compliance. Ex : Azure Automation: Running scheduled tasks for resource management.67Views2likes0CommentsSetting up Code Coverage data in Azure DevOps Pipeline, C# .NET 9
Hello everyone, I would like some assistance with my Azure DevOps pipeline. I am trying to set up Tasks in my Azure DevOps pipeline to collect Code Coverage results, after running UTs using the VsTest Task, to then have a Powershell Task in the Pipeline write to a SQL db the contents of those metrics. The main issue I am encountering is actually finding the published results after the UTs successfully run. I have set up Tasks to publish the results, then find them & then insert, but the publish doesn't seem to actually publish to the directory I specify, or if it does publish, I cannot see where to. Here are the Tasks I currently have set-up. Task to run UTs: steps: - task: VSTest@2 displayName: 'VsTest - testAssemblies' inputs: testAssemblyVer2: | **\$(BuildConfiguration)\*\*test*.dll !**\obj\** runSettingsFile: '$/B3API/Main/B3API.Tests/codecoverage.runsettings' runInParallel: true runTestsInIsolation: false codeCoverageEnabled: true platform: '$(BuildPlatform)' configuration: '$(BuildConfiguration)' failOnMinTestsNotRun: true codecoverage.runsettings file: <?xml version="1.0" encoding="utf-8"?> <RunSettings> <DataCollectionRunSettings> <DataCollectors> <DataCollector friendlyName="Code Coverage"> <Configuration> <Format>cobertura</Format> </Configuration> </DataCollector> </DataCollectors> </DataCollectionRunSettings> </RunSettings> Task to publish results: steps: - task: PublishCodeCoverageResults@2 displayName: 'Publish code coverage results' inputs: summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.cobertura.xml' pathToSources: '$(System.DefaultWorkingDirectory)/**/coverage' Task to find published file & store into variable: steps: - powershell: | $coverageFile = "$(System.DefaultWorkingDirectory)/**/coverage.cobertura.xml" [xml]$coverageData = Get-Content $coverageFile $coveragePercentage = $coverageData.coverage.@line-rate # Store the coverage data in a variable Write-Host "##vso[task.setvariable variable=coveragePercentage]$coveragePercentage" displayName: 'Store Coverage in variable' The main issue it the Task to publish, it does not publish the results, I think it is due to not finding them in the first place. Thank you for taking the time to read my post, any help would be greatly appreciated, thanks!56Views0likes1Commentbypass of MFA for Admin portals
Hello, I have a conditional access policy that bypasses MFA for custom enterprise apps when working from our trusted IPs. Since this policy is working as designed and expected, I thought it would be a simple matter to add the admin portal apps to it so sites like portal.azure.com are also bypassed. But for some reason it doesn't work even though sign-in logs reflect that the password only policy is indeed being applied to the sign in. Is there something additional I need to do? Are admin portals hardcoded for MFA? I have included some screenshots of the policy and logs for review. Thanks,69Views0likes4Comments