Showing posts with label #AzureMonitoring. Show all posts
Showing posts with label #AzureMonitoring. Show all posts

Saturday, August 1, 2020

Secure Azure Infrastructure Practices

Secure Azure Infrastructure Practices

 

Secure Cloud Infrastructure

In Year 2020 cloud computing outcomes show that enterprises continue to embrace multi-cloud (Azure, AWS and Google) and hybrid cloud strategies. While consider

Infrastructure-as-a-Service (IaaS) adoption continues its upward trend as the fastest growing public cloud segment than PaaS.

More adaptability may lead towards more security concern. Here I embrace few aspects which can be consider while managing Azure Infrastructure which is the rapid adoption of IaaS providers. A adequate action may turn to more secure environment and mitigation of potential impact of an attempted break.

n secure your Azure infrastructure.

Security for Azure resources are further categories as mentioned below: 

  1.          Azure Security Center(ASC)
  2.          Security for virtual machines
  3.          Azure Identity and Access Management(IAM)
  4.          Azure Storage
  5.          SQL Server Databases
  6.          Azure Network Security
  7.          Azure Monitor
  8.          Azure Key Vault
  9.          Azure Governance
  10.         Azure Private Link

 

1.      Azure Security Center (ASC) : ASC is a PaaS based security management solution for Azure subscription. It extends advanced threat protection for across hybrid clouds workloads for both cloud and on-premise workloads.

·         Strengthen security posture: Security Center assesses cloud environment and shares cloud resources whether they are secure or not.

·         Protect potential threats: ASC evaluates assesses workloads and raises threat prevention recommendations and security alerts.

·         ASC secure faster: In Azure ASC is natively integrated so deployment of ASC is very easier and faster.

    2. Security for virtual machines:

  • MDATP : ASC extends its workload protection using Microsoft Defender Advanced Threat Protection(MDATP). MDATP generates an alerts after notice attacker tools, techniques, also its sensors for VM’s collects vast verities of signals
  • Operating System vulnerabilities -> Enable OS vulnerabilities recommendations for virtual machines
  • Endpoint protection-> Enable endpoint protection for Azure Virtual machines and on-premises VMs  to remove viruses, spyware, and other malicious software. Use ASC for this purpose.
  • Adequate Implementation of NSG-> All network ports should be restricted on NSG associated to your VM.
  • Adaptive Network Hardening(ANH): ASC recommends network hardening should be applied on internet facing virtual machines and should be limited to specific ip ranges.
  • Deploying the Qualys built-in vulnerability scanner-> Microsoft ASC advises to enable the built-in vulnerability assessment solution on virtual machines (powered by Qualys)
  • Enable latest OS patch updates for virtual machines-> Ensure Latest Operating system  Patches for virtual machines.
  • Enable disk encryption on virtual machines. ASC always recommends for this as high Severity alerts and Azure Disk Encryption(ADE) protects data to meet an organizational security and compliance needs. ASC always recommends for this as High Severity alerts.

  3. Azure Identify & Access Management (IAM): Points of consideration are listed here

·         Secure multi-factor authentication is enabled for all users -> Though for Global administrator and other potential users has already MFA enabled however we should consider to enable MFA for those users who have write access to Azure resources and may gain access to harm infrastructure.

  • Ensure Privilege Identity Management (PIM) -> PIM must be reviewed on a certain interval to review users access. User must be granted only JIT.
  • Conditional Access Policy -> Conditional access policy must be applied for Hybrid joined users or AD users to avoid all vulnerabilities.
  • Less numbers of admins/owners -> Less numbers of Owner/Admin role always beneficial and mitigates unavoidable circumstances which may happens.

4. Storage Accounts: Data is always a key component for any organization and should not be breach at all so Ensure the following are set to enabled:

  • Enable Advanced Threat Protection: ATP enables an extra layer of security intelligence that detects strange and potentially harmful attempts to access or tap storage account.
  • Storage Secure transfer: HTTPS is always considered as secure transfer so enable https to connect to azure storage through secure transfer.
  •  Storage service encryption: Storage service encryption protects your data at rest. Azure uses symmetric encryption to encrypt and decrypt  data when its written to storage and whenever you access it.

