Skip to content

Commit 1eb0580

Browse files
Merge pull request #111919 from yelevin/yelevin/connect-cef-2
Step 3 of connecting CEF logs to Azure Sentinel
2 parents 477dfa5 + e2d02aa commit 1eb0580

File tree

1 file changed

+103
-7
lines changed

1 file changed

+103
-7
lines changed

articles/sentinel/connect-cef-verify.md

Lines changed: 103 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Validate connectivity to Azure Sentinel| Microsoft Docs
2+
title: Validate connectivity to Azure Sentinel | Microsoft Docs
33
description: Validate connectivity of your security solution to make sure CEF messages are being forwarded to Azure Sentinel.
44
services: sentinel
55
documentationcenter: na
@@ -13,25 +13,121 @@ ms.devlang: na
1313
ms.topic: conceptual
1414
ms.tgt_pltfrm: na
1515
ms.workload: na
16-
ms.date: 12/30/2019
16+
ms.date: 04/19/2020
1717
ms.author: yelevin
1818

1919
---
2020
# STEP 3: Validate connectivity
2121

22+
Once you have deployed your log forwarder (in Step 1) and configured your security solution to send it CEF messages (in Step 2), follow these instructions to verify connectivity between your security solution and Azure Sentinel.
2223

24+
## Prerequisites
2325

24-
After you deployed the agent and configured your security solution to forward CEF messages, use this article to understand how to verify connectivity between Azure Sentinel and your security solution.
26+
- You must have elevated permissions (sudo) on your log forwarder machine.
27+
28+
- You must have Python installed on your log forwarder machine.<br>
29+
Use the `python –version` command to check.
2530

2631
## How to validate connectivity
2732

28-
1. Open Log Analytics to make sure that logs are received using the CommonSecurityLog schema.<br> It may take upwards of 20 minutes until your logs start to appear in Log Analytics.
33+
1. From the Azure Sentinel navigation menu, open **Logs**. Run a query using the **CommonSecurityLog** schema to see if you are receiving logs from your security solution.<br>
34+
Be aware that it may take about 20 minutes until your logs start to appear in **Log Analytics**.
35+
36+
1. If you don't see any results from the query, verify that events are being generated from your security solution, or try generating some, and verify they are being forwarded to the Syslog forwarder machine you designated.
2937

30-
1. Before you run the script, we recommend that you send messages from your security solution to make sure they are being forwarded to the Syslog proxy machine you configured.
31-
1. You must have elevated permissions (sudo) on your machine. Make sure that you have Python on your machine using the following command: `python –version`
32-
1. Run the following script to check connectivity between the agent, Azure Sentinel, and your security solution. It checks that the daemon forwarding is properly configured, listens on the correct ports, and that nothing is blocking communication between the daemon and the Log Analytics agent. The script also sends mock messages 'TestCommonEventFormat' to check end-to-end connectivity. <br>
38+
1. Run the following script on the log forwarder to check connectivity between your security solution, the log forwarder, and Azure Sentinel. This script checks that the daemon is listening on the correct ports, that the forwarding is properly configured, and that nothing is blocking communication between the daemon and the Log Analytics agent. It also sends mock messages 'TestCommonEventFormat' to check end-to-end connectivity. <br>
3339
`sudo wget https://raw.githubusercontent.com/Azure/Azure-Sentinel/master/DataConnectors/CEF/cef_troubleshoot.py&&sudo python cef_troubleshoot.py [WorkspaceID]`
3440

