Skip to content
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

Add Cisco ASA messages to firewalls patterns. #226

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fchouina
Copy link

Fix issue with ASA-3-313004.
Add Cisco ASA message patterns to firewalls patterns file:

  • ASA-2-106017
  • ASA-1-106101
  • ASA-6-303002
  • ASA-3-303006
  • ASA-5-305013
  • ASA-5-713257
  • ASA-4-713903
  • ASA-6-725001
  • ASA-6-725002
  • ASA-6-725007
  • ASA-6-725016
  • ASA-3-746016

Thanks for contributing to Logstash! If you haven't already signed our CLA, here's a handy link: https://www.elastic.co/contributor-agreement/

Fix issue with ASA-3-313004.
Add Cisco ASA message patterns to firewalls patterns file:
- ASA-2-106017
- ASA-1-106101
- ASA-6-303002
- ASA-3-303006
- ASA-5-305013
- ASA-5-713257
- ASA-4-713903
- ASA-6-725001
- ASA-6-725002
- ASA-6-725007
- ASA-6-725016
- ASA-3-746016
@fchouina
Copy link
Author

I have now signed the CLA.

@jsvd jsvd self-assigned this Apr 17, 2018
# ASA-6-305011
CISCOFW305011 %{CISCO_ACTION:action} %{CISCO_XLATE_TYPE:xlate_type} %{WORD:protocol} translation from %{DATA:src_interface}:%{IP:src_ip}(/%{INT:src_port})?(\(%{DATA:src_fwuser}\))? to %{DATA:src_xlated_interface}:%{IP:src_xlated_ip}/%{DATA:src_xlated_port}
# ASA-3-313001, ASA-3-313004, ASA-3-313008
Copy link
Member

Choose a reason for hiding this comment

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

I'm unfamiliar with the asa firewalls, but I'd like to avoid removing patterns as that can create troubles for folks already using this CISCOFW313001_313004_313008 pattern.

@fchouina
Copy link
Author

We could leave the name as is, but that pattern does not match ASA-3-313004 properly.
That is why I had to add a pattern specific for ASA-3-313004 right after.
Personally, I do not mind, but it does not document properly what is going on in the patterns matching if we leave it as is.

@@ -79,8 +93,22 @@ CISCOFW602303_602304 %{WORD:protocol}: An %{CISCO_DIRECTION:direction} %{GREEDYD
CISCOFW710001_710002_710003_710005_710006 %{WORD:protocol} (?:request|access) %{CISCO_ACTION:action} from %{IP:src_ip}/%{INT:src_port} to %{DATA:dst_interface}:%{IP:dst_ip}/%{INT:dst_port}
# ASA-6-713172
CISCOFW713172 Group = %{GREEDYDATA:group}, IP = %{IP:src_ip}, Automatic NAT Detection Status:\s+Remote end\s*%{DATA:is_remote_natted}\s*behind a NAT device\s+This\s+end\s*%{DATA:is_local_natted}\s*behind a NAT device
# ASA-5-713257
CISCOFW713257 Phase %{INT:phase} failure: Mismatched attribute types for class %{DATA:class}: Rcv'd: %{DATA:received_attribute} Cfg'd: %{GREEDYDATA:configured_attribute}
Copy link
Member

Choose a reason for hiding this comment

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

This pattern has a few double spaces, is this intended?

Copy link
Author

Choose a reason for hiding this comment

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

Yes.
Here is a sample log message:

Phase 1 failure:  Mismatched attribute types for class Group Description:  Rcv'd: Group 2  Cfg'd: Group 5

Copy link
Member

Choose a reason for hiding this comment

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

I see, my question came from doing a quick search online and finding references to that log entry with only 1 space: https://supportforums.cisco.com/t5/remote-access/ipsec-vpn-to-asa-5520/td-p/1528993

Maybe we can be safe here and replace these potential "more than one" spaces with %{SPACE} ?

Copy link
Author

Choose a reason for hiding this comment

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

We could use '\s+' (1 or more spaces) but not %{SPACE} because it is defined as '\s*' (zero or more spaces).
Using %{SPACE} could break the pattern.

Copy link
Author

Choose a reason for hiding this comment

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

BTW, if it sheds more light on the subject, all the ASA-5-713257 messages I have ever seen (I have been parsing Cisco ASA logs for 3 years now) have always had the 2 spaces in those places.

@colinsurprenant
Copy link
Contributor

@fchouina to continue the discussion on the CISCOFW313001_313004_313008 pattern you suggest to remove: does that pattern causes any problem or conflict with the patterns you suggest adding? As @jsvd mentioned, I would be cautious to not create BWC issue for anyone potentially using it. If you believe this is still a valid fix but somewhat unrelated to your proposed additions here, please submit a new PR just for that. Does that make sense?

@fchouina
Copy link
Author

No there is no conflict with the new ASA-3-313004 pattern. The original CISCOFW313001_313004_313008 pattern simply does not match any ASA-3-313004 logs.

@colinsurprenant
Copy link
Contributor

Ok @fchouina thanks for confirming. So for the sake of keeping separate concerns into separate issues, could you please revert the CISCOFW313001_313004_313008 pattern and create a new issue for it? Thanks so much.

@ghost
Copy link

ghost commented Jul 25, 2018

This is great! Thanks for contributing the additional filters @fchouina!

I have several more to contribute myself for these message patterns:
ASA-5-713050
ASA-5-713259
ASA-4-113019
ASA-5-713119
ASA-5-713120
ASA-5-713049
ASA-5-713076
ASA-5-713130
ASA-4-722012
ASA-4-722037
ASA-4-722041
ASA-4-722051
ASA-5-722010
ASA-5-722028
ASA-5-722032
ASA-5-722033
ASA-5-722034
ASA-5-737003
ASA-5-737034

Maybe I'll wait for this PR to be merged into master until I contribute? I don't want to submit another PR and cause anything to get lost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants