Skip to content

Commit 5b0a506

Browse files
Merge pull request #187679 from batamig/diff-syslog-cef
separating syslog and cef
2 parents be054b7 + 7a8f9f6 commit 5b0a506

File tree

1 file changed

+160
-46
lines changed

1 file changed

+160
-46
lines changed

articles/sentinel/troubleshooting-cef-syslog.md

Lines changed: 160 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,22 @@ Other symptoms of a failed connector deployment include when either the **securi
2020

2121
For more information, see [Connect your external solution using Common Event Format](connect-common-event-format.md) and [Collect data from Linux-based sources using Syslog](connect-syslog.md).
2222

23-
> [!NOTE]
24-
> The Log Analytics agent for Windows is often referred to as the *Microsoft Monitoring Agent (MMA)*. The Log Analytics agent for Linux is often referred to as the *OMS agent*.
25-
>
23+
If you've deployed your connector using a method different than the documented procedure and are having issues, we recommend that you purge the deployment and install again as documented.
2624

27-
> [!TIP]
28-
> When troubleshooting, we recommend that you work through the steps in this article in the order they're presented to check and resolve issues in your Syslog Collector, operating system, or OMS agent.
29-
>
30-
> If you've deployed your connector using a method different than the documented procedure and are having issues, we recommend that you purge the deployment and install again as documented.
31-
>
25+
## How to use this article
3226

