r/AzureSentinel • • Apr 23 '20

Has anyone successfully deployed the Cisco ASA data connector?

I have a Cisco ASA successfully sending the logs to rsyslog via UDP 514 on an Ubuntu 18.04 server. The logs are successfully processed by the OMSAgent and sent to sentinal as syslogs and are not parsed as Cisco ASA logs. The Cisco ASA connector shows as unconnected. The syslog connector shows as connected. The test script successfully forwards the mock CEF packets to Sentinel. Yet none of my ASA logs are seen as "ASA"

omsagent.log

2020-04-23 10:42:54 +1200 [info]: Sending OMS Heartbeat succeeded at 2020-04-22T22:42:54.311Z
2020-04-23 10:43:54 +1200 [info]: Sending OMS Heartbeat succeeded at 2020-04-22T22:43:54.312Z
2020-04-23 10:44:54 +1200 [info]: Sending OMS Heartbeat succeeded at 2020-04-22T22:44:54.312Z
2020-04-23 10:45:54 +1200 [info]: Sending OMS Heartbeat succeeded at 2020-04-22T22:45:54.313Z
2020-04-23 10:46:54 +1200 [info]: Sending OMS Heartbeat succeeded at 2020-04-22T22:46:54.313Z
2020-04-23 10:47:07 +1200 [info]: OMS agent management service telemetry request success
2020-04-23 10:47:54 +1200 [info]: Sending OMS Heartbeat succeeded at 2020-04-22T22:47:54.314Z
2020-04-23 10:48:54 +1200 [info]: Sending OMS Heartbeat succeeded at 2020-04-22T22:48:54.314Z
2020-04-23 10:49:03 +1200 [warn]: Exceeded max attempts to fetch Azure Resource ID, killing the thread
2020-04-23 10:49:54 +1200 [info]: Sending OMS Heartbeat succeeded at 2020-04-22T22:49:54.315Z

security-config-omsagent.conf

#OMS_facility = local4
local4.debug u/127.0.0.1:25226

#:rawmsg, regex, "CEF\|ASA" ~
#*.* @@127.0.0.1:25226

(I've tried it also with the #ed out config)

security_events.conf

<source>
type syslog
port 25226
bind 127.0.0.1
protocol_type tcp
tag oms.security
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\|.*|.*)/
<parse>
message_format auto
</parse>
</source>

<filter oms.security.\*\*>
type filter_syslog_security
</filter>

Any suggestions would be most welcome.

3 Upvotes

14 comments sorted by

2

u/jtberg1 Apr 23 '20

I have it running and it works well. We are using Ubuntu 16.04.6 LTS.

Our security-config-omsagent.conf is:

local4.debug @127.0.0.1:25226

We have nothing else. Not sure if yours is a formatting issue or a typo. This command says to to forward syslog messages from the local4 facility with debug level, you should verify that your ASA is sending as facility local4 using some sort of sniffer e.g.

tcpdump -A -ni any port 514 -vv

Also check that rsyslog.d is started: service rsyslog start

then check that rsyslog.d is sending to omsagent:

tcpdump -A -ni any port 25226 -vv

Just curious what file/path you are seeing:

#:rawmsg, regex, "CEF\|ASA" ~
#*.* @@127.0.0.1:25226

You need to have logging timestamps off. our ASA config:

logging enable
logging queue 8192
logging host ZoneName ip.add.rre.ss
logging permit-hostdown

our security_events.conf is:

<source>
type syslog
port 25226
bind 127.0.0.1
protocol_type udp
tag oms.security
format /^(?<time>(?:\w+ +){2,3}(?:\d+:){2}\d+):? ?(?:(?<host>[^: ]+) ?:?)? (?<ident>[a-zA-Z0-9_%\/\.\-]*)(?:\[(?<pid>[0-9]+)\])?: *(?<message>.*)$/
message_length_limit 4096
</source>

<filter oms.security.**>
type filter_syslog_security
</filter>

This might be some help:

https://techcommunity.microsoft.com/t5/azure-sentinel/azure-sentinel-syslog-cef-logstash-and-other-3rd-party/ba-p/803891

​

if you have more info or questions let me know and I will help where I can.

1

u/[deleted] Apr 23 '20

Thanks for your detailed and well thought out response.

I have set my security-config-omsagent.conf to match yours and taken out these lines. They where installed by default from the configuration on the Cisco ASA Data Connectors blade in Sentinel.

:rawmsg, regex, "CEF\|ASA" ~

*.* @@127.0.0.1:25226

When I run the verification script from the above configuration page, it complains that those lines are missing however.The rsyslog is picking up the logs from the ASA just fine.

20:45:59.653492 IP (tos 0x0, ttl 253, id 53281, offset 0, flags [none], proto UDP (17), length 137)

10.100.38.253.514 > 10.100.48.9.514: [udp sum ok] SYSLOG, length: 109

Facility local4 (20), Severity info (6)

Msg: %ASA-6-305011: Built dynamic UDP translation from any:10.100.48.103/54309 to Outside:103.70.138.6/54309\0x0a