5. Azure SQL Services: On SQL database or servers, ensure the following are set to on:

  • SQL Auditing
    Auditing embraces activity, compliance, anomalies and conflicting facts. Auditing goes after database events and writes them to an audit log in your Azure storage account. It can be helpful to identify suspected security concerns. So it must be enabled.
  • Transparent Data Encryption on SQL databases: Transparent Data Encryption on SQL databases, Managed instances and azure synapse analytics should be enabled.
  • Threat detection . It enables an additional layer of security intelligence that detects unusual and potentially harmful attempts to access or exploit SQL databases.

6. Azure Networking : Ensure the following are disabled on network security groups from internet:

  • Disable RDP and SSH:
    Ensure RDP and SSH are allowed to certain set of users and JIT must be enabled during  rdp and ssh over the Internet as an attackers can use various brute-force ways to get access to Azure Virtual Machines.
  • Azure Bastion : Azure Bastion furnishes secure and seamless RDP/SSH connectivity to VMs directly in the Azure portal over SSL. You don’t require public IP while connect to VM’s through  Azure Bastion.
  • Web Application Firewall (WAF): Web application are always a risk area and can be tempered with brute force or malicious attacks . Few well known vulnerabilities are SQL injection and cross site scripting attacks A centralized WAF protects against such web attacks without incurring an additional application changes.

7. Azure Monitor:

·         Enabled Diagnostic: Resource log is indeed helpful to get an insights about azure resource internal operation and can be beneficial for root cause analysis, so ensure that diagnostic settings for azure resource is enabled and sending telemetry to LogAnalyticsWorkspace or azure storage or Event hubs.

·         Azure Monitor Alerts: Enterprise application must be designed considering metric alerts activity alert, cost alerts and log analytics alert are configured adequately. These alerts send an alerts in case any potential threshold meet criteria for azure resource and further can be integrated to SIEM tool.

  • Web Application Firewall (WAF): Web application are always a risk area and can be tempered with brute force or malicious attacks . Few well known vulnerabilities are SQL injection and cross site scripting attacks A centralized WAF protects against such web attacks without incurring an additional application changes.

8. Azure Key Vault: Azure key vault is  hardware security modules (HSMs) based technique and provides access to token ,password and apikey. Key Vault greatly reduces the chances that secrets may be accidentally leaked. E.g. An application may need to connect to DB and that connection string can be stored in Key Vault and can be access over URI.

9. Azure Governance: It’s a process to maintain an application and resources in Azure. Few main characteristics of azure governance depicts below:

·         Apply RBAC to prevent and control user access permission to mitigate undesirable actions se Grant permission to set of users to access application and resources. Azure Policy manages policy definitions to enforce rules for your resources within infrastructure and can be applied to identify complaint resources and take adequate action against non-compliant resources.

10. Azure Private Link: An objective of Azure private link is to secure connection with azure PaaS offerings. It promises private connectivity from Azure VNet to Azure PaaS, customer-owned service over Azure backbone network and avoid transmission on public network.

Private Link supports the following services in GA:

§  Azure Storage

§  Azure Data Lake Storage Gen 2

§  Azure SQL

§  Azure Synapse

§  Azure Cosmos DB

§  Azure Database for PostgreSQL

§  Azure Database for MySQL & MariaDB

§  Azure Key Vault

§  Azure Kubernetes Services

 

I hope it will assist you to get an understanding about some security practice.

Kindly Visit my channel for all video's

Thursday, March 26, 2020


 Enable performance counter for Log analytics and execute KUSTO Query

 

This article states you about how can you execute log analytics query or KUSTO query over log analytics workspace. A KUSTO query is combination of SQL,PowerShell and bash and becomes KQL (Kusto query language).
Prior to this please go through to this which is about how to create log analytics workspace.




Pre-requisite

The following must be present for this solution:
1.     You should have Log analytics workspace already configured in your Azure subscription.

Log analytics workspace

Once you are done with creation of LAW, go to that and find an option logs on t eleft side of the panel as you can see in an image LA.jpg below marked as RED


