Back to controls

Ensure Network Security Group Flow logs are captured and sent to Log Analytics

Ensure that network flow logs are captured and fed into a central log analytics workspace.

Category

Controls

Low

Applies to

Microsoft Azure

Coverage

1 queries

Asset types

1 covered

Overview

Ensure that network flow logs are captured and fed into a central log analytics workspace.

Rationale

Network Flow Logs provide valuable insight into the flow of traffic around your network and feed into Azure Monitor and Azure Sentinel (if in use), permitting the generation of visual flow diagrams to aid with analyzing for lateral movement, etc.

Impact

The impact of configuring NSG Flow logs is primarily cost and configuration. If deployed, it will create storage accounts that hold minimal amounts of data for a 5-day lifecycle before feeding it to the Log Analytics Workspace.

This will increase the amount of data stored and used by Azure Monitor.

Default Value

By default, Network Security Group logs are not sent to Log Analytics.

References

Remediation guidance

Remediate from Azure Portal

  1. Navigate to Network Watcher.
  2. Under Logs, select Flow logs.
  3. Select + Create.
  4. Select the desired Subscription.
  5. For Flow log type, select Network security group.
  6. Select + Select target resource.
  7. Select Network security group.
  8. Select a network security group.
  9. Click Confirm selection.
  10. Select or create a new Storage Account.
  11. If using a v2 storage account, input the retention in days to retain the log.
  12. Click Next.
  13. Under Analytics, for Flow log version, select Version 2.
  14. Check the box next to Enable traffic analytics.
  15. Select a processing interval.
  16. Select a Log Analytics Workspace.
  17. Select Next.
  18. Optionally add Tags.
  19. Select Review + create.
  20. Select Create.

Warning

The remediation policy creates remediation deployment and names them by concatenating the subscription name and the resource group name. The MAXIMUM permitted length of a deployment name is 64 characters. Exceeding this will cause the remediation task to fail.

Service-wide remediation

Recommended when many resources are affected: fix the platform baseline first so new resources inherit the secure setting, then remediate the existing flagged resources in batches.

Azure

Use management group or subscription Azure Policy assignments, remediation tasks where supported, landing-zone standards, and IaC modules so drift is prevented at scale.

Operational rollout

  1. Fix the baseline first at the account, subscription, project, cluster, or tenant scope that owns this control.
  2. Remediate the currently affected resources in batches, starting with internet-exposed and production assets.
  3. Re-scan and track approved exceptions with an owner and expiry date.

Query logic

These are the stored checks tied to this control.

Azure Flow Logs for NSGs without Log Analytics

Connectors

Microsoft Azure

Covered asset types

FlowLog

Expected check: eq []

{
  flowLogs(
    where: {
      targetResourceID_CONTAINS: "networkSecurityGroups"
      trafficAnalyticsEnabled: false
    }
  ) {
    ...AssetFragment
  }
}
Cyscale Logo
Cyscale is an agentless cloud-native application protection platform (CNAPP) that automates the contextual analysis of cloud misconfigurations, vulnerabilities, access, and data, to provide an accurate and actionable assessment of risk.

Stay connected

Receive new blog posts and product updates from Cyscale

By clicking Subscribe, I agree to Cyscale’s Privacy Policy


© 2026 Cyscale Limited

LinkedIn icon
Twitter icon
Facebook icon
crunch base icon
angel icon