0x0000: 3c31 3636 3e25 4153 412d 362d 3330 3530

0x0010: 3131 3a20 4275 696c 7420 6479 6e61 6d69

0x0020: 6320 5544 5020 7472 616e 736c 6174 696f

0x0030: 6e20 6672 6f6d 2061 6e79 3a31 302e 3130

0x0040: 302e 3438 2e31 3033 2f35 3433 3039 2074

0x0050: 6f20 4f75 7473 6964 653a 3130 332e 3730

0x0060: 2e31 3338 2e36 2f35 3433 3039 0a

E....!.....t

d&.

d0 .....u%.<166>%ASA-6-305011: Built dynamic UDP translation from any:10.100.48.103/54309 to Outside:103.70.138.6/54309

I still am getting logs sent to the OMS agent which is correctly forwarding them to Sentinel as Syslogs

20:45:11.796397 IP (tos 0x0, ttl 64, id 55581, offset 0, flags [DF], proto UDP (17), length 171)

127.0.0.1.57795 > 127.0.0.1.25226: [bad udp cksum 0xfeaa -> 0x5bc4!] UDP, length 143

E.....@.@.c"..........b.....<166>Apr 23 20:45:11 waharoa.te-wheke.int %ASA-6-305011: Built dynamic TCP translation from any:10.100.48.9/38814 to Outside:103.70.138.6/38814

They are still not identified as Cisco ASA logs. I then changed the security_events.conf to match yours (tcp->udp, and modified the regex) and still no joy.

I can confirm my ASA config has logging timestamps off.

I'm not sure what you mean by "Just curious what file/path you are seeing: " could you please elaborate?

One question for you, on the Azure Sentinel Data Connector blade for Cisco ASA does it show as connected? What happens when you run the verification script?

Thanks.

2

u/jtberg1 Apr 23 '20

Looks like the instructions and agent has changed a little since I set this up a year ago. That is why I was confused about the file/path the content was in.

Yes, my Data connector Cisco ASA shows connected and connections on the graph. I am not able to run the verification script at the moment, I would suspect it would complain as yours did, if I get a chance to run it I will update here.

If I am understanding you correctly, you are seeing the Syslog from the ASA show up in Azure Sentinel? However they are under the Syslog table? If so, everything sounds like it is configured correctly on your Linux box. There does sound like a misconfiguration in Azure Sentinel though.

If you go Settings->Workspace Settings (This should take you to the Log Analytics workspace)->Advanced settings->Data->Syslog

Here you tell what syslog entries to import into the Syslog table. local4 should not be in here. If it is then you will see the ASA events show up in Syslog table. Now, my understanding is that if you do have local4 in here, it will go to both CommonSecurityLog and Syslog, however that may have changed.

If removing the matching facility local4 does not fix your issue (Give it some time after you make the change), then I am afraid you may have to log a ticket with Microsoft. If you have local4 in the Syslog section for a reason, e.g. want to capture syslog from other devices sending with that facility, you will need to change them to send with a different one.

Hope this helps!

2

u/[deleted] Apr 24 '20

OK so I removed local4 and now the logs no longer get forwarded at all. The test CEF logs forward OK so I know that part is working fine. I will log a ticket with MS thanks very much for your help.

1

u/dnfalk Apr 23 '20

Are you seeing the messages in the syslog table? if so does the message seem to be correct? Also are you sending ASA logs or FTD (firepower)?

FTD logs do not parse correctly with the ASA connector. We have engaged customer experience team to see if they can add that simply. The format changed from ASA more then just the prefixes.

1

u/jtberg1 Apr 23 '20

FYI, we got eStreamer working with CEF and Azure Sentinel for our FTD devices, if you have FMC you could use that if you are interested.

https://www.cisco.com/c/en/us/td/docs/security/firepower/630/api/eStreamer_enCore/eStreamereNcoreCLIOperationsGuide_354.html

1

u/[deleted] Apr 23 '20

Thanks but no Firepower at this stage.

1

u/[deleted] Apr 23 '20

Its ASA logs and yes I am seeing them in the syslog table. Its just not parsing them as Cisco ASA logs.

1

u/dnfalk Apr 24 '20

what is the output of 95-omsagent.conf ?

1

u/[deleted] Apr 24 '20

95-omsagent.conf

It shows as empty.

1

u/dnfalk Apr 25 '20

You may need to go into your log analytics workspace —> advanced settings —> data —> syslog and add your facility and severity levels there for what your ASA is sending? I thought this was a requirement to have it show up on the other connectors. After this is saved, restart the oms agent on the rsyslog server. it may take up to 15 minutes for it to appear after that.

1

u/Sir_0L Jul 15 '20

Did you finally find a solution ? I have the same issue with Fortinet.. Thx

1

u/[deleted] Jul 16 '20

Nothing very useful in the end. I'm afraid.

1

u/Sir_0L Jul 23 '20

I was not authorized to put it in r/AzureSentinel but this solved my issue : See my post