There I’ve executed a query which is describes about list the number of computers sending logs, each hour. For that purpose I selected a table named HeartBeat which contains a potential information about the virtual machine connected to Log analytics workspace aka LAW


Go to Data -> Windows Performance Counter -> Add the selected performance counter
And click on that. As soon as you click all those counter will be enable and will start sending telemetry to log analytics workspace on which you can query and get virtual machine performace information. Refer enable-counter.jpg




Once performance counter got enabled , it starts sending those information to Log Analytics workspace.

NOTE: If you don’t get any records while you execute query on PERF table than restart MMA agent persists on virtual machine or disconnect/connect from virtual machine option visible in Log Analytics Workspace.

You can easily see the performance of a virtual machine connected to Log analytics workspace aka LAW. For that select PERF table .


Another set of query is for Usage and rendering it in piechart. You can render it in table , scatterchart and with few more option

// Usage by data types
// Chart the amount of logs reported for each data type, today
Usage
| summarize count_per_type=count() by DataType
| sort by count_per_type desc
| render piechart

In an image below you should be able to understand how does it works in real use case.

KUSTO keywords in use

Refer an image below kusto-query-piechart.jpg below for the output in piechart.




NOTE:  Following query fetches information about "%committed bytes in use"  (in case of windows OS) for Linux base machine counter name will be "% Used Memory".
After executing the below query I get 3 rows as a result because If you remember I’ve enable performance counter for windows computer. Refer screen shot enable-counter.jpg



Perf
| where TimeGenerated > ago(30m)
| where  CounterName == "% Committed Bytes In Use"
| project TimeGenerated, CounterName, CounterValue, Computer 
| summarize UsedMemory = avg(CounterValue) by CounterName, bin(TimeGenerated, 10m), Computer
| where UsedMemory > 0
| render timechart

Refer an image result.jpg below

 

I hope it helps you a bit to understand how can we run KUSTO on LOG analytics workspace.


Tuesday, March 24, 2020


Configure MMA agent for multiple VM’s in Azure - An Easiest Way 

 

This article states how to setup MMA agent earlier known as OMS agent or Log analytics Agent  to multiple vm’s through portal.
Prior to this please go through to this which is about how to create log analytics workspace.

Pre-requisite

The following must be present for this solution:
1.     You should have Log analytics workspace already configured in your Azure subscription.
2.      For the MMA, an internet access must be there
3.      The MMA supports Windows Server 2008 SP1, Windows 7 SP1, and later.
4.      You can install the MMA on physical or virtual machines, but not Azure virtual machines — these     are connected via the Azure Portal.

Create Log analytics workspace

Once you are done with creation of LAW, go to that and find an option virtual machines as you can see in an image LA.jpg below marked as RED


Connect existing virtual machine with workspace

In order to install the MMA agent , click on virtual machine property and choose your desire virtual machines to install MMA in a one go. I do have only one windows based virtual machine , in you case you may have more .Kindly refer an image install-mma-on-vm.jpg below

There can be few more virtual machines




You can select multiple machine from here also and these can be Windows and Linux based machine.
Once you click in that click on connect in order to install/configure MMA as depicted below in image connect-vm.jpg
 
Click on the connect button, Same way you have to do for other virtual machine

As soon as you click on connect a new message appears as “Connecting VM to Log Analytics. Please check back later for status update”. It should not take more than 4 mins.
After Successfully connected to  VM, it changes a status and shows as below screenshot connected-to-vm.jpg


Once it succeeds than go to virtual machine which you have create and follow the below steps to confirm weather MMA agent got installed or not.

Once setup is finished than go to you server and open control panel Microsoft Monitoring agent must persist there as appears in below image mma-control-panel.jpg



Click on that and it will open the following windows which confirms that The Microsoft Monitoring Agent has successfully connected to the log analytics service as shown in image installation-succeeded.jpg

Microsoft Monitoring agent is connected to Log Analytics Workspace
In upcoming article will share you
1.       How can we write Kusto query.
2.       Enable Windows and Linux performance counter from azure portal.