Skip to content

[Azure] Update Azure Firewall pipeline #9428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 52 commits into from
Jul 11, 2024

Conversation

lucian-ioan
Copy link
Contributor

@lucian-ioan lucian-ioan commented Mar 22, 2024

Proposed commit message

Update Azure Firewall pipeline due to new format introduced by Azure via Resource Specific Structured Logging.

Currently adding support for the following categories:

  • AZFWNatRule
  • AZFWNetworkRule
  • AZFWApplicationRule
  • AZFWDnsQuery

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Screenshots

@elasticmachine
Copy link

elasticmachine commented Mar 22, 2024

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@lucian-ioan lucian-ioan self-assigned this Mar 24, 2024
@lucian-ioan lucian-ioan added the Integration:azure Azure Logs label Mar 24, 2024
@lucian-ioan lucian-ioan marked this pull request as ready for review April 10, 2024 09:56
@lucian-ioan lucian-ioan requested review from a team as code owners April 10, 2024 09:56
@lucian-ioan lucian-ioan requested a review from muthu-mps April 10, 2024 09:56
@@ -0,0 +1,30 @@
{
"expected": [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the log fields are missing for this category AZFWApplicationRule? Do we need to re-run the pipeline test and generate the sample metrics with all the fields added to the expected json?

"policy": "policy",
"protocol": "TCP",
"rule": "rule",
"rule_collection": "rule collection",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we provide a meaningful name for the rule, rule_collection and the rule_collection_group?

@@ -50,6 +39,130 @@
type: keyword
description: |
Operation name
- name: destination_ip
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we leverage the ECS fields for source and destination IP address and port?

@muthu-mps
Copy link
Contributor

@lucian-ioan

  • Update the documentation to capture the supported categories. Add few lines about the structured logs.
  • Adding the current version of the document below
Screenshot 2024-04-16 at 2 29 39 PM
  • Add the screenshot of the dashboard image to this PR which would help to cross check with the previous version.

@lucian-ioan lucian-ioan requested a review from muthu-mps July 3, 2024 23:22
@lucian-ioan lucian-ioan force-pushed the update_azure_firewall_pipeline branch from aeacc79 to 9bdd073 Compare July 5, 2024 09:48
@lucian-ioan lucian-ioan requested a review from kcreddy July 5, 2024 12:07
Copy link
Contributor

@kcreddy kcreddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor suggestions on my end

lucian-ioan and others added 4 commits July 5, 2024 16:11
…pipeline/default.yml

Co-authored-by: Krishna Chaitanya Reddy Burri <krish.reddy91@gmail.com>
…pipeline/default.yml

Co-authored-by: Krishna Chaitanya Reddy Burri <krish.reddy91@gmail.com>
…pipeline/default.yml

Co-authored-by: Krishna Chaitanya Reddy Burri <krish.reddy91@gmail.com>
@lucian-ioan
Copy link
Contributor Author

Thank you @kcreddy for the help, suggestions added.

Copy link
Contributor

@kcreddy kcreddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for my comments

Copy link
Contributor

@zmoog zmoog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

My only suggestion is to clarify and expand the docs about diagnostics vs. resource-specific.

@lucian-ioan, does the integration support all resource-specific log categories for Azur Firewall, or are there more?

I have a vague recall of a long list of log categories.

Comment on lines +7 to +17
| Log Category | Description | Destination Table |
|:----------------------------:|:------------------------------------------------------------------------------------------------------------------------------------:|:------------------:|
| AzureFirewallApplicationRule | These logs capture information about the traffic that is allowed or denied by application rules configured in Azure Firewall. | Azure diagnostics |
| AzureFirewallNetworkRule | These logs capture information about the traffic that is allowed or denied by network rules configured in Azure Firewall. | Azure diagnostics |
| AzureFirewallDnsProxy | These logs capture information about DNS requests and responses that are processed by Azure Firewall's DNS proxy. | Azure diagnostics |
| AZFWApplicationRule | These logs capture resource specific information about the traffic that is allowed or denied by application rules configured in Azure Firewall. | Resource specific |
| AZFWNetworkRule | These logs capture resource specific information about the traffic that is allowed or denied by network rules configured in Azure Firewall. | Resource specific |
| AZFWNatRule | These logs capture resource specific information about all DNAT (Destination Network Address Translation) events log data. | Resource specific |
| AZFWDnsQuery | These logs capture resource specific information about DNS requests and responses that are processed by Azure Firewall's DNS proxy. | Resource specific |

For detailed information and instructions on how to migrate to Resource-specific mode, please refer to the following Microsoft documentation: [Azure Monitor Resource Logs](https://learn.microsoft.com/en-gb/azure/azure-monitor/essentials/resource-logs#resource-specific).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's good we're adding more info about the collection mode (azure diagnostics vs. resource specific)!

I would expand this section a little to convey more context, using the info mentioned in the doc from Azure you linked (and leaving all the other fine details to the Azure doc).

From https://learn.microsoft.com/en-gb/azure/azure-monitor/essentials/resource-logs#resource-specific:

Most Azure resources write data to the workspace in either Azure diagnostics or resource-specific mode without giving you a choice.

All Azure services will eventually use the resource-specific mode. As part of this transition, some resources allow you to select a mode in the diagnostic setting. Specify resource-specific mode for any new diagnostic settings because this mode makes the data easier to manage.

So it's also clear that users can have the log categories from Azure Diagnostics or resource-specific, but not both.

@@ -1,6 +1,6 @@
name: azure
title: Azure Logs
version: 1.12.0
version: 1.12.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a new feature (adds support to additional log categories) we can probably use v1.13.0. WDYT?

@lucian-ioan
Copy link
Contributor Author

@zmoog There are a couple more categories, this PR specifically adds support for the most important ones (which are currently used by customers).

@elasticmachine
Copy link

💚 Build Succeeded

History

cc @lucian-ioan

Copy link

Quality Gate failed Quality Gate failed

Failed conditions
63.9% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube

@lucian-ioan lucian-ioan merged commit 55e5f4f into elastic:main Jul 11, 2024
4 of 5 checks passed
@elasticmachine
Copy link

Package azure - 1.13.0 containing this change is available at https://epr.elastic.co/search?package=azure

@lucian-ioan lucian-ioan deleted the update_azure_firewall_pipeline branch February 6, 2025 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Integration:azure Azure Logs Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Azure Firewall] Certain Logs are not being parsed correctly
7 participants