33-
## Validate CEF connectivity
27+
When information in this article is relevant only for Syslog or only for CEF connectors, we've organized the page into tabs. Make sure that you're using the instructions on the correct tab for your connector type.
28+
29+
For example, if you're troubleshooting a CEF connector, start with [Validate CEF connectivity](#validate-cef-connectivity). If you're troubleshooting a Syslog connector, start below, with [Verify your data connector prerequisites](#verify-your-data-connector-prerequisites).
30+
31+
# [CEF](#tab/cef)
32+
33+
### Validate CEF connectivity
3434

3535
After you've [deployed your log forwarder](connect-common-event-format.md) and [configured your security solution to send it CEF messages](./connect-common-event-format.md), use the steps in this section to verify connectivity between your security solution and Microsoft Sentinel.
3636

37+
This procedure is relevant only for CEF connections, and is *not* relevant for Syslog connections.
38+
3739
1. Make sure that you have the following prerequisites:
3840

3941
- You must have elevated permissions (sudo) on your log forwarder machine.
@@ -60,9 +62,11 @@ After you've [deployed your log forwarder](connect-common-event-format.md) and [
6062

6163
### CEF validation script explained
6264

63-
The validation script performs the following checks:
65+
The following section describes the CEF validation script, for the [rsyslog daemon](#rsyslog-daemon) and the [syslog-ng daemon](#syslog-ng-daemon).
6466

65-
# [rsyslog daemon](#tab/rsyslog)
67+
#### rsyslog daemon
68+
69+
For an rsyslog daemon, the CEF validation script runs the following checks:
6670

6771
1. Checks that the file<br>
6872
`/etc/opt/microsoft/omsagent/[WorkspaceID]/conf/omsagent.d/security_events.conf`<br>
@@ -118,11 +122,11 @@ The validation script performs the following checks:
118122

119123
1. Checks that the syslog daemon (rsyslog) is properly configured to send messages (that it identifies as CEF) to the Log Analytics agent on TCP port 25226:
120124

121-
- Configuration file: `/etc/rsyslog.d/security-config-omsagent.conf`
125+
Configuration file: `/etc/rsyslog.d/security-config-omsagent.conf`
122126

123-
```bash
124-
if $rawmsg contains "CEF:" or $rawmsg contains "ASA-" then @@127.0.0.1:25226
125-
```
127+
```bash
128+
if $rawmsg contains "CEF:" or $rawmsg contains "ASA-" then @@127.0.0.1:25226
129+
```
126130
127131
1. Restarts the syslog daemon and the Log Analytics agent:
128132
@@ -155,7 +159,9 @@ The validation script performs the following checks:
155159
| where DeviceProduct == "MOCK"
156160
```
157161
158-
# [syslog-ng daemon](#tab/syslogng)
162+
#### syslog-ng daemon
163+
164+
For a syslog-ng daemon, the CEF validation script runs the following checks:
159165
160166
1. Checks that the file<br>
161167
`/etc/opt/microsoft/omsagent/[WorkspaceID]/conf/omsagent.d/security_events.conf`<br>
@@ -248,23 +254,28 @@ The validation script performs the following checks:
248254
CommonSecurityLog
249255
| where DeviceProduct == "MOCK"
250256
```
257+
258+
# [Syslog](#tab/syslog)
259+
260+
### Troubleshooting Syslog data connectors
261+
262+
If you are troubleshooting a Syslog data connector, start with verifying your prerequisites in the section [below](#verify-your-data-connector-prerequisites), using the information in the **Syslog** tab.
263+
251264
---
252265
253-
## Verify CEF or Syslog prerequisites
266+
## Verify your data connector prerequisites
254267
255268
Use the following sections to check your CEF or Syslog data connector prerequisites.
256269
257-
### Azure Virtual Machine as a Syslog collector
270+
# [CEF](#tab/cef)
258271
259-
If you're using an Azure Virtual Machine as a Syslog collector, verify the following:
272+
### Azure Virtual Machine as a CEF collector
260273
261-
- While you are setting up your Syslog data connector, make sure to turn off your [Microsoft Defender for Cloud auto-provisioning settings](../security-center/security-center-enable-data-collection.md) for the [MMA/OMS agent](connect-windows-security-events.md#connector-options).
274+
If you're using an Azure Virtual Machine as a CEF collector, verify the following:
262275
263-
You can turn them back on after your data connector is completely set up.
276+
- Before you deploy the [Common Event Format Data connector python script](./connect-log-forwarder.md), make sure that your Virtual Machine isn't already connected to an existing Log Analytics workspace. You can find this information on the Log Analytics Workspace Virtual Machine list, where a VM that's connected to a Syslog workspace is listed as **Connected**.
264277
265-
- Before you deploy the [Common Event Format Data connector python script](./connect-log-forwarder.md), make sure that your Virtual Machine isn't already connected to an existing Syslog workspace. You can find this information on the Log Analytics Workspace Virtual Machine list, where a VM that's connected to a Syslog workspace is listed as **Connected**.
266-
267-
- Make sure that Microsoft Sentinel is connected to the correct Syslog workspace, with the **SecurityInsights** solution installed.
278+
- Make sure that Microsoft Sentinel is connected to the correct Log Analytics workspace, with the **SecurityInsights** solution installed.
268279
269280
For more information, see [Step 1: Deploy the log forwarder](./connect-log-forwarder.md).
270281
@@ -282,14 +293,50 @@ If you are using an on-premises machine or a non-Azure virtual machine for your
282293
sudo wget -O cef_installer.py https://raw.githubusercontent.com/Azure/Azure-Sentinel/master/DataConnectors/CEF/cef_installer.py&&sudo python cef_installer.py <WorkspaceId> <Primary Key>
283294
```
284295
285-
### Enable your Syslog facility and log severity collection
296+
### Enable your CEF facility and log severity collection
286297
287298
The Syslog server, either rsyslog or syslog-ng, forwards any data defined in the relevant configuration file, which is automatically populated by the settings defined in your Log Analytics workspace.
288299
289300
Make sure to add details about the facilities and severity log levels that you want to be ingested into Microsoft Sentinel. The configuration process may take about 20 minutes.
290301
291-
For more information, see [Deployment script explained](./connect-log-forwarder.md#deployment-script-explained) and [Configure Syslog in the Azure portal](../azure-monitor/agents/data-sources-syslog.md).
302+
For more information, see [Deployment script explained](./connect-log-forwarder.md#deployment-script-explained).
292303
304+
For example, for an rsyslog server, run the following command to display the current settings for your Syslog forwarding, and review any changes to the configuration file:
305+
306+
```bash
307+
cat /etc/rsyslog.d/security-config-omsagent.conf
308+
```
309+
310+
In this case, for rsyslog, output similar to the following should display:
311+
312+
```bash
313+
if $rawmsg contains "CEF:" or $rawmsg contains "ASA-" then @@127.0.0.1:25226
314+
```
315+
316+
317+
# [Syslog](#tab/syslog)
318+
319+
### Azure Virtual Machine as a Syslog collector
320+
321+
If you're using an Azure Virtual Machine as a Syslog collector, verify the following:
322+
323+
- While you are setting up your Syslog data connector, make sure to turn off your [Microsoft Defender for Cloud auto-provisioning settings](../security-center/security-center-enable-data-collection.md) for the [MMA/OMS agent](connect-windows-security-events.md#connector-options).
324+
325+
You can turn them back on after your data connector is completely set up.
326+
327+
- Make sure that Microsoft Sentinel is connected to the correct Log Analytics workspace, with the **SecurityInsights** solution installed.
328+
329+
For more information, see [Step 1: Deploy the log forwarder](./connect-log-forwarder.md).
330+
331+
- Make sure that your machine is sized correctly with at least the minimum required prerequisites. For more information, see [CEF prerequisites](connect-common-event-format.md#prerequisites).
332+
333+
### Enable your Syslog facility and log severity collection
334+
335+
The Syslog server, either rsyslog or syslog-ng, forwards any data defined in the relevant configuration file, which is automatically populated by the settings defined in your Log Analytics workspace.
336+
337+
Make sure to add details about the facilities and severity log levels that you want to be ingested into Microsoft Sentinel. The configuration process may take about 20 minutes.
338+
339+
For more information, see [Deployment script explained](./connect-log-forwarder.md#deployment-script-explained). and [Configure Syslog in the Azure portal](../azure-monitor/agents/data-sources-syslog.md).
293340
294341
**For example, for an rsyslog server**, run the following command to display the current settings for your Syslog forwarding, and review any changes to the configuration file:
295342
@@ -310,26 +357,18 @@ local4.=alert;local4.=crit;local4.=debug;local4.=emerg;local4.=err;local4.=info;
310357
syslog.=alert;syslog.=crit;syslog.=debug;syslog.=emerg;syslog.=err;syslog.=info;syslog.=notice;syslog.=warning @127.0.0.1:25224
311358
```
312359
360+
---
313361
314-
**For CEF forwarding, for an rsyslog server**, run the following command to display the current settings for your Syslog forwarding, and review any changes to the configuration file:
315-
316-
```bash
317-
cat /etc/rsyslog.d/security-config-omsagent.conf
318-
```
319-
320-
In this case, for rsyslog, output similar to the following should display:
321-
322-
```bash
323-
if $rawmsg contains "CEF:" or $rawmsg contains "ASA-" then @@127.0.0.1:25226
324-
```
325362
326363
## Troubleshoot operating system issues
327364
328-
This procedure describes how to troubleshoot issues that are certainly derived from the operating system configuration.
365+
This section describes how to troubleshoot issues that are certainly derived from the operating system configuration.
366+
367+
# [CEF](#tab/cef)
329368
330369
**To troubleshoot operating system issues**:
331370
332-
1. If you haven't yet, verify that you're working with a supported operating system and Python version. For more information, see [CEF prerequisites](connect-common-event-format.md#prerequisites) and [Configure your Linux machine or appliance](connect-syslog.md#configure-your-linux-machine-or-appliance).
371+
1. If you haven't yet, verify that you're working with a supported operating system and Python version. For more information, see [CEF prerequisites](connect-common-event-format.md#prerequisites).
333372
334373
1. If your Virtual Machine is in Azure, verify that the network security group (NSG) allows inbound TCP/UDP connectivity from your log client (Sender) on port 514.
335374
@@ -353,13 +392,13 @@ This procedure describes how to troubleshoot issues that are certainly derived f
353392
watch -n 2 -d iptables -nvL
354393
```
355394
356-
1. Verify whether the Syslog server is processing the logs. Run:
395+
1. Verify whether the CEF server is processing the logs. Run:
357396
358397
```config
359398
tail -f /var/log/messages or tail -f /var/log/syslog
360399
```
361400
362-
Any Syslog or CEF logs being processed are displayed in plain text.
401+
Any CEF logs being processed are displayed in plain text.
363402
364403
1. Confirm that the rsyslog server is listening on TCP/UDP port 514. Run:
365404
@@ -375,11 +414,55 @@ This procedure describes how to troubleshoot issues that are certainly derived f
375414
0 127.0.0.1:36120 127.0.0.1:25226 ESTABLISHED 1055/rsyslogd
376415
```
377416
378-
If the connection is blocked, you may have a [blocked SELinux connection to the OMS agent](#selinux-blocking-connection-to-the-oms-agent), or a [blocked firewall process](#blocked-firewall-policy). Use the following sets of instructions to determine the issue.
417+
If the connection is blocked, you may have a [blocked SELinux connection to the OMS agent](#selinux-blocking-connection-to-the-oms-agent), or a [blocked firewall process](#blocked-firewall-policy). Use the relevant instructions below to determine the issue.
418+
419+
420+
# [Syslog](#tab/syslog)
421+
422+
**To troubleshoot operating system issues**:
423+
424+
1. If you haven't yet, verify that you're working with a supported operating system and Python version. For more information, see [Configure your Linux machine or appliance](connect-syslog.md#configure-your-linux-machine-or-appliance).
425+
426+
1. If your Virtual Machine is in Azure, verify that the network security group (NSG) allows inbound TCP/UDP connectivity from your log client (Sender) on port 514.
427+
428+
1. Verify that packets are arriving to the Syslog Collector. To capture the syslog packets arriving to the Syslog Collector, run:
429+
430+
```config
431+
tcpdump -Ani any port 514 and host <ip_address_of_sender> -vv
432+
```
433+
434+
1. Do one of the following:
435+
436+
- If you do not see any packets arriving, confirm the NSG security group permissions and the routing path to the Syslog Collector.
437+
438+
- If you do see packets arriving, confirm that they are not being rejected.
439+
440+
If you see rejected packets, confirm that the IP tables are not blocking the connections.
441+
442+
To confirm that packets are not being rejected, run:
443+
444+
```config
445+
watch -n 2 -d iptables -nvL
446+
```
447+
448+
1. Verify whether the Syslog server is processing the logs. Run:
449+
450+
```config
451+
tail -f /var/log/messages or tail -f /var/log/syslog
452+
```
453+
454+
Any Syslog logs being processed are displayed in plain text.
455+
456+
1. Confirm that the rsyslog server is listening on TCP/UDP port 514. Run:
457+
458+
```config
459+
netstat -anp | grep syslog
460+
```
461+
---
379462
380463
### SELinux blocking connection to the OMS agent
381464
382-
This procedure describes how to confirm whether SELinux is currently in a `permissive` state, or is blocking a connection to the OMS agent. This procedure is relevant when your operating system is a distribution from RedHat or CentOS.
465+
This procedure describes how to confirm whether SELinux is currently in a `permissive` state, or is blocking a connection to the OMS agent. This procedure is relevant when your operating system is a distribution from RedHat or CentOS, and for both CEF and Syslog data connectors.
383466
384467
> [!NOTE]
385468
> Microsoft Sentinel support for CEF and Syslog only includes FIPS hardening. Other hardening methods, such as SELinux or CIS are not currently supported.
@@ -423,7 +506,7 @@ This procedure describes how to confirm whether SELinux is currently in a `permi
423506
424507
### Blocked firewall policy
425508
426-
This procedure describes how to verify whether a firewall policy is blocking the connection from the Rsyslog daemon to the OMS agent, and how to disable it as needed.
509+
This procedure describes how to verify whether a firewall policy is blocking the connection from the Rsyslog daemon to the OMS agent, and how to disable it as needed. This procedure is relevant for both CEF and Syslog data connectors.
427510
428511
429512
1. Run the following command to verify whether there are any rejects in the IP tables, indicating traffic that's being dropped by the firewall policy:
@@ -485,6 +568,35 @@ This procedure describes how to verify whether a firewall policy is blocking the
485568
486569
## Linux and OMS Agent-related issues
487570
571+
# [CEF](#tab/cef)
572+
573+
If the steps described earlier in this article do not solve your issue, you may have a connectivity problem between the OMS Agent and the Microsoft Sentinel workspace.
574+
575+
In such cases, continue troubleshooting by verifying the following:
576+
577+
- Make sure that you can see packets arriving on TCP/UDP port 514 on the Syslog collector
578+
579+
- Make sure that you can see logs being written to the local log file, either **/var/log/messages** or **/var/log/syslog**
580+
581+
- Make sure that you can see data packets flowing on port 25226
582+
583+
- Make sure that your virtual machine has an outbound connection to port 443 via TCP, or can connect to the [Log Analytics endpoints](../azure-monitor/agents/log-analytics-agent.md#network-requirements)
584+
585+
- Make sure that you have access to required URLs from your CEF collector through your firewall policy. For more information, see [Log Analytics agent firewall requirements](../azure-monitor/agents/log-analytics-agent.md#firewall-requirements).
586+
587+
Run the following command to determine if the agent is communicating successfully with Azure, or if the OMS agent is blocked from connecting to the Log Analytics workspace.
588+
589+
```config
590+
Heartbeat
591+
| where Computer contains "<computername>"
592+
| sort by TimeGenerated desc
593+
```
594+
595+
A log entry is returned if the agent is communicating successfully. Otherwise, the OMS agent may be blocked.
596+
597+
598+
# [Syslog](#tab/syslog)
599+
488600
If the steps described earlier in this article do not solve your issue, you may have a connectivity problem between the OMS Agent and the Microsoft Sentinel workspace.
489601
490602
In such cases, continue troubleshooting by verifying the following:
@@ -493,11 +605,11 @@ In such cases, continue troubleshooting by verifying the following:
493605
494606
- Make sure that you can see logs being written to the local log file, either **/var/log/messages** or **/var/log/syslog**
495607
496-
- Make sure that you can see data packets flowing on port 25224, 25226, or both
608+
- Make sure that you can see data packets flowing on port 25224
497609
498610
- Make sure that your virtual machine has an outbound connection to port 443 via TCP, or can connect to the [Log Analytics endpoints](../azure-monitor/agents/log-analytics-agent.md#network-requirements)
499611
500-
- Make sure that you have access to required URLs from your Syslog collector through your firewall policy. For more information, see [Log Analytics agent firewall requirements](../azure-monitor/agents/log-analytics-agent.md#firewall-requirements).
612+
- Make sure that you have access to required URLs from your Syslog or CEF collector through your firewall policy. For more information, see [Log Analytics agent firewall requirements](../azure-monitor/agents/log-analytics-agent.md#firewall-requirements).
501613
502614
- Make sure that your Azure Virtual Machine is shown as connected in your workspace's list of virtual machines.
503615
@@ -511,6 +623,8 @@ Heartbeat
511623
512624
A log entry is returned if the agent is communicating successfully. Otherwise, the OMS agent may be blocked.
513625
626+
---
627+
514628
## Next steps
515629
516630
If the troubleshooting steps in this article have not helped your issue, open a support ticket or use the Microsoft Sentinel community resources. For more information, see [Useful resources for working with Microsoft Sentinel](resources.md).

0 commit comments

Comments
 (0)