41+
## Validation script explained
42+
43+
The validation script performs the following checks:
44+
45+
# [rsyslog daemon](#tab/rsyslog)
46+
47+
1. Checks that the file<br>
48+
`/etc/opt/microsoft/omsagent/[WorkspaceID]/conf/omsagent.d/security_events.conf`<br>
49+
exists and is valid.
50+
51+
1. Checks that the file includes the following text:
52+
53+
<source>
54+
type syslog
55+
port 25226
56+
bind 127.0.0.1
57+
protocol_type tcp
58+
tag oms.security
59+
format /(?<time>(?:\w+ +){2,3}(?:\d+:){2}\d+|\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.[\w\-\:\+]{3,12}):?\s*(?:(?<host>[^: ]+) ?:?)?\s*(?<ident>.*CEF.+?(?=0\|)|%ASA[0-9\-]{8,10})\s*:?(?<message>0\|.*|.*)/
60+
<parse>
61+
message_format auto
62+
</parse>
63+
</source>
64+
65+
<filter oms.security.**>
66+
type filter_syslog_security
67+
</filter>
68+
69+
1. Checks if there are any security enhancements on the machine that might be blocking network traffic (such as a host firewall).
70+
71+
1. Checks that the syslog daemon (rsyslog) is properly configured to send messages that it identifies as CEF (using a regex) to the Log Analytics agent on TCP port 25226:
72+
73+
- Configuration file: `/etc/rsyslog.d/security-config-omsagent.conf`
74+
75+
:rawmsg, regex, "CEF\|ASA" ~
76+
*.* @@127.0.0.1:25226
77+
78+
1. Checks that the syslog daemon is receiving data on port 514
79+
80+
1. Checks that the necessary connections are established: tcp 514 for receiving data, tcp 25226 for internal communication between the syslog daemon and the Log Analytics agent
81+
82+
1. Sends MOCK data to port 514 on localhost. This data should be observable in the Azure Sentinel workspace by running the following query:
83+
84+
CommonSecurityLog
85+
| where DeviceProduct == "MOCK"
86+
87+
# [syslog-ng daemon](#tab/syslogng)
88+
89+
1. Checks that the file<br>
90+
`/etc/opt/microsoft/omsagent/[WorkspaceID]/conf/omsagent.d/security_events.conf`<br>
91+
exists and is valid.
92+
93+
1. Checks that the file includes the following text:
94+
95+
<source>
96+
type syslog
97+
port 25226
98+
bind 127.0.0.1
99+
protocol_type tcp
100+
tag oms.security
101+
format /(?<time>(?:\w+ +){2,3}(?:\d+:){2}\d+|\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.[\w\-\:\+]{3,12}):?\s*(?:(?<host>[^: ]+) ?:?)?\s*(?<ident>.*CEF.+?(?=0\|)|%ASA[0-9\-]{8,10})\s*:?(?<message>0\|.*|.*)/
102+
<parse>
103+
message_format auto
104+
</parse>
105+
</source>
106+
107+
<filter oms.security.**>
108+
type filter_syslog_security
109+
</filter>
110+
111+
1. Checks if there are any security enhancements on the machine that might be blocking network traffic (such as a host firewall).
112+
113+
1. Checks that the syslog daemon (syslog-ng) is properly configured to send messages that it identifies as CEF (using a regex) to the Log Analytics agent on TCP port 25226:
114+
115+
- Configuration file: `/etc/syslog-ng/conf.d/security-config-omsagent.conf`
116+
117+
filter f_oms_filter {match(\"CEF\|ASA\" ) ;};
118+
destination oms_destination {tcp(\"127.0.0.1\" port("25226"));};
119+
log {source(s_src);filter(f_oms_filter);destination(oms_destination);};
120+
121+
1. Checks that the syslog daemon is receiving data on port 514
122+
123+
1. Checks that the necessary connections are established: tcp 514 for receiving data, tcp 25226 for internal communication between the syslog daemon and the Log Analytics agent
124+
125+
1. Sends MOCK data to port 514 on localhost. This data should be observable in the Azure Sentinel workspace by running the following query:
126+
127+
CommonSecurityLog
128+
| where DeviceProduct == "MOCK"
129+
130+
---
35131

36132
## Next steps
37133
In this document, you learned how to connect CEF appliances to Azure Sentinel. To learn more about Azure Sentinel, see the following articles:

0 commit comments

Comments
 (0)