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 detection of ASA access list events #270

Closed
wants to merge 4 commits into from

Conversation

candlerb
Copy link

@candlerb candlerb commented Jan 22, 2019

  • Rename 0210-pix_decoders to move it before 0065-cisco-ios_decoders
  • Add detection of ASA access list events
  • Extend 0060-firewall_rules so that it recognises "Deny" and "denied" as well as "DROP"
    Note: this also changes recognition of "%SEC-6-IPACCESSLOGP ... denied" which is now recognised as a 'Firewall drop event', rather than just 'Firewall rules grouped'
  • Add test cases for ASA and PIX messages

Fixes #269

@candlerb candlerb changed the title Candlerb/decode pix events Add detection of ASA access list events Jan 22, 2019
@candlerb candlerb force-pushed the candlerb/decode-pix-events branch from c2f8358 to 9484686 Compare January 22, 2019 21:04
@elwali10 elwali10 requested review from jesuslinares, migruiz4 and SitoRBJ and removed request for jesuslinares and migruiz4 January 25, 2019 07:31
Extend 0060-firewall_rules so that it recognises "Deny" and
"denied" as well as "DROP"

Note: this also changes recognition of "%SEC-6-IPACCESSLOGP
... denied" which is now recognised as a 'Firewall drop event',
rather than just 'Firewall rules grouped'

Fixes wazuh#269
@candlerb candlerb force-pushed the candlerb/decode-pix-events branch from 9484686 to a4afcd8 Compare January 31, 2019 08:21
@candlerb
Copy link
Author

Rebased to current master

@joselopezrio
Copy link

Hello Team,
this PR presents conflicts.
When renaming and changing the position of the pix_decoders.xml file from 0210-pix_decoders.xml to 0062-pix_decoders.xml it breaks the 0065-cisco-ios_decoders.xml since logs that should be decoded by the cisco decoders are being decoded by the pix decoders instead.
Here there is an example:

------------------------------------------------------------
Failed: Exit code = 3
        Alert     = 3
        Rule      = 64004
        Decoder   = cisco-asa
        Section   = cisco asa: warning message
        line name = log 5 pass

2020/03/11 15:33:51 ossec-testrule: INFO: Started (pid: 9702).
ossec-testrule: Type one log per line.



**Phase 1: Completed pre-decoding.
       full event: '%ASA-4-500004: Invalid transport field for protocol=UDP, from 10.235.91.49/45682 to 80.98.44.227/0'
       timestamp: '(null)'
       hostname: 'centos-7-16'
       program_name: '(null)'
       log: '%ASA-4-500004: Invalid transport field for protocol=UDP, from 10.235.91.49/45682 to 80.98.44.227/0'

**Phase 2: Completed decoding.
       decoder: 'pix'
       id: '4-500004'

**Phase 3: Completed filtering (rules).
       Rule id: '4313'
       Level: '4'
       Description: 'PIX warning message.'
**Alert to be generated.


lf->decoder_info->name: 'pix'
ut_decoder_name       : 'cisco-asa'
decoder matched : 'pix'
decoder expected: 'cisco-asa'

Regards,
Jose Manuel Lopez

@vikman90 vikman90 changed the base branch from 3.10 to develop July 31, 2020 12:11
@vikman90 vikman90 changed the base branch from develop to master September 25, 2020 08:21
@candlerb
Copy link
Author

candlerb commented Dec 8, 2020

this PR presents conflicts.
When renaming and changing the position of the pix_decoders.xml file from 0210-pix_decoders.xml to 0062-pix_decoders.xml it breaks the 0065-cisco-ios_decoders.xml since logs that should be decoded by the cisco decoders are being decoded by the pix decoders instead.

Is this still an issue?

Checking current git head, the ruleset has:

  • rules/0065-pix_rules.xml - with <decoded_as>pix</decoded_as>
  • rules/0075-cisco-ios_rules.xml - with <decoded_as>cisco-ios</decoded_as>
  • rules/0625-cisco-asa_rules.xml with <decoded_as>cisco-asa</decoded_as> and also explicitly matches %ASA

Now, decoders/0210-pix_decoders.xml has:

<decoder name="pix">
  <prematch>^%PIX-|^\w\w\w \d\d \d\d\d\d \d\d:\d\d:\d\d: %PIX-|</prematch>
  <prematch>^%ASA-|^\w\w\w \d\d \d\d\d\d \d\d:\d\d:\d\d: %ASA-|</prematch>
  <prematch>^%FWSM-|^\w\w\w \d\d \d\d\d\d \d\d:\d\d:\d\d: %FWSM-</prematch>
</decoder>

%ASA probably shouldn't be there. However decoders/0064-cisco-asa_decoders.xml comes before this, and it has

<decoder name="cisco-asa">
    <prematch>^%ASA-</prematch>
</decoder>

So AFAICS this should be working now, except perhaps a match like ^\w\w\w \d\d \d\d\d\d \d\d:\d\d:\d\d: %ASA- would be treated as pix rather than asa. I don't have a current test setup to try this with.

@72nomada 72nomada added threatintel Threat Intelligence threatintel/review is in review. waiting some feedback labels Jan 23, 2021
@jcruzlp
Copy link

jcruzlp commented Jun 15, 2021

Closing this, it is manage by "wazuh-ruleset: Cisco rules and decoders improvements" wazuh/wazuh#7278

@jcruzlp jcruzlp closed this Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
threatintel/review is in review. waiting some feedback threatintel Threat Intelligence
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PIX/ASA decoder disabled by Cisco IOS decoder
4 participants